Merge pull request #3 from oobjectt/room-settings-filter

Added packets for room settings filter
This commit is contained in:
dank074 2022-12-14 20:23:00 -06:00 committed by GitHub
commit 9177e718b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 103 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -157,6 +157,7 @@ export class IncomingHeader
public static ROOM_INFO_UPDATED = 3297; public static ROOM_INFO_UPDATED = 3297;
public static ROOM_SPECTATOR = 1033; public static ROOM_SPECTATOR = 1033;
public static ROOM_THICKNESS = 3547; public static ROOM_THICKNESS = 3547;
public static ROOM_GET_FILTER_WORDS = 2937;
public static INFO_FEED_ENABLE = 3284; public static INFO_FEED_ENABLE = 3284;
public static SECURITY_MACHINE = 1488; public static SECURITY_MACHINE = 1488;
public static MYSTERY_BOX_KEYS = 2833; public static MYSTERY_BOX_KEYS = 2833;

View File

@ -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;
}
}

View File

@ -20,6 +20,7 @@ export * from './NavigatorSearchEvent';
export * from './NavigatorSettingsEvent'; export * from './NavigatorSettingsEvent';
export * from './RoomEventCancelEvent'; export * from './RoomEventCancelEvent';
export * from './RoomEventEvent'; export * from './RoomEventEvent';
export * from './RoomFilterSettingsMessageEvent';
export * from './RoomSettingsUpdatedEvent'; export * from './RoomSettingsUpdatedEvent';
export * from './RoomThumbnailUpdateResultEvent'; export * from './RoomThumbnailUpdateResultEvent';
export * from './UserEventCatsEvent'; export * from './UserEventCatsEvent';

View File

@ -193,6 +193,8 @@ export class OutgoingHeader
public static ROOM_SETTINGS = 3129; public static ROOM_SETTINGS = 3129;
public static ROOM_SETTINGS_SAVE = 1969; public static ROOM_SETTINGS_SAVE = 1969;
public static ROOM_STAFF_PICK = 1918; 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 MYSTERYBOXWAITINGCANCELEDMESSAGE = 2012;
public static SECURITY_MACHINE = 2490; public static SECURITY_MACHINE = 2490;
public static SECURITY_TICKET = 2419; public static SECURITY_TICKET = 2419;

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -9,6 +9,7 @@ export * from './EditEventMessageComposer';
export * from './ForwardToARandomPromotedRoomMessageComposer'; export * from './ForwardToARandomPromotedRoomMessageComposer';
export * from './ForwardToSomeRoomMessageComposer'; export * from './ForwardToSomeRoomMessageComposer';
export * from './GetCategoriesWithUserCountMessageComposer'; export * from './GetCategoriesWithUserCountMessageComposer';
export * from './GetCustomRoomFilterMessageComposer';
export * from './GetGuestRoomMessageComposer'; export * from './GetGuestRoomMessageComposer';
export * from './GetOfficialRoomsMessageComposer'; export * from './GetOfficialRoomsMessageComposer';
export * from './GetPopularRoomTagsMessageComposer'; export * from './GetPopularRoomTagsMessageComposer';
@ -36,6 +37,7 @@ export * from './RemoveOwnRoomRightsRoomMessageComposer';
export * from './RoomAdEventTabAdClickedComposer'; export * from './RoomAdEventTabAdClickedComposer';
export * from './RoomAdEventTabViewedComposer'; export * from './RoomAdEventTabViewedComposer';
export * from './RoomAdSearchMessageComposer'; export * from './RoomAdSearchMessageComposer';
export * from './UpdateRoomFilterMessageComposer';
export * from './RoomsWhereMyFriendsAreSearchMessageComposer'; export * from './RoomsWhereMyFriendsAreSearchMessageComposer';
export * from './RoomsWithHighestScoreSearchMessageComposer'; export * from './RoomsWithHighestScoreSearchMessageComposer';
export * from './RoomTextSearchMessageComposer'; export * from './RoomTextSearchMessageComposer';

View File

@ -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;
}
}

View File

@ -23,6 +23,7 @@ export * from './NavigatorSearchParser';
export * from './NavigatorSettingsParser'; export * from './NavigatorSettingsParser';
export * from './RoomEventCancelMessageParser'; export * from './RoomEventCancelMessageParser';
export * from './RoomEventMessageParser'; export * from './RoomEventMessageParser';
export * from './RoomFilterSettingsMessageParser';
export * from './RoomSettingsUpdatedParser'; export * from './RoomSettingsUpdatedParser';
export * from './RoomThumbnailUpdateResultMessageParser'; export * from './RoomThumbnailUpdateResultMessageParser';
export * from './UserEventCatsMessageParser'; export * from './UserEventCatsMessageParser';