From 26fa55c428500ca33078b228c498697eee527ba0 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sun, 13 Nov 2022 15:54:27 +0100 Subject: [PATCH] Do not crash server on emotes --- lib/game_server.rb | 5 +++++ lib/teeworlds_server.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/game_server.rb b/lib/game_server.rb index 8e23f7a..be54b06 100644 --- a/lib/game_server.rb +++ b/lib/game_server.rb @@ -23,6 +23,11 @@ class GameServer ) end + def on_emoticon(chunk, packet) + # TODO: generate ClEmoticon using + # twgen g ClEmoticon emoticon:int + end + def on_info(chunk, packet) u = Unpacker.new(chunk.data[1..]) net_version = u.get_string diff --git a/lib/teeworlds_server.rb b/lib/teeworlds_server.rb index f63081b..d610b51 100644 --- a/lib/teeworlds_server.rb +++ b/lib/teeworlds_server.rb @@ -105,6 +105,7 @@ class TeeworldsServer case chunk.msg when NETMSGTYPE_CL_STARTINFO then @game_server.on_start_info(chunk, packet) when NETMSGTYPE_CL_SAY then @game_server.on_say(chunk, packet) + when NETMSGTYPE_CL_EMOTICON then @game_server.on_emoticon(chunk, packet) else puts "Unsupported game msg: #{chunk.msg}" exit(1)