Apply generated code to .pas files, fix FULLMAPCONFIG handling qmlfrontend
authorunc0rr
Tue, 24 Nov 2015 20:19:00 +0300
branchqmlfrontend
changeset 11429 d96a37de1076
parent 11428 cc12bba5b2a2
child 11430 f88b3948adf3
Apply generated code to .pas files, fix FULLMAPCONFIG handling
hedgewars/uFLNet.pas
hedgewars/uFLNetProtocol.pas
hedgewars/uFLNetTypes.pas
tools/protocolParser.hs
--- a/hedgewars/uFLNet.pas	Tue Nov 24 12:09:41 2015 +0300
+++ b/hedgewars/uFLNet.pas	Tue Nov 24 20:19:00 2015 +0300
@@ -32,34 +32,6 @@
 procedure handleTail; forward;
 function getShortString: shortstring; forward;
 
-const letters: array[0..224] of char = ('A', 'S', 'K', 'P', 'A', 'S', 'S', 'W',
-    'O', 'R', 'D', #10, 'B', 'A', 'N', 'L', 'I', 'S', 'T', #10, 'Y', 'E', #10, 'C',
-    'H', 'A', 'T', #10, 'L', 'I', 'E', 'N', 'T', '_', 'F', 'L', 'A', 'G', 'S', #10,
-    'O', 'N', 'N', 'E', 'C', 'T', 'E', 'D', #10, 'E', 'M', #10, 'R', 'R', 'O', 'R',
-    #10, 'H', 'H', '_', 'N', 'U', 'M', #10, 'I', 'N', 'F', 'O', #10, 'J', 'O', 'I',
-    'N', 'E', 'D', #10, 'I', 'N', 'G', #10, 'K', 'I', 'C', 'K', 'E', 'D', #10, 'L',
-    'E', 'F', 'T', #10, 'O', 'B', 'B', 'Y', ':', 'J', 'O', 'I', 'N', 'E', 'D', #10,
-    'L', 'E', 'F', 'T', #10, 'N', 'I', 'C', 'K', #10, 'O', 'T', 'I', 'C', 'E', #10,
-    'P', 'I', 'N', 'G', #10, 'R', 'O', 'T', 'O', #10, 'R', 'O', 'O', 'M', 'S', #10,
-    #10, 'A', 'D', 'D', #10, 'D', 'E', 'L', #10, 'U', 'P', 'D', #10, 'U', 'N', 'D',
-    '_', 'F', 'I', 'N', 'I', 'S', 'H', 'E', 'D', #10, 'U', 'N', '_', 'G', 'A', 'M',
-    'E', #10, 'S', 'E', 'R', 'V', 'E', 'R', '_', 'A', 'U', 'T', 'H', #10, 'M', 'E',
-    'S', 'S', 'A', 'G', 'E', #10, 'V', 'A', 'R', 'S', #10, 'T', 'E', 'A', 'M', '_',
-    'A', 'C', 'C', 'E', 'P', 'T', 'E', 'D', #10, 'C', 'O', 'L', 'O', 'R', #10, 'W',
-    'A', 'R', 'N', 'I', 'N', 'G', #10, #0, #10);
-const commands: array[0..224] of integer = (12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    -42, 11, 7, 0, 0, 0, 0, 0, -41, 0, 0, -40, 26, 4, 0, 0, -39, 12, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, -37, 8, 2, -36, 0, 0, 0, 0, -35, 7,
-    0, 0, 0, 0, 0, -34, 5, 0, 0, 0, -33, 11, 0, 0, 0, 3, 0, -32, 0, 0, 0, -31, 7, 0,
-    0, 0, 0, 0, -30, 22, 4, 0, 0, -29, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, -28, 0, 0,
-    0, 0, -27, 11, 4, 0, 0, -26, 0, 0, 0, 0, 0, -25, 10, 4, 0, 0, -24, 0, 0, 0, 0,
-    -23, 40, 31, 17, 0, 2, -22, 0, 4, 0, 0, -21, 4, 0, 0, -20, 0, 0, 0, -19, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, -17, 25, 0, 0, 0, 0, 0,
-    0, 5, 0, 0, 0, -16, 8, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, -14, 20, 0, 0, 0, 0,
-    9, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, -12, 8, 0, 0, 0, 0, 0, 0, -11, 0,
-    -10);
-
-
 procedure handler_;
 begin
     sendUI(mtNetData, @state.cmd, sizeof(state.cmd));
@@ -89,7 +61,8 @@
         f:= cmd.str1[0] <> #0;
         if f then
             sendUI(mtNetData, @cmd, sizeof(cmd));
-    until not f
+    until not f;
+    state.l:= 0
 end;
 
 procedure handler_MS;
@@ -104,7 +77,8 @@
         f:= cmd.str1[0] <> #0;
         if f then
             sendUI(mtNetData, @cmd, sizeof(cmd));
-    until not f
+    until not f;
+    state.l:= 0
 end;
 
 procedure handler_S;
@@ -144,7 +118,8 @@
         f:= cmd.str1[0] <> #0;
         if f then
             sendUI(mtNetData, @cmd, sizeof(cmd));
-    until not f
+    until not f;
+    state.l:= 0
 end;
 
 procedure handler__i;
@@ -171,25 +146,67 @@
 procedure handler__UNKNOWN_;
 begin
     writeln('[NET] Unknown cmd');
-    handleTail()
+    handleTail();
+    state.l:= 0
 end;
 
-const handlers: array[0..32] of PHandler = (@handler__UNKNOWN_, @handler_L,
-    @handler_MS, @handler_S, @handler_SL, @handler_L, @handler_S, @handler_,
-    @handler_, @handler_MS, @handler_S, @handler_MS, @handler_MS, @handler_i,
-    @handler_MS, @handler_L, @handler_S, @handler_SL, @handler_MS, @handler_SMS,
-    @handler_, @handler_S, @handler_MS, @handler_MS, @handler_MS, @handler_L,
-    @handler_ML, @handler__i, @handler_SMS, @handler_SL, @handler_SL, @handler_MS,
-    @handler_S);
-const net2cmd: array[0..32] of TCmdType = (cmd_WARNING, cmd_WARNING,
+const net2cmd: array[0..46] of TCmdType = (cmd_WARNING, cmd_WARNING,
     cmd_TEAM_COLOR, cmd_TEAM_ACCEPTED, cmd_SERVER_VARS, cmd_SERVER_MESSAGE,
     cmd_SERVER_AUTH, cmd_RUN_GAME, cmd_ROUND_FINISHED, cmd_ROOM_UPD, cmd_ROOM_DEL,
-    cmd_ROOM_ADD, cmd_ROOMS, cmd_PROTO, cmd_PING, cmd_NOTICE, cmd_NICK,
-    cmd_LOBBY_LEFT, cmd_LOBBY_JOINED, cmd_LEFT, cmd_KICKED, cmd_JOINING, cmd_JOINED,
-    cmd_INFO, cmd_HH_NUM, cmd_ERROR, cmd_EM, cmd_CONNECTED, cmd_CLIENT_FLAGS,
-    cmd_CHAT, cmd_BYE, cmd_BANLIST, cmd_ASKPASSWORD);
+    cmd_ROOM_ADD, cmd_ROOMS, cmd_REMOVE_TEAM, cmd_PROTO, cmd_PING, cmd_NOTICE,
+    cmd_NICK, cmd_LOBBY_LEFT, cmd_LOBBY_JOINED, cmd_LEFT, cmd_KICKED, cmd_JOINING,
+    cmd_JOINED, cmd_INFO, cmd_HH_NUM, cmd_ERROR, cmd_EM, cmd_CONNECTED,
+    cmd_CLIENT_FLAGS, cmd_CHAT, cmd_CFG_THEME, cmd_CFG_TEMPLATE, cmd_CFG_SEED,
+    cmd_CFG_SCRIPT, cmd_CFG_SCHEME, cmd_CFG_MAZE_SIZE, cmd_CFG_MAP, cmd_CFG_MAPGEN,
+    cmd_CFG_FULLMAPCONFIG, cmd_CFG_FEATURE_SIZE, cmd_CFG_DRAWNMAP, cmd_CFG_AMMO,
+    cmd_BYE, cmd_BANLIST, cmd_ASKPASSWORD, cmd_ADD_TEAM);
+const letters: array[0..332] of char = ('A', 'D', 'D', '_', 'T', 'E', 'A', 'M',
+    #10, 'S', 'K', 'P', 'A', 'S', 'S', 'W', 'O', 'R', 'D', #10, 'B', 'A', 'N', 'L',
+    'I', 'S', 'T', #10, 'Y', 'E', #10, 'C', 'F', 'G', #10, 'A', 'M', 'M', 'O', #10,
+    'D', 'R', 'A', 'W', 'N', 'M', 'A', 'P', #10, 'F', 'E', 'A', 'T', 'U', 'R', 'E',
+    '_', 'S', 'I', 'Z', 'E', #10, 'U', 'L', 'L', 'M', 'A', 'P', 'C', 'O', 'N', 'F',
+    'I', 'G', #10, 'M', 'A', 'P', 'G', 'E', 'N', #10, #10, 'Z', 'E', '_', 'S', 'I',
+    'Z', 'E', #10, 'S', 'C', 'H', 'E', 'M', 'E', #10, 'R', 'I', 'P', 'T', #10, 'E',
+    'E', 'D', #10, 'T', 'E', 'M', 'P', 'L', 'A', 'T', 'E', #10, 'H', 'E', 'M', 'E',
+    #10, 'H', 'A', 'T', #10, 'L', 'I', 'E', 'N', 'T', '_', 'F', 'L', 'A', 'G', 'S',
+    #10, 'O', 'N', 'N', 'E', 'C', 'T', 'E', 'D', #10, 'E', 'M', #10, 'R', 'R', 'O',
+    'R', #10, 'H', 'H', '_', 'N', 'U', 'M', #10, 'I', 'N', 'F', 'O', #10, 'J', 'O',
+    'I', 'N', 'E', 'D', #10, 'I', 'N', 'G', #10, 'K', 'I', 'C', 'K', 'E', 'D', #10,
+    'L', 'E', 'F', 'T', #10, 'O', 'B', 'B', 'Y', ':', 'J', 'O', 'I', 'N', 'E', 'D',
+    #10, 'L', 'E', 'F', 'T', #10, 'N', 'I', 'C', 'K', #10, 'O', 'T', 'I', 'C', 'E',
+    #10, 'P', 'I', 'N', 'G', #10, 'R', 'O', 'T', 'O', #10, 'R', 'E', 'M', 'O', 'V',
+    'E', '_', 'T', 'E', 'A', 'M', #10, 'O', 'O', 'M', 'S', #10, #10, 'A', 'D', 'D',
+    #10, 'D', 'E', 'L', #10, 'U', 'P', 'D', #10, 'U', 'N', 'D', '_', 'F', 'I', 'N',
+    'I', 'S', 'H', 'E', 'D', #10, 'U', 'N', '_', 'G', 'A', 'M', 'E', #10, 'S', 'E',
+    'R', 'V', 'E', 'R', '_', 'A', 'U', 'T', 'H', #10, 'M', 'E', 'S', 'S', 'A', 'G',
+    'E', #10, 'V', 'A', 'R', 'S', #10, 'T', 'E', 'A', 'M', '_', 'A', 'C', 'C', 'E',
+    'P', 'T', 'E', 'D', #10, 'C', 'O', 'L', 'O', 'R', #10, 'W', 'A', 'R', 'N', 'I',
+    'N', 'G', #10, #0, #10);
+const commands: array[0..332] of integer = (20, 8, 0, 0, 0, 0, 0, 0, -56, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, -55, 11, 7, 0, 0, 0, 0, 0, -54, 0, 0, -53, 115, 89, 0,
+    0, 5, 0, 0, 0, -52, 9, 0, 0, 0, 0, 0, 0, 0, -51, 26, 12, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -49, 16, 0, 6, 4, 0, 0, -48, -47,
+    0, 0, 0, 0, 0, 0, 0, -46, 16, 11, 5, 0, 0, 0, -45, 0, 0, 0, 0, -44, 0, 0, 0,
+    -43, 0, 8, 0, 0, 0, 0, 0, 0, -42, 0, 0, 0, 0, -41, 4, 0, 0, -40, 12, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, -38, 8, 2, -37, 0, 0, 0, 0, -36,
+    7, 0, 0, 0, 0, 0, -35, 5, 0, 0, 0, -34, 11, 0, 0, 0, 3, 0, -33, 0, 0, 0, -32, 7,
+    0, 0, 0, 0, 0, -31, 22, 4, 0, 0, -30, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, -29, 0,
+    0, 0, 0, -28, 11, 4, 0, 0, -27, 0, 0, 0, 0, 0, -26, 10, 4, 0, 0, -25, 0, 0, 0,
+    0, -24, 51, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 31, 17, 0, 2, -22, 0, 4, 0, 0,
+    -21, 4, 0, 0, -20, 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0,
+    0, 0, 0, 0, 0, -17, 25, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, -16, 8, 0, 0, 0, 0, 0, 0,
+    -15, 0, 0, 0, 0, -14, 20, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, 0, 0,
+    0, -12, 8, 0, 0, 0, 0, 0, 0, -11, 0, -10);
+const handlers: array[0..46] of PHandler = (@handler__UNKNOWN_, @handler_L,
+    @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_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,
+    @handler_MS, @handler_S, @handler_MS);
 
-// end of generated stuff
 procedure handleTail;
 var cnt: Longint;
     c: char;
@@ -201,7 +218,8 @@
             c:= getNextChar;
             inc(cnt)
         until (c = #0) or (c = #10);
-    until (c = #0) or (cnt = 1)
+    until (c = #0) or (cnt = 1);
+    state.l:= 0
 end;
 
 var sock: PTCPSocket;
@@ -246,7 +264,7 @@
 
     repeat
         c:= getNextChar;
-        //writeln('>>>>> ', c, ' [', letters[state.l], '] ', commands[state.l]);
+        //writeln('>>>>> ', c, ' [', letters[state.l], '] ', commands[state.l], ' ', state.l);
         if c = #0 then
             state.netState:= netDisconnected
         else
--- a/hedgewars/uFLNetProtocol.pas	Tue Nov 24 12:09:41 2015 +0300
+++ b/hedgewars/uFLNetProtocol.pas	Tue Nov 24 20:19:00 2015 +0300
@@ -17,6 +17,14 @@
 
 var isInRoom: boolean;
 
+    procedure handler_ADD_TEAM(var p: TCmdParam);
+begin
+end;
+
+procedure handler_ADD_TEAM_s(var s: TCmdParamS);
+begin
+end;
+
 procedure handler_ASKPASSWORD(var p: TCmdParamS);
 begin
 end;
@@ -34,6 +42,62 @@
     sendUI(mtDisconnected, @p.str2[1], length(p.str2));
 end;
 
+procedure handler_CFG_AMMO(var p: TCmdParamSL);
+begin
+end;
+
+procedure handler_CFG_DRAWNMAP(var p: TCmdParamL);
+begin
+end;
+
+procedure handler_CFG_FEATURE_SIZE(var p: TCmdParami);
+begin
+end;
+
+procedure handler_CFG_FULLMAPCONFIG(var p: TCmdParam);
+begin
+end;
+
+procedure handler_CFG_FULLMAPCONFIG_s(var s: TCmdParamS);
+begin
+end;
+
+procedure handler_CFG_MAP(var p: TCmdParamS);
+begin
+end;
+
+procedure handler_CFG_MAPGEN(var p: TCmdParami);
+begin
+end;
+
+procedure handler_CFG_MAZE_SIZE(var p: TCmdParami);
+begin
+end;
+
+procedure handler_CFG_SCHEME(var p: TCmdParam);
+begin
+end;
+
+procedure handler_CFG_SCHEME_s(var s: TCmdParamS);
+begin
+end;
+
+procedure handler_CFG_SCRIPT(var p: TCmdParamS);
+begin
+end;
+
+procedure handler_CFG_SEED(var p: TCmdParamS);
+begin
+end;
+
+procedure handler_CFG_TEMPLATE(var p: TCmdParami);
+begin
+end;
+
+procedure handler_CFG_THEME(var p: TCmdParamS);
+begin
+end;
+
 procedure handler_CHAT(var p: TCmdParamSL);
 var s: string;
 begin
@@ -164,9 +228,31 @@
 begin
 end;
 
+procedure handler_REMOVE_TEAM(var p: TCmdParamS);
+begin
+end;
+
 var roomInfo: string;
     roomLinesCount: integer;
 
+procedure handler_ROOMS(var p: TCmdParam);
+begin
+    roomInfo:= '';
+    roomLinesCount:= 0
+end;
+
+procedure handler_ROOMS_s(var s: TCmdParamS);
+begin
+    roomInfo:= roomInfo + s.str1 + #10;
+
+    if roomLinesCount = 8 then
+    begin
+        sendUI(mtAddRoom, @roomInfo[1], length(roomInfo) - 1);
+        roomLinesCount:= 0;
+        roomInfo:= ''
+    end else inc(roomLinesCount);
+end;
+
 procedure handler_ROOM_ADD(var p: TCmdParam);
 begin
     roomInfo:= '';
@@ -206,24 +292,6 @@
         sendUI(mtUpdateRoom, @roomInfo[1], length(roomInfo) - 1);
 end;
 
-procedure handler_ROOMS(var p: TCmdParam);
-begin
-    roomInfo:= '';
-    roomLinesCount:= 0
-end;
-
-procedure handler_ROOMS_s(var s: TCmdParamS);
-begin
-    roomInfo:= roomInfo + s.str1 + #10;
-
-    if roomLinesCount = 8 then
-    begin
-        sendUI(mtAddRoom, @roomInfo[1], length(roomInfo) - 1);
-        roomLinesCount:= 0;
-        roomInfo:= ''
-    end else inc(roomLinesCount);
-end;
-
 procedure handler_ROUND_FINISHED(var p: TCmdParam);
 begin
 end;
@@ -261,9 +329,17 @@
     sendUI(mtWarning, @p.str1[1], length(p.str1));
 end;
 
-const handlers: array[TCmdType] of PHandler = (PHandler(@handler_ASKPASSWORD),
+const handlers: array[TCmdType] of PHandler = (PHandler(@handler_ADD_TEAM),
+    PHandler(@handler_ADD_TEAM_s), PHandler(@handler_ASKPASSWORD),
     PHandler(@handler_BANLIST), PHandler(@handler_BANLIST_s),
-    PHandler(@handler_BYE), PHandler(@handler_CHAT),
+    PHandler(@handler_BYE), PHandler(@handler_CFG_AMMO),
+    PHandler(@handler_CFG_DRAWNMAP), PHandler(@handler_CFG_FEATURE_SIZE),
+    PHandler(@handler_CFG_FULLMAPCONFIG), PHandler(@handler_CFG_FULLMAPCONFIG_s),
+    PHandler(@handler_CFG_MAP), PHandler(@handler_CFG_MAPGEN),
+    PHandler(@handler_CFG_MAZE_SIZE), PHandler(@handler_CFG_SCHEME),
+    PHandler(@handler_CFG_SCHEME_s), PHandler(@handler_CFG_SCRIPT),
+    PHandler(@handler_CFG_SEED), PHandler(@handler_CFG_TEMPLATE),
+    PHandler(@handler_CFG_THEME), PHandler(@handler_CHAT),
     PHandler(@handler_CLIENT_FLAGS), PHandler(@handler_CLIENT_FLAGS_s),
     PHandler(@handler_CONNECTED), PHandler(@handler_EM), PHandler(@handler_EM_s),
     PHandler(@handler_ERROR), PHandler(@handler_HH_NUM),
@@ -273,7 +349,8 @@
     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_ROOMS),
+    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),
--- a/hedgewars/uFLNetTypes.pas	Tue Nov 24 12:09:41 2015 +0300
+++ b/hedgewars/uFLNetTypes.pas	Tue Nov 24 20:19:00 2015 +0300
@@ -1,15 +1,19 @@
 unit uFLNetTypes;
 interface
 
-type TCmdType = (cmd_ASKPASSWORD, cmd_BANLIST, cmd_BANLIST_s, cmd_BYE, 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_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 TCmdType = (cmd_ADD_TEAM, cmd_ADD_TEAM_s, cmd_ASKPASSWORD, cmd_BANLIST,
+    cmd_BANLIST_s, cmd_BYE, cmd_CFG_AMMO, cmd_CFG_DRAWNMAP, cmd_CFG_FEATURE_SIZE,
+    cmd_CFG_FULLMAPCONFIG, cmd_CFG_FULLMAPCONFIG_s, cmd_CFG_MAP, cmd_CFG_MAPGEN,
+    cmd_CFG_MAZE_SIZE, cmd_CFG_SCHEME, cmd_CFG_SCHEME_s, cmd_CFG_SCRIPT,
+    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);
 
     type TCmdParam = packed record
         cmd: TCmdType;
--- a/tools/protocolParser.hs	Tue Nov 24 12:09:41 2015 +0300
+++ b/tools/protocolParser.hs	Tue Nov 24 20:19:00 2015 +0300
@@ -100,6 +100,7 @@
         , cmd1 "REMOVE_TEAM" SS
         , cmd1 "CFG~MAP" SS
         , cmd1 "CFG~SEED" SS
+        , cmd1 "CFG~SCHEME" $ Many [SS]
         , cmd1 "CFG~THEME" SS
         , cmd1 "CFG~TEMPLATE" IntP
         , cmd1 "CFG~MAPGEN" IntP
@@ -108,7 +109,7 @@
         , cmd1 "CFG~SCRIPT" SS
         , cmd1 "CFG~DRAWNMAP" LS
         , cmd2 "CFG~AMMO" SS LS
-        , cmd1 "FULLMAPCONFIG" $ Many [LS]
+        , cmd1 "CFG~FULLMAPCONFIG" $ Many [LS]
     ]
 
 hasMany = any isMany
@@ -152,7 +153,7 @@
     dt (PTPrefix s st) = text s $$ (nest (length s) $ vcat $ map dt st)
     dt _ = char '$'
 
-renderArrays (letters, commands, handlers) = vcat $ punctuate (char '\n') [grr, cmds, l, s, c, bodies, structs, realHandlers, realHandlersArray]
+renderArrays (letters, commands, handlers) = vcat $ punctuate (char '\n') [grr, l, s, c, bodies, structs, realHandlers, realHandlersArray, cmds]
     where
         maybeQuotes "$" = text "#0"
         maybeQuotes "~" = text "#10"
@@ -165,7 +166,7 @@
             <> parens (hsep . punctuate comma $ map (text . (:) '@') handlerTypes) <> semi
         grr = text "const net2cmd: array[0.." <> (int $ length fixedNames - 1) <> text "] of TCmdType = "
             <> parens (hsep . punctuate comma $ map (text . (++) "cmd_") $ reverse fixedNames) <> semi
-        handlerTypes = map cmdParams2handlerType $ reverse sortedCmdDescriptions
+        handlerTypes = "handler__UNKNOWN_" : (map cmdParams2handlerType $ reverse sortedCmdDescriptions)
         sortedCmdDescriptions = sort commandsDescription
         fixedNames = map fixName handlers
         bodies = vcat $ punctuate (char '\n') $ map handlerBody $ nub $ sort handlerTypes