コード例 #1
0
ファイル: InnerReference.cs プロジェクト: Coflnet/cloud
 /// <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
ファイル: Permission.cs プロジェクト: Coflnet/cloud
 /// <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);
 }