hedgewars/uIO.pas
changeset 4555 85150dfb5959
parent 4531 4ea193b0e378
child 4814 e19791f08443
child 4815 f2a3e1a51f4d
equal deleted inserted replaced
4554:8afc607457b0 4555:85150dfb5959
   137                'S': GameType:= gmtSave;
   137                'S': GameType:= gmtSave;
   138                else OutError(errmsgIncorrectUse + ' IPC "T" :' + s[2], true) end;
   138                else OutError(errmsgIncorrectUse + ' IPC "T" :' + s[2], true) end;
   139      else
   139      else
   140      loTicks:= SDLNet_Read16(@s[byte(s[0]) - 1]);
   140      loTicks:= SDLNet_Read16(@s[byte(s[0]) - 1]);
   141      AddCmd(loTicks, s);
   141      AddCmd(loTicks, s);
   142      {$IFDEF DEBUGFILE}AddFileLog('IPC in: '+s[1]+' ticks '+IntToStr(lastcmd^.loTime));{$ENDIF}
   142      {$IFDEF DEBUGFILE}AddFileLog('[IPC in] '+s[1]+' ticks '+IntToStr(lastcmd^.loTime));{$ENDIF}
   143      end
   143      end
   144 end;
   144 end;
   145 
   145 
   146 procedure IPCCheckSock;
   146 procedure IPCCheckSock;
   147 const ss: shortstring = '';
   147 const ss: shortstring = '';
   218 if IPCSock <> nil then
   218 if IPCSock <> nil then
   219     begin
   219     begin
   220     SendEmptyPacketTicks:= 0;
   220     SendEmptyPacketTicks:= 0;
   221     if s[0]>#251 then s[0]:= #251;
   221     if s[0]>#251 then s[0]:= #251;
   222     SDLNet_Write16(GameTicks, @s[Succ(byte(s[0]))]);
   222     SDLNet_Write16(GameTicks, @s[Succ(byte(s[0]))]);
   223     {$IFDEF DEBUGFILE}AddFileLog('IPC send: '+ s[1]);{$ENDIF}
   223     {$IFDEF DEBUGFILE}AddFileLog('[IPC out] '+ s[1]);{$ENDIF}
   224     inc(s[0], 2);
   224     inc(s[0], 2);
   225     SDLNet_TCP_Send(IPCSock, @s, Succ(byte(s[0])))
   225     SDLNet_TCP_Send(IPCSock, @s, Succ(byte(s[0])))
   226     end
   226     end
   227 end;
   227 end;
   228 
   228 
   245 end;
   245 end;
   246 
   246 
   247 procedure SendIPCTimeInc;
   247 procedure SendIPCTimeInc;
   248 const timeinc: shortstring = '#';
   248 const timeinc: shortstring = '#';
   249 begin
   249 begin
   250 {$IFDEF DEBUGFILE}AddFileLog('IPC Send #');{$ENDIF}
   250 {$IFDEF DEBUGFILE}AddFileLog('[IPC out] <time increment>');{$ENDIF}
   251 SendIPCRaw(@timeinc, 2)
   251 SendIPCRaw(@timeinc, 2)
   252 end;
   252 end;
   253 
   253 
   254 procedure IPCWaitPongEvent;
   254 procedure IPCWaitPongEvent;
   255 begin
   255 begin