Type Alias SocketEvents
bounced: [packet: BouncedPacket, data: JSONRecord];
connected: [packet: ConnectedPacket];
connectionRefused: [packet: ConnectionRefusedPacket];
dataPackage: [packet: DataPackagePacket];
disconnected: [];
invalidPacket: [packet: InvalidPacketPacket];
locationInfo: [packet: LocationInfoPacket];
printJSON: [packet: PrintJSONPacket];
receivedItems: [packet: ReceivedItemsPacket];
receivedPacket: [packet: ServerPacket];
retrieved: [packet: RetrievedPacket];
roomInfo: [packet: RoomInfoPacket];
roomUpdate: [packet: RoomUpdatePacket];
sentPackets: [packets: ClientPacket[]];
setReply: [packet: SetReplyPacket];
}
Properties
bounced
Fires when the client receives a BouncedPacket.
Param: packet
The raw BouncedPacket.
connected
Fires when the client receives a ConnectedPacket
Param: packet
The raw ConnectedPacket packet.
connectionRefused
Fires when the client receives a ConnectionRefusedPacket.
Param: packet
The raw ConnectionRefusedPacket.
dataPackage
Fires when the client receives a DataPackagePacket.
Param: packet
The raw DataPackagePacket.
disconnected
Fires when the client has lost connection to the server, intentionally or not.
invalidPacket
Fires when the client receives a InvalidPacketPacket.
Param: packet
The raw InvalidPacketPacket.
locationInfo
Fires when the client receives a LocationInfoPacket.
Param: packet
The raw LocationInfoPacket.
printJSON
Fires when the client receives a PrintJSONPacket.
Param: packet
The raw PrintJSONPacket packet.
receivedItems
Fires when the client receives a ReceivedItemsPacket.
Param: packet
The raw ReceivedItemsPacket.
receivedPacket
Fires when the client receives any ServerPacket.
Param: packet
Any received ServerPacket. Additional checks on the cmd property will be required to
determine the type of packet received.
retrieved
Fires when the client receives a RetrievedPacket.
Param: packet
The raw RetrievedPacket.
roomInfo
Fires when the client receives a RoomInfoPacket.
Param: packet
The raw RoomInfoPacket.
roomUpdate
Fires when the client receives a RoomUpdatePacket.
Param: packet
The raw RoomUpdatePacket.
sentPackets
Fires when the client sends an array of ClientPacket.
Param: packets
An array of ClientPacket sent to the server.
setReply
Fires when the client receives a SetReplyPacket.
Param: packet
The raw SetReplyPacket.
An interface with all supported socket events and their respective callback arguments. To be called from SocketManager.
Example