2258a02
Branches > main > 2258a02 > files
Separate frames as being ByteBufs
Commit: 2258a023b2782056e71c930e6ac25022311fbcda
Parent: 0cc811b
3 changed files:
src/net/bowmap/server/protocol/frame.clj view file
@@ -3,12 +3,8 @@ A frame contains the packet's numeric id and payload. Frames are not length-prefixed. See https://minecraft.wiki/w/Java_Edition_protocol/Packets for the format."- (:require- [clojure.spec.alpha :as s]) (:import- [io.netty.buffer ByteBuf Unpooled]))--(s/def ::frame #(instance? ByteBuf %))+ [io.netty.buffer Unpooled])) (defn frame "Returns an empty frame, or a frame containing the bytes of an array."src/net/bowmap/server/protocol/readers.clj view file
@@ -13,7 +13,7 @@ [java.util UUID])) (s/def ::reader (s/fspec- :args (s/cat :frame ::frame)+ :args (s/cat :buf #(instance? ByteBuf %)) :ret any?)) (defn- read-fieldsrc/net/bowmap/server/protocol/writers.clj view file
@@ -12,8 +12,8 @@ [java.util UUID])) (s/def ::writer (s/fspec- :args (s/cat :frame ::frame :value any?)- :fn #(= (-> % :args :frame)+ :args (s/cat :buf #(instance? ByteBuf %) :value any?)+ :fn #(= (-> % :args :buf) (:ret %)))) (defn- write-field