message.clj
Branches > main > 6f2bf2a > files / src / net / bowmap / network / message.clj
(ns net.bowmap.network.message
(:require
[clojure.alpha.spec :as s]
[dev.grahp.spec :as S]))
(S/def ::id
"The id of a message. See the serverbound and clientbound packet definitions for the names."
qualified-keyword?)
(S/def ::numeric-id
"Protocol id of a packet, i.e. 0x00, 0x80, etc.
Numeric ids are NOT unique across connection states! See the wiki"
pos-int?)
(S/def ::message
"Represents a logical message map (object) from client to/from server.
'Packet' is used to refer to a serialized message"
(s/schema [::id]))