import { PolusBuffer } from "../../util/polusBuffer" ; import { PacketHandler } from "../packet" ; import { RoomCode } from "../packetElements/roomCode" ; export interface WaitingForHostPacket { type : "WaitingForHost" ; RoomCode : string ; WaitingClientID : number ; } export const WaitingForHost = { parse ( packet ) { return { type : "WaitingForHost" , RoomCode : RoomCode . decode ( packet . read32 ( ) ) , WaitingClientID : packet . readU32 ( ) , } ; } , serialize ( packet ) { var buf = new PolusBuffer ( ) ; buf . write32 ( RoomCode . encode ( packet . RoomCode ) ) ; buf . writeU32 ( packet . WaitingClientID ) ; return buf ; } , } ;