Skip to content

Commit dcd6927

Browse files
committed
billsonnn#28 - CompleteDiffieHandshakeEvent added
1 parent 26741b7 commit dcd6927

File tree

6 files changed

+57
-1
lines changed

6 files changed

+57
-1
lines changed

src/nitro/communication/NitroMessages.ts

+2-1
Large diffs are not rendered by default.

src/nitro/communication/messages/incoming/IncomingHeader.ts

+1
Original file line numberDiff line numberDiff line change
@@ -414,4 +414,5 @@ export class IncomingHeader
414414
public static SHOW_ENFORCE_ROOM_CATEGORY = 3896;
415415
public static CUSTOM_USER_NOTIFICATION = 909;
416416
public static NEW_USER_EXPERIENCE_GIFT_OFFER = 3575;
417+
public static HANDSHAKE_COMPLETE_DIFFIE = 3885;
417418
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { IMessageEvent } from '../../../../../api';
2+
import { MessageEvent } from '../../../../../events';
3+
import { CompleteDiffieHandshakeParser } from '../../parser';
4+
5+
export class CompleteDiffieHandshakeEvent extends MessageEvent implements IMessageEvent
6+
{
7+
constructor(callBack: Function)
8+
{
9+
super(callBack, CompleteDiffieHandshakeParser);
10+
}
11+
12+
public getParser(): CompleteDiffieHandshakeParser
13+
{
14+
return this.parser as CompleteDiffieHandshakeParser;
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './CompleteDiffieHandshakeEvent';
12
export * from './NoobnessLevelMessageEvent';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
2+
3+
export class CompleteDiffieHandshakeParser implements IMessageParser
4+
{
5+
private _encryptedPublicKey: string = null;
6+
private _serverClientEncryption: boolean = false;
7+
8+
public flush(): boolean
9+
{
10+
return true;
11+
}
12+
13+
public parse(wrapper: IMessageDataWrapper): boolean
14+
{
15+
if(!wrapper) return false;
16+
17+
this._encryptedPublicKey = wrapper.readString();
18+
19+
if(wrapper.bytesAvailable)
20+
{
21+
this._serverClientEncryption = wrapper.readBoolean();
22+
}
23+
24+
return true;
25+
}
26+
27+
public get encryptedPublicKey(): string
28+
{
29+
return this._encryptedPublicKey;
30+
}
31+
32+
public get serverClientEncryption(): boolean
33+
{
34+
return this._serverClientEncryption;
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './CompleteDiffieHandshakeParser';
12
export * from './NoobnessLevelMessageParser';

0 commit comments

Comments
 (0)