From ef0b7de7745c8932ff76fef2dd267c1d7a0d4b69 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 27 Aug 2023 00:31:54 +0100 Subject: move chat formatting to serverside, and make chat messages include username --- client/game.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'client') diff --git a/client/game.lua b/client/game.lua index ede8d98..cf57c81 100644 --- a/client/game.lua +++ b/client/game.lua @@ -197,10 +197,8 @@ local function handle_net() color=pl.color, id=pl.id, username = pl.username, } - msgbox.add(pl.username.." joined") elseif op == "leave" then local id = j.id - msgbox.add(remote_players[id].username.." left") remote_players[id]=nil elseif op == "move" then local id,x,y = j.id,j.x,j.y @@ -224,8 +222,7 @@ local function handle_net() local h = coords.Hex:make(j.q,j.r) map:set_at(h,j.tile) elseif op == "chat" then - local msg,from = j.msg,j.from - msgbox.add("["..tostring(from).."] "..msg) + msgbox.add(j.msg) end end until not ev -- cgit v1.2.3