forked from billsonnn/nitro-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
billsonnn#28 - IdentityAccountsEvent added
- Loading branch information
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/handshake/IdentityAccountsEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './IdentityAccountsEvent'; | ||
export * from './NoobnessLevelMessageEvent'; |
39 changes: 39 additions & 0 deletions
39
src/nitro/communication/messages/parser/handshake/IdentityAccountsParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; | ||
|
||
export class IdentityAccountsParser implements IMessageParser | ||
{ | ||
private _Str_8999: Map<number, string>; | ||
|
||
public flush(): boolean | ||
{ | ||
if(this._Str_8999) | ||
{ | ||
this._Str_8999 = new Map(); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public parse(wrapper: IMessageDataWrapper): boolean | ||
{ | ||
if(!wrapper) return false; | ||
|
||
this._Str_8999 = new Map(); | ||
|
||
let totalCount = wrapper.readInt(); | ||
|
||
while(totalCount > 0) | ||
{ | ||
this._Str_8999.set(wrapper.readInt(), wrapper.readString()); | ||
|
||
totalCount--; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public get Str_8999(): Map<number, string> | ||
{ | ||
return this._Str_8999; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './IdentityAccountsParser'; | ||
export * from './NoobnessLevelMessageParser'; |