hedgewars/uIO.pas
changeset 159 63909aecb0ed
parent 155 401f4ea24715
child 183 57c2ef19f719
equal deleted inserted replaced
158:e6c3223f3bca 159:63909aecb0ed
    40 
    40 
    41 procedure SendIPC(s: shortstring);
    41 procedure SendIPC(s: shortstring);
    42 procedure SendIPCXY(cmd: char; X, Y: SmallInt);
    42 procedure SendIPCXY(cmd: char; X, Y: SmallInt);
    43 procedure SendIPCRaw(p: pointer; len: Longword);
    43 procedure SendIPCRaw(p: pointer; len: Longword);
    44 procedure SendIPCAndWaitReply(s: shortstring);
    44 procedure SendIPCAndWaitReply(s: shortstring);
       
    45 procedure IPCWaitPongEvent;
    45 procedure IPCCheckSock;
    46 procedure IPCCheckSock;
    46 procedure InitIPC;
    47 procedure InitIPC;
    47 procedure CloseIPC;
    48 procedure CloseIPC;
    48 procedure NetGetNextCmd;
    49 procedure NetGetNextCmd;
    49 
    50 
   159 SDLNet_Write16(X, @s[2]);
   160 SDLNet_Write16(X, @s[2]);
   160 SDLNet_Write16(Y, @s[4]);
   161 SDLNet_Write16(Y, @s[4]);
   161 SendIPC(s)
   162 SendIPC(s)
   162 end;
   163 end;
   163 
   164 
   164 procedure SendIPCAndWaitReply(s: shortstring);
   165 procedure IPCWaitPongEvent;
   165 begin
   166 begin
   166 SendIPC(s);
       
   167 SendIPC('?');
       
   168 isPonged:= false;
   167 isPonged:= false;
   169 repeat
   168 repeat
   170    IPCCheckSock;
   169    IPCCheckSock;
   171    SDL_Delay(1)
   170    SDL_Delay(1)
   172 until isPonged
   171 until isPonged
       
   172 end;
       
   173 
       
   174 procedure SendIPCAndWaitReply(s: shortstring);
       
   175 begin
       
   176 SendIPC(s);
       
   177 SendIPC('?');
       
   178 IPCWaitPongEvent
   173 end;
   179 end;
   174 
   180 
   175 procedure NetGetNextCmd;
   181 procedure NetGetNextCmd;
   176 var tmpflag: boolean;
   182 var tmpflag: boolean;
   177 begin
   183 begin