public override void ExecuteServerCommandOnClients(Command command)
{
if (!IsHost)
throw new CoreException("Only the host can execute server commands on clients");
_outgoingMessage = LidgrenSessionManager.Server.CreateMessage();
if (command.NetworkValue != null)
{
_outgoingMessage.Write((byte)LidgrenMessages.ExecuteServerCommandOnClientsDataExchanged);
}
else
{
_outgoingMessage.Write((byte)LidgrenMessages.ExecuteServerCommandOnClientsNoDataExchanged);
}
_outgoingMessage.Write(command.Id);
if (command.NetworkValue != null)
{
WriteNetworkValue(ref _outgoingMessage, command.NetworkValue);
}
LidgrenSessionManager.Server.SendToAll(_outgoingMessage, ConvertToNetDeliveryMethod(command.TransferOptions));
}