Update some commands to new system
Port From (https://github.com/TrinityCore/TrinityCore/commit/3260b94dd627b7b0c7114f94bb97d108b005af3e)
This commit is contained in:
@@ -167,20 +167,23 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("info", RBACPermissions.CommandGuildInfo, true)]
|
||||
static bool HandleGuildInfoCommand(CommandHandler handler, StringArguments args)
|
||||
static bool HandleGuildInfoCommand(CommandHandler handler, [OptionalArg][VariantArg(typeof(ulong), typeof(string))] dynamic guildIdentifier)
|
||||
{
|
||||
Guild guild = null;
|
||||
Player target = handler.GetSelectedPlayerOrSelf();
|
||||
|
||||
if (!args.Empty() && args[0] != '\0')
|
||||
if (guildIdentifier != null)
|
||||
{
|
||||
if (char.IsDigit(args[0]))
|
||||
guild = Global.GuildMgr.GetGuildById(args.NextUInt64());
|
||||
if (guildIdentifier is ulong)
|
||||
guild = Global.GuildMgr.GetGuildById(guildIdentifier);
|
||||
else
|
||||
guild = Global.GuildMgr.GetGuildByName(args.NextString());
|
||||
guild = Global.GuildMgr.GetGuildByName(guildIdentifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerIdentifier target = PlayerIdentifier.FromTargetOrSelf(handler);
|
||||
if (target != null && target.IsConnected())
|
||||
guild = target.GetConnectedPlayer().GetGuild();
|
||||
}
|
||||
else if (target)
|
||||
guild = target.GetGuild();
|
||||
|
||||
if (!guild)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user