Merge branch 'user-classification' of https://github.com/oobjectt/nitro-renderer into oobjectt-user-classification

This commit is contained in:
dank074 2023-01-03 01:38:13 -06:00
commit 5472a78d4e
8 changed files with 80 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -247,6 +247,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

@ -70,3 +70,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

@ -72,3 +72,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,57 @@
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;
let count: number = wrapper.readInt();
this._classifiedUsersNames = new Map();
this._classifiedUsersClass = new Map();
while(count > 0)
{
_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);
count--;
}
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';