Skip to content

Commit

Permalink
feat: improve servver connection, skin variants, and start of central…
Browse files Browse the repository at this point in the history
… i18n
  • Loading branch information
Sceat committed Jul 29, 2024
1 parent 6bbe586 commit bcf786f
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 287 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@iconify-json/token": "^1.1.6",
"@iconify-json/token-branded": "^1.1.7",
"@iconify-json/twemoji": "^1.1.15",
"@modyfi/vite-plugin-yaml": "^1.1.0",
"@types/dat.gui": "^0.7.13",
"@types/node": "^20.14.11",
"@types/three": "^0.166.0",
Expand Down
36 changes: 36 additions & 0 deletions src/assets/translations/en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
SERVER_ALREADY_ONLINE: It seems you are already connected to the server, please wait a few seconds and try again
SERVER_EARLY_ACCESS_KEY_REQUIRED: You need an early access key to play on AresRPG
SERVER_MAX_PLAYERS: Sorry sir, the server is full and we don't yet have the capacity to handle that much players, please try again later
SERVER_SIGNATURE_TIMEOUT: Please sign the message faster!
SERVER_INVALID_SIGNATURE: Invalid signature
SERVER_MOVE_FIRST: Please move before doing this action, the server must acknowledge your existence first
SERVER_CHARACTER_UNLOCKED: Did you unlock your character ?
SERVER_MAX_CHARACTERS_PER_PLAYER: You can't play with that many characters!
APP_LOGIN_AGAIN: Please login again
APP_WALLET_NOT_FOUND: Wallet not found
APP_OUTDATED: The app is outdated and can't use this feature. Please update the app.
WALLET_PLEASE_SWITCH_NETWORK: Please switch to the Sui
SUI_ENOKI_SALT: Enoki failed to deliver the transaction (salt failure). Please try again.
SUI_NO_GAS: You need Sui in your wallet to perform this action
SUI_NOT_ENOUGH_FOOD: You do not have enough food!
WALLET_CONFIG: Wallet configuration error
SUI_SUBSCRIBED: Connected to Sui
SUI_PET_ALREADY_FED: This pet is not hungry
SUI_INV_NOT_EMPTY: You must unequip all items before that
SUI_SUBSCRIBE_ERROR: The Sui node refused the subscription, please refresh the page to try again
SUI_NO_PERSONAL_KIOSK: This action requires to create a character first
SUI_SUBSCRIBE_START: Subscribing to Sui node...
SUI_FETCHING_DATA: Fetching characters and items..
SUI_DATA_FETCHED: Successfully fetched characters and items
APP_WAIT_A_MINUTE: Please wait before trying again
SUI_ENOKI_DOWN: The sponsoring service seems to be malfunctioning, please try again later.

WS_FAILED_TO_CONNECT: Failed to connect to the server, check https://status.aresrpg.world for more information
WS_RECONNECTED: Back online!
WS_CONNECTING_TO_SERVER: Connecting to the server
WS_CONNECTED_TO_SERVER: Connected to the server

SUI_ITEM_SOLD: was sold
SUI_INVALID_CONTRACT: The contract is invalid, is your app up to date ? Try to refresh the page
WALLET_SIGN_MESSAGE: "[AresRPG] This is a verification message to prove that you own this address. It will allow you to connect to the server"
BROWSER_NO_PERF: Your device does not support WebGL or it is running under conditions that would cause major performance issues. Please try on a different device or ensure your browser and drivers are up to date.
36 changes: 36 additions & 0 deletions src/assets/translations/fr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
SERVER_ALREADY_ONLINE: Il semble que vous êtes déjà connecté au serveur, veuillez patienter quelques secondes et réessayer
SERVER_EARLY_ACCESS_KEY_REQUIRED: Vous avez besoin d'une clé d'accès anticipé pour jouer sur AresRPG
SERVER_MAX_PLAYERS: Désolé sir, le serveur est plein et nous n'avons pas encore la capacité de gérer autant de joueurs, veuillez réessayer plus tard
SERVER_SIGNATURE_TIMEOUT: Veuillez signer le message plus rapidement !
SERVER_INVALID_SIGNATURE: Signature invalide
SERVER_MOVE_FIRST: Veuillez vous déplacer avant de faire cette action, le serveur doit reconnaître votre existence d'abord
SERVER_CHARACTER_UNLOCKED: Avez-vous débloqué votre personnage ?
SERVER_MAX_CHARACTERS_PER_PLAYER: Vous ne pouvez pas jouer avec autant de personnages !
APP_LOGIN_AGAIN: Veuillez vous reconnecter
APP_WALLET_NOT_FOUND: Portefeuille non trouvé
APP_OUTDATED: L'application est obsolète et ne peut pas utiliser cette fonctionnalité. Veuillez mettre à jour l'application.
WALLET_PLEASE_SWITCH_NETWORK: Veuillez changer de réseau Sui
SUI_ENOKI_SALT: Enoki n'a pas réussi à livrer la transaction (échec du salt). Veuillez réessayer.
SUI_NO_GAS: Vous avez besoin de Sui dans votre portefeuille pour effectuer cette action
SUI_NOT_ENOUGH_FOOD: Vous n'avez pas assez de nourriture !
WALLET_CONFIG: Erreur de configuration du portefeuille
SUI_SUBSCRIBED: Connecté à Sui
SUI_PET_ALREADY_FED: Ce famillier n'a pas faim
SUI_INV_NOT_EMPTY: Vous devez déséquiper tous les objets avant cela
SUI_SUBSCRIBE_ERROR: La node Sui a refusé l'abonnement, veuillez rafraîchir la page pour réessayer
SUI_NO_PERSONAL_KIOSK: Cette action nécessite de créer d'abord un personnage
SUI_SUBSCRIBE_START: Abonnement a la node Sui en cours...
SUI_FETCHING_DATA: Récupération des personnages et des objets...
SUI_DATA_FETCHED: Récupération des personnages et des objets réussie
APP_WAIT_A_MINUTE: Veuillez patienter avant de réessayer
SUI_ENOKI_DOWN: Le service de sponsoring semble être en panne, veuillez réessayer plus tard.

WS_FAILED_TO_CONNECT: Échec de la connexion au serveur, consultez https://status.aresrpg.world pour plus d'informations
WS_RECONNECTED: De retour en ligne !
WS_CONNECTING_TO_SERVER: Connexion au serveur
WS_CONNECTED_TO_SERVER: Connecté au serveur

SUI_ITEM_SOLD: a été vendu
SUI_INVALID_CONTRACT: Le contrat est invalide, votre application est-elle à jour ? Essayez de rafraîchir la page
WALLET_SIGN_MESSAGE: "[AresRPG] Ceci est un message de vérification pour prouver que vous possédez cette adresse. Cela vous permettra de vous connecter au serveur"
BROWSER_NO_PERF: Votre appareil ne prend pas en charge WebGL ou fonctionne dans des conditions qui entraîneraient de graves problèmes de performance. Veuillez essayer sur un autre appareil ou assurez-vous que votre navigateur et vos pilotes sont à jour.
2 changes: 1 addition & 1 deletion src/components/cards/item-inventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function on_right_click_item(event, item) {
try {
const fed = await sui_feed_pet(selected_item.value);
if (fed) tx.update('success', t('fed'));
else tx.update('error', t('NOT_ENOUGH_FOOD'));
else tx.update('error', t('SUI_NOT_ENOUGH_FOOD'));
} catch (error) {
if (error.message.includes('101)')) {
tx.update('error', t('pet_full'));
Expand Down
2 changes: 0 additions & 2 deletions src/components/game-ui/game-interface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.no-characters
zoneVue
characterSelectVue
wsConnectBtnVue
.middle
gameInventory(v-if="inventory_opened")
.bottom_panel
Expand All @@ -21,7 +20,6 @@
import { ref } from 'vue';
import characterSelectVue from './character-select.vue';
import wsConnectBtnVue from './ws-connect-btn.vue';
import zoneVue from './zone.vue';
import gameChat from './game-chat.vue';
import gameHealth from './game-health.vue';
Expand Down
139 changes: 0 additions & 139 deletions src/components/game-ui/ws-connect-btn.vue

This file was deleted.

39 changes: 25 additions & 14 deletions src/core/game/error_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,65 @@ import FluentEmojiSkull from '~icons/fluent-emoji/skull'

const { t } = i18n.global

let server_down_toast = null

export function notify_reconnected() {
if (server_down_toast) {
server_down_toast.update('success', t('WS_RECONNECTED'))
server_down_toast = null
}
}

export async function handle_server_error(reason) {
if (!reason) {
toast.error(
t('NO_REASON'),
'Can the dev do something?',
"<i class='bx bx-error-circle'/>",
)
if (!server_down_toast)
server_down_toast = toast.tx(t('WS_CONNECTING_TO_SERVER'))
server_down_toast.update('loading', t('WS_CONNECTING_TO_SERVER'))
return
}

switch (reason) {
case 'USER_DISCONNECTED':
return
case 'ALREADY_ONLINE':
toast.error(t('ALREADY_ONLINE'), 'Oh no!', "<i class='bx bx-key'/>")
toast.error(
t('SERVER_ALREADY_ONLINE'),
'Oh no!',
"<i class='bx bx-key'/>",
)
break
case 'EARLY_ACCESS_KEY_REQUIRED':
toast.error(
t('EARLY_ACCESS_KEY_REQUIRED'),
t('SERVER_EARLY_ACCESS_KEY_REQUIRED'),
'Oh no!',
"<i class='bx bx-key'/>",
)
break
case 'MAX_PLAYERS':
toast.info(t('MAX_PLAYERS'), 'Suuuuu', "<i class='bx bxs-hot'/>")
toast.info(t('SERVER_MAX_PLAYERS'), 'Suuuuu', "<i class='bx bxs-hot'/>")
break
case 'SIGNATURE_TIMEOUT':
if (ws_status.value === 'CLOSED')
toast.error(
t('SIGNATURE_TIMEOUT'),
t('SERVER_SIGNATURE_TIMEOUT'),
'Aaaaaaaah 🫠',
"<i class='bx bxs-timer'/>",
)
break
case 'INVALID_SIGNATURE':
toast.error(t('INVALID_SIGNATURE'))
toast.error(t('SERVER_INVALID_SIGNATURE'))
break
case 'CHARACTER_INVALID':
toast.error(t('MOVE_FIRST'))
toast.error(t('SERVER_MOVE_FIRST'))
break
case 'CHARACTER_UNLOCKED':
toast.error(t('CHARACTER_UNLOCKED'), '...', FluentEmojiSkull)
toast.error(t('SERVER_CHARACTER_UNLOCKED'), '...', FluentEmojiSkull)
break
case 'INVALID_CONTRACT':
toast.error(t('INVALID_CONTRACT'))
toast.error(t('SUI_INVALID_CONTRACT'))
break
case 'MAX_CHARACTERS_PER_PLAYER':
toast.error(t('MAX_CHARACTERS_PER_PLAYER'))
toast.error(t('SERVER_MAX_CHARACTERS_PER_PLAYER'))
break
default:
toast.error(reason)
Expand Down
Loading

0 comments on commit bcf786f

Please sign in to comment.