mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
parent
0994d10410
commit
c4bf9eb61c
61 changed files with 207 additions and 737 deletions
|
|
@ -1,9 +1,15 @@
|
|||
import { ServerDispatch } from 'store';
|
||||
import { Log, StatusEnum, User, WebSocketConnectOptions } from 'types';
|
||||
import { StatusEnum, User, WebSocketConnectOptions } from 'types';
|
||||
|
||||
import { sanitizeHtml } from 'websocket/utils';
|
||||
import {
|
||||
GameJoinedData,
|
||||
NotifyUserData,
|
||||
PlayerGamePropertiesData,
|
||||
ServerShutdownData,
|
||||
UserMessageData
|
||||
} from '../events/session/interfaces';
|
||||
import NormalizeService from '../utils/NormalizeService';
|
||||
import { GameJoinedData } from '../events/session/interfaces';
|
||||
|
||||
export class SessionPersistence {
|
||||
static initialized() {
|
||||
|
|
@ -114,8 +120,10 @@ export class SessionPersistence {
|
|||
ServerDispatch.registrationSuccess();
|
||||
}
|
||||
|
||||
static registrationFailed(error: string) {
|
||||
ServerDispatch.registrationFailed(error);
|
||||
static registrationFailed(reason: string, endTime?: number) {
|
||||
const reasonMsg = endTime ? NormalizeService.normalizeBannedUserError(reason, endTime) : reason;
|
||||
|
||||
ServerDispatch.registrationFailed(reasonMsg);
|
||||
}
|
||||
|
||||
static registrationEmailError(error: string) {
|
||||
|
|
@ -173,4 +181,28 @@ export class SessionPersistence {
|
|||
static gameJoined(gameJoinedData: GameJoinedData): void {
|
||||
console.log('gameJoined', gameJoinedData);
|
||||
}
|
||||
|
||||
static notifyUser(payload: NotifyUserData): void {
|
||||
console.log('notifyUser', payload);
|
||||
}
|
||||
|
||||
static playerPropertiesChanged(payload: PlayerGamePropertiesData): void {
|
||||
console.log('playerPropertiesChanged', payload);
|
||||
}
|
||||
|
||||
static serverShutdown(payload: ServerShutdownData): void {
|
||||
console.log('serverShutdown', payload);
|
||||
}
|
||||
|
||||
static userMessage(payload: UserMessageData): void {
|
||||
console.log('userMessage', payload);
|
||||
}
|
||||
|
||||
static addToList(list: string, userName: string): void {
|
||||
console.log('addToList', list, userName);
|
||||
}
|
||||
|
||||
static removeFromList(list: string, userName: string): void {
|
||||
console.log('removeFromList', list, userName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue