message.clj

Branches > main > bdc7514 > files / src / net / bowmap / network / protocol / message.clj

(ns net.bowmap.network.protocol.message
  (:require
   [clojure.spec.alpha :as s]
   [dev.grahp.spec :as S]))

(S/def ::id
  "The id of a message. See the serverbound and clientbound message definitions for the names."
  qualified-keyword?)

(S/def ::numeric-id
  "Protocol id of a message, 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."
  (s/keys :opt [::id]))