Updating Session Persistence with all valid persistence calls (#5085)

* Updating Session Persistence with all valid persistence calls

* Spacing fixes

---------

Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
Joseph Insalaco 2024-07-29 13:25:33 -04:00 committed by GitHub
parent ef4413633a
commit cf1f4f12a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 193 additions and 26 deletions

View file

@ -1,17 +1,19 @@
import { ServerDispatch } from 'store';
export class AdminPersistence {
static adjustMod(userName: string, shouldBeMod: boolean, shouldBeJudge: boolean) {
console.log('adjustMod');
}
static reloadConfig() {
console.log('reloadConfig');
ServerDispatch.reloadConfig();
}
static shutdownServer() {
console.log('shutdownServer');
ServerDispatch.shutdownServer();
}
static updateServerMessage() {
console.log('updateServerMessage');
ServerDispatch.updateServerMessage();
}
}

View file

@ -11,6 +11,8 @@ import {
} from '../events/session/interfaces';
import NormalizeService from '../utils/NormalizeService';
import { DeckList } from '../../types/deckList';
import { common } from 'protobufjs';
import IBytesValue = common.IBytesValue;
export class SessionPersistence {
static initialized() {
@ -156,23 +158,23 @@ export class SessionPersistence {
}
static accountPasswordChange(): void {
console.log('accountPassword');
ServerDispatch.accountPasswordChange();
}
static accountEditChanged(realName?: string, email?: string, country?: string): void {
console.log('accountEditChange');
ServerDispatch.accountEditChanged({ realName, email, country });
}
static accountImageChanged(): void {
console.log('accountImageChanged');
static accountImageChanged(avatarBmp: IBytesValue): void {
ServerDispatch.accountImageChanged({ avatarBmp });
}
static directMessageSent(userName: string, message: string): void {
console.log('directMessageSent');
ServerDispatch.directMessageSent(userName, message);
}
static getUserInfo(userInfo: string) {
console.log('getUserInfo');
static getUserInfo(userInfo: User) {
ServerDispatch.getUserInfo(userInfo);
}
static getGamesOfUser(userName: string, response: any): void {
@ -183,28 +185,28 @@ export class SessionPersistence {
console.log('gameJoined', gameJoinedData);
}
static notifyUser(payload: NotifyUserData): void {
console.log('notifyUser', payload);
static notifyUser(notification: NotifyUserData): void {
ServerDispatch.notifyUser(notification);
}
static playerPropertiesChanged(payload: PlayerGamePropertiesData): void {
console.log('playerPropertiesChanged', payload);
}
static serverShutdown(payload: ServerShutdownData): void {
console.log('serverShutdown', payload);
static serverShutdown(data: ServerShutdownData): void {
ServerDispatch.serverShutdown(data);
}
static userMessage(payload: UserMessageData): void {
console.log('userMessage', payload);
static userMessage(messageData: UserMessageData): void {
ServerDispatch.userMessage(messageData);
}
static addToList(list: string, userName: string): void {
console.log('addToList', list, userName);
ServerDispatch.addToList(list, userName)
}
static removeFromList(list: string, userName: string): void {
console.log('removeFromList', list, userName);
ServerDispatch.removeFromList(list, userName);
}
static deckDelete(deckId: number): void {