Indiefreaks.Xna.Sessions.Live.LiveSession.ExecuteServerCommandOnClients C# (CSharp) Method

ExecuteServerCommandOnClients() public method

Asks the Session to send a remote command call on all session clients
public ExecuteServerCommandOnClients ( Command command ) : void
command Indiefreaks.Xna.Logic.Command The command that should be executed
return void
        public override void ExecuteServerCommandOnClients(Command command)
        {
            if (!IsHost)
                throw new CoreException("Only the host can execute server commands on clients");

            if (command.NetworkValue != null)
                _packetWriter.Write(Constants.ExecuteServerCommandOnClientsDataExchanged);
            else
                _packetWriter.Write(Constants.ExecuteServerCommandOnClientsNoDataExchanged);

            _packetWriter.Write(command.Id);

            if (command.NetworkValue != null)
            {
                WriteNetworkValue(ref _packetWriter, command.NetworkValue);
            }

            ((LocalNetworkGamer) _networkSession.Host).SendData(_packetWriter,
                                                                ConvertToSendDataOptions(command.TransferOptions));
        }