Misc command updates.
This commit is contained in:
@@ -705,7 +705,7 @@ namespace Game.Chat
|
|||||||
int partIndex = 0;
|
int partIndex = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (partIndex >= part.Length)
|
if (partIndex >= part.Length || part[partIndex] == ' ')
|
||||||
return true;
|
return true;
|
||||||
else if (partIndex >= name.Length)
|
else if (partIndex >= name.Length)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -26,31 +26,19 @@ namespace Game.Chat.Commands
|
|||||||
class BNetAccountCommands
|
class BNetAccountCommands
|
||||||
{
|
{
|
||||||
[Command("create", RBACPermissions.CommandBnetAccountCreate, true)]
|
[Command("create", RBACPermissions.CommandBnetAccountCreate, true)]
|
||||||
static bool HandleAccountCreateCommand(CommandHandler handler, StringArguments args)
|
static bool HandleAccountCreateCommand(CommandHandler handler, string accountName, string password, bool? createGameAccount)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Parse the command line arguments
|
|
||||||
string accountName = args.NextString();
|
|
||||||
string password = args.NextString();
|
|
||||||
if (string.IsNullOrEmpty(accountName) || string.IsNullOrEmpty(password))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!accountName.Contains('@'))
|
if (!accountName.Contains('@'))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.AccountInvalidBnetName);
|
handler.SendSysMessage(CypherStrings.AccountInvalidBnetName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bool.TryParse(args.NextString(), out bool createGameAccount))
|
|
||||||
createGameAccount = true;
|
|
||||||
|
|
||||||
string gameAccountName;
|
string gameAccountName;
|
||||||
switch (Global.BNetAccountMgr.CreateBattlenetAccount(accountName, password, createGameAccount, out gameAccountName))
|
switch (Global.BNetAccountMgr.CreateBattlenetAccount(accountName, password, createGameAccount.GetValueOrDefault(true), out gameAccountName))
|
||||||
{
|
{
|
||||||
case AccountOpResult.Ok:
|
case AccountOpResult.Ok:
|
||||||
if (createGameAccount)
|
if (createGameAccount.Value)
|
||||||
handler.SendSysMessage(CypherStrings.AccountCreatedBnetWithGame, accountName, gameAccountName);
|
handler.SendSysMessage(CypherStrings.AccountCreatedBnetWithGame, accountName, gameAccountName);
|
||||||
else
|
else
|
||||||
handler.SendSysMessage(CypherStrings.AccountCreated, accountName);
|
handler.SendSysMessage(CypherStrings.AccountCreated, accountName);
|
||||||
@@ -59,7 +47,7 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.Player, "Account: {0} (IP: {1}) Character:[{2}] ({3}) created Battle.net account {4}{5}{6}",
|
Log.outInfo(LogFilter.Player, "Account: {0} (IP: {1}) Character:[{2}] ({3}) created Battle.net account {4}{5}{6}",
|
||||||
handler.GetSession().GetAccountId(), handler.GetSession().GetRemoteAddress(), handler.GetSession().GetPlayer().GetName(),
|
handler.GetSession().GetAccountId(), handler.GetSession().GetRemoteAddress(), handler.GetSession().GetPlayer().GetName(),
|
||||||
handler.GetSession().GetPlayer().GetGUID().ToString(), accountName, createGameAccount ? " with game account " : "", createGameAccount ? gameAccountName : "");
|
handler.GetSession().GetPlayer().GetGUID().ToString(), accountName, createGameAccount.Value ? " with game account " : "", createGameAccount.Value ? gameAccountName : "");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AccountOpResult.NameTooLong:
|
case AccountOpResult.NameTooLong:
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Command("dummy", RBACPermissions.CommandDebugDummy)]
|
[Command("dummy", RBACPermissions.CommandDebugDummy)]
|
||||||
static bool HandleDebugDummyCommand(CommandHandler handler, StringArguments args)
|
static bool HandleDebugDummyCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage("This command does nothing right now. Edit your local core (DebugCommands.cs) to make it do whatever you need for testing.");
|
handler.SendSysMessage("This command does nothing right now. Edit your local core (DebugCommands.cs) to make it do whatever you need for testing.");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ namespace Game.Chat
|
|||||||
class MessageCommands
|
class MessageCommands
|
||||||
{
|
{
|
||||||
[CommandNonGroup("nameannounce", RBACPermissions.CommandNameannounce, true)]
|
[CommandNonGroup("nameannounce", RBACPermissions.CommandNameannounce, true)]
|
||||||
static bool HandleNameAnnounceCommand(CommandHandler handler, object[] args)
|
static bool HandleNameAnnounceCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string name = "Console";
|
string name = "Console";
|
||||||
@@ -38,14 +38,14 @@ namespace Game.Chat
|
|||||||
if (session)
|
if (session)
|
||||||
name = session.GetPlayer().GetName();
|
name = session.GetPlayer().GetName();
|
||||||
|
|
||||||
Global.WorldMgr.SendWorldText(CypherStrings.AnnounceColor, name, args);
|
Global.WorldMgr.SendWorldText(CypherStrings.AnnounceColor, name, message);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("gmnameannounce", RBACPermissions.CommandGmnameannounce, true)]
|
[CommandNonGroup("gmnameannounce", RBACPermissions.CommandGmnameannounce, true)]
|
||||||
static bool HandleGMNameAnnounceCommand(CommandHandler handler, object[] args)
|
static bool HandleGMNameAnnounceCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string name = "Console";
|
string name = "Console";
|
||||||
@@ -53,40 +53,38 @@ namespace Game.Chat
|
|||||||
if (session)
|
if (session)
|
||||||
name = session.GetPlayer().GetName();
|
name = session.GetPlayer().GetName();
|
||||||
|
|
||||||
Global.WorldMgr.SendGMText(CypherStrings.AnnounceColor, name, args);
|
Global.WorldMgr.SendGMText(CypherStrings.AnnounceColor, name, message);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("announce", RBACPermissions.CommandAnnounce, true)]
|
[CommandNonGroup("announce", RBACPermissions.CommandAnnounce, true)]
|
||||||
static bool HandleAnnounceCommand(CommandHandler handler, object[] args)
|
static bool HandleAnnounceCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string str = handler.GetParsedString(CypherStrings.Systemmessage, args);
|
Global.WorldMgr.SendServerMessage(ServerMessageType.String, handler.GetParsedString(CypherStrings.Systemmessage, message));
|
||||||
Global.WorldMgr.SendServerMessage(ServerMessageType.String, str);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("gmannounce", RBACPermissions.CommandGmannounce, true)]
|
[CommandNonGroup("gmannounce", RBACPermissions.CommandGmannounce, true)]
|
||||||
static bool HandleGMAnnounceCommand(CommandHandler handler, object[] args)
|
static bool HandleGMAnnounceCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Global.WorldMgr.SendGMText(CypherStrings.GmBroadcast, args);
|
Global.WorldMgr.SendGMText(CypherStrings.GmBroadcast, message);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("notify", RBACPermissions.CommandNotify, true)]
|
[CommandNonGroup("notify", RBACPermissions.CommandNotify, true)]
|
||||||
static bool HandleNotifyCommand(CommandHandler handler, object[] args)
|
static bool HandleNotifyCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string str = handler.GetCypherString(CypherStrings.GlobalNotify);
|
string str = handler.GetCypherString(CypherStrings.GlobalNotify);
|
||||||
foreach (string str2 in args)
|
str += message;
|
||||||
str += str2;
|
|
||||||
|
|
||||||
Global.WorldMgr.SendGlobalMessage(new PrintNotification(str));
|
Global.WorldMgr.SendGlobalMessage(new PrintNotification(str));
|
||||||
|
|
||||||
@@ -94,14 +92,13 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("gmnotify", RBACPermissions.CommandGmnotify, true)]
|
[CommandNonGroup("gmnotify", RBACPermissions.CommandGmnotify, true)]
|
||||||
static bool HandleGMNotifyCommand(CommandHandler handler, object[] args)
|
static bool HandleGMNotifyCommand(CommandHandler handler, string message)
|
||||||
{
|
{
|
||||||
if (args.Length == 0)
|
if (message.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string str = handler.GetCypherString(CypherStrings.GmNotify);
|
string str = handler.GetCypherString(CypherStrings.GmNotify);
|
||||||
foreach (string str2 in args)
|
str += message;
|
||||||
str += str2;
|
|
||||||
|
|
||||||
Global.WorldMgr.SendGlobalGMMessage(new PrintNotification(str));
|
Global.WorldMgr.SendGlobalGMMessage(new PrintNotification(str));
|
||||||
|
|
||||||
|
|||||||
@@ -186,25 +186,16 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("additem set", RBACPermissions.CommandAdditemset)]
|
[CommandNonGroup("additem set", RBACPermissions.CommandAdditemset)]
|
||||||
static bool HandleAddItemSetCommand(CommandHandler handler, StringArguments args)
|
static bool HandleAddItemSetCommand(CommandHandler handler, uint itemSetId, string bonuses, string context)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
string idStr = handler.ExtractKeyFromLink(args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r
|
|
||||||
if (string.IsNullOrEmpty(idStr))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// prevent generation all items with itemset field value '0'
|
// prevent generation all items with itemset field value '0'
|
||||||
if (!uint.TryParse(idStr, out uint itemSetId) || itemSetId == 0)
|
if (itemSetId == 0)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.NoItemsFromItemsetFound, itemSetId);
|
handler.SendSysMessage(CypherStrings.NoItemsFromItemsetFound, itemSetId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<uint> bonusListIDs = new();
|
List<uint> bonusListIDs = new();
|
||||||
var bonuses = args.NextString();
|
|
||||||
var context = args.NextString();
|
|
||||||
|
|
||||||
// semicolon separated bonuslist ids (parse them after all arguments are extracted by strtok!)
|
// semicolon separated bonuslist ids (parse them after all arguments are extracted by strtok!)
|
||||||
if (!bonuses.IsEmpty())
|
if (!bonuses.IsEmpty())
|
||||||
@@ -411,14 +402,14 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("bank", RBACPermissions.CommandBank)]
|
[CommandNonGroup("bank", RBACPermissions.CommandBank)]
|
||||||
static bool HandleBankCommand(CommandHandler handler, StringArguments args)
|
static bool HandleBankCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
handler.GetSession().SendShowBank(handler.GetSession().GetPlayer().GetGUID());
|
handler.GetSession().SendShowBank(handler.GetSession().GetPlayer().GetGUID());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("bindsight", RBACPermissions.CommandBindsight)]
|
[CommandNonGroup("bindsight", RBACPermissions.CommandBindsight)]
|
||||||
static bool HandleBindSightCommand(CommandHandler handler, StringArguments args)
|
static bool HandleBindSightCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Unit unit = handler.GetSelectedUnit();
|
Unit unit = handler.GetSelectedUnit();
|
||||||
if (!unit)
|
if (!unit)
|
||||||
@@ -458,7 +449,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("cometome", RBACPermissions.CommandCometome)]
|
[CommandNonGroup("cometome", RBACPermissions.CommandCometome)]
|
||||||
static bool HandleComeToMeCommand(CommandHandler handler, StringArguments args)
|
static bool HandleComeToMeCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Creature caster = handler.GetSelectedCreature();
|
Creature caster = handler.GetSelectedCreature();
|
||||||
if (!caster)
|
if (!caster)
|
||||||
@@ -988,11 +979,8 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("hidearea", RBACPermissions.CommandHidearea)]
|
[CommandNonGroup("hidearea", RBACPermissions.CommandHidearea)]
|
||||||
static bool HandleHideAreaCommand(CommandHandler handler, StringArguments args)
|
static bool HandleHideAreaCommand(CommandHandler handler, uint areaId)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Player playerTarget = handler.GetSelectedPlayer();
|
Player playerTarget = handler.GetSelectedPlayer();
|
||||||
if (!playerTarget)
|
if (!playerTarget)
|
||||||
{
|
{
|
||||||
@@ -1000,7 +988,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(args.NextUInt32());
|
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(areaId);
|
||||||
if (area == null)
|
if (area == null)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.BadValue);
|
handler.SendSysMessage(CypherStrings.BadValue);
|
||||||
@@ -1122,7 +1110,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("listfreeze", RBACPermissions.CommandListfreeze)]
|
[CommandNonGroup("listfreeze", RBACPermissions.CommandListfreeze)]
|
||||||
static bool HandleListFreezeCommand(CommandHandler handler, StringArguments args)
|
static bool HandleListFreezeCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
// Get names from DB
|
// Get names from DB
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_FROZEN);
|
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_AURA_FROZEN);
|
||||||
@@ -1159,7 +1147,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("mailbox", RBACPermissions.CommandMailbox)]
|
[CommandNonGroup("mailbox", RBACPermissions.CommandMailbox)]
|
||||||
static bool HandleMailBoxCommand(CommandHandler handler, StringArguments args)
|
static bool HandleMailBoxCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Player player = handler.GetSession().GetPlayer();
|
Player player = handler.GetSession().GetPlayer();
|
||||||
|
|
||||||
@@ -1168,7 +1156,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("movegens", RBACPermissions.CommandMovegens)]
|
[CommandNonGroup("movegens", RBACPermissions.CommandMovegens)]
|
||||||
static bool HandleMovegensCommand(CommandHandler handler, StringArguments args)
|
static bool HandleMovegensCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Unit unit = handler.GetSelectedUnit();
|
Unit unit = handler.GetSelectedUnit();
|
||||||
if (!unit)
|
if (!unit)
|
||||||
@@ -1251,7 +1239,7 @@ namespace Game.Chat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mute player for some times
|
// mute player for the specified duration
|
||||||
[CommandNonGroup("mute", RBACPermissions.CommandMute, true)]
|
[CommandNonGroup("mute", RBACPermissions.CommandMute, true)]
|
||||||
static bool HandleMuteCommand(CommandHandler handler, StringArguments args)
|
static bool HandleMuteCommand(CommandHandler handler, StringArguments args)
|
||||||
{
|
{
|
||||||
@@ -1336,15 +1324,8 @@ namespace Game.Chat
|
|||||||
|
|
||||||
// mutehistory command
|
// mutehistory command
|
||||||
[CommandNonGroup("mutehistory", RBACPermissions.CommandMutehistory, true)]
|
[CommandNonGroup("mutehistory", RBACPermissions.CommandMutehistory, true)]
|
||||||
static bool HandleMuteInfoCommand(CommandHandler handler, StringArguments args)
|
static bool HandleMuteHistoryCommand(CommandHandler handler, string accountName)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
string accountName = args.NextString("");
|
|
||||||
if (accountName.IsEmpty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
uint accountId = Global.AccountMgr.GetId(accountName);
|
uint accountId = Global.AccountMgr.GetId(accountName);
|
||||||
if (accountId == 0)
|
if (accountId == 0)
|
||||||
{
|
{
|
||||||
@@ -1791,29 +1772,22 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("playall", RBACPermissions.CommandPlayall)]
|
[CommandNonGroup("playall", RBACPermissions.CommandPlayall)]
|
||||||
static bool HandlePlayAllCommand(CommandHandler handler, StringArguments args)
|
static bool HandlePlayAllCommand(CommandHandler handler, uint soundId, uint? broadcastTextId)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
uint soundId = args.NextUInt32();
|
|
||||||
|
|
||||||
if (!CliDB.SoundKitStorage.ContainsKey(soundId))
|
if (!CliDB.SoundKitStorage.ContainsKey(soundId))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.SoundNotExist, soundId);
|
handler.SendSysMessage(CypherStrings.SoundNotExist, soundId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint broadcastTextId = args.NextUInt32();
|
Global.WorldMgr.SendGlobalMessage(new PlaySound(handler.GetSession().GetPlayer().GetGUID(), soundId, broadcastTextId.GetValueOrDefault(0)));
|
||||||
|
|
||||||
Global.WorldMgr.SendGlobalMessage(new PlaySound(handler.GetSession().GetPlayer().GetGUID(), soundId, broadcastTextId));
|
|
||||||
|
|
||||||
handler.SendSysMessage(CypherStrings.CommandPlayedToAll, soundId);
|
handler.SendSysMessage(CypherStrings.CommandPlayedToAll, soundId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("possess", RBACPermissions.CommandPossess)]
|
[CommandNonGroup("possess", RBACPermissions.CommandPossess)]
|
||||||
static bool HandlePossessCommand(CommandHandler handler, StringArguments args)
|
static bool HandlePossessCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Unit unit = handler.GetSelectedUnit();
|
Unit unit = handler.GetSelectedUnit();
|
||||||
if (!unit)
|
if (!unit)
|
||||||
@@ -1899,7 +1873,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("respawn", RBACPermissions.CommandRespawn)]
|
[CommandNonGroup("respawn", RBACPermissions.CommandRespawn)]
|
||||||
static bool HandleRespawnCommand(CommandHandler handler, StringArguments args)
|
static bool HandleRespawnCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Player player = handler.GetSession().GetPlayer();
|
Player player = handler.GetSession().GetPlayer();
|
||||||
|
|
||||||
@@ -1991,11 +1965,8 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("showarea", RBACPermissions.CommandShowarea)]
|
[CommandNonGroup("showarea", RBACPermissions.CommandShowarea)]
|
||||||
static bool HandleShowAreaCommand(CommandHandler handler, StringArguments args)
|
static bool HandleShowAreaCommand(CommandHandler handler, uint areaId)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Player playerTarget = handler.GetSelectedPlayer();
|
Player playerTarget = handler.GetSelectedPlayer();
|
||||||
if (!playerTarget)
|
if (!playerTarget)
|
||||||
{
|
{
|
||||||
@@ -2003,7 +1974,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(args.NextUInt32());
|
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(areaId);
|
||||||
if (area == null)
|
if (area == null)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.BadValue);
|
handler.SendSysMessage(CypherStrings.BadValue);
|
||||||
@@ -2144,7 +2115,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("unbindsight", RBACPermissions.CommandUnbindsight)]
|
[CommandNonGroup("unbindsight", RBACPermissions.CommandUnbindsight)]
|
||||||
static bool HandleUnbindSightCommand(CommandHandler handler, StringArguments args)
|
static bool HandleUnbindSightCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Player player = handler.GetSession().GetPlayer();
|
Player player = handler.GetSession().GetPlayer();
|
||||||
|
|
||||||
@@ -2156,15 +2127,14 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("unfreeze", RBACPermissions.CommandUnfreeze)]
|
[CommandNonGroup("unfreeze", RBACPermissions.CommandUnfreeze)]
|
||||||
static bool HandleUnFreezeCommand(CommandHandler handler, StringArguments args)
|
static bool HandleUnFreezeCommand(CommandHandler handler, string targetNameArg)
|
||||||
{
|
{
|
||||||
string name = "";
|
string name = "";
|
||||||
Player player;
|
Player player;
|
||||||
string targetName = args.NextString(); // Get entered name
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(targetName))
|
if (!targetNameArg.IsEmpty())
|
||||||
{
|
{
|
||||||
name = targetName;
|
name = targetNameArg;
|
||||||
ObjectManager.NormalizePlayerName(ref name);
|
ObjectManager.NormalizePlayerName(ref name);
|
||||||
player = Global.ObjAccessor.FindPlayerByName(name);
|
player = Global.ObjAccessor.FindPlayerByName(name);
|
||||||
}
|
}
|
||||||
@@ -2186,7 +2156,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(targetName))
|
if (!targetNameArg.IsEmpty())
|
||||||
{
|
{
|
||||||
// Check for offline players
|
// Check for offline players
|
||||||
ObjectGuid guid = Global.CharacterCacheStorage.GetCharacterGuidByName(name);
|
ObjectGuid guid = Global.CharacterCacheStorage.GetCharacterGuidByName(name);
|
||||||
@@ -2267,7 +2237,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("unpossess", RBACPermissions.CommandUnpossess)]
|
[CommandNonGroup("unpossess", RBACPermissions.CommandUnpossess)]
|
||||||
static bool HandleUnPossessCommand(CommandHandler handler, StringArguments args)
|
static bool HandleUnPossessCommand(CommandHandler handler)
|
||||||
{
|
{
|
||||||
Unit unit = handler.GetSelectedUnit();
|
Unit unit = handler.GetSelectedUnit();
|
||||||
if (!unit)
|
if (!unit)
|
||||||
@@ -2354,26 +2324,14 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("wchange", RBACPermissions.CommandWchange)]
|
[CommandNonGroup("wchange", RBACPermissions.CommandWchange)]
|
||||||
static bool HandleChangeWeather(CommandHandler handler, StringArguments args)
|
static bool HandleChangeWeather(CommandHandler handler, uint type, float intensity)
|
||||||
{
|
{
|
||||||
if (args.Empty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Weather is OFF
|
// Weather is OFF
|
||||||
if (!WorldConfig.GetBoolValue(WorldCfg.Weather))
|
if (!WorldConfig.GetBoolValue(WorldCfg.Weather))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.WeatherDisabled);
|
handler.SendSysMessage(CypherStrings.WeatherDisabled);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// *Change the weather of a cell
|
|
||||||
//0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
|
|
||||||
if (!uint.TryParse(args.NextString(), out uint type))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
//0 to 1, sending -1 is instand good weather
|
|
||||||
if (!float.TryParse(args.NextString(), out float grade))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Player player = handler.GetSession().GetPlayer();
|
Player player = handler.GetSession().GetPlayer();
|
||||||
uint zoneid = player.GetZoneId();
|
uint zoneid = player.GetZoneId();
|
||||||
@@ -2385,7 +2343,7 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
weather.SetWeather((WeatherType)type, grade);
|
weather.SetWeather((WeatherType)type, intensity);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Game.Chat
|
|||||||
class SpellCommands
|
class SpellCommands
|
||||||
{
|
{
|
||||||
[CommandNonGroup("cooldown", RBACPermissions.CommandCooldown)]
|
[CommandNonGroup("cooldown", RBACPermissions.CommandCooldown)]
|
||||||
static bool HandleCooldownCommand(CommandHandler handler, StringArguments args)
|
static bool HandleCooldownCommand(CommandHandler handler, uint? spellIdArg)
|
||||||
{
|
{
|
||||||
Unit target = handler.GetSelectedUnit();
|
Unit target = handler.GetSelectedUnit();
|
||||||
if (!target)
|
if (!target)
|
||||||
@@ -44,7 +44,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
string nameLink = handler.GetNameLink(owner);
|
string nameLink = handler.GetNameLink(owner);
|
||||||
if (args.Empty())
|
if (!spellIdArg.HasValue)
|
||||||
{
|
{
|
||||||
target.GetSpellHistory().ResetAllCooldowns();
|
target.GetSpellHistory().ResetAllCooldowns();
|
||||||
target.GetSpellHistory().ResetAllCharges();
|
target.GetSpellHistory().ResetAllCharges();
|
||||||
@@ -52,21 +52,16 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
|
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellIdArg.Value, target.GetMap().GetDifficultyID());
|
||||||
uint spellIid = handler.ExtractSpellIdFromLink(args);
|
|
||||||
if (spellIid == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellIid, target.GetMap().GetDifficultyID());
|
|
||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.UnknownSpell, owner == handler.GetSession().GetPlayer() ? handler.GetCypherString(CypherStrings.You) : nameLink);
|
handler.SendSysMessage(CypherStrings.UnknownSpell, owner == handler.GetSession().GetPlayer() ? handler.GetCypherString(CypherStrings.You) : nameLink);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.GetSpellHistory().ResetCooldown(spellIid, true);
|
target.GetSpellHistory().ResetCooldown(spellInfo.Id, true);
|
||||||
target.GetSpellHistory().ResetCharges(spellInfo.ChargeCategoryId);
|
target.GetSpellHistory().ResetCharges(spellInfo.ChargeCategoryId);
|
||||||
handler.SendSysMessage(CypherStrings.RemoveallCooldown, spellIid, owner == handler.GetSession().GetPlayer() ? handler.GetCypherString(CypherStrings.You) : nameLink);
|
handler.SendSysMessage(CypherStrings.RemoveallCooldown, spellInfo.Id, owner == handler.GetSession().GetPlayer() ? handler.GetCypherString(CypherStrings.You) : nameLink);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -123,23 +118,8 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CommandNonGroup("setskill", RBACPermissions.CommandSetskill)]
|
[CommandNonGroup("setskill", RBACPermissions.CommandSetskill)]
|
||||||
static bool SetSkill(CommandHandler handler, StringArguments args)
|
static bool HandleSetSkillCommand(CommandHandler handler, uint skillId, uint level, uint? maxSkillArg)
|
||||||
{
|
{
|
||||||
// number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
|
|
||||||
string skillStr = handler.ExtractKeyFromLink(args, "Hskill");
|
|
||||||
if (string.IsNullOrEmpty(skillStr))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!uint.TryParse(skillStr, out uint skill) || skill == 0)
|
|
||||||
{
|
|
||||||
handler.SendSysMessage(CypherStrings.InvalidSkillId, skill);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint level = args.NextUInt32();
|
|
||||||
if (level == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Player target = handler.GetSelectedPlayerOrSelf();
|
Player target = handler.GetSelectedPlayerOrSelf();
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
@@ -147,19 +127,18 @@ namespace Game.Chat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillLineRecord skillLine = CliDB.SkillLineStorage.LookupByKey(skill);
|
SkillLineRecord skillLine = CliDB.SkillLineStorage.LookupByKey(skillId);
|
||||||
if (skillLine == null)
|
if (skillLine == null)
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.InvalidSkillId, skill);
|
handler.SendSysMessage(CypherStrings.InvalidSkillId, skillId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool targetHasSkill = target.GetSkillValue((SkillType)skill) != 0;
|
bool targetHasSkill = target.GetSkillValue((SkillType)skillId) != 0;
|
||||||
|
|
||||||
ushort maxPureSkill = args.NextUInt16();
|
|
||||||
// If our target does not yet have the skill they are trying to add to them, the chosen level also becomes
|
// If our target does not yet have the skill they are trying to add to them, the chosen level also becomes
|
||||||
// the max level of the new profession.
|
// the max level of the new profession.
|
||||||
ushort max = maxPureSkill != 0 ? maxPureSkill : targetHasSkill ? target.GetPureMaxSkillValue((SkillType)skill) : (ushort)level;
|
ushort max = (ushort)maxSkillArg.GetValueOrDefault(targetHasSkill ? target.GetPureMaxSkillValue((SkillType)skillId) : level);
|
||||||
|
|
||||||
if (level == 0 || level > max)
|
if (level == 0 || level > max)
|
||||||
return false;
|
return false;
|
||||||
@@ -167,8 +146,8 @@ namespace Game.Chat
|
|||||||
// If the player has the skill, we get the current skill step. If they don't have the skill, we
|
// If the player has the skill, we get the current skill step. If they don't have the skill, we
|
||||||
// add the skill to the player's book with step 1 (which is the first rank, in most cases something
|
// add the skill to the player's book with step 1 (which is the first rank, in most cases something
|
||||||
// like 'Apprentice <skill>'.
|
// like 'Apprentice <skill>'.
|
||||||
target.SetSkill((SkillType)skill, (uint)(targetHasSkill ? target.GetSkillStep((SkillType)skill) : 1), level, max);
|
target.SetSkill((SkillType)skillId, (uint)(targetHasSkill ? target.GetSkillStep((SkillType)skillId) : 1), level, max);
|
||||||
handler.SendSysMessage(CypherStrings.SetSkill, skill, skillLine.DisplayName[handler.GetSessionDbcLocale()], handler.GetNameLink(target), level, max);
|
handler.SendSysMessage(CypherStrings.SetSkill, skillId, skillLine.DisplayName[handler.GetSessionDbcLocale()], handler.GetNameLink(target), level, max);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,6 @@ namespace Game.Misc
|
|||||||
opt.Confirm = item.BoxMessage; // accept text (related to money) pop up box, 2.0.3
|
opt.Confirm = item.BoxMessage; // accept text (related to money) pop up box, 2.0.3
|
||||||
opt.Status = GossipOptionStatus.Available;
|
opt.Status = GossipOptionStatus.Available;
|
||||||
packet.GossipOptions.Add(opt);
|
packet.GossipOptions.Add(opt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (byte i = 0; i < _questMenu.GetMenuItemCount(); ++i)
|
for (byte i = 0; i < _questMenu.GetMenuItemCount(); ++i)
|
||||||
|
|||||||
@@ -1860,13 +1860,14 @@ ChatFakeMessagePreventing = 1
|
|||||||
#
|
#
|
||||||
# ChatStrictLinkChecking.Severity
|
# ChatStrictLinkChecking.Severity
|
||||||
# Description: Check chat messages for in-game links to spells, items, quests, etc.
|
# Description: Check chat messages for in-game links to spells, items, quests, etc.
|
||||||
# Default: 0 - (Disabled)
|
# -1 - (Only verify validity of link data, but permit use of custom colors)
|
||||||
# 1 - (Enabled, Check if only valid pipe commands are used, Prevents posting
|
# Default: 0 - (Only verify that link data and color are valid without checking text)
|
||||||
# pictures.)
|
# 1 - (Additionally verifies that the link text matches the provided data)
|
||||||
# 2 - (Enabled, Verify that pipe commands are used in a correct order)
|
#
|
||||||
# 3 - (Check if color, entry and name don't contradict each other. For this to
|
# Note: If this is set to '1', you must additionally provide .dbc files for all
|
||||||
# work correctly, please assure that you have extracted locale DBCs of
|
# client locales that are in use on your server.
|
||||||
# every language specific client playing on this server)
|
# If any files are missing, messages with links from clients using those
|
||||||
|
# locales will likely be blocked by the server.
|
||||||
|
|
||||||
ChatStrictLinkChecking.Severity = 0
|
ChatStrictLinkChecking.Severity = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user