import { PolusBuffer } from "../../util/polusBuffer" ; import { PacketHandler } from "../packet" ; import { RoomCode } from "../packetElements/roomCode" ; export interface AlterGamePacket { type : "AlterGame" ; RoomCode : string ; AlterGameTag : number ; IsPublic : boolean ; } export const AlterGame = { parse ( packet ) { return { type : "AlterGame" , RoomCode : RoomCode . decode ( packet . read32 ( ) ) , AlterGameTag : packet . readU8 ( ) , IsPublic : packet . readBoolean ( ) , } ; } , serialize ( packet ) { const buf = new PolusBuffer ( 5 ) ; buf . write32 ( RoomCode . encode ( packet . RoomCode ) ) ; buf . writeU8 ( packet . AlterGameTag ) ; buf . writeBoolean ( packet . IsPublic ) ; return buf ; } , } ;