public static InputSynchronizationMessage FromUserCmd(UserCmd command)
    {
        var messageData   = command.Serialize();
        var messageLength = messageData.Length;
        //Fill our message fields to be send
        var newMessage = new InputSynchronizationMessage();

        newMessage.messageData = messageData;

        return(newMessage);
    }
Пример #2
0
    public void PipeUserCommand(UserCmd cmd)
    {
        if (cmd.SequenceNumber - m_LastOutgoingSeq > 1)
        {
            //We are missing some commands, lets look at our choked command history.
            return;
        }

        // Create input message.
        InputSynchronizationMessage msg = new InputSynchronizationMessage();

        // Assign message values.
        msg.netId       = netId.Value;
        msg.messageData = cmd.Serialize();

        // Send message to server.
        connectionToServer.SendByChannel(
            InputSynchronizationMessage.MessageID,
            msg,
            Channels.DefaultUnreliable
            );

        m_LastOutgoingSeq++;
    }