Skip to content

Codec

The Codec class insisde of Zombslib is the main packet decoding/encoding interface. It is what Game uses internally to deal with raw data.

IDPacket typeEncodeDecodeCodec method
0EntityUpdatede/encodeEntityUpdate()
1PlayerCounterUpdate
2SetWorldDimensions
3Input
4EnterWorld (req)de/encodeEnterWorldRequest()
4EnterWorld (res)de/encodeEnterWorldResponse()
7Ping
9Rpcde/encodeRpc()
10UdpConnect (req)de/encodeUdpConnectRequest()
10UdpConnect (res)de/encodeUdpConnectResponse()
11UdpTickde/encodeUdpTick()
12UdpAckTickde/encodeUdpAckTick()
13UdpPong
14UdpTickWithCompressedUidsde/encdodeUdpTick()
15UdpFragmentde/encodeUdpFragment()
16UdpConnect1300 (req)de/encodeUdpConnectRequest()
16UdpConnect1300 (res)de/encodeUdpConnectResponse()
17UdpConnect500 (req)de/encodeUdpConnectRequest()
17UdpConnect500 (res)de/encodeUdpConnectResponse()
-1UdpRpcde/encodeRpc()

Documentation for ZRCrypto class, as well as the rest of Codec is going to be completed in a later time frame.

In case the RPC mapping, for whatever reason, doesn’t contain a descriptor for an RPC with a given namehash, the following fallbacks are used:

  • Rpc name: R_0x{rpc-namehash-hex}
  • Rpc parameter name: P_0x{param-namehash-hex}

The same parameter name fallback is used when a descriptor exists but the needed parameter can’t be found in it.

Analgoically, entity map attributes (Tick fields) unaccounted for by Codec.getAttributeName(), use a similar convention:

  • Attribute name: A_0x{attr-id-hex}