mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Merge pull request #3 from oobjectt/room-settings-filter
Added packets for room settings filter
This commit is contained in:
commit
9177e718b5
File diff suppressed because one or more lines are too long
@ -157,6 +157,7 @@ export class IncomingHeader
|
||||
public static ROOM_INFO_UPDATED = 3297;
|
||||
public static ROOM_SPECTATOR = 1033;
|
||||
public static ROOM_THICKNESS = 3547;
|
||||
public static ROOM_GET_FILTER_WORDS = 2937;
|
||||
public static INFO_FEED_ENABLE = 3284;
|
||||
public static SECURITY_MACHINE = 1488;
|
||||
public static MYSTERY_BOX_KEYS = 2833;
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { RoomFilterSettingsMessageParser } from '../../parser';
|
||||
|
||||
export class RoomFilterSettingsMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, RoomFilterSettingsMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): RoomFilterSettingsMessageParser
|
||||
{
|
||||
return this.parser as RoomFilterSettingsMessageParser;
|
||||
}
|
||||
}
|
@ -20,6 +20,7 @@ export * from './NavigatorSearchEvent';
|
||||
export * from './NavigatorSettingsEvent';
|
||||
export * from './RoomEventCancelEvent';
|
||||
export * from './RoomEventEvent';
|
||||
export * from './RoomFilterSettingsMessageEvent';
|
||||
export * from './RoomSettingsUpdatedEvent';
|
||||
export * from './RoomThumbnailUpdateResultEvent';
|
||||
export * from './UserEventCatsEvent';
|
||||
|
@ -193,6 +193,8 @@ export class OutgoingHeader
|
||||
public static ROOM_SETTINGS = 3129;
|
||||
public static ROOM_SETTINGS_SAVE = 1969;
|
||||
public static ROOM_STAFF_PICK = 1918;
|
||||
public static ROOM_FILTER_WORDS = 1911;
|
||||
public static ROOM_FILTER_WORDS_MODIFY = 3001;
|
||||
public static MYSTERYBOXWAITINGCANCELEDMESSAGE = 2012;
|
||||
public static SECURITY_MACHINE = 2490;
|
||||
public static SECURITY_TICKET = 2419;
|
||||
|
@ -0,0 +1,21 @@
|
||||
import { IMessageComposer } from '../../../../../api';
|
||||
|
||||
export class GetCustomRoomFilterMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetCustomRoomFilterMessageComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof GetCustomRoomFilterMessageComposer>;
|
||||
|
||||
constructor(roomId: number)
|
||||
{
|
||||
this._data = [roomId];
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import { IMessageComposer } from '../../../../../api';
|
||||
|
||||
export class UpdateRoomFilterMessageComposer implements IMessageComposer<ConstructorParameters<typeof UpdateRoomFilterMessageComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof UpdateRoomFilterMessageComposer>;
|
||||
|
||||
constructor(roomId: number, isAddingWord: boolean, word: string)
|
||||
{
|
||||
this._data = [roomId, isAddingWord, word];
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ export * from './EditEventMessageComposer';
|
||||
export * from './ForwardToARandomPromotedRoomMessageComposer';
|
||||
export * from './ForwardToSomeRoomMessageComposer';
|
||||
export * from './GetCategoriesWithUserCountMessageComposer';
|
||||
export * from './GetCustomRoomFilterMessageComposer';
|
||||
export * from './GetGuestRoomMessageComposer';
|
||||
export * from './GetOfficialRoomsMessageComposer';
|
||||
export * from './GetPopularRoomTagsMessageComposer';
|
||||
@ -36,6 +37,7 @@ export * from './RemoveOwnRoomRightsRoomMessageComposer';
|
||||
export * from './RoomAdEventTabAdClickedComposer';
|
||||
export * from './RoomAdEventTabViewedComposer';
|
||||
export * from './RoomAdSearchMessageComposer';
|
||||
export * from './UpdateRoomFilterMessageComposer';
|
||||
export * from './RoomsWhereMyFriendsAreSearchMessageComposer';
|
||||
export * from './RoomsWithHighestScoreSearchMessageComposer';
|
||||
export * from './RoomTextSearchMessageComposer';
|
||||
|
@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../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;
|
||||
}
|
||||
}
|
@ -23,6 +23,7 @@ export * from './NavigatorSearchParser';
|
||||
export * from './NavigatorSettingsParser';
|
||||
export * from './RoomEventCancelMessageParser';
|
||||
export * from './RoomEventMessageParser';
|
||||
export * from './RoomFilterSettingsMessageParser';
|
||||
export * from './RoomSettingsUpdatedParser';
|
||||
export * from './RoomThumbnailUpdateResultMessageParser';
|
||||
export * from './UserEventCatsMessageParser';
|
||||
|
Loading…
Reference in New Issue
Block a user