2020-04-04 14:05:18 +02:00
|
|
|
import {Socket} from "socket.io";
|
2020-04-04 16:25:03 +02:00
|
|
|
import {PointInterface} from "./PointInterface";
|
2020-05-14 23:19:48 +02:00
|
|
|
import {Identificable} from "./Identificable";
|
2020-06-09 23:07:19 +02:00
|
|
|
import {TokenInterface} from "../../Controller/AuthenticateController";
|
2020-09-15 10:06:11 +02:00
|
|
|
import {ViewportInterface} from "_Model/Websocket/ViewportMessage";
|
2020-09-24 11:16:08 +02:00
|
|
|
import {BatchMessage, SubMessage} from "../../Messages/generated/messages_pb";
|
2020-04-04 14:05:18 +02:00
|
|
|
|
2020-05-14 23:19:48 +02:00
|
|
|
export interface ExSocketInterface extends Socket, Identificable {
|
2020-06-10 12:32:39 +02:00
|
|
|
token: string;
|
2020-04-04 19:25:08 +02:00
|
|
|
roomId: string;
|
2020-09-18 17:18:50 +02:00
|
|
|
webRtcRoomId: string|undefined;
|
2020-09-18 13:57:38 +02:00
|
|
|
userId: number; // A temporary (autoincremented) identifier for this user
|
|
|
|
userUuid: string; // A unique identifier for this user
|
2020-05-03 22:24:14 +02:00
|
|
|
name: string;
|
2020-07-28 17:43:33 +02:00
|
|
|
characterLayers: string[];
|
2020-04-04 16:25:03 +02:00
|
|
|
position: PointInterface;
|
2020-09-15 10:06:11 +02:00
|
|
|
viewport: ViewportInterface;
|
2020-09-11 09:56:05 +02:00
|
|
|
isArtillery: boolean; // Whether this socket is opened by Artillery for load testing (hack)
|
2020-09-15 10:06:11 +02:00
|
|
|
/**
|
|
|
|
* Pushes an event that will be sent in the next batch of events
|
|
|
|
*/
|
2020-09-18 15:51:15 +02:00
|
|
|
emitInBatch: (event: string, payload: SubMessage) => void;
|
|
|
|
batchedMessages: BatchMessage;
|
2020-09-15 10:06:11 +02:00
|
|
|
batchTimeout: NodeJS.Timeout|null;
|
2020-05-08 15:18:22 +02:00
|
|
|
}
|