Deleted use of WAError and add defining of language of client everywhere
This commit is contained in:
@@ -48,7 +48,6 @@ import { selectCharacterSceneVisibleStore } from "../Stores/SelectCharacterStore
|
||||
import { gameManager } from "../Phaser/Game/GameManager";
|
||||
import { SelectCharacterScene, SelectCharacterSceneName } from "../Phaser/Login/SelectCharacterScene";
|
||||
import { errorScreenStore } from "../Stores/ErrorScreenStore";
|
||||
import { WAError } from "../Phaser/Reconnecting/WAError";
|
||||
|
||||
const manualPingDelay = 20000;
|
||||
|
||||
@@ -486,7 +485,7 @@ export class RoomConnection implements RoomConnection {
|
||||
this._errorScreenMessageStream.next(message.errorScreenMessage);
|
||||
if (message.errorScreenMessage.code !== "retry") this.closed = true;
|
||||
console.error("An error occurred server side: " + message.errorScreenMessage.code);
|
||||
errorScreenStore.setError(message.errorScreenMessage as WAError);
|
||||
errorScreenStore.setError(message.errorScreenMessage);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { waScaleManager } from "../Services/WaScaleManager";
|
||||
import { ReconnectingTextures } from "../Reconnecting/ReconnectingScene";
|
||||
import { localeDetector } from "../../i18n/locales";
|
||||
import { errorScreenStore } from "../../Stores/ErrorScreenStore";
|
||||
import {ErrorScreenMessage} from "../../Messages/ts-proto-generated/protos/messages";
|
||||
|
||||
export const EntrySceneName = "EntryScene";
|
||||
|
||||
@@ -47,19 +48,7 @@ export class EntryScene extends Scene {
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.response.data?.code) {
|
||||
errorScreenStore.setError(
|
||||
new WAError(
|
||||
err.response.data.type,
|
||||
err.response.data.code,
|
||||
err.response.data.title,
|
||||
err.response.data.subtitle,
|
||||
err.response.data.details,
|
||||
err.response.data.timeToRetry,
|
||||
err.response.data.canRetryManual,
|
||||
err.response.data.urlToRedirect,
|
||||
err.response.data.buttonTitle
|
||||
)
|
||||
);
|
||||
errorScreenStore.setError(err.response.data);
|
||||
} else {
|
||||
ErrorScene.showError(err, this.scene);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { writable } from "svelte/store";
|
||||
import { WAError } from "../Phaser/Reconnecting/WAError";
|
||||
import {ErrorScreenMessage} from "../Messages/ts-proto-generated/protos/messages";
|
||||
|
||||
/**
|
||||
* A store that contains one error of type WAError to be displayed.
|
||||
*/
|
||||
function createErrorScreenStore() {
|
||||
const { subscribe, set } = writable<WAError>(undefined);
|
||||
const { subscribe, set } = writable<ErrorScreenMessage>(undefined);
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
setError: (e: WAError): void => set(e),
|
||||
setError: (e: ErrorScreenMessage): void => set(e),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user