Adding a Pusher container as a middleware/dispatcher between front and back
This commit is contained in:
parent
6c6d046891
commit
4c1e566a6c
86 changed files with 12172 additions and 983 deletions
42
pusher/src/Model/Websocket/ExSocketInterface.ts
Normal file
42
pusher/src/Model/Websocket/ExSocketInterface.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import {PointInterface} from "./PointInterface";
|
||||
import {Identificable} from "./Identificable";
|
||||
import {ViewportInterface} from "_Model/Websocket/ViewportMessage";
|
||||
import {
|
||||
BatchMessage,
|
||||
PusherToBackMessage,
|
||||
ServerToClientMessage,
|
||||
SubMessage
|
||||
} from "../../Messages/generated/messages_pb";
|
||||
import {WebSocket} from "uWebSockets.js"
|
||||
import {CharacterTexture} from "../../Services/AdminApi";
|
||||
import {ClientDuplexStream} from "grpc";
|
||||
import {Zone} from "_Model/Zone";
|
||||
|
||||
export type BackConnection = ClientDuplexStream<PusherToBackMessage, ServerToClientMessage>;
|
||||
|
||||
export interface CharacterLayer {
|
||||
name: string,
|
||||
url: string|undefined
|
||||
}
|
||||
|
||||
export interface ExSocketInterface extends WebSocket, Identificable {
|
||||
token: string;
|
||||
roomId: string;
|
||||
//userId: number; // A temporary (autoincremented) identifier for this user
|
||||
userUuid: string; // A unique identifier for this user
|
||||
name: string;
|
||||
characterLayers: CharacterLayer[];
|
||||
position: PointInterface;
|
||||
viewport: ViewportInterface;
|
||||
/**
|
||||
* Pushes an event that will be sent in the next batch of events
|
||||
*/
|
||||
emitInBatch: (payload: SubMessage) => void;
|
||||
batchedMessages: BatchMessage;
|
||||
batchTimeout: NodeJS.Timeout|null;
|
||||
disconnecting: boolean,
|
||||
tags: string[],
|
||||
textures: CharacterTexture[],
|
||||
backConnection: BackConnection,
|
||||
listenedZones: Set<Zone>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue