Migrating userId to "int32" to save some space and adding userMoves message in protobuf
This commit is contained in:
parent
4b55b54a07
commit
e9ca8721a6
31 changed files with 295 additions and 445 deletions
|
@ -8,7 +8,8 @@ export interface ExSocketInterface extends Socket, Identificable {
|
|||
token: string;
|
||||
roomId: string;
|
||||
webRtcRoomId: string;
|
||||
userId: string;
|
||||
userId: number; // A temporary (autoincremented) identifier for this user
|
||||
userUuid: string; // A unique identifier for this user
|
||||
name: string;
|
||||
characterLayers: string[];
|
||||
position: PointInterface;
|
||||
|
|
|
@ -2,5 +2,5 @@ import {PositionInterface} from "_Model/PositionInterface";
|
|||
|
||||
export interface GroupUpdateInterface {
|
||||
position: PositionInterface,
|
||||
groupId: string,
|
||||
groupId: number,
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
export interface Identificable {
|
||||
userId: string;
|
||||
userId: number;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {PointInterface} from "_Model/Websocket/PointInterface";
|
||||
|
||||
export class MessageUserJoined {
|
||||
constructor(public userId: string, public name: string, public characterLayers: string[], public position: PointInterface) {
|
||||
constructor(public userId: number, public name: string, public characterLayers: string[], public position: PointInterface) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {PointInterface} from "./PointInterface";
|
||||
|
||||
export class MessageUserMoved {
|
||||
constructor(public userId: string, public position: PointInterface) {
|
||||
constructor(public userId: number, public position: PointInterface) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@ export class Point implements PointInterface{
|
|||
}
|
||||
|
||||
export class MessageUserPosition {
|
||||
constructor(public userId: string, public name: string, public characterLayers: string[], public position: PointInterface) {
|
||||
constructor(public userId: number, public name: string, public characterLayers: string[], public position: PointInterface) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export interface UserInGroupInterface {
|
||||
userId: string,
|
||||
userId: number,
|
||||
name: string,
|
||||
initiator: boolean
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import * as tg from "generic-type-guard";
|
||||
import {isPointInterface} from "./PointInterface";
|
||||
import {isViewport} from "./ViewportMessage";
|
||||
|
||||
|
||||
export const isUserMovesInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
position: isPointInterface,
|
||||
viewport: isViewport,
|
||||
}).get();
|
||||
export type UserMovesInterface = tg.GuardedType<typeof isUserMovesInterface>;
|
|
@ -7,12 +7,12 @@ export const isSignalData =
|
|||
|
||||
export const isWebRtcSignalMessageInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
receiverId: tg.isString,
|
||||
receiverId: tg.isNumber,
|
||||
signal: isSignalData
|
||||
}).get();
|
||||
export const isWebRtcScreenSharingStartMessageInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
userId: tg.isString,
|
||||
userId: tg.isNumber,
|
||||
roomId: tg.isString
|
||||
}).get();
|
||||
export type WebRtcSignalMessageInterface = tg.GuardedType<typeof isWebRtcSignalMessageInterface>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue