Fix LEFT command handling qmlfrontend
authorunc0rr
Wed, 02 Dec 2015 22:30:13 +0300
branchqmlfrontend
changeset 11446 908aed8525f9
parent 11445 330c14f4ba69
child 11447 6b04a266feee
Fix LEFT command handling
hedgewars/uFLNet.pas
hedgewars/uFLNetProtocol.pas
hedgewars/uFLNetTypes.pas
tools/protocolParser.hs
--- a/hedgewars/uFLNet.pas	Wed Dec 02 22:21:23 2015 +0300
+++ b/hedgewars/uFLNet.pas	Wed Dec 02 22:30:13 2015 +0300
@@ -207,7 +207,7 @@
     @handler_MS, @handler_S, @handler_SL, @handler_L, @handler_S, @handler_,
     @handler_, @handler_MS, @handler_S, @handler_MS, @handler_MS, @handler_S,
     @handler_i, @handler_MS, @handler_L, @handler_S, @handler_SL, @handler_MS,
-    @handler_SMS, @handler_, @handler_S, @handler_MS, @handler_MS, @handler_MS,
+    @handler_SL, @handler_, @handler_S, @handler_MS, @handler_MS, @handler_MS,
     @handler_L, @handler_ML, @handler__i, @handler_SMS, @handler_SL, @handler_S,
     @handler_i, @handler_S, @handler_S, @handler_MS, @handler_i, @handler_i,
     @handler_S, @handler_ML, @handler_i, @handler_L, @handler_SL, @handler_SL,
--- a/hedgewars/uFLNetProtocol.pas	Wed Dec 02 22:21:23 2015 +0300
+++ b/hedgewars/uFLNetProtocol.pas	Wed Dec 02 22:30:13 2015 +0300
@@ -292,13 +292,10 @@
     sendUI(mtMoveToLobby, nil, 0);
 end;
 
-procedure handler_LEFT(var p: TCmdParamS);
+procedure handler_LEFT(var p: TCmdParamSL);
 begin
-    sendUI(mtRemoveLobbyClient, @p.str1[1], length(p.str1));
-end;
-
-procedure handler_LEFT_s(var s: TCmdParamS);
-begin
+    p.str2:= p.str1 + #10 + p.str2;
+    sendUI(mtRemoveRoomClient, @p.str2[1], length(p.str2));
 end;
 
 procedure handler_LOBBY_JOINED(var p: TCmdParam);
@@ -464,19 +461,18 @@
     PHandler(@handler_HH_NUM_s), PHandler(@handler_INFO), PHandler(@handler_INFO_s),
     PHandler(@handler_JOINED), PHandler(@handler_JOINED_s),
     PHandler(@handler_JOINING), PHandler(@handler_KICKED), PHandler(@handler_LEFT),
-    PHandler(@handler_LEFT_s), PHandler(@handler_LOBBY_JOINED),
-    PHandler(@handler_LOBBY_JOINED_s), PHandler(@handler_LOBBY_LEFT),
-    PHandler(@handler_NICK), PHandler(@handler_NOTICE), PHandler(@handler_PING),
-    PHandler(@handler_PING_s), PHandler(@handler_PROTO),
-    PHandler(@handler_REMOVE_TEAM), PHandler(@handler_ROOMS),
-    PHandler(@handler_ROOMS_s), PHandler(@handler_ROOM_ADD),
-    PHandler(@handler_ROOM_ADD_s), PHandler(@handler_ROOM_DEL),
-    PHandler(@handler_ROOM_UPD), PHandler(@handler_ROOM_UPD_s),
-    PHandler(@handler_ROUND_FINISHED), PHandler(@handler_RUN_GAME),
-    PHandler(@handler_SERVER_AUTH), PHandler(@handler_SERVER_MESSAGE),
-    PHandler(@handler_SERVER_VARS), PHandler(@handler_TEAM_ACCEPTED),
-    PHandler(@handler_TEAM_COLOR), PHandler(@handler_TEAM_COLOR_s),
-    PHandler(@handler_WARNING));
+    PHandler(@handler_LOBBY_JOINED), PHandler(@handler_LOBBY_JOINED_s),
+    PHandler(@handler_LOBBY_LEFT), PHandler(@handler_NICK),
+    PHandler(@handler_NOTICE), PHandler(@handler_PING), PHandler(@handler_PING_s),
+    PHandler(@handler_PROTO), PHandler(@handler_REMOVE_TEAM),
+    PHandler(@handler_ROOMS), PHandler(@handler_ROOMS_s),
+    PHandler(@handler_ROOM_ADD), PHandler(@handler_ROOM_ADD_s),
+    PHandler(@handler_ROOM_DEL), PHandler(@handler_ROOM_UPD),
+    PHandler(@handler_ROOM_UPD_s), PHandler(@handler_ROUND_FINISHED),
+    PHandler(@handler_RUN_GAME), PHandler(@handler_SERVER_AUTH),
+    PHandler(@handler_SERVER_MESSAGE), PHandler(@handler_SERVER_VARS),
+    PHandler(@handler_TEAM_ACCEPTED), PHandler(@handler_TEAM_COLOR),
+    PHandler(@handler_TEAM_COLOR_s), PHandler(@handler_WARNING));
 
 procedure passNetData(p: pointer); cdecl;
 begin
--- a/hedgewars/uFLNetTypes.pas	Wed Dec 02 22:21:23 2015 +0300
+++ b/hedgewars/uFLNetTypes.pas	Wed Dec 02 22:30:13 2015 +0300
@@ -8,12 +8,12 @@
     cmd_CFG_SEED, cmd_CFG_TEMPLATE, cmd_CFG_THEME, cmd_CHAT, cmd_CLIENT_FLAGS,
     cmd_CLIENT_FLAGS_s, cmd_CONNECTED, cmd_EM, cmd_EM_s, cmd_ERROR, cmd_HH_NUM,
     cmd_HH_NUM_s, cmd_INFO, cmd_INFO_s, cmd_JOINED, cmd_JOINED_s, cmd_JOINING,
-    cmd_KICKED, cmd_LEFT, cmd_LEFT_s, cmd_LOBBY_JOINED, cmd_LOBBY_JOINED_s,
-    cmd_LOBBY_LEFT, cmd_NICK, cmd_NOTICE, cmd_PING, cmd_PING_s, cmd_PROTO,
-    cmd_REMOVE_TEAM, cmd_ROOMS, cmd_ROOMS_s, cmd_ROOM_ADD, cmd_ROOM_ADD_s,
-    cmd_ROOM_DEL, cmd_ROOM_UPD, cmd_ROOM_UPD_s, cmd_ROUND_FINISHED, cmd_RUN_GAME,
-    cmd_SERVER_AUTH, cmd_SERVER_MESSAGE, cmd_SERVER_VARS, cmd_TEAM_ACCEPTED,
-    cmd_TEAM_COLOR, cmd_TEAM_COLOR_s, cmd_WARNING);
+    cmd_KICKED, cmd_LEFT, cmd_LOBBY_JOINED, cmd_LOBBY_JOINED_s, cmd_LOBBY_LEFT,
+    cmd_NICK, cmd_NOTICE, cmd_PING, cmd_PING_s, cmd_PROTO, cmd_REMOVE_TEAM,
+    cmd_ROOMS, cmd_ROOMS_s, cmd_ROOM_ADD, cmd_ROOM_ADD_s, cmd_ROOM_DEL,
+    cmd_ROOM_UPD, cmd_ROOM_UPD_s, cmd_ROUND_FINISHED, cmd_RUN_GAME, cmd_SERVER_AUTH,
+    cmd_SERVER_MESSAGE, cmd_SERVER_VARS, cmd_TEAM_ACCEPTED, cmd_TEAM_COLOR,
+    cmd_TEAM_COLOR_s, cmd_WARNING);
 
     type TCmdParam = packed record
         cmd: TCmdType;
--- a/tools/protocolParser.hs	Wed Dec 02 22:21:23 2015 +0300
+++ b/tools/protocolParser.hs	Wed Dec 02 22:30:13 2015 +0300
@@ -78,7 +78,7 @@
         , cmd1 "LOBBY:JOINED" $ Many [SS]
         , cmd2 "LOBBY:LEFT" SS LS
         , cmd2 "CLIENT_FLAGS" SS $ Many [SS]
-        , cmd2 "LEFT" SS $ Many [SS]
+        , cmd2 "LEFT" SS LS
         , cmd1 "SERVER_MESSAGE" LS
         , cmd1 "ERROR" LS
         , cmd1 "NOTICE" LS