workadventure/back/src/Model/Websocket/ExSocketInterface.ts

24 lines
881 B
TypeScript
Raw Normal View History

import {PointInterface} from "./PointInterface";
import {Identificable} from "./Identificable";
import {ViewportInterface} from "_Model/Websocket/ViewportMessage";
import {BatchMessage, SubMessage} from "../../Messages/generated/messages_pb";
2020-09-28 18:52:54 +02:00
import {WebSocket} from "uWebSockets.js"
2020-09-28 18:52:54 +02:00
export interface ExSocketInterface extends WebSocket, Identificable {
2020-06-10 12:32:39 +02:00
token: string;
roomId: string;
userId: number; // A temporary (autoincremented) identifier for this user
userUuid: string; // A unique identifier for this user
name: string;
characterLayers: string[];
position: PointInterface;
viewport: ViewportInterface;
/**
* Pushes an event that will be sent in the next batch of events
*/
2020-09-28 18:52:54 +02:00
emitInBatch: (payload: SubMessage) => void;
batchedMessages: BatchMessage;
batchTimeout: NodeJS.Timeout|null;
2020-09-28 18:52:54 +02:00
disconnecting: boolean
}