Core/Refactor: Part 3

This commit is contained in:
hondacrx
2018-05-16 19:57:48 -04:00
parent 225a5d27f7
commit 5dacd669b5
112 changed files with 564 additions and 561 deletions
+1 -1
View File
@@ -574,7 +574,7 @@ namespace Game.Chat
Log.outDebug(LogFilter.ChatSystem, "SMSG_CHANNEL_LIST {0} Channel: {1}", player.GetSession().GetPlayerInfo(), channelName);
ChannelListResponse list = new ChannelListResponse();
list.Display = true; /// always true?
list.Display = true; // always true?
list.Channel = channelName;
list.ChannelFlags = GetFlags();
+2 -2
View File
@@ -52,11 +52,11 @@ namespace Game.Chat
if (text.Length < 2)
return false;
/// ignore messages staring from many dots.
// ignore messages staring from many dots.
if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!'))
return false;
/// skip first . or ! (in console allowed use command with . and ! and without its)
// skip first . or ! (in console allowed use command with . and ! and without its)
if (text[0] == '!' || text[0] == '.')
text = text.Substring(1);
+5 -5
View File
@@ -47,7 +47,7 @@ namespace Game.Chat
"Unknown security level: Notify technician for details."));
// RBAC required display - is not displayed for console
if (pwConfig == 2 && session != null && hasRBAC)
if (pwConfig == 2 && hasRBAC)
handler.SendSysMessage(CypherStrings.RbacEmailRequired);
// Email display if sufficient rights
@@ -635,8 +635,8 @@ namespace Game.Chat
return false;
}
/// can set email only for target with less security
/// This also restricts setting handler's own email.
// can set email only for target with less security
// This also restricts setting handler's own email.
if (handler.HasLowerSecurityAccount(null, targetAccountId, true))
return false;
@@ -696,8 +696,8 @@ namespace Game.Chat
return false;
}
/// can set email only for target with less security
/// This also restricts setting handler's own email.
// can set email only for target with less security
// This also restricts setting handler's own email.
if (handler.HasLowerSecurityAccount(null, targetAccountId, true))
return false;
+1 -1
View File
@@ -146,7 +146,7 @@ namespace Game.Chat.Commands
if (!uint.TryParse(durationStr, out uint tempValue) || tempValue > 0)
{
if (WorldConfig.GetBoolValue(WorldCfg.ShowBanInWorld))
Global.WorldMgr.SendWorldText(CypherStrings.BanAccountYoubannedmessageWorld, author, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr)).ToString(), reasonStr);
Global.WorldMgr.SendWorldText(CypherStrings.BanAccountYoubannedmessageWorld, author, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr)), reasonStr);
else
handler.SendSysMessage(CypherStrings.BanYoubanned, nameOrIP, Time.secsToTimeString(Time.TimeStringToSecs(durationStr), true), reasonStr);
}
@@ -306,7 +306,7 @@ namespace Game.Chat
stmt.AddValue(0, AtLoginFlags.ChangeRace);
if (target)
{
/// @todo add text into database
// @todo add text into database
handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target));
target.SetAtLoginFlag(AtLoginFlags.ChangeRace);
stmt.AddValue(1, target.GetGUID().GetCounter());
@@ -314,7 +314,7 @@ namespace Game.Chat
else
{
string oldNameLink = handler.playerLink(targetName);
/// @todo add text into database
// @todo add text into database
handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString());
stmt.AddValue(1, targetGuid.GetCounter());
}
+1 -1
View File
@@ -619,7 +619,7 @@ namespace Game.Chat
return false;
target.SetUnitMovementFlags((MovementFlag)moveFlags);
/// @fixme: port master's HandleDebugMoveflagsCommand; flags need different handling
// @fixme: port master's HandleDebugMoveflagsCommand; flags need different handling
if (!string.IsNullOrEmpty(mask2))
{
@@ -609,13 +609,13 @@ namespace Game.Chat
if (string.IsNullOrEmpty(state))
return false;
if (!uint.TryParse(state, out uint objectState))
if (!int.TryParse(state, out int objectState))
return false;
if (objectType < 4)
obj.SetByteValue(GameObjectFields.Bytes1, (byte)objectType, (byte)objectState);
else if (objectType == 4)
obj.SendCustomAnim(objectState);
obj.SendCustomAnim((uint)objectState);
else if (objectType == 5)
{
if (objectState < 0 || objectState > (uint)GameObjectDestructibleState.Rebuilding)
+1 -1
View File
@@ -199,7 +199,7 @@ namespace Game.Chat.Commands
uint ownerAccountId = result.Read<uint>(4);
string ownerName = result.Read<string>(5);
string itemPos = "";
string itemPos;
if (Player.IsEquipmentPos((byte)itemBag, itemSlot))
itemPos = "[equipped]";
else if (Player.IsInventoryPos((byte)itemBag, itemSlot))
+1 -1
View File
@@ -618,7 +618,7 @@ namespace Game.Chat
Global.ObjectMgr.LoadQuests();
handler.SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");
/// dependent also from `gameobject` but this table not reloaded anyway
// dependent also from `gameobject` but this table not reloaded anyway
Log.outInfo(LogFilter.Server, "Re-Loading GameObjects for quests...");
Global.ObjectMgr.LoadGameObjectForQuests();
handler.SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
+5 -5
View File
@@ -56,7 +56,7 @@ namespace Game.Chat.Commands
// from console show not existed sender
MailSender sender = new MailSender(MailMessageType.Normal, handler.GetSession() ? handler.GetSession().GetPlayer().GetGUID().GetCounter() : 0, MailStationery.Gm);
/// @todo Fix poor design
// @todo Fix poor design
SQLTransaction trans = new SQLTransaction();
new MailDraft(subject, text)
.SendMailTo(trans, new MailReceiver(target, targetGuid.GetCounter()), sender);
@@ -102,7 +102,7 @@ namespace Game.Chat.Commands
// get from tail next item str
StringArguments itemStr;
while ((itemStr = new StringArguments(tail.NextString(" "))) != null)
while (!(itemStr = new StringArguments(tail.NextString(" "))).Empty())
{
// parse item str
string itemIdStr = itemStr.NextString(":");
@@ -172,7 +172,7 @@ namespace Game.Chat.Commands
[Command("money", RBACPermissions.CommandSendMoney, true)]
static bool HandleSendMoneyCommand(StringArguments args, CommandHandler handler)
{
/// format: name "subject text" "mail text" money
// format: name "subject text" "mail text" money
Player receiver;
ObjectGuid receiverGuid;
@@ -221,7 +221,7 @@ namespace Game.Chat.Commands
[Command("message", RBACPermissions.CommandSendMessage, true)]
static bool HandleSendMessageCommand(StringArguments args, CommandHandler handler)
{
/// - Find the player
// - Find the player
Player player;
if (!handler.extractPlayerTarget(args, out player))
return false;
@@ -237,7 +237,7 @@ namespace Game.Chat.Commands
return false;
}
/// - Send the message
// - Send the message
player.GetSession().SendNotification("{0}", msgStr);
player.GetSession().SendNotification("|cffff0000[Message from administrator]:|r");