Socket messages
We also refer socket messages to its more specific term called a packet.
The game sends different kind of packets, but we are only interested in the usefull data here.
Here's an example:
{
mapId: 847563
mapKey: "4kz7mm31r0edda5m16em8ew2etgq9nxj"
_isInitialized: true
_messageType: "CurrentMapMessage"
}
As you can see, the _messageType
key tells you wich event is being sent.
With that, we can detect and attach systems to specific events when listening to the socket.