Packet handling order of operations notes
This commit is contained in:
@@ -11,6 +11,25 @@
|
||||
|
||||
## Shared
|
||||
* Can be internal packet
|
||||
* If packet is smaller then 3 bytes; forward to plugin handlers (*)before handling them (len(data) <= 2)
|
||||
|
||||
## Order of operations
|
||||
1. Check if banned (if true, cancel rest and handle) [^1]
|
||||
2. If first byte in data is (0x19, 0x1d, 0x1f, 0x24 or 0x18) custom code flow required [^2]
|
||||
3. HandleSocketReceiveFromConnectedPlayer (cancel rest if handled)
|
||||
4. Check if cheat (modified) packet (unexpected at this time, there are some packets we can expect) [^3]
|
||||
|
||||
[^1]: this could be changed in custom implementation (dont allow inital connection instead)
|
||||
[^2]: if (0x18 and length == 2) or (0x19 and length <= 2):
|
||||
handle packet and return
|
||||
elif (0x1d or 0x1f or 0x24) and length <= 2:
|
||||
handle packet, but continue
|
||||
[^3]: if ((0x18 or 0x1a) and length <= 3) or ((0x19 or 0x1d) and length <= 2) or
|
||||
((0x08 or 0x07 or 0x27) and length >= 5) or (0x37 and length < 400):
|
||||
We expect this packet, everything is ok?
|
||||
else:
|
||||
This is a cheat (modified / injected) packet that should not arrive at this time
|
||||
Send a packet to client that you received a modified packet (0x26)
|
||||
|
||||
# Internal packet
|
||||
|condition|name|bit length|type|notes|
|
||||
|
||||
Reference in New Issue
Block a user