diff options
author | ubq323 <ubq323@ubq323.website> | 2023-08-27 00:31:54 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-08-27 00:31:54 +0100 |
commit | ef0b7de7745c8932ff76fef2dd267c1d7a0d4b69 (patch) | |
tree | e5876c15da3bd013ce13bc41e8ff4514268f771a /client | |
parent | 00d6c715e8d71056274e22b3a7eae2e55d3840c1 (diff) |
move chat formatting to serverside, and make chat messages include username
Diffstat (limited to 'client')
-rw-r--r-- | client/game.lua | 5 |
1 files changed, 1 insertions, 4 deletions
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 |