Move to Renderer V2

This commit is contained in:
duckietm
2024-04-03 09:27:56 +02:00
parent 110c3ad393
commit b3134ce50b
4080 changed files with 115593 additions and 66375 deletions
@@ -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';