You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
Sync renderer safety push
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
getValueWithParameter(key: string, parameter: string, replacement: string): string;
|
getValueWithParameter(key: string, parameter: string, replacement: string): string;
|
||||||
getValueWithParameters(key: string, parameters: string[], replacements: string[]): string;
|
getValueWithParameters(key: string, parameters: string[], replacements: string[]): string;
|
||||||
setValue(key: string, value: string): void;
|
setValue(key: string, value: string): void;
|
||||||
|
setOverrideValues(values: Map<string, string>): void;
|
||||||
|
clearOverrideValues(): void;
|
||||||
registerParameter(key: string, parameter: string, value: string): void;
|
registerParameter(key: string, parameter: string, value: string): void;
|
||||||
getBadgeName(key: string): string;
|
getBadgeName(key: string): string;
|
||||||
getBadgeDesc(key: string): string;
|
getBadgeDesc(key: string): string;
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ export interface IRoomUserData
|
|||||||
sex: string;
|
sex: string;
|
||||||
figure: string;
|
figure: string;
|
||||||
custom: string;
|
custom: string;
|
||||||
|
nickIcon: string;
|
||||||
|
prefixText: string;
|
||||||
|
prefixColor: string;
|
||||||
|
prefixIcon: string;
|
||||||
|
prefixEffect: string;
|
||||||
|
prefixFont: string;
|
||||||
|
displayOrder: string;
|
||||||
webID: number;
|
webID: number;
|
||||||
groupId: number;
|
groupId: number;
|
||||||
groupName: string;
|
groupName: string;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export interface ISessionDataManager
|
|||||||
{
|
{
|
||||||
init(): Promise<void>;
|
init(): Promise<void>;
|
||||||
getAllFurnitureData(): IFurnitureData[];
|
getAllFurnitureData(): IFurnitureData[];
|
||||||
|
applyFurnitureDataOverrides(url: string): Promise<void>;
|
||||||
|
clearFurnitureDataOverrides(): void;
|
||||||
getFloorItemData(id: number): IFurnitureData;
|
getFloorItemData(id: number): IFurnitureData;
|
||||||
getFloorItemDataByName(name: string): IFurnitureData;
|
getFloorItemDataByName(name: string): IFurnitureData;
|
||||||
getWallItemData(id: number): IFurnitureData;
|
getWallItemData(id: number): IFurnitureData;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ export interface IUserDataManager
|
|||||||
updateFigure(roomIndex: number, figure: string, sex: string, hasSaddle: boolean, isRiding: boolean): void;
|
updateFigure(roomIndex: number, figure: string, sex: string, hasSaddle: boolean, isRiding: boolean): void;
|
||||||
updateName(roomIndex: number, name: string): void;
|
updateName(roomIndex: number, name: string): void;
|
||||||
updateMotto(roomIndex: number, custom: string): void;
|
updateMotto(roomIndex: number, custom: string): void;
|
||||||
|
updateNickIcon(roomIndex: number, nickIcon: string): void;
|
||||||
|
updateCustomization(roomIndex: number, nickIcon: string, prefixText: string, prefixColor: string, prefixIcon: string, prefixEffect: string, prefixFont: string, displayOrder: string): void;
|
||||||
updateAchievementScore(roomIndex: number, score: number): void;
|
updateAchievementScore(roomIndex: number, score: number): void;
|
||||||
updatePetLevel(roomIndex: number, level: number): void;
|
updatePetLevel(roomIndex: number, level: number): void;
|
||||||
updatePetBreedingStatus(roomIndex: number, canBreed: boolean, canHarvest: boolean, canRevive: boolean, hasBreedingPermission: boolean): void;
|
updatePetBreedingStatus(roomIndex: number, canBreed: boolean, canHarvest: boolean, canRevive: boolean, hasBreedingPermission: boolean): void;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -76,6 +76,7 @@ export * from './messages/incoming/roomsettings';
|
|||||||
export * from './messages/incoming/security';
|
export * from './messages/incoming/security';
|
||||||
export * from './messages/incoming/sound';
|
export * from './messages/incoming/sound';
|
||||||
export * from './messages/incoming/talent';
|
export * from './messages/incoming/talent';
|
||||||
|
export * from './messages/incoming/translation';
|
||||||
export * from './messages/incoming/user';
|
export * from './messages/incoming/user';
|
||||||
export * from './messages/incoming/user/access';
|
export * from './messages/incoming/user/access';
|
||||||
export * from './messages/incoming/user/data';
|
export * from './messages/incoming/user/data';
|
||||||
@@ -153,6 +154,7 @@ export * from './messages/outgoing/roomsettings';
|
|||||||
export * from './messages/outgoing/sound';
|
export * from './messages/outgoing/sound';
|
||||||
export * from './messages/outgoing/talent';
|
export * from './messages/outgoing/talent';
|
||||||
export * from './messages/outgoing/tracking';
|
export * from './messages/outgoing/tracking';
|
||||||
|
export * from './messages/outgoing/translation';
|
||||||
export * from './messages/outgoing/user';
|
export * from './messages/outgoing/user';
|
||||||
export * from './messages/outgoing/user/data';
|
export * from './messages/outgoing/user/data';
|
||||||
export * from './messages/outgoing/user/inventory';
|
export * from './messages/outgoing/user/inventory';
|
||||||
@@ -233,6 +235,7 @@ export * from './messages/parser/roomsettings';
|
|||||||
export * from './messages/parser/security';
|
export * from './messages/parser/security';
|
||||||
export * from './messages/parser/sound';
|
export * from './messages/parser/sound';
|
||||||
export * from './messages/parser/talent';
|
export * from './messages/parser/talent';
|
||||||
|
export * from './messages/parser/translation';
|
||||||
export * from './messages/parser/user';
|
export * from './messages/parser/user';
|
||||||
export * from './messages/parser/user/access';
|
export * from './messages/parser/user/access';
|
||||||
export * from './messages/parser/user/data';
|
export * from './messages/parser/user/data';
|
||||||
|
|||||||
@@ -274,6 +274,8 @@ export class IncomingHeader
|
|||||||
public static WIRED_USER_VARIABLES_DATA = 5103;
|
public static WIRED_USER_VARIABLES_DATA = 5103;
|
||||||
public static CONF_INVIS_STATE = 5104;
|
public static CONF_INVIS_STATE = 5104;
|
||||||
public static HANDITEM_BLOCK_STATE = 5105;
|
public static HANDITEM_BLOCK_STATE = 5105;
|
||||||
|
public static TRANSLATION_LANGUAGES = 5106;
|
||||||
|
public static TRANSLATION_RESULT = 5107;
|
||||||
public static WIRED_OPEN = 1830;
|
public static WIRED_OPEN = 1830;
|
||||||
public static WIRED_REWARD = 178;
|
public static WIRED_REWARD = 178;
|
||||||
public static WIRED_SAVE = 1155;
|
public static WIRED_SAVE = 1155;
|
||||||
@@ -495,4 +497,5 @@ export class IncomingHeader
|
|||||||
public static USER_PREFIXES = 7001;
|
public static USER_PREFIXES = 7001;
|
||||||
public static PREFIX_RECEIVED = 7002;
|
public static PREFIX_RECEIVED = 7002;
|
||||||
public static ACTIVE_PREFIX_UPDATED = 7003;
|
public static ACTIVE_PREFIX_UPDATED = 7003;
|
||||||
|
public static USER_NICK_ICONS = 7004;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export * from './roomsettings';
|
|||||||
export * from './security';
|
export * from './security';
|
||||||
export * from './sound';
|
export * from './sound';
|
||||||
export * from './talent';
|
export * from './talent';
|
||||||
|
export * from './translation';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
export * from './user/access';
|
export * from './user/access';
|
||||||
export * from './user/data';
|
export * from './user/data';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export * from './badges';
|
|||||||
export * from './clothes';
|
export * from './clothes';
|
||||||
export * from './furni';
|
export * from './furni';
|
||||||
export * from './furni/gifts';
|
export * from './furni/gifts';
|
||||||
|
export * from './nickicons';
|
||||||
export * from './pets';
|
export * from './pets';
|
||||||
export * from './prefixes';
|
export * from './prefixes';
|
||||||
export * from './trading';
|
export * from './trading';
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { UserNickIconsParser } from '../../../parser';
|
||||||
|
|
||||||
|
export class UserNickIconsEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, UserNickIconsParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): UserNickIconsParser
|
||||||
|
{
|
||||||
|
return this.parser as UserNickIconsParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './UserNickIconsEvent';
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { TranslationLanguagesParser } from '../../parser';
|
||||||
|
|
||||||
|
export class TranslationLanguagesEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, TranslationLanguagesParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): TranslationLanguagesParser
|
||||||
|
{
|
||||||
|
return this.parser as TranslationLanguagesParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { TranslationResultParser } from '../../parser';
|
||||||
|
|
||||||
|
export class TranslationResultEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, TranslationResultParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): TranslationResultParser
|
||||||
|
{
|
||||||
|
return this.parser as TranslationResultParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './TranslationLanguagesEvent';
|
||||||
|
export * from './TranslationResultEvent';
|
||||||
@@ -278,6 +278,8 @@ export class OutgoingHeader
|
|||||||
public static WIRED_USER_VARIABLE_UPDATE = 10025;
|
public static WIRED_USER_VARIABLE_UPDATE = 10025;
|
||||||
public static WIRED_USER_VARIABLE_MANAGE = 10026;
|
public static WIRED_USER_VARIABLE_MANAGE = 10026;
|
||||||
public static WIRED_USER_INSPECT_MOVE = 10027;
|
public static WIRED_USER_INSPECT_MOVE = 10027;
|
||||||
|
public static TRANSLATION_LANGUAGES_REQUEST = 10032;
|
||||||
|
public static TRANSLATION_TEXT_REQUEST = 10033;
|
||||||
public static WIRED_OPEN = 768;
|
public static WIRED_OPEN = 768;
|
||||||
public static WIRED_TRIGGER_SAVE = 1520;
|
public static WIRED_TRIGGER_SAVE = 1520;
|
||||||
public static GET_ITEM_DATA = 3964;
|
public static GET_ITEM_DATA = 3964;
|
||||||
@@ -510,4 +512,9 @@ export class OutgoingHeader
|
|||||||
public static SET_ACTIVE_PREFIX = 7012;
|
public static SET_ACTIVE_PREFIX = 7012;
|
||||||
public static DELETE_PREFIX = 7013;
|
public static DELETE_PREFIX = 7013;
|
||||||
public static PURCHASE_PREFIX = 7014;
|
public static PURCHASE_PREFIX = 7014;
|
||||||
|
public static REQUEST_NICK_ICONS = 7015;
|
||||||
|
public static PURCHASE_NICK_ICON = 7016;
|
||||||
|
public static SET_ACTIVE_NICK_ICON = 7017;
|
||||||
|
public static PURCHASE_CATALOG_PREFIX = 7018;
|
||||||
|
public static SET_DISPLAY_ORDER = 7019;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export * from './roomsettings';
|
|||||||
export * from './sound';
|
export * from './sound';
|
||||||
export * from './talent';
|
export * from './talent';
|
||||||
export * from './tracking';
|
export * from './tracking';
|
||||||
|
export * from './translation';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
export * from './user/data';
|
export * from './user/data';
|
||||||
export * from './user/inventory';
|
export * from './user/inventory';
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export * from './avatareffect';
|
|||||||
export * from './badges';
|
export * from './badges';
|
||||||
export * from './bots';
|
export * from './bots';
|
||||||
export * from './furni';
|
export * from './furni';
|
||||||
|
export * from './nickicons';
|
||||||
export * from './pets';
|
export * from './pets';
|
||||||
export * from './prefixes';
|
export * from './prefixes';
|
||||||
export * from './trading';
|
export * from './trading';
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class PurchaseNickIconComposer implements IMessageComposer<ConstructorParameters<typeof PurchaseNickIconComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof PurchaseNickIconComposer>;
|
||||||
|
|
||||||
|
constructor(iconKey: string)
|
||||||
|
{
|
||||||
|
this._data = [ iconKey ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class RequestNickIconsComposer implements IMessageComposer<ConstructorParameters<typeof RequestNickIconsComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof RequestNickIconsComposer>;
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
this._data = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class SetActiveNickIconComposer implements IMessageComposer<ConstructorParameters<typeof SetActiveNickIconComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof SetActiveNickIconComposer>;
|
||||||
|
|
||||||
|
constructor(iconId: number)
|
||||||
|
{
|
||||||
|
this._data = [ iconId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export * from './PurchaseNickIconComposer';
|
||||||
|
export * from './RequestNickIconsComposer';
|
||||||
|
export * from './SetActiveNickIconComposer';
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '../../../../../api';
|
||||||
|
|
||||||
|
export class PurchaseCatalogPrefixComposer implements IMessageComposer<ConstructorParameters<typeof PurchaseCatalogPrefixComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof PurchaseCatalogPrefixComposer>;
|
||||||
|
|
||||||
|
constructor(prefixId: number)
|
||||||
|
{
|
||||||
|
this._data = [ prefixId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
this._data = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -4,9 +4,9 @@ export class PurchasePrefixComposer implements IMessageComposer<ConstructorParam
|
|||||||
{
|
{
|
||||||
private _data: ConstructorParameters<typeof PurchasePrefixComposer>;
|
private _data: ConstructorParameters<typeof PurchasePrefixComposer>;
|
||||||
|
|
||||||
constructor(text: string, color: string, icon: string = '', effect: string = '')
|
constructor(text: string, color: string, icon: string = '', effect: string = '', font: string = '')
|
||||||
{
|
{
|
||||||
this._data = [ text, color, icon, effect ];
|
this._data = [ text, color, icon, effect, font ];
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMessageArray()
|
public getMessageArray()
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '../../../../../api';
|
||||||
|
|
||||||
|
export class SetDisplayOrderComposer implements IMessageComposer<ConstructorParameters<typeof SetDisplayOrderComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof SetDisplayOrderComposer>;
|
||||||
|
|
||||||
|
constructor(displayOrder: string)
|
||||||
|
{
|
||||||
|
this._data = [ displayOrder ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
this._data = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
export * from './DeletePrefixComposer';
|
export * from './DeletePrefixComposer';
|
||||||
|
export * from './PurchaseCatalogPrefixComposer';
|
||||||
export * from './PurchasePrefixComposer';
|
export * from './PurchasePrefixComposer';
|
||||||
export * from './RequestPrefixesComposer';
|
export * from './RequestPrefixesComposer';
|
||||||
|
export * from './SetDisplayOrderComposer';
|
||||||
export * from './SetActivePrefixComposer';
|
export * from './SetActivePrefixComposer';
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class TranslationLanguagesRequestComposer implements IMessageComposer<ConstructorParameters<typeof TranslationLanguagesRequestComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof TranslationLanguagesRequestComposer>;
|
||||||
|
|
||||||
|
constructor(displayLanguage: string = 'en')
|
||||||
|
{
|
||||||
|
this._data = [displayLanguage];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class TranslationTextRequestComposer implements IMessageComposer<ConstructorParameters<typeof TranslationTextRequestComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof TranslationTextRequestComposer>;
|
||||||
|
|
||||||
|
constructor(requestId: number, text: string, targetLanguage: string)
|
||||||
|
{
|
||||||
|
this._data = [requestId, text, targetLanguage];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './TranslationLanguagesRequestComposer';
|
||||||
|
export * from './TranslationTextRequestComposer';
|
||||||
@@ -69,6 +69,7 @@ export * from './roomsettings';
|
|||||||
export * from './security';
|
export * from './security';
|
||||||
export * from './sound';
|
export * from './sound';
|
||||||
export * from './talent';
|
export * from './talent';
|
||||||
|
export * from './translation';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
export * from './user/access';
|
export * from './user/access';
|
||||||
export * from './user/data';
|
export * from './user/data';
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export * from './avatareffect';
|
|||||||
export * from './badges';
|
export * from './badges';
|
||||||
export * from './clothing';
|
export * from './clothing';
|
||||||
export * from './furniture';
|
export * from './furniture';
|
||||||
|
export * from './nickicons';
|
||||||
export * from './pets';
|
export * from './pets';
|
||||||
export * from './prefixes';
|
export * from './prefixes';
|
||||||
export * from './purse';
|
export * from './purse';
|
||||||
|
|||||||
+222
@@ -0,0 +1,222 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export interface INickIconData
|
||||||
|
{
|
||||||
|
iconKey: string;
|
||||||
|
displayName: string;
|
||||||
|
points: number;
|
||||||
|
pointsType: number;
|
||||||
|
owned: boolean;
|
||||||
|
active: boolean;
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ICustomizePrefixCatalogData
|
||||||
|
{
|
||||||
|
id: number;
|
||||||
|
displayName: string;
|
||||||
|
text: string;
|
||||||
|
color: string;
|
||||||
|
icon: string;
|
||||||
|
effect: string;
|
||||||
|
font: string;
|
||||||
|
points: number;
|
||||||
|
pointsType: number;
|
||||||
|
owned: boolean;
|
||||||
|
active: boolean;
|
||||||
|
ownedPrefixId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ICustomizeOwnedPrefixData
|
||||||
|
{
|
||||||
|
id: number;
|
||||||
|
displayName: string;
|
||||||
|
text: string;
|
||||||
|
color: string;
|
||||||
|
icon: string;
|
||||||
|
effect: string;
|
||||||
|
font: string;
|
||||||
|
active: boolean;
|
||||||
|
isCustom: boolean;
|
||||||
|
points: number;
|
||||||
|
pointsType: number;
|
||||||
|
catalogPrefixId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UserNickIconsParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _nickIcons: INickIconData[];
|
||||||
|
private _displayOrder: string;
|
||||||
|
private _customPrefixMaxLength: number;
|
||||||
|
private _customPrefixPriceCredits: number;
|
||||||
|
private _customPrefixPricePoints: number;
|
||||||
|
private _customPrefixPointsType: number;
|
||||||
|
private _customPrefixFontPriceCredits: number;
|
||||||
|
private _customPrefixFontPricePoints: number;
|
||||||
|
private _customPrefixFontPointsType: number;
|
||||||
|
private _prefixCatalog: ICustomizePrefixCatalogData[];
|
||||||
|
private _ownedPrefixes: ICustomizeOwnedPrefixData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._nickIcons = [];
|
||||||
|
this._displayOrder = 'icon-prefix-name';
|
||||||
|
this._customPrefixMaxLength = 15;
|
||||||
|
this._customPrefixPriceCredits = 0;
|
||||||
|
this._customPrefixPricePoints = 0;
|
||||||
|
this._customPrefixPointsType = 0;
|
||||||
|
this._customPrefixFontPriceCredits = 0;
|
||||||
|
this._customPrefixFontPricePoints = 0;
|
||||||
|
this._customPrefixFontPointsType = 0;
|
||||||
|
this._prefixCatalog = [];
|
||||||
|
this._ownedPrefixes = [];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._nickIcons = [];
|
||||||
|
this._displayOrder = 'icon-prefix-name';
|
||||||
|
this._customPrefixMaxLength = 15;
|
||||||
|
this._customPrefixPriceCredits = 0;
|
||||||
|
this._customPrefixPricePoints = 0;
|
||||||
|
this._customPrefixPointsType = 0;
|
||||||
|
this._customPrefixFontPriceCredits = 0;
|
||||||
|
this._customPrefixFontPricePoints = 0;
|
||||||
|
this._customPrefixFontPointsType = 0;
|
||||||
|
this._prefixCatalog = [];
|
||||||
|
this._ownedPrefixes = [];
|
||||||
|
|
||||||
|
let count = wrapper.readInt();
|
||||||
|
|
||||||
|
while(count > 0)
|
||||||
|
{
|
||||||
|
this._nickIcons.push({
|
||||||
|
iconKey: wrapper.readString(),
|
||||||
|
displayName: wrapper.readString(),
|
||||||
|
points: wrapper.readInt(),
|
||||||
|
pointsType: wrapper.readInt(),
|
||||||
|
owned: (wrapper.readInt() === 1),
|
||||||
|
active: (wrapper.readInt() === 1),
|
||||||
|
id: wrapper.readInt()
|
||||||
|
});
|
||||||
|
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(wrapper.bytesAvailable)
|
||||||
|
{
|
||||||
|
this._displayOrder = wrapper.readString();
|
||||||
|
this._customPrefixMaxLength = wrapper.readInt();
|
||||||
|
this._customPrefixPriceCredits = wrapper.readInt();
|
||||||
|
this._customPrefixPricePoints = wrapper.readInt();
|
||||||
|
this._customPrefixPointsType = wrapper.readInt();
|
||||||
|
this._customPrefixFontPriceCredits = wrapper.readInt();
|
||||||
|
this._customPrefixFontPricePoints = wrapper.readInt();
|
||||||
|
this._customPrefixFontPointsType = wrapper.readInt();
|
||||||
|
|
||||||
|
let catalogCount = wrapper.readInt();
|
||||||
|
|
||||||
|
while(catalogCount > 0)
|
||||||
|
{
|
||||||
|
this._prefixCatalog.push({
|
||||||
|
id: wrapper.readInt(),
|
||||||
|
displayName: wrapper.readString(),
|
||||||
|
text: wrapper.readString(),
|
||||||
|
color: wrapper.readString(),
|
||||||
|
icon: wrapper.readString(),
|
||||||
|
effect: wrapper.readString(),
|
||||||
|
font: wrapper.readString(),
|
||||||
|
points: wrapper.readInt(),
|
||||||
|
pointsType: wrapper.readInt(),
|
||||||
|
owned: (wrapper.readInt() === 1),
|
||||||
|
active: (wrapper.readInt() === 1),
|
||||||
|
ownedPrefixId: wrapper.readInt()
|
||||||
|
});
|
||||||
|
|
||||||
|
catalogCount--;
|
||||||
|
}
|
||||||
|
|
||||||
|
let ownedCount = wrapper.readInt();
|
||||||
|
|
||||||
|
while(ownedCount > 0)
|
||||||
|
{
|
||||||
|
this._ownedPrefixes.push({
|
||||||
|
id: wrapper.readInt(),
|
||||||
|
displayName: wrapper.readString(),
|
||||||
|
text: wrapper.readString(),
|
||||||
|
color: wrapper.readString(),
|
||||||
|
icon: wrapper.readString(),
|
||||||
|
effect: wrapper.readString(),
|
||||||
|
font: wrapper.readString(),
|
||||||
|
active: (wrapper.readInt() === 1),
|
||||||
|
isCustom: (wrapper.readInt() === 1),
|
||||||
|
points: wrapper.readInt(),
|
||||||
|
pointsType: wrapper.readInt(),
|
||||||
|
catalogPrefixId: wrapper.readInt()
|
||||||
|
});
|
||||||
|
|
||||||
|
ownedCount--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get nickIcons(): INickIconData[]
|
||||||
|
{
|
||||||
|
return this._nickIcons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixMaxLength(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixMaxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixPriceCredits(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixPriceCredits;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixPricePoints(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixPricePoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixPointsType(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixPointsType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixFontPriceCredits(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixFontPriceCredits;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixFontPricePoints(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixFontPricePoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get customPrefixFontPointsType(): number
|
||||||
|
{
|
||||||
|
return this._customPrefixFontPointsType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixCatalog(): ICustomizePrefixCatalogData[]
|
||||||
|
{
|
||||||
|
return this._prefixCatalog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get ownedPrefixes(): ICustomizeOwnedPrefixData[]
|
||||||
|
{
|
||||||
|
return this._ownedPrefixes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './UserNickIconsParser';
|
||||||
+4
@@ -7,6 +7,7 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
|||||||
private _color: string;
|
private _color: string;
|
||||||
private _icon: string;
|
private _icon: string;
|
||||||
private _effect: string;
|
private _effect: string;
|
||||||
|
private _font: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -15,6 +16,7 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
|||||||
this._color = '';
|
this._color = '';
|
||||||
this._icon = '';
|
this._icon = '';
|
||||||
this._effect = '';
|
this._effect = '';
|
||||||
|
this._font = '';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
|||||||
this._color = wrapper.readString();
|
this._color = wrapper.readString();
|
||||||
this._icon = wrapper.readString();
|
this._icon = wrapper.readString();
|
||||||
this._effect = wrapper.readString();
|
this._effect = wrapper.readString();
|
||||||
|
this._font = wrapper.readString();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -36,4 +39,5 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
|||||||
public get color(): string { return this._color; }
|
public get color(): string { return this._color; }
|
||||||
public get icon(): string { return this._icon; }
|
public get icon(): string { return this._icon; }
|
||||||
public get effect(): string { return this._effect; }
|
public get effect(): string { return this._effect; }
|
||||||
|
public get font(): string { return this._font; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export class PrefixReceivedParser implements IMessageParser
|
|||||||
private _color: string;
|
private _color: string;
|
||||||
private _icon: string;
|
private _icon: string;
|
||||||
private _effect: string;
|
private _effect: string;
|
||||||
|
private _font: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -15,6 +16,7 @@ export class PrefixReceivedParser implements IMessageParser
|
|||||||
this._color = '';
|
this._color = '';
|
||||||
this._icon = '';
|
this._icon = '';
|
||||||
this._effect = '';
|
this._effect = '';
|
||||||
|
this._font = '';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ export class PrefixReceivedParser implements IMessageParser
|
|||||||
this._color = wrapper.readString();
|
this._color = wrapper.readString();
|
||||||
this._icon = wrapper.readString();
|
this._icon = wrapper.readString();
|
||||||
this._effect = wrapper.readString();
|
this._effect = wrapper.readString();
|
||||||
|
this._font = wrapper.readString();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -36,4 +39,5 @@ export class PrefixReceivedParser implements IMessageParser
|
|||||||
public get color(): string { return this._color; }
|
public get color(): string { return this._color; }
|
||||||
public get icon(): string { return this._icon; }
|
public get icon(): string { return this._icon; }
|
||||||
public get effect(): string { return this._effect; }
|
public get effect(): string { return this._effect; }
|
||||||
|
public get font(): string { return this._font; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface IPrefixData
|
|||||||
color: string;
|
color: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
effect: string;
|
effect: string;
|
||||||
|
font: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ export class UserPrefixesParser implements IMessageParser
|
|||||||
color: wrapper.readString(),
|
color: wrapper.readString(),
|
||||||
icon: wrapper.readString(),
|
icon: wrapper.readString(),
|
||||||
effect: wrapper.readString(),
|
effect: wrapper.readString(),
|
||||||
|
font: wrapper.readString(),
|
||||||
active: wrapper.readInt() === 1
|
active: wrapper.readInt() === 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
private _backgroundId: number;
|
private _backgroundId: number;
|
||||||
private _standId: number;
|
private _standId: number;
|
||||||
private _overlayId: number;
|
private _overlayId: number;
|
||||||
|
private _nickIcon: string;
|
||||||
|
private _prefixText: string;
|
||||||
|
private _prefixColor: string;
|
||||||
|
private _prefixIcon: string;
|
||||||
|
private _prefixEffect: string;
|
||||||
|
private _prefixFont: string;
|
||||||
|
private _displayOrder: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -21,6 +28,13 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
this._backgroundId = 0;
|
this._backgroundId = 0;
|
||||||
this._standId = 0;
|
this._standId = 0;
|
||||||
this._overlayId = 0;
|
this._overlayId = 0;
|
||||||
|
this._nickIcon = '';
|
||||||
|
this._prefixText = '';
|
||||||
|
this._prefixColor = '';
|
||||||
|
this._prefixIcon = '';
|
||||||
|
this._prefixEffect = '';
|
||||||
|
this._prefixFont = '';
|
||||||
|
this._displayOrder = 'icon-prefix-name';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -37,6 +51,13 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
this._backgroundId = wrapper.readInt();
|
this._backgroundId = wrapper.readInt();
|
||||||
this._standId = wrapper.readInt();
|
this._standId = wrapper.readInt();
|
||||||
this._overlayId = wrapper.readInt();
|
this._overlayId = wrapper.readInt();
|
||||||
|
this._nickIcon = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._prefixText = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._prefixColor = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._prefixIcon = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._prefixEffect = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._prefixFont = (wrapper.bytesAvailable ? wrapper.readString() : '');
|
||||||
|
this._displayOrder = (wrapper.bytesAvailable ? wrapper.readString() : 'icon-prefix-name');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -80,4 +101,39 @@ export class RoomUnitInfoParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixText(): string
|
||||||
|
{
|
||||||
|
return this._prefixText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixColor(): string
|
||||||
|
{
|
||||||
|
return this._prefixColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixIcon(): string
|
||||||
|
{
|
||||||
|
return this._prefixIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixEffect(): string
|
||||||
|
{
|
||||||
|
return this._prefixEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -75,6 +75,13 @@ export class RoomUnitParser implements IMessageParser
|
|||||||
user.figure = figure;
|
user.figure = figure;
|
||||||
user.activityPoints = wrapper.readInt();
|
user.activityPoints = wrapper.readInt();
|
||||||
user.isModerator = wrapper.readBoolean();
|
user.isModerator = wrapper.readBoolean();
|
||||||
|
user.nickIcon = wrapper.readString();
|
||||||
|
user.prefixText = wrapper.readString();
|
||||||
|
user.prefixColor = wrapper.readString();
|
||||||
|
user.prefixIcon = wrapper.readString();
|
||||||
|
user.prefixEffect = wrapper.readString();
|
||||||
|
user.prefixFont = wrapper.readString();
|
||||||
|
user.displayOrder = wrapper.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type === 2)
|
else if(type === 2)
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ export class UserMessageData
|
|||||||
private _sex: string = '';
|
private _sex: string = '';
|
||||||
private _figure: string = '';
|
private _figure: string = '';
|
||||||
private _custom: string = '';
|
private _custom: string = '';
|
||||||
|
private _nickIcon: string = '';
|
||||||
|
private _prefixText: string = '';
|
||||||
|
private _prefixColor: string = '';
|
||||||
|
private _prefixIcon: string = '';
|
||||||
|
private _prefixEffect: string = '';
|
||||||
|
private _prefixFont: string = '';
|
||||||
|
private _displayOrder: string = 'icon-prefix-name';
|
||||||
private _activityPoints: number = 0;
|
private _activityPoints: number = 0;
|
||||||
private _background: number = 0;
|
private _background: number = 0;
|
||||||
private _stand: number = 0;
|
private _stand: number = 0;
|
||||||
@@ -437,6 +444,97 @@ export class UserMessageData
|
|||||||
return this._isModerator;
|
return this._isModerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set nickIcon(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._nickIcon = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixText(): string
|
||||||
|
{
|
||||||
|
return this._prefixText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixText(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._prefixText = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixColor(): string
|
||||||
|
{
|
||||||
|
return this._prefixColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixColor(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._prefixColor = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixIcon(): string
|
||||||
|
{
|
||||||
|
return this._prefixIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixIcon(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._prefixIcon = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixEffect(): string
|
||||||
|
{
|
||||||
|
return this._prefixEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixEffect(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._prefixEffect = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixFont(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._prefixFont = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set displayOrder(k: string)
|
||||||
|
{
|
||||||
|
if(!this._isReadOnly)
|
||||||
|
{
|
||||||
|
this._displayOrder = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public set isModerator(k: boolean)
|
public set isModerator(k: boolean)
|
||||||
{
|
{
|
||||||
if(!this._isReadOnly)
|
if(!this._isReadOnly)
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ export class RoomUnitChatParser implements IMessageParser
|
|||||||
private _prefixColor: string;
|
private _prefixColor: string;
|
||||||
private _prefixIcon: string;
|
private _prefixIcon: string;
|
||||||
private _prefixEffect: string;
|
private _prefixEffect: string;
|
||||||
|
private _prefixFont: string;
|
||||||
|
private _nickIcon: string;
|
||||||
|
private _displayOrder: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -27,6 +30,9 @@ export class RoomUnitChatParser implements IMessageParser
|
|||||||
this._prefixColor = '';
|
this._prefixColor = '';
|
||||||
this._prefixIcon = '';
|
this._prefixIcon = '';
|
||||||
this._prefixEffect = '';
|
this._prefixEffect = '';
|
||||||
|
this._prefixFont = '';
|
||||||
|
this._nickIcon = '';
|
||||||
|
this._displayOrder = 'icon-prefix-name';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -48,6 +54,9 @@ export class RoomUnitChatParser implements IMessageParser
|
|||||||
this._prefixColor = wrapper.readString();
|
this._prefixColor = wrapper.readString();
|
||||||
this._prefixIcon = wrapper.readString();
|
this._prefixIcon = wrapper.readString();
|
||||||
this._prefixEffect = wrapper.readString();
|
this._prefixEffect = wrapper.readString();
|
||||||
|
this._prefixFont = wrapper.readString();
|
||||||
|
this._nickIcon = wrapper.readString();
|
||||||
|
this._displayOrder = (wrapper.bytesAvailable ? wrapper.readString() : 'icon-prefix-name');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -124,4 +133,19 @@ export class RoomUnitChatParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._prefixEffect;
|
return this._prefixEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export interface ITranslationLanguageData
|
||||||
|
{
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TranslationLanguagesParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _success: boolean;
|
||||||
|
private _errorMessage: string;
|
||||||
|
private _languages: ITranslationLanguageData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._success = false;
|
||||||
|
this._errorMessage = '';
|
||||||
|
this._languages = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._success = wrapper.readBoolean();
|
||||||
|
this._errorMessage = wrapper.readString();
|
||||||
|
this._languages = [];
|
||||||
|
|
||||||
|
const totalLanguages = wrapper.readInt();
|
||||||
|
|
||||||
|
for(let index = 0; index < totalLanguages; index++)
|
||||||
|
{
|
||||||
|
this._languages.push({
|
||||||
|
code: wrapper.readString(),
|
||||||
|
name: wrapper.readString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get success(): boolean
|
||||||
|
{
|
||||||
|
return this._success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get errorMessage(): string
|
||||||
|
{
|
||||||
|
return this._errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get languages(): ITranslationLanguageData[]
|
||||||
|
{
|
||||||
|
return this._languages;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class TranslationResultParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _requestId: number;
|
||||||
|
private _success: boolean;
|
||||||
|
private _errorMessage: string;
|
||||||
|
private _originalText: string;
|
||||||
|
private _translatedText: string;
|
||||||
|
private _detectedLanguage: string;
|
||||||
|
private _targetLanguage: string;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._requestId = 0;
|
||||||
|
this._success = false;
|
||||||
|
this._errorMessage = '';
|
||||||
|
this._originalText = '';
|
||||||
|
this._translatedText = '';
|
||||||
|
this._detectedLanguage = '';
|
||||||
|
this._targetLanguage = '';
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._requestId = wrapper.readInt();
|
||||||
|
this._success = wrapper.readBoolean();
|
||||||
|
this._errorMessage = wrapper.readString();
|
||||||
|
this._originalText = wrapper.readString();
|
||||||
|
this._translatedText = wrapper.readString();
|
||||||
|
this._detectedLanguage = wrapper.readString();
|
||||||
|
this._targetLanguage = wrapper.readString();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get requestId(): number
|
||||||
|
{
|
||||||
|
return this._requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get success(): boolean
|
||||||
|
{
|
||||||
|
return this._success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get errorMessage(): string
|
||||||
|
{
|
||||||
|
return this._errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get originalText(): string
|
||||||
|
{
|
||||||
|
return this._originalText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get translatedText(): string
|
||||||
|
{
|
||||||
|
return this._translatedText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get detectedLanguage(): string
|
||||||
|
{
|
||||||
|
return this._detectedLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get targetLanguage(): string
|
||||||
|
{
|
||||||
|
return this._targetLanguage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './TranslationLanguagesParser';
|
||||||
|
export * from './TranslationResultParser';
|
||||||
@@ -19,6 +19,13 @@ export class UserProfileParser implements IMessageParser
|
|||||||
private _backgroundId: number;
|
private _backgroundId: number;
|
||||||
private _standId: number;
|
private _standId: number;
|
||||||
private _overlayId: number;
|
private _overlayId: number;
|
||||||
|
private _nickIcon: string;
|
||||||
|
private _prefixText: string;
|
||||||
|
private _prefixColor: string;
|
||||||
|
private _prefixIcon: string;
|
||||||
|
private _prefixEffect: string;
|
||||||
|
private _prefixFont: string;
|
||||||
|
private _displayOrder: string;
|
||||||
|
|
||||||
public flush(): boolean
|
public flush(): boolean
|
||||||
{
|
{
|
||||||
@@ -38,6 +45,13 @@ export class UserProfileParser implements IMessageParser
|
|||||||
this._backgroundId = 0;
|
this._backgroundId = 0;
|
||||||
this._standId = 0;
|
this._standId = 0;
|
||||||
this._overlayId = 0;
|
this._overlayId = 0;
|
||||||
|
this._nickIcon = '';
|
||||||
|
this._prefixText = '';
|
||||||
|
this._prefixColor = '';
|
||||||
|
this._prefixIcon = '';
|
||||||
|
this._prefixEffect = '';
|
||||||
|
this._prefixFont = '';
|
||||||
|
this._displayOrder = 'icon-prefix-name';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -71,6 +85,21 @@ export class UserProfileParser implements IMessageParser
|
|||||||
this._backgroundId = wrapper.readInt();
|
this._backgroundId = wrapper.readInt();
|
||||||
this._standId = wrapper.readInt();
|
this._standId = wrapper.readInt();
|
||||||
this._overlayId = wrapper.readInt();
|
this._overlayId = wrapper.readInt();
|
||||||
|
|
||||||
|
if(wrapper.bytesAvailable)
|
||||||
|
{
|
||||||
|
this._nickIcon = wrapper.readString();
|
||||||
|
|
||||||
|
if(wrapper.bytesAvailable)
|
||||||
|
{
|
||||||
|
this._prefixText = wrapper.readString();
|
||||||
|
this._prefixColor = wrapper.readString();
|
||||||
|
this._prefixIcon = wrapper.readString();
|
||||||
|
this._prefixEffect = wrapper.readString();
|
||||||
|
this._prefixFont = wrapper.readString();
|
||||||
|
this._displayOrder = wrapper.readString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -155,4 +184,39 @@ export class UserProfileParser implements IMessageParser
|
|||||||
{
|
{
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixText(): string
|
||||||
|
{
|
||||||
|
return this._prefixText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixColor(): string
|
||||||
|
{
|
||||||
|
return this._prefixColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixIcon(): string
|
||||||
|
{
|
||||||
|
return this._prefixIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixEffect(): string
|
||||||
|
{
|
||||||
|
return this._prefixEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ export class ConfigurationManager implements IConfigurationManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(value.indexOf('%timestamp%') >= 0)
|
||||||
|
{
|
||||||
|
value = value.replace(/%timestamp%/gi, Date.now().toString());
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export class RoomSessionChatEvent extends RoomSessionEvent
|
|||||||
private _objectId: number;
|
private _objectId: number;
|
||||||
private _message: string;
|
private _message: string;
|
||||||
private _chatType: number;
|
private _chatType: number;
|
||||||
|
private _chatColours: string;
|
||||||
private _links: string[];
|
private _links: string[];
|
||||||
private _extraParam: number;
|
private _extraParam: number;
|
||||||
private _style: number;
|
private _style: number;
|
||||||
@@ -28,8 +29,11 @@ export class RoomSessionChatEvent extends RoomSessionEvent
|
|||||||
private _prefixColor: string;
|
private _prefixColor: string;
|
||||||
private _prefixIcon: string;
|
private _prefixIcon: string;
|
||||||
private _prefixEffect: string;
|
private _prefixEffect: string;
|
||||||
|
private _prefixFont: string;
|
||||||
|
private _nickIcon: string;
|
||||||
|
private _displayOrder: string;
|
||||||
|
|
||||||
constructor(type: string, session: IRoomSession, objectId: number, message: string, chatType: number, style: number = 0, chatColours: string[], links: string[] = null, extraParam: number = -1, prefixText: string = '', prefixColor: string = '', prefixIcon: string = '', prefixEffect: string = '')
|
constructor(type: string, session: IRoomSession, objectId: number, message: string, chatType: number, style: number = 0, chatColours: string = '', links: string[] = null, extraParam: number = -1, prefixText: string = '', prefixColor: string = '', prefixIcon: string = '', prefixEffect: string = '', prefixFont: string = '', nickIcon: string = '', displayOrder: string = 'icon-prefix-name')
|
||||||
{
|
{
|
||||||
super(type, session);
|
super(type, session);
|
||||||
|
|
||||||
@@ -44,6 +48,9 @@ export class RoomSessionChatEvent extends RoomSessionEvent
|
|||||||
this._prefixColor = prefixColor;
|
this._prefixColor = prefixColor;
|
||||||
this._prefixIcon = prefixIcon;
|
this._prefixIcon = prefixIcon;
|
||||||
this._prefixEffect = prefixEffect;
|
this._prefixEffect = prefixEffect;
|
||||||
|
this._prefixFont = prefixFont;
|
||||||
|
this._nickIcon = nickIcon;
|
||||||
|
this._displayOrder = displayOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get objectId(): number
|
public get objectId(): number
|
||||||
@@ -76,7 +83,7 @@ export class RoomSessionChatEvent extends RoomSessionEvent
|
|||||||
return this._style;
|
return this._style;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get chatColours(): string[]
|
public get chatColours(): string
|
||||||
{
|
{
|
||||||
return this._chatColours;
|
return this._chatColours;
|
||||||
}
|
}
|
||||||
@@ -100,4 +107,19 @@ export class RoomSessionChatEvent extends RoomSessionEvent
|
|||||||
{
|
{
|
||||||
return this._prefixEffect;
|
return this._prefixEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
private _backgroundId: number | null;
|
private _backgroundId: number | null;
|
||||||
private _standId: number | null;
|
private _standId: number | null;
|
||||||
private _overlayId: number | null;
|
private _overlayId: number | null;
|
||||||
|
private _nickIcon: string;
|
||||||
|
private _prefixText: string;
|
||||||
|
private _prefixColor: string;
|
||||||
|
private _prefixIcon: string;
|
||||||
|
private _prefixEffect: string;
|
||||||
|
private _prefixFont: string;
|
||||||
|
private _displayOrder: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
session: IRoomSession,
|
session: IRoomSession,
|
||||||
@@ -22,7 +29,14 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
achievementScore: number,
|
achievementScore: number,
|
||||||
backgroundId: number | null,
|
backgroundId: number | null,
|
||||||
standId: number | null,
|
standId: number | null,
|
||||||
overlayId: number | null
|
overlayId: number | null,
|
||||||
|
nickIcon: string = '',
|
||||||
|
prefixText: string = '',
|
||||||
|
prefixColor: string = '',
|
||||||
|
prefixIcon: string = '',
|
||||||
|
prefixEffect: string = '',
|
||||||
|
prefixFont: string = '',
|
||||||
|
displayOrder: string = 'icon-prefix-name'
|
||||||
) {
|
) {
|
||||||
super(RoomSessionUserFigureUpdateEvent.USER_FIGURE, session);
|
super(RoomSessionUserFigureUpdateEvent.USER_FIGURE, session);
|
||||||
|
|
||||||
@@ -34,6 +48,13 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
this._backgroundId = backgroundId;
|
this._backgroundId = backgroundId;
|
||||||
this._standId = standId;
|
this._standId = standId;
|
||||||
this._overlayId = overlayId;
|
this._overlayId = overlayId;
|
||||||
|
this._nickIcon = nickIcon;
|
||||||
|
this._prefixText = prefixText;
|
||||||
|
this._prefixColor = prefixColor;
|
||||||
|
this._prefixIcon = prefixIcon;
|
||||||
|
this._prefixEffect = prefixEffect;
|
||||||
|
this._prefixFont = prefixFont;
|
||||||
|
this._displayOrder = displayOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get roomIndex(): number {
|
public get roomIndex(): number {
|
||||||
@@ -67,4 +88,32 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent {
|
|||||||
public get overlayId(): number | null {
|
public get overlayId(): number | null {
|
||||||
return this._overlayId;
|
return this._overlayId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string {
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixText(): string {
|
||||||
|
return this._prefixText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixColor(): string {
|
||||||
|
return this._prefixColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixIcon(): string {
|
||||||
|
return this._prefixIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixEffect(): string {
|
||||||
|
return this._prefixEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string {
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string {
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import { BadgeBaseAndLevel } from './BadgeBaseAndLevel';
|
|||||||
export class LocalizationManager implements ILocalizationManager
|
export class LocalizationManager implements ILocalizationManager
|
||||||
{
|
{
|
||||||
private _definitions: Map<string, string> = new Map();
|
private _definitions: Map<string, string> = new Map();
|
||||||
|
private _overrideDefinitions: Map<string, string> = new Map();
|
||||||
private _parameters: Map<string, Map<string, string>> = new Map();
|
private _parameters: Map<string, Map<string, string>> = new Map();
|
||||||
private _badgePointLimits: Map<string, number> = new Map();
|
private _badgePointLimits: Map<string, number> = new Map();
|
||||||
private _romanNumerals: string[] = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI', 'XXII', 'XXIII', 'XXIV', 'XXV', 'XXVI', 'XXVII', 'XXVIII', 'XXIX', 'XXX' ];
|
private _romanNumerals: string[] = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI', 'XXII', 'XXIII', 'XXIV', 'XXV', 'XXVI', 'XXVII', 'XXVIII', 'XXIX', 'XXX' ];
|
||||||
@@ -102,7 +103,7 @@ export class LocalizationManager implements ILocalizationManager
|
|||||||
|
|
||||||
public hasValue(key: string): boolean
|
public hasValue(key: string): boolean
|
||||||
{
|
{
|
||||||
return this._definitions.has(key);
|
return (this._overrideDefinitions.has(key) || this._definitions.has(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public getValue(key: string, doParams: boolean = true): string
|
public getValue(key: string, doParams: boolean = true): string
|
||||||
@@ -116,7 +117,7 @@ export class LocalizationManager implements ILocalizationManager
|
|||||||
for(const splitKey of keys) key = key.replace(splitKey, this.getValue(splitKey.slice(2, -1), doParams));
|
for(const splitKey of keys) key = key.replace(splitKey, this.getValue(splitKey.slice(2, -1), doParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
let value = (this._definitions.get(key) || null);
|
let value = (this._overrideDefinitions.get(key) || this._definitions.get(key) || null);
|
||||||
|
|
||||||
if(!value)
|
if(!value)
|
||||||
{
|
{
|
||||||
@@ -260,6 +261,16 @@ export class LocalizationManager implements ILocalizationManager
|
|||||||
this._definitions.set(key, value);
|
this._definitions.set(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setOverrideValues(values: Map<string, string>): void
|
||||||
|
{
|
||||||
|
this._overrideDefinitions = (values || new Map());
|
||||||
|
}
|
||||||
|
|
||||||
|
public clearOverrideValues(): void
|
||||||
|
{
|
||||||
|
this._overrideDefinitions.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public registerParameter(key: string, parameter: string, value: string): void
|
public registerParameter(key: string, parameter: string, value: string): void
|
||||||
{
|
{
|
||||||
if(!key || (key.length === 0) || !parameter || (parameter.length === 0)) return;
|
if(!key || (key.length === 0) || !parameter || (parameter.length === 0)) return;
|
||||||
|
|||||||
@@ -314,10 +314,6 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
// })
|
// })
|
||||||
// ];
|
// ];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
sprite.filters = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sprite.texture)
|
if(sprite.texture)
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ export class RoomUserData implements IRoomUserData
|
|||||||
private _sex: string = '';
|
private _sex: string = '';
|
||||||
private _figure: string = '';
|
private _figure: string = '';
|
||||||
private _custom: string = '';
|
private _custom: string = '';
|
||||||
|
private _nickIcon: string = '';
|
||||||
|
private _prefixText: string = '';
|
||||||
|
private _prefixColor: string = '';
|
||||||
|
private _prefixIcon: string = '';
|
||||||
|
private _prefixEffect: string = '';
|
||||||
|
private _prefixFont: string = '';
|
||||||
|
private _displayOrder: string = 'icon-prefix-name';
|
||||||
private _activityPoints: number;
|
private _activityPoints: number;
|
||||||
private _background: number;
|
private _background: number;
|
||||||
private _stand: number;
|
private _stand: number;
|
||||||
@@ -286,6 +293,76 @@ export class RoomUserData implements IRoomUserData
|
|||||||
return this._isModerator;
|
return this._isModerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get nickIcon(): string
|
||||||
|
{
|
||||||
|
return this._nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set nickIcon(k: string)
|
||||||
|
{
|
||||||
|
this._nickIcon = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixText(): string
|
||||||
|
{
|
||||||
|
return this._prefixText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixText(k: string)
|
||||||
|
{
|
||||||
|
this._prefixText = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixColor(): string
|
||||||
|
{
|
||||||
|
return this._prefixColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixColor(k: string)
|
||||||
|
{
|
||||||
|
this._prefixColor = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixIcon(): string
|
||||||
|
{
|
||||||
|
return this._prefixIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixIcon(k: string)
|
||||||
|
{
|
||||||
|
this._prefixIcon = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixEffect(): string
|
||||||
|
{
|
||||||
|
return this._prefixEffect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixEffect(k: string)
|
||||||
|
{
|
||||||
|
this._prefixEffect = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prefixFont(): string
|
||||||
|
{
|
||||||
|
return this._prefixFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set prefixFont(k: string)
|
||||||
|
{
|
||||||
|
this._prefixFont = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get displayOrder(): string
|
||||||
|
{
|
||||||
|
return this._displayOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set displayOrder(k: string)
|
||||||
|
{
|
||||||
|
this._displayOrder = k;
|
||||||
|
}
|
||||||
|
|
||||||
public set isModerator(k: boolean)
|
public set isModerator(k: boolean)
|
||||||
{
|
{
|
||||||
this._isModerator = k;
|
this._isModerator = k;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { IFurnitureData, IGroupInformationManager, IMessageComposer, IMessageEvent, IProductData, ISessionDataManager, NoobnessLevelEnum, SecurityLevel } from '@nitrots/api';
|
import { IFurnitureData, IGroupInformationManager, IMessageComposer, IMessageEvent, IProductData, ISessionDataManager, NoobnessLevelEnum, SecurityLevel } from '@nitrots/api';
|
||||||
import { AccountSafetyLockStatusChangeMessageEvent, AccountSafetyLockStatusChangeParser, AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, EmailStatusResultEvent, FigureUpdateEvent, GetCommunication, GetUserTagsComposer, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, PetScratchFailedMessageEvent, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer, UserTagsMessageEvent } from '@nitrots/communication';
|
import { AccountSafetyLockStatusChangeMessageEvent, AccountSafetyLockStatusChangeParser, AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, EmailStatusResultEvent, FigureUpdateEvent, GetCommunication, GetUserTagsComposer, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, PetScratchFailedMessageEvent, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer, UserTagsMessageEvent } from '@nitrots/communication';
|
||||||
import { GetConfiguration } from '@nitrots/configuration';
|
import { GetConfiguration } from '@nitrots/configuration';
|
||||||
|
import { GetLocalizationManager } from '@nitrots/localization';
|
||||||
import { GetEventDispatcher, MysteryBoxKeysUpdateEvent, NitroSettingsEvent, SessionDataPreferencesEvent, UserNameUpdateEvent } from '@nitrots/events';
|
import { GetEventDispatcher, MysteryBoxKeysUpdateEvent, NitroSettingsEvent, SessionDataPreferencesEvent, UserNameUpdateEvent } from '@nitrots/events';
|
||||||
import { CreateLinkEvent, HabboWebTools } from '@nitrots/utils';
|
import { CreateLinkEvent, HabboWebTools } from '@nitrots/utils';
|
||||||
import { Texture } from 'pixi.js';
|
import { Texture } from 'pixi.js';
|
||||||
@@ -42,6 +43,8 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
|
|
||||||
private _floorItems: Map<number, IFurnitureData> = new Map();
|
private _floorItems: Map<number, IFurnitureData> = new Map();
|
||||||
private _wallItems: Map<number, IFurnitureData> = new Map();
|
private _wallItems: Map<number, IFurnitureData> = new Map();
|
||||||
|
private _floorItemOverrides: Map<string, Partial<IFurnitureData>> = new Map();
|
||||||
|
private _wallItemOverrides: Map<string, Partial<IFurnitureData>> = new Map();
|
||||||
private _products: Map<string, IProductData> = new Map();
|
private _products: Map<string, IProductData> = new Map();
|
||||||
private _furnitureData: FurnitureDataLoader = new FurnitureDataLoader(this._floorItems, this._wallItems);
|
private _furnitureData: FurnitureDataLoader = new FurnitureDataLoader(this._floorItems, this._wallItems);
|
||||||
private _productData: ProductDataLoader = new ProductDataLoader(this._products);
|
private _productData: ProductDataLoader = new ProductDataLoader(this._products);
|
||||||
@@ -130,7 +133,38 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
|
|
||||||
public getAllFurnitureData(): IFurnitureData[]
|
public getAllFurnitureData(): IFurnitureData[]
|
||||||
{
|
{
|
||||||
return [ ...Array.from(this._floorItems.values()), ...Array.from(this._wallItems.values()) ];
|
return [
|
||||||
|
...Array.from(this._floorItems.values()).map(item => this.applyFurnitureOverrides(item, this._floorItemOverrides)),
|
||||||
|
...Array.from(this._wallItems.values()).map(item => this.applyFurnitureOverrides(item, this._wallItemOverrides))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public async applyFurnitureDataOverrides(url: string): Promise<void>
|
||||||
|
{
|
||||||
|
if(!url || !url.length)
|
||||||
|
{
|
||||||
|
this.clearFurnitureDataOverrides();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(url);
|
||||||
|
|
||||||
|
if(response.status !== 200) throw new Error(`Unable to load ${ url }`);
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
this._floorItemOverrides = this.parseFurnitureOverrides(data?.roomitemtypes?.furnitype || []);
|
||||||
|
this._wallItemOverrides = this.parseFurnitureOverrides(data?.wallitemtypes?.furnitype || []);
|
||||||
|
|
||||||
|
this.refreshFurnitureLocalizations();
|
||||||
|
}
|
||||||
|
|
||||||
|
public clearFurnitureDataOverrides(): void
|
||||||
|
{
|
||||||
|
this._floorItemOverrides.clear();
|
||||||
|
this._wallItemOverrides.clear();
|
||||||
|
this.refreshFurnitureLocalizations();
|
||||||
}
|
}
|
||||||
|
|
||||||
private onUserInfoEvent(event: UserInfoEvent): void
|
private onUserInfoEvent(event: UserInfoEvent): void
|
||||||
@@ -290,7 +324,7 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
|
|
||||||
if(!existing) return null;
|
if(!existing) return null;
|
||||||
|
|
||||||
return existing;
|
return this.applyFurnitureOverrides(existing, this._floorItemOverrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getFloorItemDataByName(name: string): IFurnitureData
|
public getFloorItemDataByName(name: string): IFurnitureData
|
||||||
@@ -301,7 +335,7 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
{
|
{
|
||||||
if(!item || (item.className !== name)) continue;
|
if(!item || (item.className !== name)) continue;
|
||||||
|
|
||||||
return item;
|
return this.applyFurnitureOverrides(item, this._floorItemOverrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -313,7 +347,7 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
|
|
||||||
if(!existing) return null;
|
if(!existing) return null;
|
||||||
|
|
||||||
return existing;
|
return this.applyFurnitureOverrides(existing, this._wallItemOverrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getWallItemDataByName(name: string): IFurnitureData
|
public getWallItemDataByName(name: string): IFurnitureData
|
||||||
@@ -324,7 +358,7 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
{
|
{
|
||||||
if(!item || (item.className !== name)) continue;
|
if(!item || (item.className !== name)) continue;
|
||||||
|
|
||||||
return item;
|
return this.applyFurnitureOverrides(item, this._wallItemOverrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -335,6 +369,64 @@ export class SessionDataManager implements ISessionDataManager
|
|||||||
return this._products.get(type);
|
return this._products.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private parseFurnitureOverrides(items: any[]): Map<string, Partial<IFurnitureData>>
|
||||||
|
{
|
||||||
|
const overrides = new Map<string, Partial<IFurnitureData>>();
|
||||||
|
|
||||||
|
for(const item of items)
|
||||||
|
{
|
||||||
|
if(!item?.classname) continue;
|
||||||
|
|
||||||
|
const className = ((item.classname as string).split('*')[0] || '').trim();
|
||||||
|
|
||||||
|
if(!className.length) continue;
|
||||||
|
|
||||||
|
overrides.set(className, {
|
||||||
|
name: item.name || '',
|
||||||
|
description: item.description || ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return overrides;
|
||||||
|
}
|
||||||
|
|
||||||
|
private applyFurnitureOverrides(item: IFurnitureData, overrides: Map<string, Partial<IFurnitureData>>): IFurnitureData
|
||||||
|
{
|
||||||
|
if(!item) return null;
|
||||||
|
|
||||||
|
const override = overrides.get(item.className);
|
||||||
|
|
||||||
|
if(!override) return item;
|
||||||
|
|
||||||
|
const clonedItem = Object.assign(Object.create(Object.getPrototypeOf(item)), item) as any;
|
||||||
|
|
||||||
|
if(override.name !== undefined) clonedItem._localizedName = override.name;
|
||||||
|
if(override.description !== undefined) clonedItem._description = override.description;
|
||||||
|
|
||||||
|
return clonedItem as IFurnitureData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private refreshFurnitureLocalizations(): void
|
||||||
|
{
|
||||||
|
const localizationManager = GetLocalizationManager();
|
||||||
|
|
||||||
|
for(const item of this._floorItems.values())
|
||||||
|
{
|
||||||
|
const resolvedItem = this.applyFurnitureOverrides(item, this._floorItemOverrides);
|
||||||
|
|
||||||
|
localizationManager.setValue(('roomItem.name.' + item.id), resolvedItem.name);
|
||||||
|
localizationManager.setValue(('roomItem.desc.' + item.id), resolvedItem.description);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const item of this._wallItems.values())
|
||||||
|
{
|
||||||
|
const resolvedItem = this.applyFurnitureOverrides(item, this._wallItemOverrides);
|
||||||
|
|
||||||
|
localizationManager.setValue(('wallItem.name.' + item.id), resolvedItem.name);
|
||||||
|
localizationManager.setValue(('wallItem.desc.' + item.id), resolvedItem.description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public getBadgeUrl(name: string): string
|
public getBadgeUrl(name: string): string
|
||||||
{
|
{
|
||||||
return this._badgeImageManager.getBadgeUrl(name);
|
return this._badgeImageManager.getBadgeUrl(name);
|
||||||
|
|||||||
@@ -145,6 +145,30 @@ export class UserDataManager implements IUserDataManager
|
|||||||
userData.custom = custom;
|
userData.custom = custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public updateNickIcon(roomIndex: number, nickIcon: string): void
|
||||||
|
{
|
||||||
|
const userData = this.getUserDataByIndex(roomIndex);
|
||||||
|
|
||||||
|
if(!userData) return;
|
||||||
|
|
||||||
|
userData.nickIcon = nickIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public updateCustomization(roomIndex: number, nickIcon: string, prefixText: string, prefixColor: string, prefixIcon: string, prefixEffect: string, prefixFont: string, displayOrder: string): void
|
||||||
|
{
|
||||||
|
const userData = this.getUserDataByIndex(roomIndex);
|
||||||
|
|
||||||
|
if(!userData) return;
|
||||||
|
|
||||||
|
userData.nickIcon = nickIcon;
|
||||||
|
userData.prefixText = prefixText;
|
||||||
|
userData.prefixColor = prefixColor;
|
||||||
|
userData.prefixIcon = prefixIcon;
|
||||||
|
userData.prefixEffect = prefixEffect;
|
||||||
|
userData.prefixFont = prefixFont;
|
||||||
|
userData.displayOrder = displayOrder;
|
||||||
|
}
|
||||||
|
|
||||||
public updateBackground(roomIndex: number, background: number, stand: number, overlay: number): void
|
public updateBackground(roomIndex: number, background: number, stand: number, overlay: number): void
|
||||||
{
|
{
|
||||||
const userData = this.getUserDataByIndex(roomIndex);
|
const userData = this.getUserDataByIndex(roomIndex);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export class RoomChatHandler extends BaseHandler
|
|||||||
if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_SHOUT;
|
if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_SHOUT;
|
||||||
else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_WHISPER;
|
else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_WHISPER;
|
||||||
|
|
||||||
const chatEvent = new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.roomIndex, parser.message, chatType, parser.bubble, parser.chatColours, null, -1, parser.prefixText, parser.prefixColor, parser.prefixIcon, parser.prefixEffect);
|
const chatEvent = new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.roomIndex, parser.message, chatType, parser.bubble, parser.chatColours, null, -1, parser.prefixText, parser.prefixColor, parser.prefixIcon, parser.prefixEffect, parser.prefixFont, parser.nickIcon, parser.displayOrder);
|
||||||
|
|
||||||
GetEventDispatcher().dispatchEvent(chatEvent);
|
GetEventDispatcher().dispatchEvent(chatEvent);
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ export class RoomChatHandler extends BaseHandler
|
|||||||
|
|
||||||
if(!parser) return;
|
if(!parser) return;
|
||||||
|
|
||||||
GetEventDispatcher().dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent.CHAT_TYPE_HAND_ITEM_RECEIVED, SystemChatStyleEnum.GENERIC, [], null, parser.handItemType));
|
GetEventDispatcher().dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent.CHAT_TYPE_HAND_ITEM_RECEIVED, SystemChatStyleEnum.GENERIC, '', null, parser.handItemType));
|
||||||
}
|
}
|
||||||
|
|
||||||
private onRespectReceivedEvent(event: RespectReceivedEvent): void
|
private onRespectReceivedEvent(event: RespectReceivedEvent): void
|
||||||
@@ -136,7 +136,7 @@ export class RoomChatHandler extends BaseHandler
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetEventDispatcher().dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, petData.roomIndex, '', chatType, SystemChatStyleEnum.GENERIC, [], null, userRoomIndex));
|
GetEventDispatcher().dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, petData.roomIndex, '', chatType, SystemChatStyleEnum.GENERIC, '', null, userRoomIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
private onFloodControlEvent(event: FloodControlEvent): void
|
private onFloodControlEvent(event: FloodControlEvent): void
|
||||||
|
|||||||
@@ -55,6 +55,13 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
|
|
||||||
userData.name = user.name;
|
userData.name = user.name;
|
||||||
userData.custom = user.custom;
|
userData.custom = user.custom;
|
||||||
|
userData.nickIcon = user.nickIcon;
|
||||||
|
userData.prefixText = user.prefixText;
|
||||||
|
userData.prefixColor = user.prefixColor;
|
||||||
|
userData.prefixIcon = user.prefixIcon;
|
||||||
|
userData.prefixEffect = user.prefixEffect;
|
||||||
|
userData.prefixFont = user.prefixFont;
|
||||||
|
userData.displayOrder = user.displayOrder;
|
||||||
userData.background = user.background;
|
userData.background = user.background;
|
||||||
userData.stand = user.stand;
|
userData.stand = user.stand;
|
||||||
userData.overlay = user.overlay;
|
userData.overlay = user.overlay;
|
||||||
@@ -104,11 +111,12 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
|
|
||||||
session.userDataManager.updateFigure(parser.unitId, parser.figure, parser.gender, false, false);
|
session.userDataManager.updateFigure(parser.unitId, parser.figure, parser.gender, false, false);
|
||||||
session.userDataManager.updateMotto(parser.unitId, parser.motto);
|
session.userDataManager.updateMotto(parser.unitId, parser.motto);
|
||||||
|
session.userDataManager.updateCustomization(parser.unitId, parser.nickIcon || '', parser.prefixText || '', parser.prefixColor || '', parser.prefixIcon || '', parser.prefixEffect || '', parser.prefixFont || '', parser.displayOrder || 'icon-prefix-name');
|
||||||
session.userDataManager.updateAchievementScore(parser.unitId, parser.achievementScore);
|
session.userDataManager.updateAchievementScore(parser.unitId, parser.achievementScore);
|
||||||
|
|
||||||
session.userDataManager.updateBackground(parser.unitId, parser.backgroundId, parser.standId, parser.overlayId);
|
session.userDataManager.updateBackground(parser.unitId, parser.backgroundId, parser.standId, parser.overlayId);
|
||||||
|
|
||||||
GetEventDispatcher().dispatchEvent(new RoomSessionUserFigureUpdateEvent(session, parser.unitId, parser.figure, parser.gender, parser.motto, parser.achievementScore, parser.backgroundId, parser.standId, parser.overlayId));
|
GetEventDispatcher().dispatchEvent(new RoomSessionUserFigureUpdateEvent(session, parser.unitId, parser.figure, parser.gender, parser.motto, parser.achievementScore, parser.backgroundId, parser.standId, parser.overlayId, parser.nickIcon || '', parser.prefixText || '', parser.prefixColor || '', parser.prefixIcon || '', parser.prefixEffect || '', parser.prefixFont || '', parser.displayOrder || 'icon-prefix-name'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user