You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 15:36:18 +00:00
Move to Renderer V2
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class CheckUserNameResultMessageParser implements IMessageParser
|
||||
{
|
||||
private _resultCode: number;
|
||||
private _name: string;
|
||||
private _nameSuggestions: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._resultCode = -1;
|
||||
this._name = '';
|
||||
this._nameSuggestions = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._resultCode = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
|
||||
let totalSuggestions = wrapper.readInt();
|
||||
|
||||
while(totalSuggestions > 0)
|
||||
{
|
||||
this._nameSuggestions.push(wrapper.readString());
|
||||
|
||||
totalSuggestions--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get resultCode(): number
|
||||
{
|
||||
return this._resultCode;
|
||||
}
|
||||
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get nameSuggestions(): string[]
|
||||
{
|
||||
return this._nameSuggestions;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user