370 tmpflag:= false; |
369 tmpflag:= false; |
371 lastTurnChecksum:= SDLNet_Read32(@headcmd^.str[2]); |
370 lastTurnChecksum:= SDLNet_Read32(@headcmd^.str[2]); |
372 AddFileLog('got cmd "N": time '+IntToStr(hiTicks shl 16 + headcmd^.loTime)) |
371 AddFileLog('got cmd "N": time '+IntToStr(hiTicks shl 16 + headcmd^.loTime)) |
373 end; |
372 end; |
374 'p': begin |
373 'p': begin |
375 x32:= SDLNet_Read32(@(headcmd^.X)); |
374 x32:= SDLNet_Read32(@(headcmd^.str[2])); |
376 y32:= SDLNet_Read32(@(headcmd^.Y)); |
375 y32:= SDLNet_Read32(@(headcmd^.str[4])); |
377 doPut(x32, y32, false) |
376 doPut(x32, y32, false) |
378 end; |
377 end; |
379 'P': begin |
378 'P': begin |
380 // these are equations solved for CursorPoint |
379 // these are equations solved for CursorPoint |
381 // SDLNet_Read16(@(headcmd^.X)) == CursorPoint.X - WorldDx; |
380 // SDLNet_Read16(@(headcmd^.X)) == CursorPoint.X - WorldDx; |
382 // SDLNet_Read16(@(headcmd^.Y)) == cScreenHeight - CursorPoint.Y - WorldDy; |
381 // SDLNet_Read16(@(headcmd^.Y)) == cScreenHeight - CursorPoint.Y - WorldDy; |
383 if CurrentTeam^.ExtDriven then |
382 if CurrentTeam^.ExtDriven then |
384 begin |
383 begin |
385 TargetCursorPoint.X:= LongInt(SDLNet_Read32(@(headcmd^.X))) + WorldDx; |
384 TargetCursorPoint.X:= LongInt(SDLNet_Read32(@(headcmd^.str[2]))) + WorldDx; |
386 TargetCursorPoint.Y:= cScreenHeight - LongInt(SDLNet_Read32(@(headcmd^.Y))) - WorldDy; |
385 TargetCursorPoint.Y:= cScreenHeight - LongInt(SDLNet_Read32(@(headcmd^.str[4]))) - WorldDy; |
387 if not bShowAmmoMenu and autoCameraOn then |
386 if not bShowAmmoMenu and autoCameraOn then |
388 CursorPoint:= TargetCursorPoint |
387 CursorPoint:= TargetCursorPoint |
389 end |
388 end |
390 end; |
389 end; |
391 'w': ParseCommand('setweap ' + headcmd^.str[2], true); |
390 'w': ParseCommand('setweap ' + headcmd^.str[2], true); |
392 't': ParseCommand('taunt ' + headcmd^.str[2], true); |
391 't': ParseCommand('taunt ' + headcmd^.str[2], true); |
393 'h': ParseCommand('hogsay ' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); |
392 'h': ParseCommand('hogsay ' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); |
394 '1'..'5': ParseCommand('timer ' + headcmd^.cmd, true); |
393 '1'..'5': ParseCommand('timer ' + headcmd^.cmd, true); |
395 else |
394 else |
396 if (headcmd^.cmd >= #128) and (headcmd^.cmd <= char(128 + cMaxSlotIndex)) then |
395 if (byte(headcmd^.cmd) >= 128) and (byte(headcmd^.cmd) <= 128 + cMaxSlotIndex) then |
397 ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true) |
396 ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true) |
398 else |
397 else |
399 OutError('Unexpected protocol command: ' + headcmd^.cmd, True) |
398 OutError('Unexpected protocol command: ' + headcmd^.cmd, True) |
400 end; |
399 end; |
401 RemoveCmd |
400 RemoveCmd |