16276c5
Branches > client-handling-rewrite > 16276c5 > files
Rename start-server2!
Commit: 16276c56a67e0b4a5fc03a1c1fe0c9e8fbc42df1
Parent: a6d1abb
2 changed files:
src/net/bowmap/core.clj view file
@@ -8,11 +8,7 @@ [net.bowmap.network.message.server :as server] [net.bowmap.server :as server-process])) -; Glossary to probably use--; Packet: a serialized byte form, may be framed or unframed-; Framed packet: a byte representation that holds exactly one serialized message-; Message: a map that represents a message being sent between the client and the server, a.k.a. a deserialized packet+;; TODO yeah... (defn handle-packet "Handles one ByteBuf of a framed serialized serverbound packet, and returns a@@ -26,6 +22,7 @@ (fn [client msg] (:msg/id msg))) +; Should be per-client and able to dispatch to the global thing, probably a tick loop or async dun really matter (defn handle-message! "Handles one serverbound message from 'client', and performs the side effects of that message. Returns the new client state."@@ -76,8 +73,8 @@ (println "In client handler: " e))))) (defn start-server []- (server-process/start-server2! {:handler #'client-handler- :port 25565}))+ (server-process/start-server! {:handler #'client-handler+ :port 25565})) (defn -main [& _args] (start-server)src/net/bowmap/server.clj view file
@@ -35,7 +35,7 @@ (io-thread (handler in out)))) ; Could return a channel of clients?-(defn start-server2!+(defn start-server! "Starts a server at the port, calling 'handler' with an 'in' and 'out' channel of packets." [& {:keys [handler port]}] (tcp/start-server (fn [stream info]