You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 23:16:20 +00:00
Move to Renderer V2
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class BreedingPetInfo
|
||||
{
|
||||
private _webId: number;
|
||||
private _name: string;
|
||||
private _level: number;
|
||||
private _figure: string;
|
||||
private _owner: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this._webId = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
this._level = wrapper.readInt();
|
||||
this._figure = wrapper.readString();
|
||||
this._owner = wrapper.readString();
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
this._webId = 0;
|
||||
this._name = '';
|
||||
this._level = 0;
|
||||
this._figure = '';
|
||||
this._owner = '';
|
||||
}
|
||||
|
||||
public get webId(): number
|
||||
{
|
||||
return this._webId;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get level(): number
|
||||
{
|
||||
return this._level;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get owner(): string
|
||||
{
|
||||
return this._owner;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export enum FurnitureType
|
||||
{
|
||||
FLOOR = 'S',
|
||||
WALL = 'I',
|
||||
EFFECT = 'E',
|
||||
BADGE = 'B',
|
||||
ROBOT = 'R',
|
||||
HABBO_CLUB = 'H',
|
||||
PET = 'P'
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
export interface IFurnitureData
|
||||
{
|
||||
type: string;
|
||||
id: number;
|
||||
className: string;
|
||||
fullName: string;
|
||||
category: string;
|
||||
hasIndexedColor: boolean;
|
||||
colorIndex: number;
|
||||
revision: number;
|
||||
tileSizeX: number;
|
||||
tileSizeY: number;
|
||||
tileSizeZ: number;
|
||||
colors: number[];
|
||||
name: string;
|
||||
description: string;
|
||||
adUrl: string;
|
||||
purchaseOfferId: number;
|
||||
rentOfferId: number;
|
||||
customParams: string;
|
||||
specialType: number;
|
||||
purchaseCouldBeUsedForBuyout: boolean;
|
||||
rentCouldBeUsedForBuyout: boolean;
|
||||
availableForBuildersClub: boolean;
|
||||
canStandOn: boolean;
|
||||
canSitOn: boolean;
|
||||
canLayOn: boolean;
|
||||
isExternalImage: boolean;
|
||||
excludeDynamic: boolean;
|
||||
furniLine: string;
|
||||
environment: string;
|
||||
rare: boolean;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface IFurnitureDataListener
|
||||
{
|
||||
loadFurnitureData(): void;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface IGroupInformationManager
|
||||
{
|
||||
init(): void;
|
||||
getGroupBadge(groupId: number): string;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export interface IIgnoredUsersManager
|
||||
{
|
||||
init(): void;
|
||||
requestIgnoredUsers(username: string): void;
|
||||
ignoreUserId(id: number): void;
|
||||
ignoreUser(name: string): void;
|
||||
unignoreUser(name: string): void;
|
||||
isIgnored(name: string): boolean;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface IPetCustomPart
|
||||
{
|
||||
layerId: number;
|
||||
partId: number;
|
||||
paletteId: number;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface IPollChoice
|
||||
{
|
||||
value: string;
|
||||
choiceText: string;
|
||||
choiceType: number;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { IPollChoice } from './IPollChoice';
|
||||
|
||||
export interface IPollQuestion
|
||||
{
|
||||
questionId: number;
|
||||
questionType: number;
|
||||
sortOrder: number;
|
||||
questionText: string;
|
||||
questionCategory: number;
|
||||
questionAnswerType: number;
|
||||
questionAnswerCount: number;
|
||||
children: IPollQuestion[];
|
||||
questionChoices: IPollChoice[];
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface IProductData
|
||||
{
|
||||
type: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { IDisposable } from '../../common';
|
||||
|
||||
export interface IProductDataListener extends IDisposable
|
||||
{
|
||||
loadProductData(): void;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface IQuestion
|
||||
{
|
||||
id: number;
|
||||
number: number;
|
||||
type: number;
|
||||
content: string;
|
||||
selection_min?: number;
|
||||
selections?: string[];
|
||||
selection_values?: string[];
|
||||
selection_count?: number;
|
||||
selection_max?: number;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { IRoomSession } from './IRoomSession';
|
||||
|
||||
export interface IRoomHandlerListener
|
||||
{
|
||||
getSession(id: number): IRoomSession;
|
||||
sessionUpdate(id: number, type: string): void;
|
||||
sessionReinitialize(fromRoomId: number, toRoomId: number): void;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface IRoomModerationSettings
|
||||
{
|
||||
readonly allowMute: number;
|
||||
readonly allowKick: number;
|
||||
readonly allowBan: number;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
export interface IRoomPetData
|
||||
{
|
||||
id: number;
|
||||
level: number;
|
||||
maximumLevel: number;
|
||||
experience: number;
|
||||
levelExperienceGoal: number;
|
||||
energy: number;
|
||||
maximumEnergy: number;
|
||||
happyness: number;
|
||||
maximumHappyness: number;
|
||||
ownerId: number;
|
||||
ownerName: string;
|
||||
respect: number;
|
||||
age: number;
|
||||
unknownRarity: number;
|
||||
saddle: boolean;
|
||||
rider: boolean;
|
||||
skillTresholds: number[];
|
||||
publiclyRideable: number;
|
||||
breedable: boolean;
|
||||
fullyGrown: boolean;
|
||||
dead: boolean;
|
||||
rarityLevel: number;
|
||||
maximumTimeToLive: number;
|
||||
remainingTimeToLive: number;
|
||||
remainingGrowTime: number;
|
||||
publiclyBreedable: boolean;
|
||||
readonly adultLevel: number;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import { IRoomModerationSettings } from './IRoomModerationSettings';
|
||||
import { IUserDataManager } from './IUserDataManager';
|
||||
|
||||
export interface IRoomSession
|
||||
{
|
||||
openGift(objectId: number): void;
|
||||
setControllerLevel(level: number): void;
|
||||
setOwnRoomIndex(roomIndex: number): void;
|
||||
setRoomOwner(): void;
|
||||
start(): boolean;
|
||||
reset(roomId: number): void;
|
||||
sendChatMessage(text: string, styleId: number): void;
|
||||
sendShoutMessage(text: string, styleId: number): void;
|
||||
sendWhisperMessage(recipientName: string, text: string, styleId: number): void;
|
||||
sendChatTypingMessage(isTyping: boolean): void;
|
||||
sendMottoMessage(motto: string): void;
|
||||
sendDanceMessage(danceId: number): void;
|
||||
sendExpressionMessage(expression: number): void;
|
||||
sendSignMessage(sign: number): void;
|
||||
sendPostureMessage(posture: number): void;
|
||||
sendDoorbellApprovalMessage(userName: string, flag: boolean): void;
|
||||
sendAmbassadorAlertMessage(userId: number): void;
|
||||
sendKickMessage(userId: number): void;
|
||||
sendMuteMessage(userId: number, minutes: number): void;
|
||||
sendBanMessage(userId: number, type: string): void;
|
||||
sendGiveRightsMessage(userId: number): void;
|
||||
sendTakeRightsMessage(userId: number): void;
|
||||
sendPollStartMessage(pollId: number): void;
|
||||
sendPollRejectMessage(pollId: number): void;
|
||||
sendPollAnswerMessage(pollId: number, questionId: number, answers: string[]): void;
|
||||
votePoll(counter: number): void;
|
||||
sendPeerUsersClassificationMessage(userClassType: string): void;
|
||||
sendRoomUsersClassificationMessage(userClassType: string): void;
|
||||
updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void;
|
||||
toggleMoodlightState(): void;
|
||||
pickupPet(id: number): void;
|
||||
pickupBot(id: number): void;
|
||||
requestMoodlightSettings(): void;
|
||||
mountPet(id: number): void;
|
||||
dismountPet(id: number): void;
|
||||
usePetProduct(itemId: number, petId: number): void;
|
||||
removePetSaddle(id: number): void;
|
||||
togglePetBreeding(id: number): void;
|
||||
togglePetRiding(id: number): void;
|
||||
useMultistateItem(id: number): void;
|
||||
harvestPet(id: number): void;
|
||||
compostPlant(id: number): void;
|
||||
requestPetCommands(id: number): void;
|
||||
sendScriptProceed(): void;
|
||||
userDataManager: IUserDataManager;
|
||||
roomId: number;
|
||||
state: string;
|
||||
tradeMode: number;
|
||||
isPrivateRoom: boolean;
|
||||
doorMode: number;
|
||||
allowPets: boolean;
|
||||
controllerLevel: number;
|
||||
ownRoomIndex: number;
|
||||
isGuildRoom: boolean;
|
||||
isRoomOwner: boolean;
|
||||
isDecorating: boolean;
|
||||
isSpectator: boolean;
|
||||
moderationSettings: IRoomModerationSettings;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { IRoomSession } from './IRoomSession';
|
||||
|
||||
export interface IRoomSessionManager
|
||||
{
|
||||
init(): Promise<void>;
|
||||
getSession(id: number): IRoomSession;
|
||||
createSession(roomId: number, password?: string): boolean;
|
||||
startSession(session: IRoomSession): boolean;
|
||||
removeSession(id: number, openLandingView?: boolean): void;
|
||||
viewerSession: IRoomSession;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
export interface IRoomUserData
|
||||
{
|
||||
readonly roomIndex: number;
|
||||
activityPoints: number;
|
||||
name: string;
|
||||
type: number;
|
||||
sex: string;
|
||||
figure: string;
|
||||
custom: string;
|
||||
webID: number;
|
||||
groupId: number;
|
||||
groupName: string;
|
||||
groupStatus: number;
|
||||
ownerId: number;
|
||||
ownerName: string;
|
||||
rarityLevel: number;
|
||||
hasSaddle: boolean;
|
||||
isRiding: boolean;
|
||||
canBreed: boolean;
|
||||
canHarvest: boolean;
|
||||
canRevive: boolean;
|
||||
hasBreedingPermission: boolean;
|
||||
petLevel: number;
|
||||
botSkills: number[];
|
||||
isModerator: boolean;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { Texture } from 'pixi.js';
|
||||
import { ICommunicationManager } from '../../communication';
|
||||
import { IFurnitureData } from './IFurnitureData';
|
||||
import { IGroupInformationManager } from './IGroupInformationManager';
|
||||
import { IIgnoredUsersManager } from './IIgnoredUsersManager';
|
||||
import { IProductData } from './IProductData';
|
||||
|
||||
export interface ISessionDataManager
|
||||
{
|
||||
init(): Promise<void>;
|
||||
getAllFurnitureData(): IFurnitureData[];
|
||||
getFloorItemData(id: number): IFurnitureData;
|
||||
getFloorItemDataByName(name: string): IFurnitureData;
|
||||
getWallItemData(id: number): IFurnitureData;
|
||||
getWallItemDataByName(name: string): IFurnitureData;
|
||||
getProductData(type: string): IProductData;
|
||||
getBadgeUrl(name: string): string;
|
||||
getGroupBadgeUrl(name: string): string;
|
||||
getBadgeImage(name: string): Texture;
|
||||
getUserTags(roomUnitId: number): string[];
|
||||
loadBadgeImage(name: string): string;
|
||||
getGroupBadgeImage(name: string): Texture;
|
||||
loadGroupBadgeImage(name: string): string;
|
||||
hasSecurity(level: number): boolean;
|
||||
giveRespect(userId: number): void;
|
||||
givePetRespect(petId: number): void;
|
||||
sendSpecialCommandMessage(text: string, styleId?: number): void;
|
||||
ignoreUser(name: string): void;
|
||||
unignoreUser(name: string): void;
|
||||
isUserIgnored(name: string): boolean;
|
||||
getGroupBadge(groupId: number): string;
|
||||
communication: ICommunicationManager;
|
||||
userId: number;
|
||||
userName: string;
|
||||
figure: string;
|
||||
gender: string;
|
||||
realName: string;
|
||||
ignoredUsersManager: IIgnoredUsersManager;
|
||||
groupInformationManager: IGroupInformationManager;
|
||||
respectsReceived: number;
|
||||
respectsLeft: number;
|
||||
respectsPetLeft: number;
|
||||
canChangeName: boolean;
|
||||
clubLevel: number;
|
||||
securityLevel: number;
|
||||
isAmbassador: boolean;
|
||||
isNoob: boolean;
|
||||
isRealNoob: boolean;
|
||||
isSystemOpen: boolean;
|
||||
isSystemShutdown: boolean;
|
||||
isAuthenticHabbo: boolean;
|
||||
isModerator: boolean;
|
||||
isCameraFollowDisabled: boolean;
|
||||
uiFlags: number;
|
||||
tags: string[];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { IRoomUserData } from './IRoomUserData';
|
||||
|
||||
export interface IUserDataManager
|
||||
{
|
||||
getUserData(webID: number): IRoomUserData;
|
||||
getPetData(webID: number): IRoomUserData;
|
||||
getBotData(webID: number): IRoomUserData;
|
||||
getRentableBotData(webID: number): IRoomUserData;
|
||||
getDataByType(webID: number, type: number): IRoomUserData;
|
||||
getUserDataByIndex(roomIndex: number): IRoomUserData;
|
||||
getUserDataByName(name: string): IRoomUserData;
|
||||
updateUserData(data: IRoomUserData): void;
|
||||
removeUserData(roomIndex: number): void;
|
||||
getUserBadges(userId: number): string[];
|
||||
setUserBadges(userId: number, badges: string[]): void;
|
||||
updateFigure(roomIndex: number, figure: string, sex: string, hasSaddle: boolean, isRiding: boolean): void;
|
||||
updateName(roomIndex: number, name: string): void;
|
||||
updateMotto(roomIndex: number, custom: string): void;
|
||||
updateAchievementScore(roomIndex: number, score: number): void;
|
||||
updatePetLevel(roomIndex: number, level: number): void;
|
||||
updatePetBreedingStatus(roomIndex: number, canBreed: boolean, canHarvest: boolean, canRevive: boolean, hasBreedingPermission: boolean): void;
|
||||
requestPetInfo(id: number): void;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { IMessageDataWrapper, IPetBreedingResultData } from '@nitrots/api';
|
||||
|
||||
export class PetBreedingResultData implements IPetBreedingResultData
|
||||
{
|
||||
private _stuffId: number;
|
||||
private _classId: number;
|
||||
private _productCode: string;
|
||||
private _userId: number;
|
||||
private _userName: string;
|
||||
private _rarityLevel: number;
|
||||
private _hasMutation: boolean;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._stuffId = wrapper.readInt();
|
||||
this._classId = wrapper.readInt();
|
||||
this._productCode = wrapper.readString();
|
||||
this._userId = wrapper.readInt();
|
||||
this._userName = wrapper.readString();
|
||||
this._rarityLevel = wrapper.readInt();
|
||||
this._hasMutation = wrapper.readBoolean();
|
||||
}
|
||||
|
||||
public get stuffId(): number
|
||||
{
|
||||
return this._stuffId;
|
||||
}
|
||||
|
||||
public get classId(): number
|
||||
{
|
||||
return this._classId;
|
||||
}
|
||||
|
||||
public get productCode(): string
|
||||
{
|
||||
return this._productCode;
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
|
||||
public get rarityLevel(): number
|
||||
{
|
||||
return this._rarityLevel;
|
||||
}
|
||||
|
||||
public get hasMutation(): boolean
|
||||
{
|
||||
return this._hasMutation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import { IPetCustomPart } from './IPetCustomPart';
|
||||
|
||||
export class PetCustomPart implements IPetCustomPart
|
||||
{
|
||||
private _layerId: number;
|
||||
private _partId: number;
|
||||
private _paletteId: number;
|
||||
|
||||
constructor(layerId: number, partId: number, paletteId: number)
|
||||
{
|
||||
this._layerId = layerId;
|
||||
this._partId = partId;
|
||||
this._paletteId = paletteId;
|
||||
}
|
||||
|
||||
public get layerId(): number
|
||||
{
|
||||
return this._layerId;
|
||||
}
|
||||
|
||||
public set layerId(layerId: number)
|
||||
{
|
||||
this._layerId = layerId;
|
||||
}
|
||||
|
||||
public get partId(): number
|
||||
{
|
||||
return this._partId;
|
||||
}
|
||||
|
||||
public set partId(partId: number)
|
||||
{
|
||||
this._partId = partId;
|
||||
}
|
||||
|
||||
public get paletteId(): number
|
||||
{
|
||||
return this._paletteId;
|
||||
}
|
||||
|
||||
public set paletteId(paletteId: number)
|
||||
{
|
||||
this._paletteId = paletteId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
import { IPetCustomPart } from './IPetCustomPart';
|
||||
import { PetCustomPart } from './PetCustomPart';
|
||||
|
||||
export class PetFigureData
|
||||
{
|
||||
private _typeId: number;
|
||||
private _paletteId: number;
|
||||
private _color: number;
|
||||
private _headOnly: boolean;
|
||||
|
||||
private _customParts: IPetCustomPart[];
|
||||
private _customLayerIds: number[];
|
||||
private _customPartIds: number[];
|
||||
private _customPaletteIds: number[];
|
||||
|
||||
constructor(k: string)
|
||||
{
|
||||
this._typeId = this.getTypeId(k);
|
||||
this._paletteId = this.getPaletteId(k);
|
||||
this._color = this.getColor(k);
|
||||
this._headOnly = this.getHeadOnly(k);
|
||||
|
||||
const _local_2 = this.getCustomData(k);
|
||||
|
||||
this._customLayerIds = this.getCustomLayerIds(_local_2);
|
||||
this._customPartIds = this.getCustomPartIds(_local_2);
|
||||
this._customPaletteIds = this.getCustomPaletteIds(_local_2);
|
||||
this._customParts = [];
|
||||
|
||||
let i = 0;
|
||||
|
||||
while(i < this._customLayerIds.length)
|
||||
{
|
||||
this._customParts.push(new PetCustomPart(this._customLayerIds[i], this._customPartIds[i], this._customPaletteIds[i]));
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public get typeId(): number
|
||||
{
|
||||
return this._typeId;
|
||||
}
|
||||
|
||||
public get paletteId(): number
|
||||
{
|
||||
return this._paletteId;
|
||||
}
|
||||
|
||||
public get color(): number
|
||||
{
|
||||
return this._color;
|
||||
}
|
||||
|
||||
public get customLayerIds(): number[]
|
||||
{
|
||||
return this._customLayerIds;
|
||||
}
|
||||
|
||||
public get customPartIds(): number[]
|
||||
{
|
||||
return this._customPartIds;
|
||||
}
|
||||
|
||||
public get customPaletteIds(): number[]
|
||||
{
|
||||
return this._customPaletteIds;
|
||||
}
|
||||
|
||||
public get customParts(): IPetCustomPart[]
|
||||
{
|
||||
return this._customParts;
|
||||
}
|
||||
|
||||
public getCustomPart(k: number): IPetCustomPart
|
||||
{
|
||||
if(this._customParts)
|
||||
{
|
||||
for(const _local_2 of this._customParts)
|
||||
{
|
||||
if(_local_2.layerId === k) return _local_2;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public get hasCustomParts(): boolean
|
||||
{
|
||||
return (!(this._customLayerIds == null)) && (this._customLayerIds.length > 0);
|
||||
}
|
||||
|
||||
public get headOnly(): boolean
|
||||
{
|
||||
return this._headOnly;
|
||||
}
|
||||
|
||||
public get figureString(): string
|
||||
{
|
||||
let figure = ((((this.typeId + ' ') + this.paletteId) + ' ') + this.color.toString(16));
|
||||
|
||||
figure = (figure + (' ' + this.customParts.length));
|
||||
|
||||
for(const _local_2 of this.customParts)
|
||||
{
|
||||
figure = (figure + (((((' ' + _local_2.layerId) + ' ') + _local_2.partId) + ' ') + _local_2.paletteId));
|
||||
}
|
||||
|
||||
return figure;
|
||||
}
|
||||
|
||||
private getCustomData(k: string): string[]
|
||||
{
|
||||
let _local_2: string[] = [];
|
||||
|
||||
if(k)
|
||||
{
|
||||
const _local_3 = k.split(' ');
|
||||
const _local_4 = ((this._headOnly) ? 1 : 0);
|
||||
const _local_5 = (4 + _local_4);
|
||||
|
||||
if(_local_3.length > _local_5)
|
||||
{
|
||||
const _local_6 = (3 + _local_4);
|
||||
const _local_7 = parseInt(_local_3[_local_6]);
|
||||
|
||||
_local_2 = _local_3.slice(_local_5, (_local_5 + (_local_7 * 3)));
|
||||
}
|
||||
}
|
||||
|
||||
return _local_2;
|
||||
}
|
||||
|
||||
private getCustomLayerIds(data: string[]): number[]
|
||||
{
|
||||
const layerIds: number[] = [];
|
||||
|
||||
let i = 0;
|
||||
|
||||
while(i < data.length)
|
||||
{
|
||||
layerIds.push(parseInt(data[(i + 0)]));
|
||||
|
||||
i = (i + 3);
|
||||
}
|
||||
|
||||
return layerIds;
|
||||
}
|
||||
|
||||
private getCustomPartIds(data: string[]): number[]
|
||||
{
|
||||
const partIds: number[] = [];
|
||||
|
||||
let i = 0;
|
||||
|
||||
while(i < data.length)
|
||||
{
|
||||
partIds.push(parseInt(data[(i + 1)]));
|
||||
|
||||
i = (i + 3);
|
||||
}
|
||||
|
||||
return partIds;
|
||||
}
|
||||
|
||||
private getCustomPaletteIds(data: string[]): number[]
|
||||
{
|
||||
const paletteIds: number[] = [];
|
||||
|
||||
let i = 0;
|
||||
|
||||
while(i < data.length)
|
||||
{
|
||||
paletteIds.push(parseInt(data[(i + 2)]));
|
||||
|
||||
i = (i + 3);
|
||||
}
|
||||
|
||||
return paletteIds;
|
||||
}
|
||||
|
||||
private getTypeId(data: string): number
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
const parts = data.split(' ');
|
||||
|
||||
if(parts.length >= 1) return parseInt(parts[0]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private getPaletteId(data: string): number
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
const parts = data.split(' ');
|
||||
|
||||
if(parts.length >= 2) return parseInt(parts[1]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private getColor(data: string): number
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
const parts = data.split(' ');
|
||||
|
||||
if(parts.length >= 3) return parseInt(parts[2], 16);
|
||||
}
|
||||
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
private getHeadOnly(data: string): boolean
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
const parts = data.split(' ');
|
||||
|
||||
if(parts.length >= 4) return parts[3] === 'head';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class RarityCategoryData
|
||||
{
|
||||
private _chance: number;
|
||||
private _breeds: number[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
if(!wrapper) throw new Error('invalid_wrapper');
|
||||
|
||||
this._chance = wrapper.readInt();
|
||||
this._breeds = [];
|
||||
|
||||
let totalCount = wrapper.readInt();
|
||||
|
||||
while(totalCount > 0)
|
||||
{
|
||||
this._breeds.push(wrapper.readInt());
|
||||
|
||||
totalCount--;
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
this._chance = -1;
|
||||
this._breeds = [];
|
||||
}
|
||||
|
||||
public get chance(): number
|
||||
{
|
||||
return this._chance;
|
||||
}
|
||||
|
||||
public get breeds(): number[]
|
||||
{
|
||||
return this._breeds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export class GenericErrorEnum
|
||||
{
|
||||
public static KICKED_OUT_OF_ROOM: number = 4008;
|
||||
public static STRIP_LOCKED_FOR_TRADING: number = -13001;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export class NoobnessLevelEnum
|
||||
{
|
||||
public static OLD_IDENTITY: number = 0;
|
||||
public static NEW_IDENTITY: number = 1;
|
||||
public static REAL_NOOB: number = 2;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
export class PetType
|
||||
{
|
||||
public static DOG: number = 0;
|
||||
public static CAT: number = 1;
|
||||
public static CROCODILE: number = 2;
|
||||
public static TERRIER: number = 3;
|
||||
public static BEAR: number = 4;
|
||||
public static PIG: number = 5;
|
||||
public static LION: number = 6;
|
||||
public static RHINO: number = 7;
|
||||
public static SPIDER: number = 8;
|
||||
public static TURTLE: number = 9;
|
||||
public static CHICKEN: number = 10;
|
||||
public static FROG: number = 11;
|
||||
public static DRAGON: number = 12;
|
||||
public static MONSTER: number = 13;
|
||||
public static MONKEY: number = 14;
|
||||
public static HORSE: number = 15;
|
||||
public static MONSTERPLANT: number = 16;
|
||||
public static BUNNY: number = 17;
|
||||
public static BUNNYEVIL: number = 18;
|
||||
public static BUNNYDEPRESSED: number = 19;
|
||||
public static BUNNYLOVE: number = 20;
|
||||
public static PIGEONGOOD: number = 21;
|
||||
public static PIGEONEVIL: number = 22;
|
||||
public static DEMONMONKEY: number = 23;
|
||||
public static BABYBEAR: number = 24;
|
||||
public static BABYTERRIER: number = 25;
|
||||
public static GNOME: number = 26;
|
||||
public static LEPRECHAUN: number = 27;
|
||||
public static KITTENBABY: number = 28;
|
||||
public static PUPPYBABY: number = 29;
|
||||
public static PIGLETNBABY: number = 30;
|
||||
public static HALOOMPA: number = 31;
|
||||
public static FOOLS: number = 32;
|
||||
public static PTEROSAUR: number = 33;
|
||||
public static VELOCIRAPTOR: number = 34;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export class RoomControllerLevel
|
||||
{
|
||||
public static NONE: number = 0;
|
||||
public static GUEST: number = 1;
|
||||
public static GUILD_MEMBER: number = 2;
|
||||
public static GUILD_ADMIN: number = 3;
|
||||
public static ROOM_OWNER: number = 4;
|
||||
public static MODERATOR: number = 5;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
export class RoomTradingLevelEnum
|
||||
{
|
||||
public static NO_TRADING: number = 0;
|
||||
public static ROOM_CONTROLLER_REQUIRED: number = 1;
|
||||
public static FREE_TRADING: number = 2;
|
||||
|
||||
|
||||
public static getLocalizationKey(k: number): string
|
||||
{
|
||||
switch(k)
|
||||
{
|
||||
case RoomTradingLevelEnum.FREE_TRADING:
|
||||
return '${trading.mode.free}';
|
||||
case RoomTradingLevelEnum.ROOM_CONTROLLER_REQUIRED:
|
||||
return '${trading.mode.controller}';
|
||||
case RoomTradingLevelEnum.NO_TRADING:
|
||||
return '${trading.mode.not.allowed}';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
export class SecurityLevel
|
||||
{
|
||||
public static SUPER_USER: number = 9;
|
||||
public static ADMINISTRATOR: number = 8;
|
||||
public static COMMUNITY: number = 7;
|
||||
public static PLAYER_SUPPORT: number = 6;
|
||||
public static MODERATOR: number = 5;
|
||||
public static EMPLOYEE: number = 4;
|
||||
public static BUS_PARTNER: number = 3;
|
||||
public static PARTNER: number = 2;
|
||||
public static CELEBRITY: number = 1;
|
||||
public static NONE: number = 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export * from './GenericErrorEnum';
|
||||
export * from './NoobnessLevelEnum';
|
||||
export * from './PetType';
|
||||
export * from './RoomControllerLevel';
|
||||
export * from './RoomTradingLevelEnum';
|
||||
export * from './SecurityLevel';
|
||||
@@ -0,0 +1,25 @@
|
||||
export * from './BreedingPetInfo';
|
||||
export * from './FurnitureType';
|
||||
export * from './IFurnitureData';
|
||||
export * from './IFurnitureDataListener';
|
||||
export * from './IGroupInformationManager';
|
||||
export * from './IIgnoredUsersManager';
|
||||
export * from './IPetCustomPart';
|
||||
export * from './IPollChoice';
|
||||
export * from './IPollQuestion';
|
||||
export * from './IProductData';
|
||||
export * from './IProductDataListener';
|
||||
export * from './IQuestion';
|
||||
export * from './IRoomHandlerListener';
|
||||
export * from './IRoomModerationSettings';
|
||||
export * from './IRoomPetData';
|
||||
export * from './IRoomSession';
|
||||
export * from './IRoomSessionManager';
|
||||
export * from './IRoomUserData';
|
||||
export * from './ISessionDataManager';
|
||||
export * from './IUserDataManager';
|
||||
export * from './PetBreedingResultData';
|
||||
export * from './PetCustomPart';
|
||||
export * from './PetFigureData';
|
||||
export * from './RarityCategoryData';
|
||||
export * from './enum';
|
||||
Reference in New Issue
Block a user