cdcec40
Branches > refactor/use-spec-1 > cdcec40 > files / src / dev
Yap about minecraft protocol packets in a comment
Commit: cdcec40370d25457d79378cb723acd8d1449abd6
Parent: 6c48ce5
1 changed file:
src/net/bowmap/packet.clj view file
@@ -6,9 +6,19 @@ ; The name of the packet id keyword, i.e. ::server/handshaking (s/def ::id qualified-keyword?) -; Packets will have a bunch of unqualified keys for their fields+; Represents a Minecraft protocol packet ; See net.bowmap.packets.client and net.bowmap.packets.server for those+; In serialized form, uncompressed packets have the following structure:+; - A length varint (see net.bowmap.packet.types)+; - A numeric id varint (::numeric-id)+; - The rest of the packet data, which depends on the ID+; Each protocol connection state (see net.bowmap.client.state) has its own set+; of numeric ids for clientbound and serverbound packets, so there isn't a+; direct function of numeric ids to '::id's.+; See 'net.bowmap.packet.client/packet-ids' and 'net.bowmap.packet.server/packet-ids' though+; Packet maps will also contain other fields as defined in 'packets' of the above namespaces (s/def ::packet (s/schema [::id])) +; This could actually check the id and fields to see if it's valid if there's any point in that (defn packet? [x] (some? (::id x)))