Пример #1
0
 /// <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);
 }
Пример #2
0
 public abstract void SendCommand(CommandData data, long serverId = 0);
Пример #3
0
 public override bool CheckPermission(CommandData data, Entity target)
 {
     return(data.SenderId == target.Id);
 }
Пример #4
0
 /// <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);
Пример #5
0
 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);
 }