Merge branch 'oobjectt-handshake-init-diffie'

This commit is contained in:
dank074 2022-12-27 00:23:30 -06:00
commit 40e547308b
6 changed files with 53 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -433,4 +433,5 @@ export class IncomingHeader
public static EXTENDED_PROFILE_CHANGED = 876;
public static WELCOME_GIFT_CHANGE_EMAIL_RESULT = 2293;
public static WELCOME_GIFT_STATUS = 2707;
public static HANDSHAKE_INIT_DIFFIE = 1347;
}

View File

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

View File

@ -1,3 +1,4 @@
export * from './DisconnectReasonEnum';
export * from './DisconnectReasonEvent';
export * from './InitDiffieHandshakeEvent';
export * from './NoobnessLevelMessageEvent';

View File

@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class InitDiffieHandshakeParser implements IMessageParser
{
private _encryptedPrime: string;
private _encryptedGenerator: string;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._encryptedPrime = wrapper.readString();
this._encryptedGenerator = wrapper.readString();
return true;
}
public get encryptedPrime(): string
{
return this._encryptedPrime;
}
public get encryptedGenerator(): string
{
return this._encryptedGenerator;
}
}

View File

@ -1,2 +1,3 @@
export * from './DisconnectReasonParser';
export * from './InitDiffieHandshakeParser';
export * from './NoobnessLevelMessageParser';