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,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class CanCreateRoomEventParser implements IMessageParser
|
||||
{
|
||||
private _canCreate: boolean;
|
||||
private _errorCode: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._canCreate = false;
|
||||
this._errorCode = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._canCreate = wrapper.readBoolean();
|
||||
this._errorCode = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get canCreate(): boolean
|
||||
{
|
||||
return this._canCreate;
|
||||
}
|
||||
|
||||
public get errorCode(): number
|
||||
{
|
||||
return this._errorCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class CanCreateRoomMessageParser implements IMessageParser
|
||||
{
|
||||
public static readonly CREATION_ALLOWED = 0;
|
||||
public static readonly ROOM_LIMIT_REACHED = 1;
|
||||
|
||||
private _resultCode: number;
|
||||
private _roomLimit: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._resultCode = wrapper.readInt();
|
||||
this._roomLimit = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get resultCode(): number
|
||||
{
|
||||
return this._resultCode;
|
||||
}
|
||||
|
||||
public get roomLimit(): number
|
||||
{
|
||||
return this._roomLimit;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { CategoriesWithVisitorCountData } from './utils';
|
||||
|
||||
export class CategoriesWithVisitorCountParser implements IMessageParser
|
||||
{
|
||||
private _data: CategoriesWithVisitorCountData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new CategoriesWithVisitorCountData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): CategoriesWithVisitorCountData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { CompetitionRoomsData } from './utils';
|
||||
|
||||
export class CompetitionRoomsDataMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: CompetitionRoomsData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new CompetitionRoomsData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): CompetitionRoomsData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ConvertedRoomIdMessageParser implements IMessageParser
|
||||
{
|
||||
private _globalId: string;
|
||||
private _convertedId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._globalId = wrapper.readString();
|
||||
this._convertedId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get globalId(): string
|
||||
{
|
||||
return this._globalId;
|
||||
}
|
||||
|
||||
public get convertedId(): number
|
||||
{
|
||||
return this._convertedId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class DoorbellMessageParser implements IMessageParser
|
||||
{
|
||||
private _userName: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userName = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userName = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FavouriteChangedMessageParser implements IMessageParser
|
||||
{
|
||||
private _flatId: number;
|
||||
private _added: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._flatId = wrapper.readInt();
|
||||
this._added = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get flatId(): number
|
||||
{
|
||||
return this._flatId;
|
||||
}
|
||||
|
||||
public get added(): boolean
|
||||
{
|
||||
return this._added;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FavouritesMessageParser implements IMessageParser
|
||||
{
|
||||
private _limit: number;
|
||||
private _favouriteRoomIds: number[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._favouriteRoomIds = [];
|
||||
this._limit = wrapper.readInt();
|
||||
|
||||
const count = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._favouriteRoomIds.push(wrapper.readInt());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get limit(): number
|
||||
{
|
||||
return this._limit;
|
||||
}
|
||||
|
||||
public get favoriteRoomIds(): number[]
|
||||
{
|
||||
return this._favouriteRoomIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FlatAccessDeniedMessageParser implements IMessageParser
|
||||
{
|
||||
private _userName: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userName = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userName = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FlatCreatedMessageParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _roomName: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = -1;
|
||||
this._roomName = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._roomName = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get roomName(): string
|
||||
{
|
||||
return this._roomName;
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { RoomDataParser } from '../room';
|
||||
import { RoomChatSettings, RoomModerationSettings } from '../roomsettings';
|
||||
|
||||
export class GetGuestRoomResultMessageParser implements IMessageParser
|
||||
{
|
||||
private _roomEnter: boolean;
|
||||
private _roomForward: boolean;
|
||||
private _data: RoomDataParser;
|
||||
private _staffPick: boolean;
|
||||
private _isGroupMember: boolean;
|
||||
private _moderation: RoomModerationSettings;
|
||||
private _chat: RoomChatSettings;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomEnter = false;
|
||||
this._roomForward = false;
|
||||
this._data = null;
|
||||
this._staffPick = false;
|
||||
this._isGroupMember = false;
|
||||
this._moderation = null;
|
||||
this._chat = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomEnter = wrapper.readBoolean();
|
||||
this._data = new RoomDataParser(wrapper);
|
||||
this._roomForward = wrapper.readBoolean();
|
||||
this._staffPick = wrapper.readBoolean();
|
||||
this._isGroupMember = wrapper.readBoolean();
|
||||
this.data.allInRoomMuted = wrapper.readBoolean();
|
||||
this._moderation = new RoomModerationSettings(wrapper);
|
||||
this.data.canMute = wrapper.readBoolean();
|
||||
this._chat = new RoomChatSettings(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomEnter(): boolean
|
||||
{
|
||||
return this._roomEnter;
|
||||
}
|
||||
|
||||
public get roomForward(): boolean
|
||||
{
|
||||
return this._roomForward;
|
||||
}
|
||||
|
||||
public get data(): RoomDataParser
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public get staffPick(): boolean
|
||||
{
|
||||
return this._staffPick;
|
||||
}
|
||||
|
||||
public get isGroupMember(): boolean
|
||||
{
|
||||
return this._isGroupMember;
|
||||
}
|
||||
|
||||
public get moderation(): RoomModerationSettings
|
||||
{
|
||||
return this._moderation;
|
||||
}
|
||||
|
||||
public get chat(): RoomChatSettings
|
||||
{
|
||||
return this._chat;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { GuestRoomSearchResultData } from './utils';
|
||||
|
||||
export class GuestRoomSearchResultMessageParser implements IMessageParser
|
||||
{
|
||||
_data: GuestRoomSearchResultData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new GuestRoomSearchResultData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): GuestRoomSearchResultData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class NavigatorCategoryDataParser
|
||||
{
|
||||
private _id: number;
|
||||
private _name: string;
|
||||
private _visible: boolean;
|
||||
private _automatic: boolean;
|
||||
private _automaticCategoryKey: string;
|
||||
private _globalCategoryKey: string;
|
||||
private _staffOnly: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._id = -1;
|
||||
this._name = null;
|
||||
this._visible = false;
|
||||
this._automatic = false;
|
||||
this._automaticCategoryKey = null;
|
||||
this._globalCategoryKey = null;
|
||||
this._staffOnly = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._id = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
this._visible = wrapper.readBoolean();
|
||||
this._automatic = wrapper.readBoolean();
|
||||
this._automaticCategoryKey = wrapper.readString();
|
||||
this._globalCategoryKey = wrapper.readString();
|
||||
this._staffOnly = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get visible(): boolean
|
||||
{
|
||||
return this._visible;
|
||||
}
|
||||
|
||||
public get automatic(): boolean
|
||||
{
|
||||
return this._automatic;
|
||||
}
|
||||
|
||||
public get automaticCategoryKey(): string
|
||||
{
|
||||
return this._automaticCategoryKey;
|
||||
}
|
||||
|
||||
public get globalCategoryKey(): string
|
||||
{
|
||||
return this._globalCategoryKey;
|
||||
}
|
||||
|
||||
public get staffOnly(): boolean
|
||||
{
|
||||
return this._staffOnly;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class NavigatorCollapsedParser implements IMessageParser
|
||||
{
|
||||
private _categories: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._categories = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalCategories = wrapper.readInt();
|
||||
|
||||
while(totalCategories > 0)
|
||||
{
|
||||
this._categories.push(wrapper.readString());
|
||||
|
||||
totalCategories--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get categories(): string[]
|
||||
{
|
||||
return this._categories;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class NavigatorEventCategoryDataParser
|
||||
{
|
||||
private _id: number;
|
||||
private _name: string;
|
||||
private _visible: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._id = -1;
|
||||
this._name = null;
|
||||
this._visible = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._id = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
this._visible = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get visible(): boolean
|
||||
{
|
||||
return this._visible;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class NavigatorHomeRoomParser implements IMessageParser
|
||||
{
|
||||
private _homeRoomId: number;
|
||||
private _roomIdToEnter: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._homeRoomId = -1;
|
||||
this._roomIdToEnter = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._homeRoomId = wrapper.readInt();
|
||||
this._roomIdToEnter = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get homeRoomId(): number
|
||||
{
|
||||
return this._homeRoomId;
|
||||
}
|
||||
|
||||
public get roomIdToEnter(): number
|
||||
{
|
||||
return this._roomIdToEnter;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class NavigatorLiftedDataParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _areaId: number;
|
||||
private _image: string;
|
||||
private _caption: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = -1;
|
||||
this._areaId = -1;
|
||||
this._image = null;
|
||||
this._caption = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
this._areaId = wrapper.readInt();
|
||||
this._image = wrapper.readString();
|
||||
this._caption = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get areaId(): number
|
||||
{
|
||||
return this._areaId;
|
||||
}
|
||||
|
||||
public get image(): string
|
||||
{
|
||||
return this._image;
|
||||
}
|
||||
|
||||
public get caption(): string
|
||||
{
|
||||
return this._caption;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorLiftedDataParser } from './NavigatorLiftedDataParser';
|
||||
|
||||
export class NavigatorLiftedParser implements IMessageParser
|
||||
{
|
||||
private _rooms: NavigatorLiftedDataParser[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._rooms = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalRooms = wrapper.readInt();
|
||||
|
||||
while(totalRooms > 0)
|
||||
{
|
||||
this._rooms.push(new NavigatorLiftedDataParser(wrapper));
|
||||
|
||||
totalRooms--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get rooms(): NavigatorLiftedDataParser[]
|
||||
{
|
||||
return this._rooms;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorTopLevelContext } from './utils';
|
||||
|
||||
export class NavigatorMetadataParser implements IMessageParser
|
||||
{
|
||||
private _topLevelContexts: NavigatorTopLevelContext[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._topLevelContexts = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalContexts = wrapper.readInt();
|
||||
|
||||
while(totalContexts > 0)
|
||||
{
|
||||
this._topLevelContexts.push(new NavigatorTopLevelContext(wrapper));
|
||||
|
||||
totalContexts--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get topLevelContexts(): NavigatorTopLevelContext[]
|
||||
{
|
||||
return this._topLevelContexts;
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class NavigatorOpenRoomCreatorParser implements IMessageParser
|
||||
{
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorSearchResultSet } from './utils';
|
||||
|
||||
export class NavigatorSearchParser implements IMessageParser
|
||||
{
|
||||
private _result: NavigatorSearchResultSet;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._result = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._result = new NavigatorSearchResultSet(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get result(): NavigatorSearchResultSet
|
||||
{
|
||||
return this._result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorSavedSearch } from './utils';
|
||||
|
||||
export class NavigatorSearchesParser implements IMessageParser
|
||||
{
|
||||
private _searches: NavigatorSavedSearch[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._searches = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalSearches = wrapper.readInt();
|
||||
|
||||
while(totalSearches > 0)
|
||||
{
|
||||
this._searches.push(new NavigatorSavedSearch(wrapper));
|
||||
|
||||
totalSearches--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get searches(): NavigatorSavedSearch[]
|
||||
{
|
||||
return this._searches;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class NavigatorSettingsParser implements IMessageParser
|
||||
{
|
||||
private _windowX: number;
|
||||
private _windowY: number;
|
||||
private _windowWidth: number;
|
||||
private _windowHeight: number;
|
||||
private _leftPanelHidden: boolean;
|
||||
private _resultsMode: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._windowX = 0;
|
||||
this._windowY = 0;
|
||||
this._windowWidth = 0;
|
||||
this._windowHeight = 0;
|
||||
this._leftPanelHidden = false;
|
||||
this._resultsMode = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._windowX = wrapper.readInt();
|
||||
this._windowY = wrapper.readInt();
|
||||
this._windowWidth = wrapper.readInt();
|
||||
this._windowHeight = wrapper.readInt();
|
||||
this._leftPanelHidden = wrapper.readBoolean();
|
||||
this._resultsMode = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get windowX(): number
|
||||
{
|
||||
return this._windowX;
|
||||
}
|
||||
|
||||
public get windowY(): number
|
||||
{
|
||||
return this._windowY;
|
||||
}
|
||||
|
||||
public get windowWidth(): number
|
||||
{
|
||||
return this._windowWidth;
|
||||
}
|
||||
|
||||
public get windowHeight(): number
|
||||
{
|
||||
return this._windowHeight;
|
||||
}
|
||||
|
||||
public get leftPanelHidden(): boolean
|
||||
{
|
||||
return this._leftPanelHidden;
|
||||
}
|
||||
|
||||
public get resultsMode(): number
|
||||
{
|
||||
return this._resultsMode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { PopularTagData } from './PopularTagData';
|
||||
|
||||
export class PopularRoomTagsData
|
||||
{
|
||||
private _tags: PopularTagData[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._tags = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._tags = [];
|
||||
|
||||
const totalTags = wrapper.readInt();
|
||||
|
||||
let total = 0;
|
||||
|
||||
while(total < totalTags)
|
||||
{
|
||||
this._tags.push(new PopularTagData(wrapper));
|
||||
total++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get tags(): PopularTagData[]
|
||||
{
|
||||
return this._tags;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { PopularRoomTagsData } from './PopularRoomTagsData';
|
||||
|
||||
export class PopularRoomTagsResultMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: PopularRoomTagsData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._data = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new PopularRoomTagsData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): PopularRoomTagsData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class PopularTagData
|
||||
{
|
||||
private _tagName: string;
|
||||
private _userCount: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._tagName = wrapper.readString();
|
||||
this._userCount = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get tagName(): string
|
||||
{
|
||||
return this._tagName;
|
||||
}
|
||||
|
||||
public get userCount(): number
|
||||
{
|
||||
return this._userCount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomEventCancelMessageParser implements IMessageParser
|
||||
{
|
||||
flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { RoomEventData } from './utils';
|
||||
|
||||
export class RoomEventMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: RoomEventData;
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
this._data = new RoomEventData(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): RoomEventData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomFilterSettingsMessageParser implements IMessageParser
|
||||
{
|
||||
private _words: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._words = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalWords = wrapper.readInt();
|
||||
|
||||
while(totalWords > 0)
|
||||
{
|
||||
this._words.push(wrapper.readString());
|
||||
|
||||
totalWords--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get words(): string[]
|
||||
{
|
||||
return this._words;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomSettingsUpdatedParser 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;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RoomThumbnailUpdateResultMessageParser implements IMessageParser
|
||||
{
|
||||
private _flatId: number;
|
||||
private _resultCode: number;
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
this._flatId = wrapper.readInt();
|
||||
this._resultCode = wrapper.readInt();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get flatId(): number
|
||||
{
|
||||
return this._flatId;
|
||||
}
|
||||
|
||||
public get resultCode(): number
|
||||
{
|
||||
return this._resultCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorEventCategoryDataParser } from './NavigatorEventCategoryDataParser';
|
||||
|
||||
export class UserEventCatsMessageParser implements IMessageParser
|
||||
{
|
||||
private _categories: NavigatorEventCategoryDataParser[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._categories = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalCategories = wrapper.readInt();
|
||||
|
||||
while(totalCategories > 0)
|
||||
{
|
||||
this._categories.push(new NavigatorEventCategoryDataParser(wrapper));
|
||||
|
||||
totalCategories--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get categories(): NavigatorEventCategoryDataParser[]
|
||||
{
|
||||
return this._categories;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { NavigatorCategoryDataParser } from './NavigatorCategoryDataParser';
|
||||
|
||||
export class UserFlatCatsMessageParser implements IMessageParser
|
||||
{
|
||||
private _categories: NavigatorCategoryDataParser[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._categories = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalCategories = wrapper.readInt();
|
||||
|
||||
while(totalCategories > 0)
|
||||
{
|
||||
this._categories.push(new NavigatorCategoryDataParser(wrapper));
|
||||
|
||||
totalCategories--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get categories(): NavigatorCategoryDataParser[]
|
||||
{
|
||||
return this._categories;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
export * from './CanCreateRoomEventParser';
|
||||
export * from './CanCreateRoomMessageParser';
|
||||
export * from './CategoriesWithVisitorCountParser';
|
||||
export * from './CompetitionRoomsDataMessageParser';
|
||||
export * from './ConvertedRoomIdMessageParser';
|
||||
export * from './DoorbellMessageParser';
|
||||
export * from './FavouriteChangedMessageParser';
|
||||
export * from './FavouritesMessageParser';
|
||||
export * from './FlatAccessDeniedMessageParser';
|
||||
export * from './FlatCreatedMessageParser';
|
||||
export * from './GetGuestRoomResultMessageParser';
|
||||
export * from './GuestRoomSearchResultMessageParser';
|
||||
export * from './NavigatorCategoryDataParser';
|
||||
export * from './NavigatorCollapsedParser';
|
||||
export * from './NavigatorEventCategoryDataParser';
|
||||
export * from './NavigatorHomeRoomParser';
|
||||
export * from './NavigatorLiftedDataParser';
|
||||
export * from './NavigatorLiftedParser';
|
||||
export * from './NavigatorMetadataParser';
|
||||
export * from './NavigatorOpenRoomCreatorParser';
|
||||
export * from './NavigatorSearchesParser';
|
||||
export * from './NavigatorSearchParser';
|
||||
export * from './NavigatorSettingsParser';
|
||||
export * from './PopularRoomTagsData';
|
||||
export * from './PopularRoomTagsResultMessageParser';
|
||||
export * from './PopularTagData';
|
||||
export * from './RoomEventCancelMessageParser';
|
||||
export * from './RoomEventMessageParser';
|
||||
export * from './RoomFilterSettingsMessageParser';
|
||||
export * from './RoomSettingsUpdatedParser';
|
||||
export * from './RoomThumbnailUpdateResultMessageParser';
|
||||
export * from './UserEventCatsMessageParser';
|
||||
export * from './UserFlatCatsMessageParser';
|
||||
export * from './utils';
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class CategoriesWithVisitorCountData
|
||||
{
|
||||
private _categoryToCurrentUserCountMap: Map<number, number>;
|
||||
private _categoryToMaxUserCountMap: Map<number, number>;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._categoryToCurrentUserCountMap = new Map();
|
||||
this._categoryToMaxUserCountMap = new Map();
|
||||
|
||||
const count = k.readInt();
|
||||
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
const _local_4 = k.readInt();
|
||||
const _local_5 = k.readInt();
|
||||
const _local_6 = k.readInt();
|
||||
this._categoryToCurrentUserCountMap.set(_local_4, _local_5);
|
||||
this._categoryToMaxUserCountMap.set(_local_4, _local_6);
|
||||
}
|
||||
}
|
||||
|
||||
public get categoryToCurrentUserCountMap(): Map<number, number>
|
||||
{
|
||||
return this._categoryToCurrentUserCountMap;
|
||||
}
|
||||
|
||||
public get categoryToMaxUserCountMap(): Map<number, number>
|
||||
{
|
||||
return this._categoryToMaxUserCountMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class CompetitionRoomsData
|
||||
{
|
||||
private _goalId: number;
|
||||
private _pageIndex: number;
|
||||
private _pageCount: number;
|
||||
|
||||
constructor(k: IMessageDataWrapper, _arg_2: number = 0, _arg_3: number = 0)
|
||||
{
|
||||
this._goalId = _arg_2;
|
||||
this._pageIndex = _arg_3;
|
||||
|
||||
if(k)
|
||||
{
|
||||
this._goalId = k.readInt();
|
||||
this._pageIndex = k.readInt();
|
||||
this._pageCount = k.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
public get goalId(): number
|
||||
{
|
||||
return this._goalId;
|
||||
}
|
||||
|
||||
public get pageIndex(): number
|
||||
{
|
||||
return this._pageIndex;
|
||||
}
|
||||
|
||||
public get pageCount(): number
|
||||
{
|
||||
return this._pageCount;
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { RoomDataParser } from '../../room';
|
||||
import { OfficialRoomEntryData } from './OfficialRoomEntryData';
|
||||
|
||||
export class GuestRoomSearchResultData
|
||||
{
|
||||
private _searchType: number;
|
||||
private _searchParam: string;
|
||||
private _rooms: RoomDataParser[];
|
||||
private _ad: OfficialRoomEntryData;
|
||||
private _disposed: boolean;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._rooms = [];
|
||||
this._searchType = k.readInt();
|
||||
this._searchParam = k.readString();
|
||||
const count = k.readInt();
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._rooms.push(new RoomDataParser(k));
|
||||
}
|
||||
const hasAdditional = k.readBoolean();
|
||||
if(hasAdditional)
|
||||
{
|
||||
this._ad = new OfficialRoomEntryData(k);
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
if(this._disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this._disposed = true;
|
||||
if(this._rooms != null)
|
||||
{
|
||||
for(const k of this._rooms)
|
||||
{
|
||||
k.flush();
|
||||
}
|
||||
}
|
||||
if(this._ad != null)
|
||||
{
|
||||
this._ad.dispose();
|
||||
this._ad = null;
|
||||
}
|
||||
this._rooms = null;
|
||||
}
|
||||
|
||||
public get disposed(): boolean
|
||||
{
|
||||
return this._disposed;
|
||||
}
|
||||
|
||||
public get searchType(): number
|
||||
{
|
||||
return this._searchType;
|
||||
}
|
||||
|
||||
public get searchParam(): string
|
||||
{
|
||||
return this._searchParam;
|
||||
}
|
||||
|
||||
public get rooms(): RoomDataParser[]
|
||||
{
|
||||
return this._rooms;
|
||||
}
|
||||
|
||||
public get ad(): OfficialRoomEntryData
|
||||
{
|
||||
return this._ad;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class NavigatorSavedSearch
|
||||
{
|
||||
private _id: number;
|
||||
private _code: string;
|
||||
private _filter: string;
|
||||
private _localization: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._id = -1;
|
||||
this._code = null;
|
||||
this._filter = null;
|
||||
this._localization = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._id = wrapper.readInt();
|
||||
this._code = wrapper.readString();
|
||||
this._filter = wrapper.readString();
|
||||
this._localization = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get code(): string
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get filter(): string
|
||||
{
|
||||
return this._filter;
|
||||
}
|
||||
|
||||
public get localization(): string
|
||||
{
|
||||
return this._localization;
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { RoomDataParser } from '../../room';
|
||||
|
||||
export class NavigatorSearchResultList
|
||||
{
|
||||
private _code: string;
|
||||
private _data: string;
|
||||
private _action: number;
|
||||
private _closed: boolean;
|
||||
private _mode: number;
|
||||
private _rooms: RoomDataParser[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._code = null;
|
||||
this._data = null;
|
||||
this._action = -1;
|
||||
this._closed = false;
|
||||
this._mode = -1;
|
||||
this._rooms = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._code = wrapper.readString();
|
||||
this._data = wrapper.readString();
|
||||
this._action = wrapper.readInt();
|
||||
this._closed = wrapper.readBoolean();
|
||||
this._mode = wrapper.readInt();
|
||||
|
||||
let totalRooms = wrapper.readInt();
|
||||
|
||||
while(totalRooms > 0)
|
||||
{
|
||||
this._rooms.push(new RoomDataParser(wrapper));
|
||||
|
||||
totalRooms--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get code(): string
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get data(): string
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public get action(): number
|
||||
{
|
||||
return this._action;
|
||||
}
|
||||
|
||||
public get closed(): boolean
|
||||
{
|
||||
return this._closed;
|
||||
}
|
||||
|
||||
public get mode(): number
|
||||
{
|
||||
return this._mode;
|
||||
}
|
||||
|
||||
public get rooms(): RoomDataParser[]
|
||||
{
|
||||
return this._rooms;
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { NavigatorSearchResultList } from './NavigatorSearchResultList';
|
||||
|
||||
export class NavigatorSearchResultSet
|
||||
{
|
||||
private _code: string;
|
||||
private _data: string;
|
||||
private _results: NavigatorSearchResultList[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._code = null;
|
||||
this._data = null;
|
||||
this._results = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._code = wrapper.readString();
|
||||
this._data = wrapper.readString();
|
||||
|
||||
let totalResults = wrapper.readInt();
|
||||
|
||||
while(totalResults > 0)
|
||||
{
|
||||
this._results.push(new NavigatorSearchResultList(wrapper));
|
||||
|
||||
totalResults--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get code(): string
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get data(): string
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public get results(): NavigatorSearchResultList[]
|
||||
{
|
||||
return this._results;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { NavigatorSavedSearch } from './NavigatorSavedSearch';
|
||||
|
||||
export class NavigatorTopLevelContext
|
||||
{
|
||||
private _code: string;
|
||||
private _savedSearches: NavigatorSavedSearch[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._code = null;
|
||||
this._savedSearches = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._code = wrapper.readString();
|
||||
|
||||
let totalSavedSearches = wrapper.readInt();
|
||||
|
||||
while(totalSavedSearches > 0)
|
||||
{
|
||||
this._savedSearches.push(new NavigatorSavedSearch(wrapper));
|
||||
|
||||
totalSavedSearches--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get code(): string
|
||||
{
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get savedSearches(): NavigatorSavedSearch[]
|
||||
{
|
||||
return this._savedSearches;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
import { RoomDataParser } from '../../room';
|
||||
|
||||
export class OfficialRoomEntryData
|
||||
{
|
||||
public static readonly TYPE_TAG = 1;
|
||||
public static readonly TYPE_GUEST_ROOM = 2;
|
||||
public static readonly TYPE_FOLDER = 4;
|
||||
|
||||
private _index: number;
|
||||
private _popupCaption: string;
|
||||
private _popupDesc: string;
|
||||
private _showDetails: boolean;
|
||||
private _picText: string;
|
||||
private _picRef: string;
|
||||
private _folderId: number;
|
||||
private _userCount: number;
|
||||
private _type: number;
|
||||
private _tag: string;
|
||||
private _guestRoomData: RoomDataParser;
|
||||
private _open: boolean;
|
||||
private _disposed: boolean;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._index = k.readInt();
|
||||
this._popupCaption = k.readString();
|
||||
this._popupDesc = k.readString();
|
||||
this._showDetails = k.readInt() == 1;
|
||||
this._picText = k.readString();
|
||||
this._picRef = k.readString();
|
||||
this._folderId = k.readInt();
|
||||
this._userCount = k.readInt();
|
||||
this._type = k.readInt();
|
||||
if(this._type == OfficialRoomEntryData.TYPE_TAG)
|
||||
{
|
||||
this._tag = k.readString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this._type == OfficialRoomEntryData.TYPE_GUEST_ROOM)
|
||||
{
|
||||
this._guestRoomData = new RoomDataParser(k);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._open = k.readBoolean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
if(this._disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this._disposed = true;
|
||||
if(this._guestRoomData != null)
|
||||
{
|
||||
this._guestRoomData.flush();
|
||||
this._guestRoomData = null;
|
||||
}
|
||||
}
|
||||
|
||||
public get disposed(): boolean
|
||||
{
|
||||
return this._disposed;
|
||||
}
|
||||
|
||||
public get type(): number
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
|
||||
public get index(): number
|
||||
{
|
||||
return this._index;
|
||||
}
|
||||
|
||||
public get popupCaption(): string
|
||||
{
|
||||
return this._popupCaption;
|
||||
}
|
||||
|
||||
public get popupDesc(): string
|
||||
{
|
||||
return this._popupDesc;
|
||||
}
|
||||
|
||||
public get showDetails(): boolean
|
||||
{
|
||||
return this._showDetails;
|
||||
}
|
||||
|
||||
public get picText(): string
|
||||
{
|
||||
return this._picText;
|
||||
}
|
||||
|
||||
public get picRef(): string
|
||||
{
|
||||
return this._picRef;
|
||||
}
|
||||
|
||||
public get folderId(): number
|
||||
{
|
||||
return this._folderId;
|
||||
}
|
||||
|
||||
public get tag(): string
|
||||
{
|
||||
return this._tag;
|
||||
}
|
||||
|
||||
public get userCount(): number
|
||||
{
|
||||
return this._userCount;
|
||||
}
|
||||
|
||||
public get guestRoomData(): RoomDataParser
|
||||
{
|
||||
return this._guestRoomData;
|
||||
}
|
||||
|
||||
public get open(): boolean
|
||||
{
|
||||
return this._open;
|
||||
}
|
||||
|
||||
public toggleOpen(): void
|
||||
{
|
||||
this._open = !this._open;
|
||||
}
|
||||
|
||||
public get maxUsers(): number
|
||||
{
|
||||
if(this.type == OfficialRoomEntryData.TYPE_TAG)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(this.type == OfficialRoomEntryData.TYPE_GUEST_ROOM)
|
||||
{
|
||||
return this._guestRoomData.maxUserCount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class RoomEventData
|
||||
{
|
||||
private _adId: number;
|
||||
private _ownerAvatarId: number;
|
||||
private _ownerAvatarName: string;
|
||||
private _flatId: number;
|
||||
private _categoryId: number;
|
||||
private _eventType: number;
|
||||
private _eventName: string;
|
||||
private _eventDescription: string;
|
||||
private _creationTime: string;
|
||||
private _expirationDate: Date;
|
||||
private _disposed: boolean;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._adId = k.readInt();
|
||||
this._ownerAvatarId = k.readInt();
|
||||
this._ownerAvatarName = k.readString();
|
||||
this._flatId = k.readInt();
|
||||
this._eventType = k.readInt();
|
||||
this._eventName = k.readString();
|
||||
this._eventDescription = k.readString();
|
||||
const _local_2 = k.readInt();
|
||||
const _local_3 = k.readInt();
|
||||
const _local_4: Date = new Date();
|
||||
let _local_5 = _local_4.getTime();
|
||||
const _local_6 = ((_local_2 * 60) * 1000);
|
||||
_local_5 = (_local_5 - _local_6);
|
||||
const _local_7: Date = new Date(_local_5);
|
||||
this._creationTime = ((((((((_local_7.getDate() + '-') + _local_7.getMonth()) + '-') + _local_7.getFullYear()) + ' ') + _local_7.getHours()) + ':') + _local_7.getMinutes());
|
||||
let _local_8 = _local_4.getTime();
|
||||
const _local_9 = ((_local_3 * 60) * 1000);
|
||||
_local_8 = (_local_8 + _local_9);
|
||||
this._expirationDate = new Date(_local_8);
|
||||
this._categoryId = k.readInt();
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
if(this._disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this._disposed = true;
|
||||
}
|
||||
|
||||
public get disposed(): boolean
|
||||
{
|
||||
return this._disposed;
|
||||
}
|
||||
|
||||
public get adId(): number
|
||||
{
|
||||
return this._adId;
|
||||
}
|
||||
|
||||
public get ownerAvatarId(): number
|
||||
{
|
||||
return this._ownerAvatarId;
|
||||
}
|
||||
|
||||
public get ownerAvatarName(): string
|
||||
{
|
||||
return this._ownerAvatarName;
|
||||
}
|
||||
|
||||
public get flatId(): number
|
||||
{
|
||||
return this._flatId;
|
||||
}
|
||||
|
||||
public get categoryId(): number
|
||||
{
|
||||
return this._categoryId;
|
||||
}
|
||||
|
||||
public get eventType(): number
|
||||
{
|
||||
return this._eventType;
|
||||
}
|
||||
|
||||
public get eventName(): string
|
||||
{
|
||||
return this._eventName;
|
||||
}
|
||||
|
||||
public get eventDescription(): string
|
||||
{
|
||||
return this._eventDescription;
|
||||
}
|
||||
|
||||
public get creationTime(): string
|
||||
{
|
||||
return this._creationTime;
|
||||
}
|
||||
|
||||
public get expirationDate(): Date
|
||||
{
|
||||
return this._expirationDate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export * from './CategoriesWithVisitorCountData';
|
||||
export * from './CompetitionRoomsData';
|
||||
export * from './GuestRoomSearchResultData';
|
||||
export * from './NavigatorSavedSearch';
|
||||
export * from './NavigatorSearchResultList';
|
||||
export * from './NavigatorSearchResultSet';
|
||||
export * from './NavigatorTopLevelContext';
|
||||
export * from './OfficialRoomEntryData';
|
||||
export * from './RoomEventData';
|
||||
Reference in New Issue
Block a user