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:
+28
@@ -0,0 +1,28 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class AccountSafetyLockStatusChangeParser implements IMessageParser
|
||||
{
|
||||
public static SAFETY_LOCK_STATUS_LOCKED: number = 0;
|
||||
public static SAFETY_LOCK_STATUS_UNLOCKED: number = 1;
|
||||
|
||||
private _status: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._status = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get status(): number
|
||||
{
|
||||
return this._status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ApproveNameResultParser implements IMessageParser
|
||||
{
|
||||
private _result: number;
|
||||
private _validationInfo: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._result = -1;
|
||||
this._validationInfo = '';
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._result = wrapper.readInt();
|
||||
this._validationInfo = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get result(): number
|
||||
{
|
||||
return this._result;
|
||||
}
|
||||
|
||||
public get validationInfo(): string
|
||||
{
|
||||
return this._validationInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ChangeEmailResultParser implements IMessageParser
|
||||
{
|
||||
public static readonly EMAIL_STATUS_OK: number = 0;
|
||||
|
||||
private _result: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._result = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._result = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get result(): number
|
||||
{
|
||||
return this._result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class EmailStatusParser implements IMessageParser
|
||||
{
|
||||
private _email: string;
|
||||
private _isVerified: boolean;
|
||||
private _allowChange: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._email = null;
|
||||
this._isVerified = false;
|
||||
this._allowChange = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._email = wrapper.readString();
|
||||
this._isVerified = wrapper.readBoolean();
|
||||
this._allowChange = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get email(): string
|
||||
{
|
||||
return this._email;
|
||||
}
|
||||
|
||||
public get isVerified(): boolean
|
||||
{
|
||||
return this._isVerified;
|
||||
}
|
||||
|
||||
public get allowChange(): boolean
|
||||
{
|
||||
return this._allowChange;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ExtendedProfileChangedMessageParser implements IMessageParser
|
||||
{
|
||||
private _userId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userId = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class GroupDetailsChangedMessageParser implements IMessageParser
|
||||
{
|
||||
private _groupId: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._groupId = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._groupId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get groupId(): number
|
||||
{
|
||||
return this._groupId;
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { MemberData } from '../../incoming';
|
||||
|
||||
export class GroupMembershipRequestedMessageParser implements IMessageParser
|
||||
{
|
||||
private _groupId: number;
|
||||
private _requester: MemberData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._groupId = -1;
|
||||
this._requester = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._groupId = wrapper.readInt();
|
||||
this._requester = new MemberData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get groupId(): number
|
||||
{
|
||||
return this._groupId;
|
||||
}
|
||||
|
||||
public get requester(): MemberData
|
||||
{
|
||||
return this._requester;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class GuildEditFailedMessageParser implements IMessageParser
|
||||
{
|
||||
public static readonly INSUFFICIENT_SUBSCRIPTION_LEVEL: number = 2;
|
||||
|
||||
private _reason: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._reason = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._reason = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get reason(): number
|
||||
{
|
||||
return this._reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class GuildMemberMgmtFailedMessageParser implements IMessageParser
|
||||
{
|
||||
private _guildId: number;
|
||||
private _reason: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._guildId = -1;
|
||||
this._reason = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._guildId = wrapper.readInt();
|
||||
this._reason = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get guildId(): number
|
||||
{
|
||||
return this._guildId;
|
||||
}
|
||||
|
||||
public get reason(): number
|
||||
{
|
||||
return this._reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { HabboGroupEntryData } from './HabboGroupEntryData';
|
||||
|
||||
export class GuildMembershipsMessageParser implements IMessageParser
|
||||
{
|
||||
private _groups: HabboGroupEntryData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._groups = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalOffers = wrapper.readInt();
|
||||
|
||||
while(totalOffers > 0)
|
||||
{
|
||||
this._groups.push(new HabboGroupEntryData(wrapper));
|
||||
|
||||
totalOffers--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get groups(): HabboGroupEntryData[]
|
||||
{
|
||||
return this._groups;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class HabboGroupBadgesMessageParser implements IMessageParser
|
||||
{
|
||||
private _badges: Map<number, string>;
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
this._badges = new Map();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let badgesCount = wrapper.readInt();
|
||||
|
||||
while(badgesCount > 0)
|
||||
{
|
||||
const id = wrapper.readInt();
|
||||
const badge = wrapper.readString();
|
||||
|
||||
this._badges.set(id, badge);
|
||||
badgesCount--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get badges(): Map<number, string>
|
||||
{
|
||||
return this._badges;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class HabboGroupEntryData
|
||||
{
|
||||
private _groupId: number;
|
||||
private _groupName: string;
|
||||
private _badgeCode: string;
|
||||
private _colorA: string;
|
||||
private _colorB: string;
|
||||
private _favourite: boolean;
|
||||
private _ownerId: number;
|
||||
private _hasForum: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._groupId = wrapper.readInt();
|
||||
this._groupName = wrapper.readString();
|
||||
this._badgeCode = wrapper.readString();
|
||||
this._colorA = wrapper.readString();
|
||||
this._colorB = wrapper.readString();
|
||||
this._favourite = wrapper.readBoolean();
|
||||
this._ownerId = wrapper.readInt();
|
||||
this._hasForum = wrapper.readBoolean();
|
||||
}
|
||||
|
||||
public get groupId(): number
|
||||
{
|
||||
return this._groupId;
|
||||
}
|
||||
|
||||
public get groupName(): string
|
||||
{
|
||||
return this._groupName;
|
||||
}
|
||||
|
||||
public get badgeCode(): string
|
||||
{
|
||||
return this._badgeCode;
|
||||
}
|
||||
|
||||
public get colorA(): string
|
||||
{
|
||||
return this._colorA;
|
||||
}
|
||||
|
||||
public get colorB(): string
|
||||
{
|
||||
return this._colorB;
|
||||
}
|
||||
|
||||
public get favourite(): boolean
|
||||
{
|
||||
return this._favourite;
|
||||
}
|
||||
|
||||
public get ownerId(): number
|
||||
{
|
||||
return this._ownerId;
|
||||
}
|
||||
|
||||
public get hasForum(): boolean
|
||||
{
|
||||
return this._hasForum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class HabboGroupJoinFailedMessageParser implements IMessageParser
|
||||
{
|
||||
public static readonly INSUFFICIENT_SUBSCRIPTION_LEVEL: number = 4;
|
||||
|
||||
private _reason: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._reason = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._reason = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get reason(): number
|
||||
{
|
||||
return this._reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class IgnoreResultParser implements IMessageParser
|
||||
{
|
||||
private _result: number;
|
||||
private _name: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._result = -1;
|
||||
this._name = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._result = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get result(): number
|
||||
{
|
||||
return this._result;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class IgnoredUsersParser implements IMessageParser
|
||||
{
|
||||
private _ignoredUsers: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._ignoredUsers = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._ignoredUsers = [];
|
||||
|
||||
let count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._ignoredUsers.push(wrapper.readString());
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get ignoredUsers(): string[]
|
||||
{
|
||||
return this._ignoredUsers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class InClientLinkParser implements IMessageParser
|
||||
{
|
||||
private _link: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._link = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._link = wrapper.readString();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get link(): string
|
||||
{
|
||||
return this._link;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { IMessageDataWrapper, IMessageParser, PetType } from '@nitrots/api';
|
||||
import { PetData } from '../inventory';
|
||||
|
||||
export class PetRespectNotificationParser implements IMessageParser
|
||||
{
|
||||
private _respect: number;
|
||||
private _petOwnerId: number;
|
||||
private _petData: PetData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._respect = 0;
|
||||
this._petOwnerId = 0;
|
||||
this._petData = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._respect = wrapper.readInt();
|
||||
this._petOwnerId = wrapper.readInt();
|
||||
this._petData = new PetData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get respect(): number
|
||||
{
|
||||
return this._respect;
|
||||
}
|
||||
|
||||
public get petOwnerId(): number
|
||||
{
|
||||
return this._petOwnerId;
|
||||
}
|
||||
|
||||
public get petData(): PetData
|
||||
{
|
||||
return this._petData;
|
||||
}
|
||||
|
||||
public get isTreat(): boolean
|
||||
{
|
||||
return (this._petData.typeId === PetType.MONSTERPLANT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export class PetSupplementTypeEnum
|
||||
{
|
||||
public static WATER: number = 0;
|
||||
public static LIGHT: number = 1;
|
||||
public static REVIVE: number = 2;
|
||||
public static REBREED_FERTILIZER: number = 3;
|
||||
public static SPEED_FERTILIZER: number = 4;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class PetSupplementedNotificationParser implements IMessageParser
|
||||
{
|
||||
private _petId: number;
|
||||
private _userId: number;
|
||||
private _supplementType: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._petId = 0;
|
||||
this._userId = 0;
|
||||
this._supplementType = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._petId = wrapper.readInt();
|
||||
this._userId = wrapper.readInt();
|
||||
this._supplementType = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get petId(): number
|
||||
{
|
||||
return this._petId;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get supplementType(): number
|
||||
{
|
||||
return this._supplementType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class RespectReceivedParser implements IMessageParser
|
||||
{
|
||||
private _userId: number;
|
||||
private _respectsReceived: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userId = 0;
|
||||
this._respectsReceived = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userId = wrapper.readInt();
|
||||
this._respectsReceived = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get respectsReceived(): number
|
||||
{
|
||||
return this._respectsReceived;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
export class RoomEntryData
|
||||
{
|
||||
private _roomId: number;
|
||||
private _roomName: string;
|
||||
private _hasControllers: boolean = false;
|
||||
|
||||
constructor(roomId: number, roomName: string, hasControllers: boolean)
|
||||
{
|
||||
this._roomId = roomId;
|
||||
this._roomName = roomName;
|
||||
this._hasControllers = hasControllers;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get roomName(): string
|
||||
{
|
||||
return this._roomName;
|
||||
}
|
||||
|
||||
public get hasControllers(): boolean
|
||||
{
|
||||
return this._hasControllers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class ScrKickbackData
|
||||
{
|
||||
private _currentHcStreak: number;
|
||||
private _firstSubscriptionDate: string;
|
||||
private _kickbackPercentage: number;
|
||||
private _totalCreditsMissed: number;
|
||||
private _totalCreditsRewarded: number;
|
||||
private _totalCreditsSpent: number;
|
||||
private _creditRewardForStreakBonus: number;
|
||||
private _creditRewardForMonthlySpent: number;
|
||||
private _timeUntilPayday: number;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._currentHcStreak = k.readInt();
|
||||
this._firstSubscriptionDate = k.readString();
|
||||
this._kickbackPercentage = k.readDouble();
|
||||
this._totalCreditsMissed = k.readInt();
|
||||
this._totalCreditsRewarded = k.readInt();
|
||||
this._totalCreditsSpent = k.readInt();
|
||||
this._creditRewardForStreakBonus = k.readInt();
|
||||
this._creditRewardForMonthlySpent = k.readInt();
|
||||
this._timeUntilPayday = k.readInt();
|
||||
}
|
||||
|
||||
public get currentHcStreak(): number
|
||||
{
|
||||
return this._currentHcStreak;
|
||||
}
|
||||
|
||||
public get firstSubscriptionDate(): string
|
||||
{
|
||||
return this._firstSubscriptionDate;
|
||||
}
|
||||
|
||||
public get kickbackPercentage(): number
|
||||
{
|
||||
return this._kickbackPercentage;
|
||||
}
|
||||
|
||||
public get totalCreditsMissed(): number
|
||||
{
|
||||
return this._totalCreditsMissed;
|
||||
}
|
||||
|
||||
public get totalCreditsRewarded(): number
|
||||
{
|
||||
return this._totalCreditsRewarded;
|
||||
}
|
||||
|
||||
public get totalCreditsSpent(): number
|
||||
{
|
||||
return this._totalCreditsSpent;
|
||||
}
|
||||
|
||||
public get creditRewardForStreakBonus(): number
|
||||
{
|
||||
return this._creditRewardForStreakBonus;
|
||||
}
|
||||
|
||||
public get creditRewardForMonthlySpent(): number
|
||||
{
|
||||
return this._creditRewardForMonthlySpent;
|
||||
}
|
||||
|
||||
public get timeUntilPayday(): number
|
||||
{
|
||||
return this._timeUntilPayday;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { ScrKickbackData } from './ScrKickbackData';
|
||||
|
||||
export class ScrSendKickbackInfoMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: ScrKickbackData;
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
this._data = null;
|
||||
return true;
|
||||
}
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
this._data = new ScrKickbackData(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): ScrKickbackData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class WelcomeGiftChangeEmailResultParser implements IMessageParser
|
||||
{
|
||||
private _result: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._result = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._result = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get result(): number
|
||||
{
|
||||
return this._result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserPermissionsParser implements IMessageParser
|
||||
{
|
||||
private _clubLevel: number;
|
||||
private _securityLevel: number;
|
||||
private _isAmbassador: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._clubLevel = 0;
|
||||
this._securityLevel = 0;
|
||||
this._isAmbassador = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._clubLevel = wrapper.readInt();
|
||||
this._securityLevel = wrapper.readInt();
|
||||
this._isAmbassador = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get clubLevel(): number
|
||||
{
|
||||
return this._clubLevel;
|
||||
}
|
||||
|
||||
public get securityLevel(): number
|
||||
{
|
||||
return this._securityLevel;
|
||||
}
|
||||
|
||||
public get isAmbassador(): boolean
|
||||
{
|
||||
return this._isAmbassador;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './UserPermissionsParser';
|
||||
@@ -0,0 +1,67 @@
|
||||
import { IMessageDataWrapper, RelationshipStatusEnum } from '@nitrots/api';
|
||||
|
||||
export class RelationshipStatusInfo
|
||||
{
|
||||
private _relationshipStatusType: number;
|
||||
private _friendCount: number;
|
||||
private _randomFriendId: number;
|
||||
private _randomFriendName: string;
|
||||
private _randomFriendFigure: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._relationshipStatusType = RelationshipStatusEnum.NONE;
|
||||
this._friendCount = 0;
|
||||
this._randomFriendId = 0;
|
||||
this._randomFriendFigure = null;
|
||||
this._randomFriendName = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._relationshipStatusType = wrapper.readInt();
|
||||
this._friendCount = wrapper.readInt();
|
||||
this._randomFriendId = wrapper.readInt();
|
||||
this._randomFriendName = wrapper.readString();
|
||||
this._randomFriendFigure = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get relationshipStatusType(): number
|
||||
{
|
||||
return this._relationshipStatusType;
|
||||
}
|
||||
|
||||
public get friendCount(): number
|
||||
{
|
||||
return this._friendCount;
|
||||
}
|
||||
|
||||
public get randomFriendId(): number
|
||||
{
|
||||
return this._randomFriendId;
|
||||
}
|
||||
|
||||
public get randomFriendName(): string
|
||||
{
|
||||
return this._randomFriendName;
|
||||
}
|
||||
|
||||
public get randomFriendFigure(): string
|
||||
{
|
||||
return this._randomFriendFigure;
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { AdvancedMap } from '@nitrots/utils';
|
||||
import { RelationshipStatusInfo } from './RelationshipStatusInfo';
|
||||
|
||||
export class RelationshipStatusInfoMessageParser implements IMessageParser
|
||||
{
|
||||
private _userId: number;
|
||||
private _relationshipStatusMap: IAdvancedMap<number, RelationshipStatusInfo>;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userId = 0;
|
||||
this._relationshipStatusMap = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userId = wrapper.readInt();
|
||||
this._relationshipStatusMap = new AdvancedMap();
|
||||
|
||||
const relationshipsCount = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < relationshipsCount; i++)
|
||||
{
|
||||
const relationship = new RelationshipStatusInfo(wrapper);
|
||||
|
||||
this._relationshipStatusMap.add(relationship.relationshipStatusType, relationship);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get relationshipStatusMap(): IAdvancedMap<number, RelationshipStatusInfo>
|
||||
{
|
||||
return this._relationshipStatusMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserCurrentBadgesParser implements IMessageParser
|
||||
{
|
||||
private _userId: number;
|
||||
private _badges: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userId = null;
|
||||
this._badges = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userId = wrapper.readInt();
|
||||
|
||||
let totalBadges = wrapper.readInt();
|
||||
|
||||
while(totalBadges > 0)
|
||||
{
|
||||
const slotId = wrapper.readInt();
|
||||
const badgeCode = wrapper.readString();
|
||||
|
||||
this._badges.push(badgeCode);
|
||||
|
||||
totalBadges--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get badges(): string[]
|
||||
{
|
||||
return this._badges;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserFigureParser implements IMessageParser
|
||||
{
|
||||
private _figure: string;
|
||||
private _gender: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._figure = null;
|
||||
this._gender = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._figure = wrapper.readString();
|
||||
this._gender = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get gender(): string
|
||||
{
|
||||
return this._gender;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class UserInfoDataParser
|
||||
{
|
||||
private _userId: number;
|
||||
private _username: string;
|
||||
private _figure: string;
|
||||
private _gender: string;
|
||||
private _motto: string;
|
||||
private _realName: string;
|
||||
private _directMail: boolean;
|
||||
private _respectsReceived: number;
|
||||
private _respectsRemaining: number;
|
||||
private _respectsPetRemaining: number;
|
||||
private _streamPublishingAllowed: boolean;
|
||||
private _lastAccessDate: string;
|
||||
private _canChangeName: boolean;
|
||||
private _safetyLocked: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this.flush();
|
||||
this.parse(wrapper);
|
||||
}
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userId = 0;
|
||||
this._username = null;
|
||||
this._figure = null;
|
||||
this._gender = null;
|
||||
this._motto = null;
|
||||
this._realName = null;
|
||||
this._directMail = false;
|
||||
this._respectsReceived = 0;
|
||||
this._respectsRemaining = 0;
|
||||
this._respectsPetRemaining = 0;
|
||||
this._streamPublishingAllowed = false;
|
||||
this._lastAccessDate = null;
|
||||
this._canChangeName = false;
|
||||
this._safetyLocked = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userId = wrapper.readInt();
|
||||
this._username = wrapper.readString();
|
||||
this._figure = wrapper.readString();
|
||||
this._gender = wrapper.readString();
|
||||
this._motto = wrapper.readString();
|
||||
this._realName = wrapper.readString();
|
||||
this._directMail = wrapper.readBoolean();
|
||||
this._respectsReceived = wrapper.readInt();
|
||||
this._respectsRemaining = wrapper.readInt();
|
||||
this._respectsPetRemaining = wrapper.readInt();
|
||||
this._streamPublishingAllowed = wrapper.readBoolean();
|
||||
this._lastAccessDate = wrapper.readString();
|
||||
this._canChangeName = wrapper.readBoolean();
|
||||
this._safetyLocked = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get username(): string
|
||||
{
|
||||
return this._username;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get gender(): string
|
||||
{
|
||||
return this._gender;
|
||||
}
|
||||
|
||||
public get motto(): string
|
||||
{
|
||||
return this._motto;
|
||||
}
|
||||
|
||||
public get realName(): string
|
||||
{
|
||||
return this._realName;
|
||||
}
|
||||
|
||||
public get directMail(): boolean
|
||||
{
|
||||
return this._directMail;
|
||||
}
|
||||
|
||||
public get respectsReceived(): number
|
||||
{
|
||||
return this._respectsReceived;
|
||||
}
|
||||
|
||||
public get respectsRemaining(): number
|
||||
{
|
||||
return this._respectsRemaining;
|
||||
}
|
||||
|
||||
public get respectsPetRemaining(): number
|
||||
{
|
||||
return this._respectsPetRemaining;
|
||||
}
|
||||
|
||||
public get streamPublishingAllowed(): boolean
|
||||
{
|
||||
return this._streamPublishingAllowed;
|
||||
}
|
||||
|
||||
public get lastAccessedDate(): string
|
||||
{
|
||||
return this._lastAccessDate;
|
||||
}
|
||||
|
||||
public get canChangeName(): boolean
|
||||
{
|
||||
return this._canChangeName;
|
||||
}
|
||||
|
||||
public get safetyLocked(): boolean
|
||||
{
|
||||
return this._safetyLocked;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { UserInfoDataParser } from './UserInfoDataParser';
|
||||
|
||||
export class UserInfoParser implements IMessageParser
|
||||
{
|
||||
private _userInfo: UserInfoDataParser;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._userInfo = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._userInfo = new UserInfoDataParser(wrapper);
|
||||
|
||||
if(!this._userInfo) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get userInfo(): UserInfoDataParser
|
||||
{
|
||||
return this._userInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserNameChangeMessageParser implements IMessageParser
|
||||
{
|
||||
private _webId: number;
|
||||
private _id: number;
|
||||
private _newName: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._webId = -1;
|
||||
this._id = -1;
|
||||
this._newName = '';
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._webId = wrapper.readInt();
|
||||
this._id = wrapper.readInt();
|
||||
this._newName = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get webId(): number
|
||||
{
|
||||
return this._webId;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get newName(): string
|
||||
{
|
||||
return this._newName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { HabboGroupEntryData } from '../HabboGroupEntryData';
|
||||
|
||||
export class UserProfileParser implements IMessageParser
|
||||
{
|
||||
private _id: number;
|
||||
private _username: string;
|
||||
private _figure: string;
|
||||
private _motto: string;
|
||||
private _registration: string;
|
||||
private _achievementPoints: number;
|
||||
private _friendsCount: number;
|
||||
private _isMyFriend: boolean;
|
||||
private _requestSent: boolean;
|
||||
private _isOnline: boolean;
|
||||
private _groups: HabboGroupEntryData[];
|
||||
private _secondsSinceLastVisit: number;
|
||||
private _openProfileWindow: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._id = 0;
|
||||
this._username = null;
|
||||
this._figure = null;
|
||||
this._motto = null;
|
||||
this._registration = null;
|
||||
this._achievementPoints = 0;
|
||||
this._friendsCount = 0;
|
||||
this._isMyFriend = false;
|
||||
this._requestSent = false;
|
||||
this._isOnline = false;
|
||||
this._groups = [];
|
||||
this._secondsSinceLastVisit = 0;
|
||||
this._openProfileWindow = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._id = wrapper.readInt();
|
||||
this._username = wrapper.readString();
|
||||
this._figure = wrapper.readString();
|
||||
this._motto = wrapper.readString();
|
||||
this._registration = wrapper.readString();
|
||||
this._achievementPoints = wrapper.readInt();
|
||||
this._friendsCount = wrapper.readInt();
|
||||
this._isMyFriend = wrapper.readBoolean();
|
||||
this._requestSent = wrapper.readBoolean();
|
||||
this._isOnline = wrapper.readBoolean();
|
||||
const groupsCount = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < groupsCount; i++)
|
||||
{
|
||||
this._groups.push(new HabboGroupEntryData(wrapper));
|
||||
}
|
||||
|
||||
this._secondsSinceLastVisit = wrapper.readInt();
|
||||
this._openProfileWindow = wrapper.readBoolean();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get username(): string
|
||||
{
|
||||
return this._username;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get motto(): string
|
||||
{
|
||||
return this._motto;
|
||||
}
|
||||
|
||||
public get registration(): string
|
||||
{
|
||||
return this._registration;
|
||||
}
|
||||
|
||||
public get achievementPoints(): number
|
||||
{
|
||||
return this._achievementPoints;
|
||||
}
|
||||
|
||||
public get friendsCount(): number
|
||||
{
|
||||
return this._friendsCount;
|
||||
}
|
||||
|
||||
public get isMyFriend(): boolean
|
||||
{
|
||||
return this._isMyFriend;
|
||||
}
|
||||
|
||||
public get requestSent(): boolean
|
||||
{
|
||||
return this._requestSent;
|
||||
}
|
||||
|
||||
public get isOnline(): boolean
|
||||
{
|
||||
return this._isOnline;
|
||||
}
|
||||
|
||||
public get groups(): HabboGroupEntryData[]
|
||||
{
|
||||
return this._groups;
|
||||
}
|
||||
|
||||
public get secondsSinceLastVisit(): number
|
||||
{
|
||||
return this._secondsSinceLastVisit;
|
||||
}
|
||||
|
||||
public get openProfileWindow(): boolean
|
||||
{
|
||||
return this._openProfileWindow;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserSettingsParser implements IMessageParser
|
||||
{
|
||||
private _volumeSystem: number;
|
||||
private _volumeFurni: number;
|
||||
private _volumeTrax: number;
|
||||
private _oldChat: boolean;
|
||||
private _roomInvites: boolean;
|
||||
private _cameraFollow: boolean;
|
||||
private _flags: number;
|
||||
private _chatType: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._volumeSystem = 0;
|
||||
this._volumeFurni = 0;
|
||||
this._volumeTrax = 0;
|
||||
this._oldChat = false;
|
||||
this._roomInvites = false;
|
||||
this._cameraFollow = false;
|
||||
this._flags = 0;
|
||||
this._chatType = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._volumeSystem = wrapper.readInt();
|
||||
this._volumeFurni = wrapper.readInt();
|
||||
this._volumeTrax = wrapper.readInt();
|
||||
this._oldChat = wrapper.readBoolean();
|
||||
this._roomInvites = wrapper.readBoolean();
|
||||
this._cameraFollow = wrapper.readBoolean();
|
||||
this._flags = wrapper.readInt();
|
||||
this._chatType = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get volumeSystem(): number
|
||||
{
|
||||
return this._volumeSystem;
|
||||
}
|
||||
|
||||
public get volumeFurni(): number
|
||||
{
|
||||
return this._volumeFurni;
|
||||
}
|
||||
|
||||
public get volumeTrax(): number
|
||||
{
|
||||
return this._volumeTrax;
|
||||
}
|
||||
|
||||
public get oldChat(): boolean
|
||||
{
|
||||
return this._oldChat;
|
||||
}
|
||||
|
||||
public get roomInvites(): boolean
|
||||
{
|
||||
return this._roomInvites;
|
||||
}
|
||||
|
||||
public get cameraFollow(): boolean
|
||||
{
|
||||
return this._cameraFollow;
|
||||
}
|
||||
|
||||
public get flags(): number
|
||||
{
|
||||
return this._flags;
|
||||
}
|
||||
|
||||
public get chatType(): number
|
||||
{
|
||||
return this._chatType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserTagsParser implements IMessageParser
|
||||
{
|
||||
private _roomUnitId: number;
|
||||
private _tags: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomUnitId = -1;
|
||||
this._tags = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomUnitId = wrapper.readInt();
|
||||
|
||||
let totalTags = wrapper.readInt();
|
||||
|
||||
while(totalTags > 0)
|
||||
{
|
||||
this._tags.push(wrapper.readString());
|
||||
|
||||
totalTags--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomUnitId(): number
|
||||
{
|
||||
return this._roomUnitId;
|
||||
}
|
||||
|
||||
public get tags(): string[]
|
||||
{
|
||||
return this._tags;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export * from './RelationshipStatusInfo';
|
||||
export * from './RelationshipStatusInfoMessageParser';
|
||||
export * from './UserCurrentBadgesParser';
|
||||
export * from './UserFigureParser';
|
||||
export * from './UserInfoDataParser';
|
||||
export * from './UserInfoParser';
|
||||
export * from './UserNameChangeMessageParser';
|
||||
export * from './UserProfileParser';
|
||||
export * from './UserSettingsParser';
|
||||
export * from './UserTagsParser';
|
||||
@@ -0,0 +1,30 @@
|
||||
export * from './access';
|
||||
export * from './AccountSafetyLockStatusChangeParser';
|
||||
export * from './ApproveNameResultParser';
|
||||
export * from './ChangeEmailResultParser';
|
||||
export * from './data';
|
||||
export * from './EmailStatusParser';
|
||||
export * from './ExtendedProfileChangedMessageParser';
|
||||
export * from './GroupDetailsChangedMessageParser';
|
||||
export * from './GroupMembershipRequestedMessageParser';
|
||||
export * from './GuildEditFailedMessageParser';
|
||||
export * from './GuildMemberMgmtFailedMessageParser';
|
||||
export * from './GuildMembershipsMessageParser';
|
||||
export * from './HabboGroupBadgesMessageParser';
|
||||
export * from './HabboGroupEntryData';
|
||||
export * from './HabboGroupJoinFailedMessageParser';
|
||||
export * from './IgnoredUsersParser';
|
||||
export * from './IgnoreResultParser';
|
||||
export * from './InClientLinkParser';
|
||||
export * from './inventory';
|
||||
export * from './inventory/currency';
|
||||
export * from './inventory/subscription';
|
||||
export * from './PetRespectNotificationParser';
|
||||
export * from './PetSupplementedNotificationParser';
|
||||
export * from './PetSupplementTypeEnum';
|
||||
export * from './RespectReceivedParser';
|
||||
export * from './RoomEntryData';
|
||||
export * from './ScrKickbackData';
|
||||
export * from './ScrSendKickbackInfoMessageParser';
|
||||
export * from './wardrobe';
|
||||
export * from './WelcomeGiftChangeEmailResultParser';
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserCreditsParser implements IMessageParser
|
||||
{
|
||||
private _credits: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._credits = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._credits = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get credits(): string
|
||||
{
|
||||
return this._credits;
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserCurrencyParser implements IMessageParser
|
||||
{
|
||||
private _currencies: Map<number, number>;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._currencies = new Map();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalCurrencies = wrapper.readInt();
|
||||
|
||||
while(totalCurrencies > 0)
|
||||
{
|
||||
this._currencies.set(wrapper.readInt(), wrapper.readInt());
|
||||
|
||||
totalCurrencies--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get currencies(): Map<number, number>
|
||||
{
|
||||
return this._currencies;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './UserCreditsParser';
|
||||
export * from './UserCurrencyParser';
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './currency';
|
||||
export * from './subscription';
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserSubscriptionParser implements IMessageParser
|
||||
{
|
||||
public static readonly RESPONSE_TYPE_LOGIN: number = 1;
|
||||
public static readonly RESPONSE_TYPE_PURCHASE: number = 2;
|
||||
public static readonly RESPONSE_TYPE_DISCOUNT_AVAILABLE: number = 3;
|
||||
public static readonly RESPONSE_TYPE_CITIZENSHIP_DISCOUNT: number = 4;
|
||||
|
||||
private _productName: string;
|
||||
private _daysToPeriodEnd: number;
|
||||
private _memberPeriods: number;
|
||||
private _periodsSubscribedAhead: number;
|
||||
private _responseType: number;
|
||||
private _hasEverBeenMember: boolean;
|
||||
private _isVip: boolean;
|
||||
private _pastClubDays: number;
|
||||
private _pastVipDays: number;
|
||||
private _minutesUntilExpiration: number;
|
||||
private _minutesSinceLastModified: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._productName = null;
|
||||
this._daysToPeriodEnd = 0;
|
||||
this._memberPeriods = 0;
|
||||
this._periodsSubscribedAhead = 0;
|
||||
this._responseType = 0;
|
||||
this._hasEverBeenMember = false;
|
||||
this._isVip = false;
|
||||
this._pastClubDays = 0;
|
||||
this._pastVipDays = 0;
|
||||
this._minutesUntilExpiration = 0;
|
||||
this._minutesSinceLastModified = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._productName = wrapper.readString();
|
||||
this._daysToPeriodEnd = wrapper.readInt();
|
||||
this._memberPeriods = wrapper.readInt();
|
||||
this._periodsSubscribedAhead = wrapper.readInt();
|
||||
this._responseType = wrapper.readInt();
|
||||
this._hasEverBeenMember = wrapper.readBoolean();
|
||||
this._isVip = wrapper.readBoolean();
|
||||
this._pastClubDays = wrapper.readInt();
|
||||
this._pastVipDays = wrapper.readInt();
|
||||
this._minutesUntilExpiration = wrapper.readInt();
|
||||
|
||||
if(wrapper.bytesAvailable) this._minutesSinceLastModified = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get productName(): string
|
||||
{
|
||||
return this._productName;
|
||||
}
|
||||
|
||||
public get daysToPeriodEnd(): number
|
||||
{
|
||||
return this._daysToPeriodEnd;
|
||||
}
|
||||
|
||||
public get memberPeriods(): number
|
||||
{
|
||||
return this._memberPeriods;
|
||||
}
|
||||
|
||||
public get periodsSubscribedAhead(): number
|
||||
{
|
||||
return this._periodsSubscribedAhead;
|
||||
}
|
||||
|
||||
public get responseType(): number
|
||||
{
|
||||
return this._responseType;
|
||||
}
|
||||
|
||||
public get hasEverBeenMember(): boolean
|
||||
{
|
||||
return this._hasEverBeenMember;
|
||||
}
|
||||
|
||||
public get isVip(): boolean
|
||||
{
|
||||
return this._isVip;
|
||||
}
|
||||
|
||||
public get pastClubDays(): number
|
||||
{
|
||||
return this._pastClubDays;
|
||||
}
|
||||
|
||||
public get pastVipDays(): number
|
||||
{
|
||||
return this._pastVipDays;
|
||||
}
|
||||
|
||||
public get minutesUntilExpiration(): number
|
||||
{
|
||||
return this._minutesUntilExpiration;
|
||||
}
|
||||
|
||||
public get minutesSinceLastModified(): number
|
||||
{
|
||||
return this._minutesSinceLastModified;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './UserSubscriptionParser';
|
||||
@@ -0,0 +1,40 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class UserWardrobePageParser implements IMessageParser
|
||||
{
|
||||
private _looks: Map<number, [string, string]>;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._looks = new Map();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
wrapper.readInt();
|
||||
|
||||
let totalLooks = wrapper.readInt();
|
||||
|
||||
while(totalLooks > 0)
|
||||
{
|
||||
const slotId = wrapper.readInt();
|
||||
const look = wrapper.readString();
|
||||
const gender = wrapper.readString();
|
||||
|
||||
this._looks.set(slotId, [look, gender]);
|
||||
|
||||
totalLooks--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get looks(): Map<number, string[]>
|
||||
{
|
||||
return this._looks;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './UserWardrobePageParser';
|
||||
Reference in New Issue
Block a user