Exemple #1
0
        /// <summary>
        /// Gets if the given <paramref name="user"/> is allowed to invoke the given command.
        /// </summary>
        /// <param name="user">The user invoking the command.</param>
        /// <param name="commandData">The information about the command to be invoked.</param>
        /// <returns>True if the command can be invoked; otherwise false.</returns>
        protected override bool AllowInvokeCommand(User user, StringCommandParserCommandData <SayHandlerCommandAttribute> commandData)
        {
            // Check for a valid user
            if (user == null)
            {
                return(false);
            }

            // No permissions required
            if (commandData.Attribute.Permissions == UserPermissions.None)
            {
                return(true);
            }

            // Check for permission level
            if (!user.Permissions.IsSet(commandData.Attribute.Permissions))
            {
                return(false);
            }

            return(base.AllowInvokeCommand(user, commandData));
        }
Exemple #2
0
 /// <summary>
 /// Gets if the given <paramref name="user"/> is allowed to invoke the given command.
 /// For now, all commands can be executed by the client. (No restrictions)
 /// </summary>
 /// <param name="user">The user invoking the command.</param>
 /// <param name="commandData">The information about the command to be invoked.</param>
 /// <returns>True if the command can be invoked; otherwise false.</returns>
 protected override bool AllowInvokeCommand(Character user, StringCommandParserCommandData <SayCommandAttribute> commandData)
 {
     return(true);
 }
Exemple #3
0
 /// <summary>
 /// There is no real permissions to use anything on the client-side; so return nothing for now. This may change with time
 /// so support is still here.
 /// </summary>
 /// <param name="user">The user invoking the command.</param>
 /// <param name="commandData">The information about the command to be invoked.</param>
 /// <returns>The message to display to the <paramref name="user"/>, or null or empty to display nothing.</returns>
 protected override string GetCommandNotAllowedMessage(Character user, StringCommandParserCommandData <SayCommandAttribute> commandData)
 {
     return(null);
 }