From 242a0b4e7deb356a0015fbf536158962ad2ea29c Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 25 Feb 2023 15:09:58 +0000 Subject: move player size to constants.lua; fix channel-related bug where player movement wasn't being recieved properly --- server/server.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/server.lua b/server/server.lua index 03a5fd9..097bc99 100644 --- a/server/server.lua +++ b/server/server.lua @@ -9,7 +9,7 @@ local MapS = require"map".MapS local posix_time = require"posix.time" math.randomseed(os.time()) -local host = enet.host_create("*:8473") +local host = enet.host_create("*:8473",nil,2) print(host:get_socket_address()) -- sequential list of all players @@ -96,6 +96,7 @@ local function handle_ev(ev) local player = player_by_peer(ev.peer) if not player then error("sneezey "..ev.peer) end local j = json.decode(ev.data) + -- print(ev.channel,ev.data) local op = j.t if op == "ppos" then local x,y = j.x,j.y -- cgit v1.2.3