/// <summary> /// Executes a command on the server containing the resource referenced by this object /// </summary> /// <param name="data">Command data to send</param> /// <param name="changingCommand">Wherever or not this command is changing</param> public virtual void ExecuteForEntity(CommandData data, bool changingCommand = true) { CoflnetCore.Instance.SendCommand(data, Resource.Id.ServerId); }
public abstract void SendCommand(CommandData data, long serverId = 0);
public override bool CheckPermission(CommandData data, Entity target) { return(data.SenderId == target.Id); }
/// <summary> /// Checks for a permission. /// </summary> /// <returns><c>true</c>, if permission was checked, <c>false</c> otherwise.</returns> /// <param name="target">The target object</param> public abstract bool CheckPermission(CommandData data, Entity target);
public override bool CheckPermission(CommandData data, Entity target) { return(data.SenderId == target.Id.FullServerId || ConfigController.Users.Where(u => u.managingServers != null && u.managingServers.Contains(data.Recipient.ServerId)).Count() != 0 && data.SenderId.LocalId == 0); }