hedgewars/uFLNet.pas
branchqmlfrontend
changeset 11420 ef7f8ac96dfa
parent 11419 8a5cc31483c6
child 11421 25e0f427f57e
equal deleted inserted replaced
11419:8a5cc31483c6 11420:ef7f8ac96dfa
    51     -40, 11, 7, 0, 0, 0, 0, 0, -39, 0, 0, -38, 26, 4, 0, 0, -37, 12, 0, 0, 0, 0, 0,
    51     -40, 11, 7, 0, 0, 0, 0, 0, -39, 0, 0, -38, 26, 4, 0, 0, -37, 12, 0, 0, 0, 0, 0,
    52     0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -35, 8, 2, -34, 0, 0, 0, 0, -33, 7,
    52     0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, -35, 8, 2, -34, 0, 0, 0, 0, -33, 7,
    53     0, 0, 0, 0, 0, -32, 5, 0, 0, 0, -31, 11, 0, 0, 0, 3, 0, -30, 0, 0, 0, -29, 7, 0,
    53     0, 0, 0, 0, 0, -32, 5, 0, 0, 0, -31, 11, 0, 0, 0, 3, 0, -30, 0, 0, 0, -29, 7, 0,
    54     0, 0, 0, 0, -28, 22, 4, 0, 0, -27, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, -26, 0, 0,
    54     0, 0, 0, 0, -28, 22, 4, 0, 0, -27, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, -26, 0, 0,
    55     0, 0, -25, 11, 4, 0, 0, -24, 0, 0, 0, 0, 0, -23, 10, 4, 0, 0, -22, 0, 0, 0, 0,
    55     0, 0, -25, 11, 4, 0, 0, -24, 0, 0, 0, 0, 0, -23, 10, 4, 0, 0, -22, 0, 0, 0, 0,
    56     -21, 28, 19, 5, 3, 1, -20, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 0,
    56     -21, 28, 19, 5, 3, 1, -19, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, 0,
    57     0, 0, 0, 0, -17, 25, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, -16, 8, 0, 0, 0, 0, 0, 0,
    57     0, 0, 0, 0, -17, 25, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, -16, 8, 0, 0, 0, 0, 0, 0,
    58     -15, 0, 0, 0, 0, -14, 20, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, 0, 0,
    58     -15, 0, 0, 0, 0, -14, 20, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, 0, 0,
    59     0, -12, 8, 0, 0, 0, 0, 0, 0, -11, 0, -10);
    59     0, -12, 8, 0, 0, 0, 0, 0, 0, -11, 0, -10);
    60 
    60 
    61 procedure handler_;
    61 procedure handler_;
   101 procedure handler_SL;
   101 procedure handler_SL;
   102 var cmd: TCmdParamSL;
   102 var cmd: TCmdParamSL;
   103 begin
   103 begin
   104     cmd.cmd:= state.cmd;
   104     cmd.cmd:= state.cmd;
   105     cmd.str1:= getShortString;
   105     cmd.str1:= getShortString;
       
   106     if cmd.str1[0] = #0 then exit;
   106     cmd.str2:= getShortString; // FIXME should be long string
   107     cmd.str2:= getShortString; // FIXME should be long string
       
   108     if cmd.str2[0] = #0 then exit;
   107     sendUI(mtNetData, @cmd, sizeof(cmd));
   109     sendUI(mtNetData, @cmd, sizeof(cmd));
   108     handleTail()
   110     handleTail()
   109 end;
   111 end;
   110 
   112 
   111 procedure handler_SMS;
   113 procedure handler_SMS;
   114     handleTail()
   116     handleTail()
   115 end;
   117 end;
   116 
   118 
   117 procedure handler__i;
   119 procedure handler__i;
   118 var cmd: TCmdParami;
   120 var cmd: TCmdParami;
       
   121     s: shortstring;
   119 begin
   122 begin
   120     writeln('handler__i');
   123     writeln('handler__i');
   121     getShortString;
   124     s:= getShortString();
       
   125     if s[0] = #0 then exit;
   122     cmd.cmd:= state.cmd;
   126     cmd.cmd:= state.cmd;
   123     cmd.param1:= strToInt(getShortString);
   127     s:= getShortString();
       
   128     if s[0] = #0 then exit;
       
   129     cmd.param1:= strToInt(s);
   124     sendUI(mtNetData, @cmd, sizeof(cmd));
   130     sendUI(mtNetData, @cmd, sizeof(cmd));
   125     handleTail()
   131     handleTail()
   126 end;
   132 end;
   127 
   133 
   128 procedure handler_i;
   134 procedure handler_i;
   156 // end of generated stuff
   162 // end of generated stuff
   157 procedure handleTail;
   163 procedure handleTail;
   158 var cnt: Longint;
   164 var cnt: Longint;
   159     c: char;
   165     c: char;
   160 begin
   166 begin
   161     state.l:= 0;
       
   162 
       
   163     c:= getCurrChar;
   167     c:= getCurrChar;
   164     repeat
   168     repeat
   165         if c = #10 then cnt:= 0 else cnt:= 1;
   169         if c = #10 then cnt:= 0 else cnt:= 1;
   166         repeat
   170         repeat
   167             c:= getNextChar;
   171             c:= getNextChar;
   224                 if commands[state.l] < 0 then
   228                 if commands[state.l] < 0 then
   225                 begin
   229                 begin
   226                     state.cmd:= net2cmd[-10 - commands[state.l]];
   230                     state.cmd:= net2cmd[-10 - commands[state.l]];
   227                     writeln('[NET] ', state.cmd);
   231                     writeln('[NET] ', state.cmd);
   228                     handlers[-10 - commands[state.l]]();
   232                     handlers[-10 - commands[state.l]]();
       
   233                     state.l:= 0
   229                 end
   234                 end
   230                 else
   235                 else
   231                     inc(state.l)
   236                     inc(state.l)
   232             else
   237             else
   233             begin
   238             begin