void WriteLastMoveTimestampIfDirty(NetOutgoingMessage inOutputStream, ClientProxy inClientProxy) { //first, dirty? bool isTimestampDirty = inClientProxy.IsLastMoveTimestampDirty(); inOutputStream.Write(isTimestampDirty); if (isTimestampDirty) { inOutputStream.Write(inClientProxy.GetUnprocessedMoveList().GetLastMoveTimestamp()); inClientProxy.SetIsLastMoveTimestampDirty(false); } }
void HandleInputPacket(ClientProxy inClientProxy, NetIncomingMessage inInputStream) { Move move = new Move(); uint32_t moveCount = inInputStream.ReadUInt32(2); for (; moveCount > 0; --moveCount) { if (move.Read(inInputStream)) { //log.InfoFormat("recv move {0}, {1}, {2}, {3}", move.GetDeltaTime(), move.GetInputState(), move.GetTimestamp(), moveCount); if (inClientProxy.GetUnprocessedMoveList().AddMoveIfNew(move)) { inClientProxy.SetIsLastMoveTimestampDirty(true); } } } }