Indiefreaks.Xna.Sessions.Lidgren.LidgrenSession.ExecuteCommandOnServer C# (CSharp) Method

ExecuteCommandOnServer() public method

Asks the Session to send a remote command call on the session host
public ExecuteCommandOnServer ( Command command ) : void
command Indiefreaks.Xna.Logic.Command The command that should be executed
return void
        public override void ExecuteCommandOnServer(Command command)
        {
            _outgoingMessage = LidgrenSessionManager.Client.CreateMessage();

            if (command.NetworkValue != null)
            {
                _outgoingMessage.Write((byte)LidgrenMessages.ExecuteCommandOnServerDataExchanged);
            }
            else
            {
                _outgoingMessage.Write((byte)LidgrenMessages.ExecuteCommandOnServerNoDataExchanged);
            }

            _outgoingMessage.Write(command.Id);

            if (command.NetworkValue != null)
                WriteNetworkValue(ref _outgoingMessage, command.NetworkValue);

            LidgrenSessionManager.Client.SendMessage(_outgoingMessage, ConvertToNetDeliveryMethod(command.TransferOptions));
        }