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:
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/sound';
|
||||
export * from './messages/incoming/talent';
|
||||
export * from './messages/incoming/translation';
|
||||
export * from './messages/incoming/user';
|
||||
export * from './messages/incoming/user/access';
|
||||
export * from './messages/incoming/user/data';
|
||||
@@ -153,6 +154,7 @@ export * from './messages/outgoing/roomsettings';
|
||||
export * from './messages/outgoing/sound';
|
||||
export * from './messages/outgoing/talent';
|
||||
export * from './messages/outgoing/tracking';
|
||||
export * from './messages/outgoing/translation';
|
||||
export * from './messages/outgoing/user';
|
||||
export * from './messages/outgoing/user/data';
|
||||
export * from './messages/outgoing/user/inventory';
|
||||
@@ -233,6 +235,7 @@ export * from './messages/parser/roomsettings';
|
||||
export * from './messages/parser/security';
|
||||
export * from './messages/parser/sound';
|
||||
export * from './messages/parser/talent';
|
||||
export * from './messages/parser/translation';
|
||||
export * from './messages/parser/user';
|
||||
export * from './messages/parser/user/access';
|
||||
export * from './messages/parser/user/data';
|
||||
|
||||
@@ -274,6 +274,8 @@ export class IncomingHeader
|
||||
public static WIRED_USER_VARIABLES_DATA = 5103;
|
||||
public static CONF_INVIS_STATE = 5104;
|
||||
public static HANDITEM_BLOCK_STATE = 5105;
|
||||
public static TRANSLATION_LANGUAGES = 5106;
|
||||
public static TRANSLATION_RESULT = 5107;
|
||||
public static WIRED_OPEN = 1830;
|
||||
public static WIRED_REWARD = 178;
|
||||
public static WIRED_SAVE = 1155;
|
||||
@@ -495,4 +497,5 @@ export class IncomingHeader
|
||||
public static USER_PREFIXES = 7001;
|
||||
public static PREFIX_RECEIVED = 7002;
|
||||
public static ACTIVE_PREFIX_UPDATED = 7003;
|
||||
public static USER_NICK_ICONS = 7004;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ export * from './roomsettings';
|
||||
export * from './security';
|
||||
export * from './sound';
|
||||
export * from './talent';
|
||||
export * from './translation';
|
||||
export * from './user';
|
||||
export * from './user/access';
|
||||
export * from './user/data';
|
||||
|
||||
@@ -4,6 +4,7 @@ export * from './badges';
|
||||
export * from './clothes';
|
||||
export * from './furni';
|
||||
export * from './furni/gifts';
|
||||
export * from './nickicons';
|
||||
export * from './pets';
|
||||
export * from './prefixes';
|
||||
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_MANAGE = 10026;
|
||||
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_TRIGGER_SAVE = 1520;
|
||||
public static GET_ITEM_DATA = 3964;
|
||||
@@ -510,4 +512,9 @@ export class OutgoingHeader
|
||||
public static SET_ACTIVE_PREFIX = 7012;
|
||||
public static DELETE_PREFIX = 7013;
|
||||
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 './talent';
|
||||
export * from './tracking';
|
||||
export * from './translation';
|
||||
export * from './user';
|
||||
export * from './user/data';
|
||||
export * from './user/inventory';
|
||||
|
||||
@@ -2,6 +2,7 @@ export * from './avatareffect';
|
||||
export * from './badges';
|
||||
export * from './bots';
|
||||
export * from './furni';
|
||||
export * from './nickicons';
|
||||
export * from './pets';
|
||||
export * from './prefixes';
|
||||
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>;
|
||||
|
||||
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()
|
||||
|
||||
+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 './PurchaseCatalogPrefixComposer';
|
||||
export * from './PurchasePrefixComposer';
|
||||
export * from './RequestPrefixesComposer';
|
||||
export * from './SetDisplayOrderComposer';
|
||||
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 './sound';
|
||||
export * from './talent';
|
||||
export * from './translation';
|
||||
export * from './user';
|
||||
export * from './user/access';
|
||||
export * from './user/data';
|
||||
|
||||
@@ -3,6 +3,7 @@ export * from './avatareffect';
|
||||
export * from './badges';
|
||||
export * from './clothing';
|
||||
export * from './furniture';
|
||||
export * from './nickicons';
|
||||
export * from './pets';
|
||||
export * from './prefixes';
|
||||
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 _icon: string;
|
||||
private _effect: string;
|
||||
private _font: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
@@ -15,6 +16,7 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
||||
this._color = '';
|
||||
this._icon = '';
|
||||
this._effect = '';
|
||||
this._font = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
||||
this._color = wrapper.readString();
|
||||
this._icon = wrapper.readString();
|
||||
this._effect = wrapper.readString();
|
||||
this._font = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -36,4 +39,5 @@ export class ActivePrefixUpdatedParser implements IMessageParser
|
||||
public get color(): string { return this._color; }
|
||||
public get icon(): string { return this._icon; }
|
||||
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 _icon: string;
|
||||
private _effect: string;
|
||||
private _font: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
@@ -15,6 +16,7 @@ export class PrefixReceivedParser implements IMessageParser
|
||||
this._color = '';
|
||||
this._icon = '';
|
||||
this._effect = '';
|
||||
this._font = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ export class PrefixReceivedParser implements IMessageParser
|
||||
this._color = wrapper.readString();
|
||||
this._icon = wrapper.readString();
|
||||
this._effect = wrapper.readString();
|
||||
this._font = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -36,4 +39,5 @@ export class PrefixReceivedParser implements IMessageParser
|
||||
public get color(): string { return this._color; }
|
||||
public get icon(): string { return this._icon; }
|
||||
public get effect(): string { return this._effect; }
|
||||
public get font(): string { return this._font; }
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface IPrefixData
|
||||
color: string;
|
||||
icon: string;
|
||||
effect: string;
|
||||
font: string;
|
||||
active: boolean;
|
||||
}
|
||||
|
||||
@@ -36,6 +37,7 @@ export class UserPrefixesParser implements IMessageParser
|
||||
color: wrapper.readString(),
|
||||
icon: wrapper.readString(),
|
||||
effect: wrapper.readString(),
|
||||
font: wrapper.readString(),
|
||||
active: wrapper.readInt() === 1
|
||||
});
|
||||
|
||||
|
||||
@@ -7,9 +7,16 @@ export class RoomUnitInfoParser implements IMessageParser
|
||||
private _gender: string;
|
||||
private _motto: string;
|
||||
private _achievementScore: number;
|
||||
private _backgroundId: number;
|
||||
private _backgroundId: number;
|
||||
private _standId: 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
|
||||
{
|
||||
@@ -18,9 +25,16 @@ export class RoomUnitInfoParser implements IMessageParser
|
||||
this._gender = 'M';
|
||||
this._motto = null;
|
||||
this._achievementScore = 0;
|
||||
this._backgroundId = 0;
|
||||
this._backgroundId = 0;
|
||||
this._standId = 0;
|
||||
this._overlayId = 0;
|
||||
this._nickIcon = '';
|
||||
this._prefixText = '';
|
||||
this._prefixColor = '';
|
||||
this._prefixIcon = '';
|
||||
this._prefixEffect = '';
|
||||
this._prefixFont = '';
|
||||
this._displayOrder = 'icon-prefix-name';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -34,9 +48,16 @@ export class RoomUnitInfoParser implements IMessageParser
|
||||
this._gender = wrapper.readString().toLocaleUpperCase();
|
||||
this._motto = wrapper.readString();
|
||||
this._achievementScore = wrapper.readInt();
|
||||
this._backgroundId = wrapper.readInt();
|
||||
this._backgroundId = 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;
|
||||
}
|
||||
@@ -80,4 +101,39 @@ export class RoomUnitInfoParser implements IMessageParser
|
||||
{
|
||||
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.activityPoints = wrapper.readInt();
|
||||
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)
|
||||
|
||||
@@ -13,6 +13,13 @@ export class UserMessageData
|
||||
private _sex: string = '';
|
||||
private _figure: 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 _background: number = 0;
|
||||
private _stand: number = 0;
|
||||
@@ -437,6 +444,97 @@ export class UserMessageData
|
||||
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)
|
||||
{
|
||||
if(!this._isReadOnly)
|
||||
|
||||
@@ -13,6 +13,9 @@ export class RoomUnitChatParser implements IMessageParser
|
||||
private _prefixColor: string;
|
||||
private _prefixIcon: string;
|
||||
private _prefixEffect: string;
|
||||
private _prefixFont: string;
|
||||
private _nickIcon: string;
|
||||
private _displayOrder: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
@@ -27,6 +30,9 @@ export class RoomUnitChatParser implements IMessageParser
|
||||
this._prefixColor = '';
|
||||
this._prefixIcon = '';
|
||||
this._prefixEffect = '';
|
||||
this._prefixFont = '';
|
||||
this._nickIcon = '';
|
||||
this._displayOrder = 'icon-prefix-name';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -48,6 +54,9 @@ export class RoomUnitChatParser implements IMessageParser
|
||||
this._prefixColor = wrapper.readString();
|
||||
this._prefixIcon = 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;
|
||||
}
|
||||
@@ -124,4 +133,19 @@ export class RoomUnitChatParser implements IMessageParser
|
||||
{
|
||||
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 _standId: 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
|
||||
{
|
||||
@@ -38,6 +45,13 @@ export class UserProfileParser implements IMessageParser
|
||||
this._backgroundId = 0;
|
||||
this._standId = 0;
|
||||
this._overlayId = 0;
|
||||
this._nickIcon = '';
|
||||
this._prefixText = '';
|
||||
this._prefixColor = '';
|
||||
this._prefixIcon = '';
|
||||
this._prefixEffect = '';
|
||||
this._prefixFont = '';
|
||||
this._displayOrder = 'icon-prefix-name';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -71,6 +85,21 @@ export class UserProfileParser implements IMessageParser
|
||||
this._backgroundId = wrapper.readInt();
|
||||
this._standId = 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;
|
||||
@@ -155,4 +184,39 @@ export class UserProfileParser implements IMessageParser
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user