This commit is contained in:
Bill 2021-08-22 18:24:20 -04:00
commit 8883da18f4
36 changed files with 733 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, ApproveNameMessageComposer, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, ClubGiftNotificationEvent, FurnitureGuildInfoComposer, GetBonusRareInfoMessageComposer, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, MaintenanceStatusMessageEvent, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemoveAllRightsMessageComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomUnitGiveHandItemPetComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, ClubGiftNotificationEvent, FurnitureGuildInfoComposer, GetBonusRareInfoMessageComposer, GetJukeboxPlayListMessageComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, MaintenanceStatusMessageEvent, MysteryBoxKeysEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomUnitGiveHandItemPetComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent } from './messages';
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent';
import { CameraPurchaseOKMessageEvent } from './messages/incoming/camera/CameraPurchaseOKMessageEvent'; import { CameraPurchaseOKMessageEvent } from './messages/incoming/camera/CameraPurchaseOKMessageEvent';
@ -435,6 +435,7 @@ import { RoomMuteComposer } from './messages/outgoing/roomevents/RoomMuteCompose
import { UpdateActionMessageComposer } from './messages/outgoing/roomevents/UpdateActionMessageComposer'; import { UpdateActionMessageComposer } from './messages/outgoing/roomevents/UpdateActionMessageComposer';
import { UpdateConditionMessageComposer } from './messages/outgoing/roomevents/UpdateConditionMessageComposer'; import { UpdateConditionMessageComposer } from './messages/outgoing/roomevents/UpdateConditionMessageComposer';
import { UpdateTriggerMessageComposer } from './messages/outgoing/roomevents/UpdateTriggerMessageComposer'; import { UpdateTriggerMessageComposer } from './messages/outgoing/roomevents/UpdateTriggerMessageComposer';
import { GetSoundSettingsComposer } from './messages/outgoing/sound/GetSoundSettingsComposer';
import { GetIgnoredUsersComposer } from './messages/outgoing/user/data/GetIgnoredUsersComposer'; import { GetIgnoredUsersComposer } from './messages/outgoing/user/data/GetIgnoredUsersComposer';
import { IgnoreUserComposer } from './messages/outgoing/user/data/IgnoreUserComposer'; import { IgnoreUserComposer } from './messages/outgoing/user/data/IgnoreUserComposer';
import { IgnoreUserIdComposer } from './messages/outgoing/user/data/IgnoreUserIdComposer'; import { IgnoreUserIdComposer } from './messages/outgoing/user/data/IgnoreUserIdComposer';
@ -826,6 +827,16 @@ export class NitroMessages implements IMessageConfiguration
this._events.set(IncomingHeader.COMPETITION_STATUS, CompetitionStatusMessageEvent); this._events.set(IncomingHeader.COMPETITION_STATUS, CompetitionStatusMessageEvent);
this._events.set(IncomingHeader.INIT_CAMERA, InitCameraMessageEvent); this._events.set(IncomingHeader.INIT_CAMERA, InitCameraMessageEvent);
this._events.set(IncomingHeader.THUMBNAIL_STATUS, ThumbnailStatusMessageEvent); this._events.set(IncomingHeader.THUMBNAIL_STATUS, ThumbnailStatusMessageEvent);
// SOUNDS
this._events.set(IncomingHeader.JUKEBOX_PLAYLIST_FULL, JukeboxPlayListFullMessageEvent);
this._events.set(IncomingHeader.JUKEBOX_SONG_DISKS, JukeboxSongDisksMessageEvent);
this._events.set(IncomingHeader.NOW_PLAYING, NowPlayingMessageEvent);
this._events.set(IncomingHeader.OFFICIAL_SONG_ID, OfficialSongIdMessageEvent);
this._events.set(IncomingHeader.PLAYLIST, PlayListMessageEvent);
this._events.set(IncomingHeader.PLAYLIST_SONG_ADDED, PlayListSongAddedMessageEvent);
this._events.set(IncomingHeader.TRAX_SONG_INFO, TraxSongInfoMessageEvent);
this._events.set(IncomingHeader.USER_SONG_DISKS_INVENTORY, UserSongDisksInventoryMessageEvent);
} }
private registerComposers(): void private registerComposers(): void
@ -1174,6 +1185,17 @@ export class NitroMessages implements IMessageConfiguration
this._composers.set(OutgoingHeader.PURCHASE_PHOTO, PurchasePhotoMessageComposer); this._composers.set(OutgoingHeader.PURCHASE_PHOTO, PurchasePhotoMessageComposer);
this._composers.set(OutgoingHeader.PUBLISH_PHOTO, PublishPhotoMessageComposer); this._composers.set(OutgoingHeader.PUBLISH_PHOTO, PublishPhotoMessageComposer);
this._composers.set(OutgoingHeader.PHOTO_COMPETITION, PhotoCompetitionMessageComposer); this._composers.set(OutgoingHeader.PHOTO_COMPETITION, PhotoCompetitionMessageComposer);
// SOUNDS
this._composers.set(OutgoingHeader.GET_SOUND_SETTINGS, GetSoundSettingsComposer);
this._composers.set(OutgoingHeader.ADD_JUKEBOX_DISK, AddJukeboxDiskComposer);
this._composers.set(OutgoingHeader.GET_JUKEBOX_PLAYLIST, GetJukeboxPlayListMessageComposer);
this._composers.set(OutgoingHeader.GET_NOW_PLAYING, GetNowPlayingMessageComposer);
this._composers.set(OutgoingHeader.GET_OFFICIAL_SONG_ID, GetOfficialSongIdMessageComposer);
this._composers.set(OutgoingHeader.GET_SONG_INFO, GetSongInfoMessageComposer);
this._composers.set(OutgoingHeader.GET_SOUND_MACHINE_PLAYLIST, GetSoundMachinePlayListMessageComposer);
this._composers.set(OutgoingHeader.GET_USER_SONG_DISKS, GetUserSongDisksMessageComposer);
this._composers.set(OutgoingHeader.REMOVE_JUKEBOX_DISK, RemoveJukeboxDiskComposer);
} }
public get events(): Map<number, Function> public get events(): Map<number, Function>

View File

@ -280,4 +280,12 @@ export class IncomingHeader
public static HOTEL_CLOSES_AND_OPENS_AT = 2771; public static HOTEL_CLOSES_AND_OPENS_AT = 2771;
public static HOTEL_WILL_CLOSE_MINUTES = 1050; public static HOTEL_WILL_CLOSE_MINUTES = 1050;
public static HOTEL_MAINTENANCE = 1350; public static HOTEL_MAINTENANCE = 1350;
public static JUKEBOX_PLAYLIST_FULL = 105;
public static JUKEBOX_SONG_DISKS = 34;
public static NOW_PLAYING = 469;
public static OFFICIAL_SONG_ID = 1381;
public static PLAYLIST = 1748;
public static PLAYLIST_SONG_ADDED = 1140;
public static TRAX_SONG_INFO = 3365;
public static USER_SONG_DISKS_INVENTORY = 2602;
} }

View File

@ -46,6 +46,7 @@ export * from './room/unit';
export * from './room/unit/chat'; export * from './room/unit/chat';
export * from './roomevents'; export * from './roomevents';
export * from './security'; export * from './security';
export * from './sound';
export * from './user'; export * from './user';
export * from './user/access'; export * from './user/access';
export * from './user/data'; export * from './user/data';

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { JukeboxPlayListFullMessageParser } from '../../parser';
export class JukeboxPlayListFullMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, JukeboxPlayListFullMessageParser);
}
public getParser(): JukeboxPlayListFullMessageParser
{
return this.parser as JukeboxPlayListFullMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { JukeboxSongDisksMessageParser } from '../../parser';
export class JukeboxSongDisksMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, JukeboxSongDisksMessageParser);
}
public getParser(): JukeboxSongDisksMessageParser
{
return this.parser as JukeboxSongDisksMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { NowPlayingMessageParser } from '../../parser';
export class NowPlayingMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, NowPlayingMessageParser);
}
public getParser(): NowPlayingMessageParser
{
return this.parser as NowPlayingMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { OfficialSongIdMessageParser } from '../../parser';
export class OfficialSongIdMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, OfficialSongIdMessageParser);
}
public getParser(): OfficialSongIdMessageParser
{
return this.parser as OfficialSongIdMessageParser;
}
}

View File

@ -0,0 +1,46 @@
export class PlayListEntry
{
protected _id: number;
protected _length: number;
protected _name: string;
protected _creator: string;
private _startPlayHead: number = 0;
constructor(id: number, length: number, name: string, creator: string)
{
this._id = id;
this._length = length;
this._name = name;
this._creator = creator;
}
public get id(): number
{
return this._id;
}
public get length(): number
{
return this._length;
}
public get name(): string
{
return this._name;
}
public get creator(): string
{
return this._creator;
}
public get startPlayHeadPos(): number
{
return this._startPlayHead;
}
public set startPlayHeadPos(k: number)
{
this._startPlayHead = k;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { PlayListMessageParser } from '../../parser';
export class PlayListMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, PlayListMessageParser);
}
public getParser(): PlayListMessageParser
{
return this.parser as PlayListMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { PlayListSongAddedMessageParser } from '../../parser';
export class PlayListSongAddedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, PlayListSongAddedMessageParser);
}
public getParser(): PlayListSongAddedMessageParser
{
return this.parser as PlayListSongAddedMessageParser;
}
}

View File

@ -0,0 +1,17 @@
import { PlayListEntry } from '.';
export class SongInfoEntry extends PlayListEntry
{
private _data:string = '';
constructor(id:number, length:number, name:string, creator:string, data:string)
{
super(id, length, name, creator);
this._data = data;
}
public get data():string
{
return this._data;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { TraxSongInfoMessageParser } from '../../parser';
export class TraxSongInfoMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, TraxSongInfoMessageParser);
}
public getParser(): TraxSongInfoMessageParser
{
return this.parser as TraxSongInfoMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { UserSongDisksInventoryMessageParser } from '../../parser';
export class UserSongDisksInventoryMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, UserSongDisksInventoryMessageParser);
}
public getParser(): UserSongDisksInventoryMessageParser
{
return this.parser as UserSongDisksInventoryMessageParser;
}
}

View File

@ -0,0 +1,10 @@
export * from './JukeboxPlayListFullMessageEvent';
export * from './JukeboxSongDisksMessageEvent';
export * from './NowPlayingMessageEvent';
export * from './OfficialSongIdMessageEvent';
export * from './PlayListEntry';
export * from './PlayListMessageEvent';
export * from './PlayListSongAddedMessageEvent';
export * from './SongInfoEntry';
export * from './TraxSongInfoMessageEvent';
export * from './UserSongDisksInventoryMessageEvent';

View File

@ -177,7 +177,7 @@ export class OutgoingHeader
public static USER_PETS = 3095; public static USER_PETS = 3095;
public static USER_PROFILE = 3265; public static USER_PROFILE = 3265;
public static USER_RESPECT = 2694; public static USER_RESPECT = 2694;
public static USER_SETTINGS = 2388; public static GET_SOUND_SETTINGS = 2388;
public static USER_SETTINGS_CAMERA = 1461; public static USER_SETTINGS_CAMERA = 1461;
public static USER_SETTINGS_CHAT_STYLE = 1030; public static USER_SETTINGS_CHAT_STYLE = 1030;
public static USER_SETTINGS_INVITES = 1086; public static USER_SETTINGS_INVITES = 1086;
@ -271,4 +271,12 @@ export class OutgoingHeader
public static RENDER_ROOM = 3226; public static RENDER_ROOM = 3226;
public static RENDER_ROOM_THUMBNAIL = 1982; public static RENDER_ROOM_THUMBNAIL = 1982;
public static REQUEST_CAMERA_CONFIGURATION = 796; public static REQUEST_CAMERA_CONFIGURATION = 796;
public static ADD_JUKEBOX_DISK = 753;
public static GET_JUKEBOX_PLAYLIST = 1435;
public static GET_NOW_PLAYING = 1325;
public static GET_OFFICIAL_SONG_ID = 3189;
public static GET_SONG_INFO = 3082;
public static GET_SOUND_MACHINE_PLAYLIST = 3498;
public static GET_USER_SONG_DISKS = 2304;
public static REMOVE_JUKEBOX_DISK = 3050;
} }

View File

@ -15,4 +15,5 @@ export * from './pet';
export * from './quest'; export * from './quest';
export * from './room'; export * from './room';
export * from './roomevents'; export * from './roomevents';
export * from './sound';
export * from './user'; export * from './user';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class AddJukeboxDiskComposer implements IMessageComposer<ConstructorParameters<typeof AddJukeboxDiskComposer>>
{
private _data: ConstructorParameters<typeof AddJukeboxDiskComposer>;
constructor(k: number, _arg2: number)
{
this._data = [k, _arg2];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetJukeboxPlayListMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetJukeboxPlayListMessageComposer>>
{
private _data: ConstructorParameters<typeof GetJukeboxPlayListMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetNowPlayingMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetNowPlayingMessageComposer>>
{
private _data: ConstructorParameters<typeof GetNowPlayingMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetOfficialSongIdMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetOfficialSongIdMessageComposer>>
{
private _data: ConstructorParameters<typeof GetOfficialSongIdMessageComposer>;
constructor(k: string)
{
this._data = [ k ];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetSongInfoMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetSongInfoMessageComposer>>
{
private _data: ConstructorParameters< typeof GetSongInfoMessageComposer>;
constructor(...args: number[])
{
this._data = [args.length].concat(args);
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetSoundMachinePlayListMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetSoundMachinePlayListMessageComposer>>
{
private _data: ConstructorParameters<typeof GetSoundMachinePlayListMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetSoundSettingsComposer implements IMessageComposer<ConstructorParameters<typeof GetSoundSettingsComposer>>
{
private _data: ConstructorParameters<typeof GetSoundSettingsComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class GetUserSongDisksMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetUserSongDisksMessageComposer>>
{
private _data: ConstructorParameters<typeof GetUserSongDisksMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core';
export class RemoveJukeboxDiskComposer implements IMessageComposer<ConstructorParameters<typeof RemoveJukeboxDiskComposer>>
{
private _data: ConstructorParameters<typeof RemoveJukeboxDiskComposer>;
constructor(k: number)
{
this._data = [ k ];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,9 @@
export * from './AddJukeboxDiskComposer';
export * from './GetJukeboxPlayListMessageComposer';
export * from './GetNowPlayingMessageComposer';
export * from './GetOfficialSongIdMessageComposer';
export * from './GetSongInfoMessageComposer';
export * from './GetSoundMachinePlayListMessageComposer';
export * from './GetSoundSettingsComposer';
export * from './GetUserSongDisksMessageComposer';
export * from './RemoveJukeboxDiskComposer';

View File

@ -20,4 +20,5 @@ export * from './quest';
export * from './room'; export * from './room';
export * from './roomevents'; export * from './roomevents';
export * from './security'; export * from './security';
export * from './sound';
export * from './user'; export * from './user';

View File

@ -0,0 +1,14 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class JukeboxPlayListFullMessageParser implements IMessageParser
{
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
return true;
}
}

View File

@ -0,0 +1,37 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class JukeboxSongDisksMessageParser implements IMessageParser
{
private _songDisks: Map<number, number> = new Map();
private _maxLength: number;
flush(): boolean
{
this._songDisks.clear();
this._maxLength = 0;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._maxLength = wrapper.readInt();
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._songDisks.set(wrapper.readInt(), wrapper.readInt());
}
return true;
}
public get songDisks(): Map<number, number>
{
return this._songDisks;
}
public get maxLength(): number
{
return this._maxLength;
}
}

View File

@ -0,0 +1,56 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class NowPlayingMessageParser implements IMessageParser
{
private _currentSongId:number;
private _currentPosition:number;
private _nextSongId:number;
private _nextPosition:number;
private _syncCount:number;
flush(): boolean
{
this._currentSongId = -1;
this._currentPosition = -1;
this._nextSongId = -1;
this._nextPosition = -1;
this._syncCount = -1;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._currentSongId = wrapper.readInt();
this._currentPosition = wrapper.readInt();
this._nextSongId = wrapper.readInt();
this._nextPosition = wrapper.readInt();
this._syncCount = wrapper.readInt();
return true;
}
public get currentSongId():number
{
return this._currentSongId;
}
public get currentPosition():number
{
return this._currentPosition;
}
public get nextSongId():number
{
return this._nextSongId;
}
public get nextPosition():number
{
return this._nextPosition;
}
public get syncCount():number
{
return this._syncCount;
}
}

View File

@ -0,0 +1,31 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class OfficialSongIdMessageParser implements IMessageParser
{
private _songId:number;
private _officialSongId:string;
flush(): boolean
{
this._songId = 0;
this._officialSongId = '';
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._officialSongId = wrapper.readString();
this._songId = wrapper.readInt();
return true;
}
public get songId():number
{
return this._songId;
}
public get officialSongId():string
{
return this._officialSongId;
}
}

View File

@ -0,0 +1,40 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { PlayListEntry } from '../../incoming/sound';
export class PlayListMessageParser implements IMessageParser
{
private _synchronizationCount:number;
private _playlist:PlayListEntry[];
flush(): boolean
{
this._synchronizationCount = -1;
this._playlist = [];
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._synchronizationCount = wrapper.readInt();
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._playlist.push(new PlayListEntry(
wrapper.readInt(), wrapper.readInt(), wrapper.readString(), wrapper.readString()
));
}
return true;
}
public get synchronizationCount():number
{
return this._synchronizationCount;
}
public get playList():PlayListEntry[]
{
return this._playlist;
}
}

View File

@ -0,0 +1,24 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { PlayListEntry } from '../../incoming/sound';
export class PlayListSongAddedMessageParser implements IMessageParser
{
private _entry:PlayListEntry;
flush(): boolean
{
this._entry = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._entry = new PlayListEntry(wrapper.readInt(), wrapper.readInt(), wrapper.readString(), wrapper.readString());
return true;
}
public get entry():PlayListEntry
{
return this._entry;
}
}

View File

@ -0,0 +1,35 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { SongInfoEntry } from '../../incoming/sound/SongInfoEntry';
export class TraxSongInfoMessageParser implements IMessageParser
{
private _songs:SongInfoEntry[];
flush(): boolean
{
this._songs = [];
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
const count = wrapper.readInt();
for(let i = 0; i< count; i++)
{
const id = wrapper.readInt();
const _local_3 = wrapper.readString();
const name = wrapper.readString();
const data = wrapper.readString();
const length = wrapper.readInt();
const creator = wrapper.readString();
const _local_10 = new SongInfoEntry(id, length, name, creator, data);
this._songs.push(_local_10);
}
return true;
}
public get songs():SongInfoEntry[]
{
return this._songs;
}
}

View File

@ -0,0 +1,46 @@
import { AdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class UserSongDisksInventoryMessageParser implements IMessageParser
{
private _songDiskInventory: AdvancedMap<number, number> = new AdvancedMap();
flush(): boolean
{
this._songDiskInventory.reset();
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._songDiskInventory.add(wrapper.readInt(), wrapper.readInt());
}
return true;
}
public getDiskId(k: number): number
{
if(((k >= 0) && (k < this._songDiskInventory.length)))
{
return this._songDiskInventory.getKey(k);
}
return -1;
}
public getSongId(k: number): number
{
if(((k >= 0) && (k < this._songDiskInventory.length)))
{
return this._songDiskInventory.getWithIndex(k);
}
return -1;
}
public get songDiskCount(): number
{
return this._songDiskInventory.length;
}
}

View File

@ -0,0 +1,8 @@
export * from './JukeboxPlayListFullMessageParser';
export * from './JukeboxSongDisksMessageParser';
export * from './NowPlayingMessageParser';
export * from './OfficialSongIdMessageParser';
export * from './PlayListMessageParser';
export * from './PlayListSongAddedMessageParser';
export * from './TraxSongInfoMessageParser';
export * from './UserSongDisksInventoryMessageParser';