You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
Move to Renderer V2
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class ChangeUserNameResultMessageParser 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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class FigureUpdateParser implements IMessageParser
|
||||
{
|
||||
private _figure: string;
|
||||
private _gender: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._figure = '';
|
||||
this._gender = '';
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._figure = wrapper.readString();
|
||||
this._gender = wrapper.readString();
|
||||
|
||||
if(this._gender) this._gender = this._gender.toUpperCase();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get gender(): string
|
||||
{
|
||||
return this._gender;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { IMessageDataWrapper } from '@nitrots/api';
|
||||
|
||||
export class OutfitData
|
||||
{
|
||||
private _slotId: number;
|
||||
private _figureString: string;
|
||||
private _gender: string;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._slotId = wrapper.readInt();
|
||||
this._figureString = wrapper.readString();
|
||||
this._gender = wrapper.readString();
|
||||
}
|
||||
|
||||
public get slotId(): number
|
||||
{
|
||||
return this._slotId;
|
||||
}
|
||||
|
||||
public get figureString(): string
|
||||
{
|
||||
return this._figureString;
|
||||
}
|
||||
|
||||
public get gender(): string
|
||||
{
|
||||
return this._gender;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { OutfitData } from './OutfitData';
|
||||
|
||||
export class WardrobeMessageParser implements IMessageParser
|
||||
{
|
||||
private _state: number;
|
||||
private _outfits: OutfitData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._state = 0;
|
||||
this._outfits = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._state = wrapper.readInt();
|
||||
|
||||
let count = wrapper.readInt();
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
this._outfits.push(new OutfitData(wrapper));
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get state(): number
|
||||
{
|
||||
return this._state;
|
||||
}
|
||||
|
||||
public get outfits(): OutfitData[]
|
||||
{
|
||||
return this._outfits;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export * from './ChangeUserNameResultMessageParser';
|
||||
export * from './CheckUserNameResultMessageParser';
|
||||
export * from './FigureUpdateParser';
|
||||
export * from './OutfitData';
|
||||
export * from './WardrobeMessageParser';
|
||||
Reference in New Issue
Block a user