mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Refactor websocket into separate services, clean up socket status communication (#4433)
* Refactor websocket into separate services, clean up socket status communication * cleanup * add EOF lines * fix keepalive logged in check * undo change * fix keepalive connection check * cleanup * add typings * secure connection Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
19333c53f6
commit
e9ba195d7d
52 changed files with 815 additions and 757 deletions
|
|
@ -1,3 +1,12 @@
|
|||
export interface Game {
|
||||
description: string;
|
||||
gameId: number;
|
||||
gameType: string;
|
||||
gameTypes: string[];
|
||||
roomId: number;
|
||||
started: boolean;
|
||||
}
|
||||
|
||||
export enum GameSortField {
|
||||
START_TIME = "startTime"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ export * from "./user";
|
|||
export * from "./routes";
|
||||
export * from "./sort";
|
||||
export * from "./forms";
|
||||
export * from "./message";
|
||||
|
|
|
|||
7
webclient/src/types/message.tsx
Normal file
7
webclient/src/types/message.tsx
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export interface Message {
|
||||
name: string;
|
||||
message: string;
|
||||
messageType: number;
|
||||
timeOf: number;
|
||||
timeReceived: number;
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ export interface Room {
|
|||
gameCount: number;
|
||||
gameList: any[];
|
||||
gametypeList: any[];
|
||||
gametypeMap: { [index: number]: string; };
|
||||
gametypeMap: GametypeMap;
|
||||
name: string;
|
||||
permissionlevel: RoomAccessLevel;
|
||||
playerCount: number;
|
||||
|
|
@ -16,6 +16,8 @@ export interface Room {
|
|||
order: number;
|
||||
}
|
||||
|
||||
export interface GametypeMap { [index: number]: string }
|
||||
|
||||
export enum RoomAccessLevel {
|
||||
"none"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
export interface ServerStatus {
|
||||
status: StatusEnum;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export enum StatusEnum {
|
||||
DISCONNECTED = 0,
|
||||
CONNECTING = 1,
|
||||
|
|
@ -43,4 +48,10 @@ export interface Log {
|
|||
targetName: string;
|
||||
targetType: string;
|
||||
time: string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface LogGroups {
|
||||
room: Log[];
|
||||
game: Log[];
|
||||
chat: Log[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ export enum SortDirection {
|
|||
export interface SortBy {
|
||||
field: string;
|
||||
order: SortDirection;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
export interface User {
|
||||
accountageSecs: number;
|
||||
avatarBmp: Uint8Array;
|
||||
country: string;
|
||||
gender: number;
|
||||
name: string;
|
||||
privlevel: UserAccessLevel;
|
||||
realName: string;
|
||||
userLevel: UserPrivLevel;
|
||||
gender?: number;
|
||||
realName?: string;
|
||||
country?: string;
|
||||
avatarBmp?: Uint8Array;
|
||||
}
|
||||
|
||||
export enum UserAccessLevel {
|
||||
|
|
@ -22,4 +22,4 @@ export enum UserPrivLevel {
|
|||
|
||||
export enum UserSortField {
|
||||
NAME = "name"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue