Many changes. Commit before I break down.
- Authentication middleware uses Zod - PhotonRegionId in config - DB key changes and additions - WebSocket for SignalR mock - Presence additions * Needs modification for playerIds (do not store `Profile` in a set, this will cause sync issues) - Profile settings - Profile Device Class - Zod properly checks for issuer in token - Room scene type bug - Setting key import started - Instancing changes - PlayerReporting API route - Deduplicated auth/connect/token - match/player/login begin - WebSocket hands off connection to SignalR handler
This commit is contained in:
32
src/socket/socket.ts
Normal file
32
src/socket/socket.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import WebSocket from "ws";
|
||||
import Profile from "../data/profiles.ts";
|
||||
import { IncomingMessage } from "node:http";
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
|
||||
export class SignalRSocketHandler {
|
||||
|
||||
log: Logging = new Logging("SignalMock-");
|
||||
|
||||
#socket: WebSocket;
|
||||
#profile: Profile;
|
||||
|
||||
constructor(socket: WebSocket, player: Profile) {
|
||||
|
||||
this.#socket = socket;
|
||||
this.#profile = player;
|
||||
|
||||
player.setSocketHandler(this);
|
||||
this.log.source += player.getId().toString();
|
||||
|
||||
// log: we connected!!
|
||||
|
||||
Deno.addSignalListener('SIGINT', this.destroy);
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.#socket.close();
|
||||
Deno.removeSignalListener('SIGINT', this.destroy);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user