# HG changeset patch # User unc0rr # Date 1336848633 -14400 # Node ID b1b7eb9c8cc9adc1ff69d27fa68a725701f2af1f # Parent f98ec3aecf4e40d5418f33a321952d47762caad3 Get rid of cripple SendIPCc diff -r f98ec3aecf4e -r b1b7eb9c8cc9 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat May 12 22:44:39 2012 +0400 +++ b/hedgewars/GSHandlers.inc Sat May 12 22:50:33 2012 +0400 @@ -1156,8 +1156,8 @@ end; if Gear^.Timer = 0 then begin - SendIPCc('N'); - SendIPCc('q'); + SendIPC(_S'N'); + SendIPC(_S'q'); GameState := gsExit end end; diff -r f98ec3aecf4e -r b1b7eb9c8cc9 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sat May 12 22:44:39 2012 +0400 +++ b/hedgewars/uCommandHandlers.pas Sat May 12 22:50:33 2012 +0400 @@ -71,7 +71,7 @@ s:= s; // avoid compiler hint if GameState = gsConfirm then begin - SendIPCc('Q'); + SendIPC(_S'Q'); GameState:= gsExit end else @@ -81,7 +81,7 @@ procedure chHalt (var s: shortstring); begin s:= s; // avoid compiler hint - SendIPCc('H'); + SendIPC(_S'H'); GameState:= gsExit end; @@ -218,7 +218,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('L'); + SendIPC(_S'L'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmLeft and InputMask); @@ -231,7 +231,7 @@ if CheckNoTeamOrHH then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('l'); + SendIPC(_S'l'); with CurrentHedgehog^.Gear^ do Message:= Message and (not (gmLeft and InputMask)); ScriptCall('onLeftUp'); @@ -243,7 +243,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('R'); + SendIPC(_S'R'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmRight and InputMask); @@ -256,7 +256,7 @@ if CheckNoTeamOrHH then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('r'); + SendIPC(_S'r'); with CurrentHedgehog^.Gear^ do Message:= Message and (not (gmRight and InputMask)); ScriptCall('onRightUp'); @@ -268,7 +268,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('U'); + SendIPC(_S'U'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmUp and InputMask); @@ -281,7 +281,7 @@ if CheckNoTeamOrHH then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('u'); + SendIPC(_S'u'); with CurrentHedgehog^.Gear^ do Message:= Message and (not (gmUp and InputMask)); ScriptCall('onUpUp'); @@ -293,7 +293,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('D'); + SendIPC(_S'D'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmDown and InputMask); @@ -306,7 +306,7 @@ if CheckNoTeamOrHH then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('d'); + SendIPC(_S'd'); with CurrentHedgehog^.Gear^ do Message:= Message and (not (gmDown and InputMask)); ScriptCall('onDownUp'); @@ -318,7 +318,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('Z'); + SendIPC(_S'Z'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmPrecise and InputMask); @@ -331,7 +331,7 @@ if CheckNoTeamOrHH then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('z'); + SendIPC(_S'z'); with CurrentHedgehog^.Gear^ do Message:= Message and (not (gmPrecise and InputMask)); ScriptCall('onPreciseUp'); @@ -343,7 +343,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('j'); + SendIPC(_S'j'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmLJump and InputMask); @@ -356,7 +356,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('J'); + SendIPC(_S'J'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmHJump and InputMask); @@ -376,7 +376,7 @@ begin FollowGear:= CurrentHedgehog^.Gear; if not CurrentTeam^.ExtDriven then - SendIPCc('A'); + SendIPC(_S'A'); Message:= Message or (gmAttack and InputMask); ScriptCall('onAttack'); end @@ -392,7 +392,7 @@ begin if not CurrentTeam^.ExtDriven and ((Message and gmAttack) <> 0) then - SendIPCc('a'); + SendIPC(_S'a'); Message:= Message and (not (gmAttack and InputMask)); ScriptCall('onAttackUp'); end @@ -404,7 +404,7 @@ if CheckNoTeamOrHH or isPaused then exit; if not CurrentTeam^.ExtDriven then - SendIPCc('S'); + SendIPC(_S'S'); bShowFinger:= false; with CurrentHedgehog^.Gear^ do Message:= Message or (gmSwitch and InputMask); @@ -417,7 +417,7 @@ TryDo(AllInactive, '/nextturn called when not all gears are inactive', true); if not CurrentTeam^.ExtDriven then - SendIPCc('N'); + SendIPC(_S'N'); AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks)); end; @@ -439,6 +439,7 @@ procedure chSlot(var s: shortstring); var slot: LongWord; + ss: shortstring; begin if (s[0] <> #1) or CheckNoTeamOrHH then exit; @@ -446,7 +447,11 @@ if slot > cMaxSlotIndex then exit; if not CurrentTeam^.ExtDriven then - SendIPCc(char(byte(s[1]) + 79)); + begin + ss[0]:= #1; + ss[1]:= char(byte(s[1]) + 79); + SendIPC(ss); + end; bShowFinger:= false; with CurrentHedgehog^.Gear^ do begin diff -r f98ec3aecf4e -r b1b7eb9c8cc9 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat May 12 22:44:39 2012 +0400 +++ b/hedgewars/uGears.pas Sat May 12 22:50:33 2012 +0400 @@ -446,7 +446,7 @@ begin if (not CurrentTeam^.ExtDriven) then begin - SendIPCc('#'); + SendIPC(_S'#'); AddFileLog('hiTicks increment message sent') end; @@ -1161,7 +1161,7 @@ begin s:= s; // avoid compiler hint if not CurrentTeam^.ExtDriven then - SendIPCc(','); + SendIPC(_S','); uStats.Skipped; skipFlag:= true end; diff -r f98ec3aecf4e -r b1b7eb9c8cc9 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sat May 12 22:44:39 2012 +0400 +++ b/hedgewars/uIO.pas Sat May 12 22:50:33 2012 +0400 @@ -27,7 +27,6 @@ procedure InitIPC; procedure SendIPC(s: shortstring); -procedure SendIPCc(c: char); procedure SendIPCXY(cmd: char; X, Y: SmallInt); procedure SendIPCRaw(p: pointer; len: Longword); procedure SendIPCAndWaitReply(s: shortstring); @@ -117,7 +116,7 @@ begin case s[1] of '!': begin AddFileLog('Ping? Pong!'); isPonged:= true; end; - '?': SendIPCc('!'); + '?': SendIPC(_S'!'); 'e': ParseCommand(copy(s, 2, Length(s) - 1), true); 'E': OutError(copy(s, 2, Length(s) - 1), true); 'W': OutError(copy(s, 2, Length(s) - 1), false); @@ -222,14 +221,6 @@ end end; -procedure SendIPCc(c: char); -var s: shortstring; -begin - s[0]:= #1; - s[1]:= c; - SendIPC(s); -end; - procedure SendIPCRaw(p: pointer; len: Longword); begin if IPCSock <> nil then @@ -260,7 +251,7 @@ procedure SendIPCAndWaitReply(s: shortstring); begin SendIPC(s); -SendIPCc('?'); +SendIPC(_S'?'); IPCWaitPongEvent end; @@ -268,7 +259,7 @@ begin inc(SendEmptyPacketTicks, Lag); if (SendEmptyPacketTicks >= cSendEmptyPacketTime) then - SendIPCc('+') + SendIPC(_S'+') end; procedure NetGetNextCmd;