Skip to content

Commit

Permalink
Fix #21, #28
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosnt committed Feb 12, 2016
1 parent e3e7492 commit e43e9f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion( "1.0.6.3" )]
[assembly: AssemblyFileVersion( "1.0.6.3" )]
[assembly: AssemblyVersion( "1.0.6.4" )]
[assembly: AssemblyFileVersion( "1.0.6.4" )]
15 changes: 12 additions & 3 deletions src/Core/Command/MethodCommand.cs
Expand Up @@ -27,6 +27,7 @@

namespace Essentials.Core.Command
{
//TODO: !!! CLEANUP !!!
internal class MethodCommand : ICommand
{
internal Type Owner => _methodAction != null
Expand All @@ -37,6 +38,7 @@ internal class MethodCommand : ICommand
private readonly Action<ICommandSource, ICommandArgs, ICommand> _methodActionWithCommand;
private readonly CommandInfo _info;
private readonly bool _hasCommandParameter;
private readonly string _permission;

internal MethodCommand( Action<ICommandSource, ICommandArgs> methodAction )
{
Expand All @@ -47,6 +49,10 @@ internal MethodCommand( Action<ICommandSource, ICommandArgs> methodAction )
ReflectionUtil.GetAttributeFrom<CommandInfo>( methodAction.Method ),
"methodAction must have 'CommandInfo' attribute."
);

_permission = GetType().Assembly.Equals( typeof( EssCore ).Assembly )
? $"essentials.command.{Name}"
: _info.Permission;
}

internal MethodCommand( Action<ICommandSource, ICommandArgs, ICommand> methodAction )
Expand All @@ -56,15 +62,18 @@ internal MethodCommand( Action<ICommandSource, ICommandArgs, ICommand> methodAct

_info = Preconditions.NotNull(
ReflectionUtil.GetAttributeFrom<CommandInfo>( methodAction.Method ),
"methodAction must have 'CommandInfo' attribute."
);
"methodAction must have 'CommandInfo' attribute." );

_permission = GetType().Assembly.Equals( typeof( EssCore ).Assembly )
? $"essentials.command.{Name}"
: _info.Permission;
}

public string Name => _info.Name;
public string Usage => _info.Usage;
public string[] Aliases => _info.Aliases;
public string Description => _info.Description;
public string Permission => _info.Permission;
public string Permission => _permission;
public AllowedSource AllowedSource => _info.AllowedSource;

public void OnExecute(ICommandSource source, ICommandArgs args)
Expand Down
2 changes: 1 addition & 1 deletion src/Core/EssCore.cs
Expand Up @@ -78,7 +78,7 @@ public sealed class EssCore : RocketPlugin
- essentials.keepskill.<skill>
*/

internal const string PLUGIN_VERSION = "1.0.6.3";
internal const string PLUGIN_VERSION = "1.0.6.4";
internal const string ROCKET_VERSION = "4.9.2.0";
internal const string UNTURNED_VERSION = "3.14.4.0";

Expand Down

0 comments on commit e43e9f9

Please sign in to comment.