コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
                    }
                }
            }
        }