You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
Move to Renderer V2
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { IFlatUser } from './IFlatUser';
|
||||
|
||||
export class BannedUserData implements IFlatUser
|
||||
{
|
||||
private _userId: number;
|
||||
private _userName: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._userId = wrapper.readInt();
|
||||
this._userName = wrapper.readString();
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { BannedUserData } from './BannedUserData';
|
||||
|
||||
export class BannedUsersFromRoomParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _bannedUsers: BannedUserData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._bannedUsers = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
let totalBans = wrapper.readInt();
|
||||
|
||||
while(totalBans > 0)
|
||||
{
|
||||
this._bannedUsers.push(new BannedUserData(wrapper));
|
||||
|
||||
totalBans--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get bannedUsers(): BannedUserData[]
|
||||
{
|
||||
return this._bannedUsers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { FlatControllerData } from './FlatControllerData';
|
||||
|
||||
export class FlatControllerAddedParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _data: FlatControllerData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._data = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._data = new FlatControllerData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get data(): FlatControllerData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { IFlatUser } from './IFlatUser';
|
||||
|
||||
export class FlatControllerData implements IFlatUser
|
||||
{
|
||||
private _userId: number;
|
||||
private _userName: string;
|
||||
private _selected: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._userId = wrapper.readInt();
|
||||
this._userName = wrapper.readString();
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
|
||||
public get selected(): boolean
|
||||
{
|
||||
return this._selected;
|
||||
}
|
||||
|
||||
public set selected(selected: boolean)
|
||||
{
|
||||
this._selected = selected;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FlatControllerRemovedParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _userId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._userId = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._userId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FlatControllersParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _users: Map<number, string>;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._users = new Map<number, string>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
let usersCount = wrapper.readInt();
|
||||
|
||||
while(usersCount > 0)
|
||||
{
|
||||
const id = wrapper.readInt();
|
||||
const name = wrapper.readString();
|
||||
|
||||
this._users.set(id, name);
|
||||
|
||||
usersCount--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get users(): Map<number, string>
|
||||
{
|
||||
return this._users;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface IFlatUser
|
||||
{
|
||||
userId: number;
|
||||
userName: string;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class MuteAllInRoomParser implements IMessageParser
|
||||
{
|
||||
private _isMuted: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._isMuted = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get isMuted(): boolean
|
||||
{
|
||||
return this._isMuted;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class NoSuchFlatParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class RoomChatSettings
|
||||
{
|
||||
public static CHAT_MODE_FREE_FLOW: number = 0;
|
||||
public static CHAT_MODE_LINE_BY_LINE: number = 1;
|
||||
public static CHAT_BUBBLE_WIDTH_WIDE: number = 0;
|
||||
public static CHAT_BUBBLE_WIDTH_NORMAL: number = 1;
|
||||
public static CHAT_BUBBLE_WIDTH_THIN: number = 2;
|
||||
public static CHAT_SCROLL_SPEED_FAST: number = 0;
|
||||
public static CHAT_SCROLL_SPEED_NORMAL: number = 1;
|
||||
public static CHAT_SCROLL_SPEED_SLOW: number = 2;
|
||||
public static FLOOD_FILTER_STRICT: number = 0;
|
||||
public static FLOOD_FILTER_NORMAL: number = 1;
|
||||
public static FLOOD_FILTER_LOOSE: number = 2;
|
||||
|
||||
private _mode: number;
|
||||
private _weight: number;
|
||||
private _speed: number;
|
||||
private _distance: number;
|
||||
private _protection: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this._mode = wrapper.readInt();
|
||||
this._weight = wrapper.readInt();
|
||||
this._speed = wrapper.readInt();
|
||||
this._distance = wrapper.readInt();
|
||||
this._protection = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get mode(): number
|
||||
{
|
||||
return this._mode;
|
||||
}
|
||||
public get weight(): number
|
||||
{
|
||||
return this._weight;
|
||||
}
|
||||
|
||||
public get speed(): number
|
||||
{
|
||||
return this._speed;
|
||||
}
|
||||
|
||||
public get distance(): number
|
||||
{
|
||||
return this._distance;
|
||||
}
|
||||
|
||||
public get protection(): number
|
||||
{
|
||||
return this._protection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IRoomModerationSettings } from '@nitrots/api';
|
||||
|
||||
export class RoomModerationSettings implements IRoomModerationSettings
|
||||
{
|
||||
public static MODERATION_LEVEL_NONE: number = 0;
|
||||
public static MODERATION_LEVEL_USER_WITH_RIGHTS: number = 1;
|
||||
public static MODERATION_LEVEL_ALL: number = 2;
|
||||
|
||||
private _allowMute: number;
|
||||
private _allowKick: number;
|
||||
private _allowBan: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._allowMute = wrapper.readInt();
|
||||
this._allowKick = wrapper.readInt();
|
||||
this._allowBan = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get allowMute(): number
|
||||
{
|
||||
return this._allowMute;
|
||||
}
|
||||
|
||||
public get allowKick(): number
|
||||
{
|
||||
return this._allowKick;
|
||||
}
|
||||
|
||||
public get allowBan(): number
|
||||
{
|
||||
return this._allowBan;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
import { BannedUserData } from './BannedUserData';
|
||||
import { FlatControllerData } from './FlatControllerData';
|
||||
import { RoomChatSettings } from './RoomChatSettings';
|
||||
import { RoomModerationSettings } from './RoomModerationSettings';
|
||||
|
||||
export class RoomSettingsData
|
||||
{
|
||||
public static DOORMODE_OPEN: number = 0;
|
||||
public static DOORMODE_CLOSED: number = 1;
|
||||
public static DOORMODE_PASSWORD: number = 2;
|
||||
public static DOORMODE_INVISIBLE: number = 3;
|
||||
public static DOORMODE_NOOBS_ONLY: number = 4;
|
||||
public static TRADEMODE_NOT_ALLOWED: number = 0;
|
||||
public static TRADEMODE_WITH_CONTROLLER: number = 1;
|
||||
public static TRADEMODE_ALLOWED: number = 2;
|
||||
|
||||
private _roomId: number = -1;
|
||||
private _name: string = null;
|
||||
private _description: string = null;
|
||||
private _doorMode: number = RoomSettingsData.DOORMODE_OPEN;
|
||||
private _categoryId: number = -1;
|
||||
private _maximumVisitors: number = 0;
|
||||
private _maximumVisitorsLimit: number = 0;
|
||||
private _tags: string[] = [];
|
||||
private _tradeMode: number = RoomSettingsData.TRADEMODE_NOT_ALLOWED;
|
||||
private _allowPets: boolean = false;
|
||||
private _allowFoodConsume: boolean = false;
|
||||
private _allowWalkThrough: boolean = false;
|
||||
private _hideWalls: boolean = false;
|
||||
private _wallThickness: number = 0;
|
||||
private _floorThickness: number = 0;
|
||||
private _controllersById: Map<number, FlatControllerData> = new Map();
|
||||
private _controllerList: FlatControllerData[] = null;
|
||||
private _highlightedUserId: number = -1;
|
||||
private _bannedUsersById: Map<number, BannedUserData> = new Map();
|
||||
private _bannedUsersList: BannedUserData[] = null;
|
||||
private _roomModerationSettings: RoomModerationSettings = null;
|
||||
private _chatSettings: RoomChatSettings = null;
|
||||
private _allowNavigatorDynamicCats: boolean = false;
|
||||
|
||||
public static from(settings: RoomSettingsData)
|
||||
{
|
||||
const instance = new RoomSettingsData();
|
||||
|
||||
instance._roomId = settings._roomId;
|
||||
instance._name = settings._name;
|
||||
instance._description = settings._description;
|
||||
instance._doorMode = settings._doorMode;
|
||||
instance._categoryId = settings._categoryId;
|
||||
instance._maximumVisitors = settings._maximumVisitors;
|
||||
instance._maximumVisitorsLimit = settings._maximumVisitorsLimit;
|
||||
instance._tags = settings._tags;
|
||||
instance._tradeMode = settings._tradeMode;
|
||||
instance._allowPets = settings._allowPets;
|
||||
instance._allowFoodConsume = settings._allowFoodConsume;
|
||||
instance._allowWalkThrough = settings._allowWalkThrough;
|
||||
instance._hideWalls = settings._hideWalls;
|
||||
instance._wallThickness = settings._wallThickness;
|
||||
instance._floorThickness = settings._floorThickness;
|
||||
instance._controllersById = settings._controllersById;
|
||||
instance._controllerList = settings._controllerList;
|
||||
instance._highlightedUserId = settings._highlightedUserId;
|
||||
instance._bannedUsersById = settings._bannedUsersById;
|
||||
instance._bannedUsersList = settings._bannedUsersList;
|
||||
instance._roomModerationSettings = settings._roomModerationSettings;
|
||||
instance._chatSettings = settings._chatSettings;
|
||||
instance._allowNavigatorDynamicCats = settings._allowNavigatorDynamicCats;
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static getDoorModeLocalizationKey(k: number): string
|
||||
{
|
||||
switch(k)
|
||||
{
|
||||
case RoomSettingsData.DOORMODE_OPEN:
|
||||
return '${navigator.door.mode.open}';
|
||||
case RoomSettingsData.DOORMODE_CLOSED:
|
||||
return '${navigator.door.mode.closed}';
|
||||
case RoomSettingsData.DOORMODE_PASSWORD:
|
||||
return '${navigator.door.mode.password}';
|
||||
case RoomSettingsData.DOORMODE_INVISIBLE:
|
||||
return '${navigator.door.mode.invisible}';
|
||||
case RoomSettingsData.DOORMODE_NOOBS_ONLY:
|
||||
return '${navigator.door.mode.noobs_only}';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public get tradeMode(): number
|
||||
{
|
||||
return this._tradeMode;
|
||||
}
|
||||
|
||||
public set tradeMode(mode: number)
|
||||
{
|
||||
this._tradeMode = mode;
|
||||
}
|
||||
|
||||
public get allowPets(): boolean
|
||||
{
|
||||
return this._allowPets;
|
||||
}
|
||||
|
||||
public set allowPets(flag: boolean)
|
||||
{
|
||||
this._allowPets = flag;
|
||||
}
|
||||
|
||||
public get allowFoodConsume(): boolean
|
||||
{
|
||||
return this._allowFoodConsume;
|
||||
}
|
||||
|
||||
public set allowFoodConsume(flag: boolean)
|
||||
{
|
||||
this._allowFoodConsume = flag;
|
||||
}
|
||||
|
||||
public get allowWalkThrough(): boolean
|
||||
{
|
||||
return this._allowWalkThrough;
|
||||
}
|
||||
|
||||
public set allowWalkThrough(flag: boolean)
|
||||
{
|
||||
this._allowWalkThrough = flag;
|
||||
}
|
||||
|
||||
public get hideWalls(): boolean
|
||||
{
|
||||
return this._hideWalls;
|
||||
}
|
||||
|
||||
public set hideWalls(flag: boolean)
|
||||
{
|
||||
this._hideWalls = flag;
|
||||
}
|
||||
|
||||
public get wallThickness(): number
|
||||
{
|
||||
return this._wallThickness;
|
||||
}
|
||||
|
||||
public set wallThickness(thickness: number)
|
||||
{
|
||||
this._wallThickness = thickness;
|
||||
}
|
||||
|
||||
public get floorThickness(): number
|
||||
{
|
||||
return this._floorThickness;
|
||||
}
|
||||
|
||||
public set floorThickness(thickness: number)
|
||||
{
|
||||
this._floorThickness = thickness;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public set roomId(id: number)
|
||||
{
|
||||
this._roomId = id;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public set name(name: string)
|
||||
{
|
||||
this._name = name;
|
||||
}
|
||||
|
||||
public get description(): string
|
||||
{
|
||||
return this._description;
|
||||
}
|
||||
|
||||
public set description(description: string)
|
||||
{
|
||||
this._description = description;
|
||||
}
|
||||
|
||||
public get doorMode(): number
|
||||
{
|
||||
return this._doorMode;
|
||||
}
|
||||
|
||||
public set doorMode(mode: number)
|
||||
{
|
||||
this._doorMode = mode;
|
||||
}
|
||||
|
||||
public get categoryId(): number
|
||||
{
|
||||
return this._categoryId;
|
||||
}
|
||||
|
||||
public set categoryId(id: number)
|
||||
{
|
||||
this._categoryId = id;
|
||||
}
|
||||
|
||||
public get maximumVisitors(): number
|
||||
{
|
||||
return this._maximumVisitors;
|
||||
}
|
||||
|
||||
public set maximumVisitors(max: number)
|
||||
{
|
||||
this._maximumVisitors = max;
|
||||
}
|
||||
|
||||
public get maximumVisitorsLimit(): number
|
||||
{
|
||||
return this._maximumVisitorsLimit;
|
||||
}
|
||||
|
||||
public set maximumVisitorsLimit(limit: number)
|
||||
{
|
||||
this._maximumVisitorsLimit = limit;
|
||||
}
|
||||
|
||||
public get tags(): string[]
|
||||
{
|
||||
return this._tags;
|
||||
}
|
||||
|
||||
public set tags(tags: string[])
|
||||
{
|
||||
this._tags = tags;
|
||||
}
|
||||
|
||||
public setFlatController(id: number, data: FlatControllerData): void
|
||||
{
|
||||
this._controllersById.set(id, data);
|
||||
|
||||
this._controllerList = null;
|
||||
this._highlightedUserId = id;
|
||||
}
|
||||
|
||||
public get roomModerationSettings(): RoomModerationSettings
|
||||
{
|
||||
return this._roomModerationSettings;
|
||||
}
|
||||
|
||||
public set roomModerationSettings(settings: RoomModerationSettings)
|
||||
{
|
||||
this._roomModerationSettings = settings;
|
||||
}
|
||||
|
||||
public get controllersById(): Map<number, FlatControllerData>
|
||||
{
|
||||
return this._controllersById;
|
||||
}
|
||||
|
||||
public set controllersById(controllers: Map<number, FlatControllerData>)
|
||||
{
|
||||
this._controllersById = controllers;
|
||||
}
|
||||
|
||||
public get controllerList(): FlatControllerData[]
|
||||
{
|
||||
if(!this._controllerList)
|
||||
{
|
||||
this._controllerList = [];
|
||||
|
||||
for(const controllerData of this._controllersById.values()) this._controllerList.push(controllerData);
|
||||
|
||||
this._controllerList.sort((a, b) => a.userName.localeCompare(b.userName));
|
||||
}
|
||||
|
||||
return this._controllerList;
|
||||
}
|
||||
|
||||
public get highlightedUserId(): number
|
||||
{
|
||||
return this._highlightedUserId;
|
||||
}
|
||||
|
||||
public setBannedUser(id: number, data: BannedUserData): void
|
||||
{
|
||||
this._bannedUsersById.set(id, data);
|
||||
|
||||
this._bannedUsersList = null;
|
||||
}
|
||||
|
||||
public get bannedUsersById(): Map<number, BannedUserData>
|
||||
{
|
||||
return this._bannedUsersById;
|
||||
}
|
||||
|
||||
public get bannedUsersList(): BannedUserData[]
|
||||
{
|
||||
if(!this._bannedUsersList)
|
||||
{
|
||||
this._bannedUsersList = [];
|
||||
|
||||
for(const bannedUserData of this._bannedUsersById.values()) this._bannedUsersList.push(bannedUserData);
|
||||
|
||||
this._bannedUsersList.sort((a, b) => a.userName.localeCompare(b.userName));
|
||||
}
|
||||
|
||||
return this._bannedUsersList;
|
||||
}
|
||||
|
||||
public get chatSettings(): RoomChatSettings
|
||||
{
|
||||
return this._chatSettings;
|
||||
}
|
||||
|
||||
public set chatSettings(settings: RoomChatSettings)
|
||||
{
|
||||
this._chatSettings = settings;
|
||||
}
|
||||
|
||||
public get allowNavigatorDynamicCats(): boolean
|
||||
{
|
||||
return this._allowNavigatorDynamicCats;
|
||||
}
|
||||
|
||||
public set allowNavigatorDynamicCats(flag: boolean)
|
||||
{
|
||||
this._allowNavigatorDynamicCats = flag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { RoomChatSettings } from './RoomChatSettings';
|
||||
import { RoomModerationSettings } from './RoomModerationSettings';
|
||||
import { RoomSettingsData } from './RoomSettingsData';
|
||||
|
||||
export class RoomSettingsDataParser implements IMessageParser
|
||||
{
|
||||
private _roomSettingsData: RoomSettingsData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomSettingsData = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomSettingsData = new RoomSettingsData();
|
||||
|
||||
this._roomSettingsData.roomId = wrapper.readInt();
|
||||
this._roomSettingsData.name = wrapper.readString();
|
||||
this._roomSettingsData.description = wrapper.readString();
|
||||
this._roomSettingsData.doorMode = wrapper.readInt();
|
||||
this._roomSettingsData.categoryId = wrapper.readInt();
|
||||
this._roomSettingsData.maximumVisitors = wrapper.readInt();
|
||||
this._roomSettingsData.maximumVisitorsLimit = wrapper.readInt();
|
||||
this._roomSettingsData.tags = [];
|
||||
|
||||
let totalTags = wrapper.readInt();
|
||||
|
||||
while(totalTags > 0)
|
||||
{
|
||||
this._roomSettingsData.tags.push(wrapper.readString());
|
||||
|
||||
totalTags--;
|
||||
}
|
||||
|
||||
this._roomSettingsData.tradeMode = wrapper.readInt();
|
||||
this._roomSettingsData.allowPets = (wrapper.readInt() === 1);
|
||||
this._roomSettingsData.allowFoodConsume = (wrapper.readInt() === 1);
|
||||
this._roomSettingsData.allowWalkThrough = (wrapper.readInt() === 1);
|
||||
this._roomSettingsData.hideWalls = (wrapper.readInt() === 1);
|
||||
this._roomSettingsData.wallThickness = wrapper.readInt();
|
||||
this._roomSettingsData.floorThickness = wrapper.readInt();
|
||||
this._roomSettingsData.chatSettings = new RoomChatSettings(wrapper);
|
||||
this._roomSettingsData.allowNavigatorDynamicCats = wrapper.readBoolean();
|
||||
this._roomSettingsData.roomModerationSettings = new RoomModerationSettings(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): RoomSettingsData
|
||||
{
|
||||
return this._roomSettingsData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomSettingsErrorParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _code: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._code = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._code = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomSettingsSaveErrorParser implements IMessageParser
|
||||
{
|
||||
public static ERROR_ROOM_NOT_FOUND: number = 1;
|
||||
public static ERROR_NOT_OWNER: number = 2;
|
||||
public static ERROR_INVALID_DOOR_MODE: number = 3;
|
||||
public static ERROR_INVALID_USER_LIMIT: number = 4;
|
||||
public static ERROR_INVALID_PASSWORD: number = 5;
|
||||
public static ERROR_INVALID_CATEGORY: number = 6;
|
||||
public static ERROR_INVALID_NAME: number = 7;
|
||||
public static ERROR_UNACCEPTABLE_NAME: number = 8;
|
||||
public static ERROR_INVALID_DESCRIPTION: number = 9;
|
||||
public static ERROR_UNACCEPTABLE_DESCRIPTION: number = 10;
|
||||
public static ERROR_INVALID_TAG: number = 11;
|
||||
public static ERROR_NON_USER_CHOOSABLE_TAG: number = 12;
|
||||
public static ERROR_TOO_MANY_CHARACTERS_IN_TAG: number = 13;
|
||||
|
||||
private _roomId: number;
|
||||
private _code: number;
|
||||
private _message: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._code = 0;
|
||||
this._message = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._code = wrapper.readInt();
|
||||
this._message = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get code(): number
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get message(): string
|
||||
{
|
||||
return this._message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomSettingsSavedParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ShowEnforceRoomCategoryDialogParser implements IMessageParser
|
||||
{
|
||||
private _selectionType: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._selectionType = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._selectionType = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get selectionType(): number
|
||||
{
|
||||
return this._selectionType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserUnbannedFromRoomParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _userId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._userId = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._userId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
export * from './BannedUserData';
|
||||
export * from './BannedUsersFromRoomParser';
|
||||
export * from './FlatControllerAddedParser';
|
||||
export * from './FlatControllerData';
|
||||
export * from './FlatControllerRemovedParser';
|
||||
export * from './FlatControllersParser';
|
||||
export * from './IFlatUser';
|
||||
export * from './MuteAllInRoomParser';
|
||||
export * from './NoSuchFlatParser';
|
||||
export * from './RoomChatSettings';
|
||||
export * from './RoomModerationSettings';
|
||||
export * from './RoomSettingsData';
|
||||
export * from './RoomSettingsDataParser';
|
||||
export * from './RoomSettingsErrorParser';
|
||||
export * from './RoomSettingsSavedParser';
|
||||
export * from './RoomSettingsSaveErrorParser';
|
||||
export * from './ShowEnforceRoomCategoryDialogParser';
|
||||
export * from './UserUnbannedFromRoomParser';
|
||||
Reference in New Issue
Block a user