import { Uint64LE } from 'int64-buffer' ; import { InPacketBase } from 'packets/in/packet' ; import { RoomStatus } from 'room/room' ; class export class InRoomUpdateSettings { public flags : Uint64LE ; public roomName : string ; public unk00 : number ; public unk01 : number ; public unk02 : number ; public unk03 : number ; public roomPassword : string ; public unk10 : number ; public forceCamera : number ; public gameModeId : number ; public mapId : number ; public unk13 : number ; public maxPlayers : number ; public winLimit : number ; public killLimit : number ; public unk17 : number ; public unk18 : number ; public weaponRestrictions : number ; public status : RoomStatus ; public unk21 : number ; public mapCycleType : number ; public unk23 : number ; public unk24 : number ; public unk25 : number ; public numOfMultiMaps : number ; public multiMaps : number [ ] ; public teamBalanceType : number ; public unk29 : number ; public unk30 : number ; public unk31 : number ; public unk32 : number ; public unk33 : number ; public botEnabled : number ; public botDifficulty : number ; public numCtBots : number ; public numTrBots : number ; public unk35 : number ; public unk36 : number ; public unk37 : number ; public unk38 : number ; public unk39 : number ; public isIngame : boolean ; public startMoney : number ; public changeTeams : number ; public unk43 : number ; public hltvEnabled : number ; public difficulty : number ; public respawnTime : number ; constructor ( inPacket ) { if ( inPacket == null ) { return ; } this . flags = inPacket . readUInt64 ( ) ; const flagBuf = this . flags . toBuffer ( true ) ; const lowFlag = flagBuf . readUInt32LE ( 0 ) ; const highFlag = flagBuf . readUInt32LE ( 4 ) ; if ( lowFlag & 0x1 ) { this . roomName = inPacket . readString ( ) ; } if ( lowFlag & 0x2 ) { this . unk00 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x4 ) { this . unk01 = inPacket . readUInt8 ( ) ; this . unk02 = inPacket . readUInt32 ( ) ; this . unk03 = inPacket . readUInt32 ( ) ; } if ( lowFlag & 0x8 ) { this . roomPassword = inPacket . readString ( ) ; } if ( lowFlag & 0x10 ) { this . unk10 = inPacket . readUInt16 ( ) ; } if ( lowFlag & 0x20 ) { this . forceCamera = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x40 ) { this . gameModeId = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x80 ) { this . mapId = inPacket . readUInt8 ( ) ; this . unk13 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x100 ) { this . maxPlayers = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x200 ) { this . winLimit = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x400 ) { this . killLimit = inPacket . readUInt16 ( ) ; } if ( lowFlag & 0x800 ) { this . unk17 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x1000 ) { this . unk18 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x2000 ) { this . weaponRestrictions = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x4000 ) { this . status = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x8000 ) { this . unk21 = inPacket . readUInt8 ( ) ; this . mapCycleType = inPacket . readUInt8 ( ) ; this . unk23 = inPacket . readUInt8 ( ) ; this . unk24 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x10000 ) { this . unk25 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x20000 ) { this . numOfMultiMaps = inPacket . readUInt8 ( ) ; this . multiMaps = [ ] ; for ( let i = 0 ; i < this . numOfMultiMaps ; i ++ ) { this . multiMaps [ i ] = inPacket . readUInt8 ( ) ; } } if ( lowFlag & 0x40000 ) { this . teamBalanceType = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x80000 ) { this . unk29 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x100000 ) { this . unk30 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x200000 ) { this . unk31 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x400000 ) { this . unk32 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x800000 ) { this . unk33 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x1000000 ) { this . botEnabled = inPacket . readUInt8 ( ) ; if ( this . botEnabled === 1 ) { this . botDifficulty = inPacket . readUInt8 ( ) ; this . numCtBots = inPacket . readUInt8 ( ) ; this . numTrBots = inPacket . readUInt8 ( ) ; } } if ( lowFlag & 0x2000000 ) { this . unk35 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x4000000 ) { this . unk36 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x8000000 ) { this . unk37 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x10000000 ) { this . unk38 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x20000000 ) { this . unk39 = inPacket . readUInt8 ( ) ; } if ( lowFlag & 0x40000000 ) { this . isIngame = inPacket . readUInt8 ( ) === 1 ? true : false ; } if ( lowFlag & 0x80000000 ) { this . startMoney = inPacket . readUInt16 ( ) ; } if ( highFlag & 0x1 ) { this . changeTeams = inPacket . readUInt8 ( ) ; } if ( highFlag & 0x2 ) { this . unk43 = inPacket . readUInt8 ( ) ; } if ( highFlag & 0x4 ) { this . hltvEnabled = inPacket . readUInt8 ( ) ; } if ( highFlag & 0x8 ) { this . difficulty = inPacket . readUInt8 ( ) ; } if ( highFlag & 0x10 ) { this . respawnTime = inPacket . readUInt8 ( ) ; } } }