#28 - UserClassificationMessageEvent added

This commit is contained in:
oobjectt 2022-12-25 22:01:13 +01:00
parent 26741b78a7
commit 0ad697427b
8 changed files with 82 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -238,6 +238,7 @@ export class IncomingHeader
public static USER_SETTINGS = 513;
public static USER_SUBSCRIPTION = 954;
public static USER_WARDROBE_PAGE = 3315;
public static USER_CLASSIFICATION = 966;
public static GET_USER_TAGS = 1255;
public static WIRED_ACTION = 1434;
public static WIRED_CONDITION = 1108;

View File

@ -69,3 +69,4 @@ export * from './user/inventory';
export * from './user/inventory/currency';
export * from './user/inventory/subscription';
export * from './user/wardrobe';
export * from './userclassification';

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../events';
import { UserClassificationMessageParser } from '../../parser';
export class UserClassificationMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, UserClassificationMessageParser);
}
public getParser(): UserClassificationMessageParser
{
return this.parser as UserClassificationMessageParser;
}
}

View File

@ -0,0 +1 @@
export * from './UserClassificationMessageEvent';

View File

@ -71,3 +71,4 @@ export * from './user/inventory';
export * from './user/inventory/currency';
export * from './user/inventory/subscription';
export * from './user/wardrobe';
export * from './userclassification';

View File

@ -0,0 +1,59 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class UserClassificationMessageParser implements IMessageParser
{
private _classifiedUsersNames: Map<number, string>;
private _classifiedUsersClass: Map<number, string>;
public flush(): boolean
{
if(this._classifiedUsersNames)
{
this._classifiedUsersNames = new Map();
}
if(this._classifiedUsersClass)
{
this._classifiedUsersClass = new Map();
}
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
let _local_3: number;
let _local_4: string;
let _local_5: string;
const _local_2: number = wrapper.readInt();
this._classifiedUsersNames = new Map();
this._classifiedUsersClass = new Map();
let _local_6: number;
while(_local_6 < _local_2)
{
_local_3 = wrapper.readInt();
_local_4 = wrapper.readString();
_local_5 = wrapper.readString();
this._classifiedUsersNames.set(_local_3, _local_4);
this._classifiedUsersClass.set(_local_3, _local_5);
_local_6++;
}
return true;
}
public get classifiedUsernameMap(): Map<number, string>
{
return this._classifiedUsersNames;
}
public get classifiedUserTypeMap(): Map<number, string>
{
return this._classifiedUsersClass;
}
}

View File

@ -0,0 +1 @@
export * from './UserClassificationMessageParser';