Merge branch 'oobjectt-handshake-identity-account'

This commit is contained in:
dank074 2023-01-12 01:43:06 -06:00
commit c6f18ae7e0
6 changed files with 60 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -462,4 +462,5 @@ export class IncomingHeader
public static WEEKLY_GAME2_FRIENDS_LEADERBOARD = 2270;
public static WEEKLY_GAME2_LEADERBOARD = 2196;
public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35;
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
}

View File

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

View File

@ -1,5 +1,6 @@
export * from './CompleteDiffieHandshakeEvent';
export * from './DisconnectReasonEnum';
export * from './DisconnectReasonEvent';
export * from './IdentityAccountsEvent';
export * from './InitDiffieHandshakeEvent';
export * from './NoobnessLevelMessageEvent';

View File

@ -0,0 +1,39 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class IdentityAccountsParser implements IMessageParser
{
private _accounts: Map<number, string>;
public flush(): boolean
{
if(this._accounts)
{
this._accounts = new Map();
}
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._accounts = new Map();
let totalCount = wrapper.readInt();
while(totalCount > 0)
{
this._accounts.set(wrapper.readInt(), wrapper.readString());
totalCount--;
}
return true;
}
public get accounts(): Map<number, string>
{
return this._accounts;
}
}

View File

@ -1,4 +1,5 @@
export * from './CompleteDiffieHandshakeParser';
export * from './DisconnectReasonParser';
export * from './IdentityAccountsParser';
export * from './InitDiffieHandshakeParser';
export * from './NoobnessLevelMessageParser';