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,44 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { BannedUserData } from './BannedUserData';
|
||||
|
||||
export class BannedUsersFromRoomParser implements IMessageParser
|
||||
{
|
||||
private _roomId: number;
|
||||
private _bannedUsers: BannedUserData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._roomId = 0;
|
||||
this._bannedUsers = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
let totalBans = wrapper.readInt();
|
||||
|
||||
while(totalBans > 0)
|
||||
{
|
||||
this._bannedUsers.push(new BannedUserData(wrapper));
|
||||
|
||||
totalBans--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomId(): number
|
||||
{
|
||||
return this._roomId;
|
||||
}
|
||||
|
||||
public get bannedUsers(): BannedUserData[]
|
||||
{
|
||||
return this._bannedUsers;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user