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
@@ -241,7 +241,7 @@ namespace Game.AI
}
public override bool CanAIAttack(Unit victim)
{
/// todo use one function to replace it
// todo use one function to replace it
if (!me.IsWithinCombatRange(me.GetVictim(), me.m_CombatDistance)
|| (m_minRange != 0 && me.IsWithinCombatRange(me.GetVictim(), m_minRange)))
return false;
+1 -1
View File
@@ -546,7 +546,7 @@ namespace Game.AI
if (me.GetVictim() && me.GetVictim() != victim)
{
// Check if our owner selected this target and clicked "attack"
Unit ownerTarget = null;
Unit ownerTarget;
Player owner = me.GetCharmerOrOwner().ToPlayer();
if (owner)
ownerTarget = owner.GetSelectedUnit();
-1
View File
@@ -57,7 +57,6 @@ namespace Game.AI
if (victim == null || !victim.isTargetableForAttack() || !me.IsWithinDistInMap(victim, max_range) ||
me.IsFriendlyTo(victim) || !me.CanSeeOrDetect(victim))
{
victim = null;
var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me.GetCharmerOrOwnerOrSelf(), max_range);
var checker = new UnitLastSearcher(me, u_check);
Cell.VisitAllObjects(me, checker, max_range);
+1 -3
View File
@@ -133,12 +133,10 @@ namespace Game.AI
uint spellCount = 0;
SpellInfo tempSpell = null;
//Check if each spell is viable(set it to null if not)
for (uint i = 0; i < SharedConst.MaxCreatureSpells; i++)
{
tempSpell = Global.SpellMgr.GetSpellInfo(me.m_spells[i]);
SpellInfo tempSpell = Global.SpellMgr.GetSpellInfo(me.m_spells[i]);
//This spell doesn't exist
if (tempSpell == null)
@@ -142,7 +142,7 @@ namespace Game.AI
if (!HasFollowState(eFollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null)
return;
/// @todo need a better check for quests with time limit.
// @todo need a better check for quests with time limit.
Player player = GetLeaderForFollower();
if (player)
{
@@ -1255,7 +1255,7 @@ namespace Game.AI
if (e.GetScriptType() != SmartScriptType.Creature)
return true;
uint entry = 0;
uint entry;
if (e.GetEventType() == SmartEvents.TextOver)
{
entry = e.Event.textOver.creatureEntry;
+1 -1
View File
@@ -3272,7 +3272,7 @@ namespace Game.AI
if (me == null || !me.IsInCombat())
return;
List<WorldObject> _targets = null;
List<WorldObject> _targets;
switch (e.GetTargetType())
{
@@ -180,13 +180,13 @@ namespace Game.Achievements
public virtual void CompletedAchievement(AchievementRecord entry, Player referencePlayer) { }
public Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord> VisibleAchievementCheck = new Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord>(value =>
public Func<KeyValuePair<uint, CompletedAchievementData>, AchievementRecord> VisibleAchievementCheck = value =>
{
AchievementRecord achievement = CliDB.AchievementStorage.LookupByKey(value.Key);
if (achievement != null && !achievement.Flags.HasAnyFlag(AchievementFlags.Hidden))
return achievement;
return null;
});
};
protected Dictionary<uint, CompletedAchievementData> _completedAchievements = new Dictionary<uint, CompletedAchievementData>();
protected uint _achievementPoints;
@@ -1045,7 +1045,7 @@ namespace Game.Achievements
public bool IsRealmCompleted(AchievementRecord achievement)
{
var time = _allCompletedAchievements.LookupByKey(achievement.Id);
if (time == null)
if (time == default(DateTime))
return false;
if (time == DateTime.MinValue)
@@ -694,7 +694,7 @@ namespace Game.BattleFields
public override void OnPlayerLeaveWar(Player player)
{
// Remove all aura from WG /// @todo false we can go out of this zone on retail and keep Rank buff, remove on end of WG
// Remove all aura from WG // @todo false we can go out of this zone on retail and keep Rank buff, remove on end of WG
if (!player.GetSession().PlayerLogout())
{
Creature vehicle = player.GetVehicleCreatureBase();
@@ -380,21 +380,21 @@ namespace Game.BattleFields
struct WGAchievements
{
public const uint WinWg = 1717;
public const uint WinWg100 = 1718; /// @Todo: Has To Be Implemented
public const uint WgGnomeslaughter = 1723; /// @Todo: Has To Be Implemented
public const uint WinWg100 = 1718; // @Todo: Has To Be Implemented
public const uint WgGnomeslaughter = 1723; // @Todo: Has To Be Implemented
public const uint WgTowerDestroy = 1727;
public const uint DestructionDerbyA = 1737; /// @Todo: Has To Be Implemented
public const uint WgTowerCannonKill = 1751; /// @Todo: Has To Be Implemented
public const uint WgMasterA = 1752; /// @Todo: Has To Be Implemented
public const uint DestructionDerbyA = 1737; // @Todo: Has To Be Implemented
public const uint WgTowerCannonKill = 1751; // @Todo: Has To Be Implemented
public const uint WgMasterA = 1752; // @Todo: Has To Be Implemented
public const uint WinWgTimer10 = 1755;
public const uint StoneKeeper50 = 2085; /// @Todo: Has To Be Implemented
public const uint StoneKeeper100 = 2086; /// @Todo: Has To Be Implemented
public const uint StoneKeeper250 = 2087; /// @Todo: Has To Be Implemented
public const uint StoneKeeper500 = 2088; /// @Todo: Has To Be Implemented
public const uint StoneKeeper1000 = 2089; /// @Todo: Has To Be Implemented
public const uint WgRanger = 2199; /// @Todo: Has To Be Implemented
public const uint DestructionDerbyH = 2476; /// @Todo: Has To Be Implemented
public const uint WgMasterH = 2776; /// @Todo: Has To Be Implemented
public const uint StoneKeeper50 = 2085; // @Todo: Has To Be Implemented
public const uint StoneKeeper100 = 2086; // @Todo: Has To Be Implemented
public const uint StoneKeeper250 = 2087; // @Todo: Has To Be Implemented
public const uint StoneKeeper500 = 2088; // @Todo: Has To Be Implemented
public const uint StoneKeeper1000 = 2089; // @Todo: Has To Be Implemented
public const uint WgRanger = 2199; // @Todo: Has To Be Implemented
public const uint DestructionDerbyH = 2476; // @Todo: Has To Be Implemented
public const uint WgMasterH = 2776; // @Todo: Has To Be Implemented
}
struct WGSpells
@@ -693,7 +693,7 @@ namespace Game.BattleFields
public uint towerEntry; // Gameobject id of tower
public WintergraspGameObjectData[] GameObject = new WintergraspGameObjectData[6]; // Gameobject position and entry (Horde/Alliance)
// Creature: Turrets and Guard /// @todo: Killed on Tower destruction ? Tower damage ? Requires confirming
// Creature: Turrets and Guard // @todo: Killed on Tower destruction ? Tower damage ? Requires confirming
public WintergraspObjectPositionData[] CreatureBottom = new WintergraspObjectPositionData[9];
}
+1 -1
View File
@@ -227,9 +227,9 @@ namespace Game.BattleGrounds
{
if (GetReviveQueueSize() != 0)
{
Creature sh = null;
foreach (var pair in m_ReviveQueue)
{
Creature sh = null;
Player player = Global.ObjAccessor.FindPlayer(pair.Value);
if (!player)
continue;
@@ -282,7 +282,7 @@ namespace Game.BattleGrounds.Zones
EventTeamLostPoint(player, point);
}
/// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side.
// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side.
if (point == EotSPoints.FelReaver && m_PointOwnedByTeam[point] == player.GetTeam())
if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID())
if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f)
+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");
+1 -1
View File
@@ -240,7 +240,7 @@ namespace Game.Collision
meshTree.readFromFile(reader);
// write liquid data
if (reader.ReadStringFromChars(4).ToString() != "LIQU")
if (reader.ReadStringFromChars(4) != "LIQU")
return false;
chunkSize = reader.ReadUInt32();
+1 -1
View File
@@ -1504,7 +1504,7 @@ namespace Game
}
case ConditionTypes.UnitState:
{
if (cond.ConditionValue1 > (uint)UnitState.AllState)
if (cond.ConditionValue1 > (uint)UnitState.AllStateSupported)
{
Log.outError(LogFilter.Sql, "{0} has non existing UnitState in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1);
return false;
+1 -1
View File
@@ -2122,7 +2122,7 @@ namespace Game.DungeonFinding
public bool isNew;
public List<ObjectGuid> queues = new List<ObjectGuid>();
public List<ulong> showorder = new List<ulong>();
public Dictionary<ObjectGuid, LfgProposalPlayer> players = new Dictionary<ObjectGuid, LfgProposalPlayer>(); ///< Players data
public Dictionary<ObjectGuid, LfgProposalPlayer> players = new Dictionary<ObjectGuid, LfgProposalPlayer>(); // Players data
}
public class LfgRoleCheck
+2 -2
View File
@@ -60,7 +60,7 @@ namespace Game.DungeonFinding
}
Global.LFGMgr.SetTeam(player.GetGUID(), player.GetTeam());
/// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
}
public override void OnMapChanged(Player player)
@@ -157,7 +157,7 @@ namespace Game.DungeonFinding
if (isLFG && method == RemoveMethod.Kick) // Player have been kicked
{
/// @todo - Update internal kick cooldown of kicker
// @todo - Update internal kick cooldown of kicker
string str_reason = "";
if (!string.IsNullOrEmpty(reason))
str_reason = reason;
@@ -740,7 +740,7 @@ namespace Game.Entities
public bool HasSplines() { return !_spline.empty(); }
public Spline GetSpline() { return _spline; }
public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } /// @todo: research the right value, in sniffs both timers are nearly identical
public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } // @todo: research the right value, in sniffs both timers are nearly identical
ObjectGuid _targetGuid;
@@ -121,41 +121,39 @@ namespace Game.Entities
switch (TriggerType)
{
case AreaTriggerTypes.Sphere:
{
MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget);
break;
}
{
MaxSearchRadius = Math.Max(SphereDatas.Radius, SphereDatas.RadiusTarget);
break;
}
case AreaTriggerTypes.Box:
{
fixed (float* ptr = BoxDatas.Extents)
{
unsafe
{
fixed (float* ptr = BoxDatas.Extents)
{
MaxSearchRadius = (float)Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4);
}
}
break;
MaxSearchRadius = (float) Math.Sqrt(ptr[0] * ptr[0] / 4 + ptr[1] * ptr[1] / 4);
}
break;
}
case AreaTriggerTypes.Polygon:
{
if (PolygonDatas.Height <= 0.0f)
PolygonDatas.Height = 1.0f;
foreach (Vector2 vertice in PolygonVertices)
{
if (PolygonDatas.Height <= 0.0f)
PolygonDatas.Height = 1.0f;
float pointDist = vertice.GetLength();
foreach (Vector2 vertice in PolygonVertices)
{
float pointDist = vertice.GetLength();
if (pointDist > MaxSearchRadius)
MaxSearchRadius = pointDist;
}
break;
if (pointDist > MaxSearchRadius)
MaxSearchRadius = pointDist;
}
break;
}
case AreaTriggerTypes.Cylinder:
{
MaxSearchRadius = CylinderDatas.Radius;
break;
}
{
MaxSearchRadius = CylinderDatas.Radius;
break;
}
default:
break;
}
+3 -3
View File
@@ -40,7 +40,7 @@ namespace Game.Entities
public override void AddToWorld()
{
///- Register the Conversation for guid lookup and for caster
//- Register the Conversation for guid lookup and for caster
if (!IsInWorld)
{
GetMap().GetObjectsStore().Add(GetGUID(), this);
@@ -50,7 +50,7 @@ namespace Game.Entities
public override void RemoveFromWorld()
{
///- Remove the Conversation from the accessor and from all lists of objects in world
//- Remove the Conversation from the accessor and from all lists of objects in world
if (IsInWorld)
{
base.RemoveFromWorld();
@@ -110,7 +110,7 @@ namespace Game.Entities
SetMap(map);
Relocate(pos);
base._Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
_Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
PhasingHandler.InheritPhaseShift(this, creator);
SetEntry(conversationEntry);
+1 -1
View File
@@ -1177,7 +1177,7 @@ namespace Game.Entities
SetModifierValue(UnitMods.AttackPower, UnitModifierType.BaseValue, stats.AttackPower);
SetModifierValue(UnitMods.AttackPowerRanged, UnitModifierType.BaseValue, stats.RangedAttackPower);
float armor = stats.GenerateArmor(cInfo); /// @todo Why is this treated as uint32 when it's a float?
float armor = stats.GenerateArmor(cInfo); // @todo Why is this treated as uint32 when it's a float?
SetModifierValue(UnitMods.Armor, UnitModifierType.BaseValue, armor);
}
+4 -4
View File
@@ -73,20 +73,20 @@ namespace Game.Misc
/// <param name="action">action Custom action given to OnGossipHello.</param>
public void AddMenuItem(uint menuId, uint optionIndex, uint sender, uint action)
{
/// Find items for given menu id.
// Find items for given menu id.
var bounds = Global.ObjectMgr.GetGossipMenuItemsMapBounds(menuId);
/// Return if there are none.
// Return if there are none.
if (bounds.Empty())
return;
/// Iterate over each of them.
// Iterate over each of them.
foreach (var item in bounds)
{
// Find the one with the given menu item id.
if (item.OptionIndex != optionIndex)
continue;
/// Store texts for localization.
// Store texts for localization.
string strOptionText = "", strBoxText = "";
BroadcastTextRecord optionBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.OptionBroadcastTextId);
BroadcastTextRecord boxBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(item.BoxBroadcastTextId);
@@ -396,16 +396,16 @@ namespace Game.Entities
case GameObjectTypes.Trap:
{
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
GameObjectTemplate m_goInfo = GetGoInfo();
GameObjectTemplate goInfo = GetGoInfo();
// Bombs
Unit owner = GetOwner();
if (m_goInfo.Trap.charges == 2)
if (goInfo.Trap.charges == 2)
m_cooldownTime = (uint)Time.UnixTime + 10; // Hardcoded tooltip value
else if (owner)
{
if (owner.IsInCombat())
m_cooldownTime = (uint)Time.UnixTime + m_goInfo.Trap.startDelay;
m_cooldownTime = (uint)Time.UnixTime + goInfo.Trap.startDelay;
}
m_lootState = LootState.Ready;
break;
@@ -1552,7 +1552,7 @@ namespace Game.Entities
player.UpdateFishingSkill();
/// @todo find reasonable value for fishing hole search
// @todo find reasonable value for fishing hole search
GameObject fishingPool = LookupFishingHoleAround(20.0f + SharedConst.ContactDistance);
// If fishing skill is high enough, or if fishing on a pool, send correct loot.
+2 -2
View File
@@ -2563,13 +2563,13 @@ namespace Game.Entities
{
Log.outDebug(LogFilter.Spells, "Player.AddSpellMod {0}", mod.spellId);
/// First, manipulate our spellmodifier container
// First, manipulate our spellmodifier container
if (apply)
m_spellMods[(int)mod.op][(int)mod.type].Add(mod);
else
m_spellMods[(int)mod.op][(int)mod.type].Remove(mod);
/// Now, send spellmodifier packet
// Now, send spellmodifier packet
if (!IsLoading())
{
ServerOpcodes opcode = (mod.type == SpellModType.Flat ? ServerOpcodes.SetFlatSpellModifier : ServerOpcodes.SetPctSpellModifier);
+9 -9
View File
@@ -1952,7 +1952,7 @@ namespace Game.Entities
//move player's guid into HateOfflineList of those mobs
//which can't swim and move guid back into ThreatList when
//on surface.
/// @todo exist also swimming mobs, and function must be symmetric to enter/leave water
// @todo exist also swimming mobs, and function must be symmetric to enter/leave water
m_isInWater = apply;
// remove auras that need water/land
@@ -5283,7 +5283,7 @@ namespace Game.Entities
packet.Level = level;
packet.HealthDelta = 0;
/// @todo find some better solution
// @todo find some better solution
packet.PowerDelta[0] = (int)basemana - (int)GetCreateMana();
packet.PowerDelta[1] = 0;
packet.PowerDelta[2] = 0;
@@ -5584,18 +5584,18 @@ namespace Game.Entities
loginSetTimeSpeed.NewSpeed = TimeSpeed;
loginSetTimeSpeed.GameTime = (uint)Global.WorldMgr.GetGameTime();
loginSetTimeSpeed.ServerTime = (uint)Global.WorldMgr.GetGameTime();
loginSetTimeSpeed.GameTimeHolidayOffset = 0; /// @todo
loginSetTimeSpeed.ServerTimeHolidayOffset = 0; /// @todo
loginSetTimeSpeed.GameTimeHolidayOffset = 0; // @todo
loginSetTimeSpeed.ServerTimeHolidayOffset = 0; // @todo
SendPacket(loginSetTimeSpeed);
// SMSG_WORLD_SERVER_INFO
WorldServerInfo worldServerInfo = new WorldServerInfo();
worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); /// @todo
worldServerInfo.IsTournamentRealm = 0; /// @todo
worldServerInfo.RestrictedAccountMaxLevel.Clear(); /// @todo
worldServerInfo.RestrictedAccountMaxMoney.Clear(); /// @todo
worldServerInfo.InstanceGroupSize.Set(GetMap().GetMapDifficulty().MaxPlayers); // @todo
worldServerInfo.IsTournamentRealm = 0; // @todo
worldServerInfo.RestrictedAccountMaxLevel.Clear(); // @todo
worldServerInfo.RestrictedAccountMaxMoney.Clear(); // @todo
worldServerInfo.DifficultyID = (uint)GetMap().GetDifficultyID();
// worldServerInfo.XRealmPvpAlert; /// @todo
// worldServerInfo.XRealmPvpAlert; // @todo
SendPacket(worldServerInfo);
// Spell modifiers
+1 -1
View File
@@ -232,7 +232,7 @@ namespace Game.Entities
public override void UpdateObjectVisibilityOnCreate()
{
base.UpdateObjectVisibility(true);
UpdateObjectVisibility(true);
}
public void SetTempSummonType(TempSummonType type)
+1 -1
View File
@@ -2411,7 +2411,7 @@ namespace Game.Entities
bool defaultPrevented = false;
absorbAurEff.GetBase().CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb, defaultPrevented);
absorbAurEff.GetBase().CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, ref tempAbsorb, ref defaultPrevented);
currentAbsorb = (int)tempAbsorb;
if (defaultPrevented)
+3 -3
View File
@@ -476,11 +476,11 @@ namespace Game.Entities
hitOutCome = _hitOutCome;
}
public uint absorbed_damage { get; set; }
public uint absorbed_damage { get; }
public uint mitigated_damage { get; set; }
public WeaponAttackType attackType { get; set; }
public MeleeHitOutcome hitOutCome { get; set; }
public WeaponAttackType attackType { get; }
public MeleeHitOutcome hitOutCome { get; }
}
public class DispelInfo
+5 -6
View File
@@ -2243,7 +2243,7 @@ namespace Game.Entities
spellHealLog.Crit = critical;
/// @todo: 6.x Has to be implemented
// @todo: 6.x Has to be implemented
/*
var hasCritRollMade = spellHealLog.WriteBit("HasCritRollMade");
var hasCritRollNeeded = spellHealLog.WriteBit("HasCritRollNeeded");
@@ -2494,7 +2494,7 @@ namespace Game.Entities
spellLogEffect.AbsorbedOrAmplitude = info.absorb;
spellLogEffect.Resisted = info.resist;
spellLogEffect.Crit = info.critical;
/// @todo: implement debug info
// @todo: implement debug info
SandboxScalingData sandboxScalingData = new SandboxScalingData();
Unit caster = Global.ObjAccessor.GetUnit(this, aura.GetCasterGUID());
@@ -4181,10 +4181,9 @@ namespace Game.Entities
}
bool remove = false;
var appliedAuraList = GetAppliedAuras();
for (var i = 0; i < appliedAuraList.Count; i++)
for (var i = 0; i < m_appliedAuras.KeyValueList.Count; i++)
{
var app = appliedAuraList[i];
var app = m_appliedAuras.KeyValueList[i];
if (remove)
{
remove = false;
@@ -4195,7 +4194,7 @@ namespace Game.Entities
continue;
RemoveAura(app, AuraRemoveMode.Default);
if (i == appliedAuraList.Count - 1)
if (i == m_appliedAuras.KeyValueList.Count - 1)
break;
remove = true;
+2 -2
View File
@@ -227,7 +227,7 @@ namespace Game.Entities
{
var seat = Seats.LookupByKey(seatId);
if (seat == null)
return seat;
return null;
foreach (var sea in Seats)
{
@@ -633,7 +633,7 @@ namespace Game.Entities
Log.outDebug(LogFilter.Vehicle, "Passenger GuidLow: {0}, Entry: {1}, board on vehicle GuidLow: {2}, Entry: {3} SeatId: {4} cancelled",
Passenger.GetGUID().ToString(), Passenger.GetEntry(), Target.GetBase().GetGUID().ToString(), Target.GetBase().GetEntry(), Seat.Key);
/// Remove the pending event when Abort was called on the event directly
// Remove the pending event when Abort was called on the event directly
Target.RemovePendingEvent(this);
// @SPELL_AURA_CONTROL_VEHICLE auras can be applied even when the passenger is not (yet) on the vehicle.
+3 -3
View File
@@ -726,7 +726,7 @@ namespace Game
do
{
uint questId = result.Read<uint>(0);
ushort eventEntry = result.Read<byte>(1); /// @todo Change to byte
ushort eventEntry = result.Read<byte>(1); // @todo Change to byte
if (Global.ObjectMgr.GetQuestTemplate(questId) == null)
{
@@ -1214,10 +1214,10 @@ namespace Game
if (!map.Instanceable() && map.IsGridLoaded(data.posX, data.posY))
{
GameObject pGameobject = GameObject.CreateGameObjectFromDB(guid, map, false);
/// @todo find out when it is add to map
// @todo find out when it is add to map
if (pGameobject)
{
/// @todo find out when it is add to map
// @todo find out when it is add to map
if (pGameobject.isSpawnedByDefault())
map.AddToMap(pGameobject);
}
+1
View File
@@ -4561,6 +4561,7 @@ namespace Game
ItemTemplateStorage.Add(sparse.Id, itemTemplate);
}
// Load item effects (spells)
foreach (var effectEntry in CliDB.ItemEffectStorage.Values)
{
var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ParentItemID);
+2 -2
View File
@@ -939,7 +939,7 @@ namespace Game.Guilds
GuildChallengeUpdate updatePacket = new GuildChallengeUpdate();
for (int i = 0; i < GuildConst.ChallengesTypes; ++i)
updatePacket.CurrentCount[i] = 0; /// @todo current count
updatePacket.CurrentCount[i] = 0; // @todo current count
for (int i = 0; i < GuildConst.ChallengesTypes; ++i)
updatePacket.MaxCount[i] = GuildConst.ChallengesMaxCount[i];
@@ -3697,7 +3697,7 @@ namespace Game.Guilds
public override void LogAction(MoveItemData pFrom)
{
base.LogAction(pFrom);
if (!pFrom.IsBank() && m_pPlayer.GetSession().HasPermission(RBACPermissions.LogGmTrade)) /// @todo Move this to scripts
if (!pFrom.IsBank() && m_pPlayer.GetSession().HasPermission(RBACPermissions.LogGmTrade)) // @todo Move this to scripts
{
Log.outCommand(m_pPlayer.GetSession().GetAccountId(), "GM {0} ({1}) (Account: {2}) deposit item: {3} (Entry: {4} Count: {5}) to guild bank named: {6} (Guild ID: {7})",
m_pPlayer.GetName(), m_pPlayer.GetGUID().ToString(), m_pPlayer.GetSession().GetAccountId(), pFrom.GetItem().GetTemplate().GetName(),
+1 -1
View File
@@ -231,7 +231,7 @@ namespace Game
SQLTransaction trans;
if (WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionAuction))
AH.auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD
AH.auctioneer = 23442; //@TODO - HARDCODED DB GUID, BAD BAD BAD
else
AH.auctioneer = creature.GetSpawnId();
@@ -81,7 +81,7 @@ namespace Game
public void SendSetTimeZoneInformation()
{
/// @todo: replace dummy values
// @todo: replace dummy values
SetTimeZoneInformation packet = new SetTimeZoneInformation();
packet.ServerTimeTZ = "Europe/Paris";
packet.GameTimeTZ = "Europe/Paris";
+2 -2
View File
@@ -591,8 +591,8 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
{
/// @Todo: perfome research in this case
/// The unk fields are related to arenas
// @Todo: perfome research in this case
// The unk fields are related to arenas
WorldPacket data = new WorldPacket(ServerOpcodes.RatedBattlefieldInfo);
data.WriteInt32(0); // BgWeeklyWins20vs20
data.WriteInt32(0); // BgWeeklyPlayed20vs20
+1 -1
View File
@@ -208,7 +208,7 @@ namespace Game
return;
CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID);
if (oldEvent == null)
if (oldEvent != null)
{
CalendarEvent newEvent = new CalendarEvent(oldEvent, Global.CalendarMgr.GetFreeEventId());
newEvent.Date = calendarCopyEvent.Date;
+17 -17
View File
@@ -132,7 +132,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.EnumCharactersDeletedByClient, Status = SessionStatus.Authed)]
void HandleCharUndeleteEnum(EnumCharacters enumCharacters)
{
/// get all the data necessary for loading all undeleted characters (along with their pets) on the account
// get all the data necessary for loading all undeleted characters (along with their pets) on the account
PreparedStatement stmt;
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed))
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_UNDELETE_ENUM_DECLINED_NAME);
@@ -379,7 +379,7 @@ namespace Game
}
// need to check team only for first character
/// @todo what to if account already has characters of both races?
// @todo what to if account already has characters of both races?
if (!allowTwoSideAccounts)
{
Team accTeam = 0;
@@ -866,7 +866,7 @@ namespace Game
{
FeatureSystemStatus features = new FeatureSystemStatus();
/// START OF DUMMY VALUES
// START OF DUMMY VALUES
features.ComplaintStatus = 2;
features.ScrollOfResurrectionRequestsRemaining = 1;
features.ScrollOfResurrectionMaxRequestsPerDay = 1;
@@ -887,7 +887,7 @@ namespace Game
features.ComplaintStatus = 0;
features.TutorialsEnabled = true;
features.NPETutorialsEnabled = true;
/// END OF DUMMY VALUES
// END OF DUMMY VALUES
features.EuropaTicketSystemStatus.Value.TicketsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportTicketsEnabled);
features.EuropaTicketSystemStatus.Value.BugsEnabled = WorldConfig.GetBoolValue(WorldCfg.SupportBugsEnabled);
@@ -1246,7 +1246,7 @@ namespace Game
}
// character with this name already exist
/// @todo: make async
// @todo: make async
ObjectGuid newGuid = ObjectManager.GetPlayerGUIDByName(customizeInfo.CharName);
if (!newGuid.IsEmpty())
{
@@ -1261,7 +1261,7 @@ namespace Game
SQLTransaction trans = new SQLTransaction();
ulong lowGuid = customizeInfo.CharGUID.GetCounter();
/// Customize
// Customize
{
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GENDER_AND_APPEARANCE);
@@ -1279,7 +1279,7 @@ namespace Game
trans.Append(stmt);
}
/// Name Change and update atLogin flags
// Name Change and update atLogin flags
{
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
stmt.AddValue(0, customizeInfo.CharName);
@@ -1325,11 +1325,11 @@ namespace Game
{
Item item = _player.GetItemByPos(InventorySlots.Bag0, i);
/// cheating check 1 (item equipped but sent empty guid)
// cheating check 1 (item equipped but sent empty guid)
if (!item)
return;
/// cheating check 2 (sent guid does not match equipped item)
// cheating check 2 (sent guid does not match equipped item)
if (item.GetGUID() != itemGuid)
return;
}
@@ -1358,7 +1358,7 @@ namespace Game
saveEquipmentSet.Set.Appearances[i] = 0;
}
}
saveEquipmentSet.Set.IgnoreMask &= 0x7FFFF; /// clear invalid bits (i > EQUIPMENT_SLOT_END)
saveEquipmentSet.Set.IgnoreMask &= 0x7FFFF; // clear invalid bits (i > EQUIPMENT_SLOT_END)
if (saveEquipmentSet.Set.Type == EquipmentSetInfo.EquipmentSetType.Equipment)
{
saveEquipmentSet.Set.Enchants[0] = 0;
@@ -1583,7 +1583,7 @@ namespace Game
// resurrect the character in case he's dead
Player.OfflineResurrect(factionChangeInfo.Guid, trans);
/// Name Change and update atLogin flags
// Name Change and update atLogin flags
{
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
stmt.AddValue(0, factionChangeInfo.Name);
@@ -1719,7 +1719,7 @@ namespace Game
trans.Append(stmt);
}
/// @todo: make this part asynch
// @todo: make this part asynch
if (!WorldConfig.GetBoolValue(WorldCfg.AllowTwoSideInteractionGuild))
{
// Reset guild
@@ -2092,11 +2092,11 @@ namespace Game
return;
}
/// @todo: add more safety checks
/// * max char count per account
/// * max death knight count
/// * max demon hunter count
/// * team violation
// @todo: add more safety checks
// * max char count per account
// * max death knight count
// * max demon hunter count
// * team violation
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_SUM_CHARS);
stmt.AddValue(0, GetAccountId());
+1 -1
View File
@@ -448,7 +448,7 @@ namespace Game
}
break;
case ChatMsg.Whisper:
/// @todo implement cross realm whispers (someday)
// @todo implement cross realm whispers (someday)
ExtendedPlayerName extName = ObjectManager.ExtractExtendedPlayerName(target);
if (!ObjectManager.NormalizePlayerName(ref extName.Name))
+3 -3
View File
@@ -102,7 +102,7 @@ namespace Game
honorStats.LifetimeHK = player.GetUInt32Value(PlayerFields.LifetimeHonorableKills);
honorStats.YesterdayHK = player.GetUInt16Value(PlayerFields.Kills, 1);
honorStats.TodayHK = player.GetUInt16Value(PlayerFields.Kills, 0);
honorStats.LifetimeMaxRank = 0; /// @todo
honorStats.LifetimeMaxRank = 0; // @todo
SendPacket(honorStats);
}
@@ -110,7 +110,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.InspectPvp)]
void HandleInspectPVP(InspectPVPRequest request)
{
/// @todo: deal with request.InspectRealmAddress
// @todo: deal with request.InspectRealmAddress
Player player = Global.ObjAccessor.FindPlayer(request.InspectTarget);
if (!player)
@@ -127,7 +127,7 @@ namespace Game
InspectPVPResponse response = new InspectPVPResponse();
response.ClientGUID = request.InspectTarget;
/// @todo: fill brackets
// @todo: fill brackets
SendPacket(response);
}
+1 -1
View File
@@ -359,7 +359,7 @@ namespace Game
}
else
{
/// @todo: 6.x research new values
// @todo: 6.x research new values
/*WorldPackets.Item.ReadItemResultFailed packet;
packet.Item = item->GetGUID();
packet.Subcode = ??;
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Game
Player player = GetPlayer();
AELootResult aeResult = player.GetAELootView().Count > 1 ? new AELootResult() : null;
/// @todo Implement looting by LootObject guid
// @todo Implement looting by LootObject guid
foreach (LootRequest req in packet.Loot)
{
Loot loot = null;
+1 -1
View File
@@ -186,7 +186,7 @@ namespace Game
{
// NOTE: this is actually called many times while falling
// even after the player has been teleported away
/// @todo discard movement packets after the player is rooted
// @todo discard movement packets after the player is rooted
if (plrMover.IsAlive())
{
plrMover.SetFlag(PlayerFields.Flags, PlayerFlags.IsOutOfBounds);
+3 -3
View File
@@ -83,7 +83,7 @@ namespace Game
return;
}
/// @todo allow control charmed player?
// @todo allow control charmed player?
if (pet.IsTypeId(TypeId.Player) && !(flag == ActiveStates.Command && spellid == (uint)CommandStates.Attack))
return;
@@ -169,7 +169,7 @@ namespace Game
// Can't attack if owner is pacified
if (GetPlayer().HasAuraType(AuraType.ModPacify))
{
/// @todo Send proper error message to client
// @todo Send proper error message to client
return;
}
@@ -376,7 +376,7 @@ namespace Game
}
else
{
if (pet.isPossessed() || pet.IsVehicle()) /// @todo: confirm this check
if (pet.isPossessed() || pet.IsVehicle()) // @todo: confirm this check
Spell.SendCastResult(GetPlayer(), spellInfo, spell.m_SpellVisual, spell.m_castId, result);
else
spell.SendPetCastResult(result);
+2 -2
View File
@@ -471,7 +471,7 @@ namespace Game
if (!GetPlayer().IsInSameRaidWith(originalPlayer))
return;
if (!!originalPlayer.IsActiveQuest(packet.QuestID))
if (!originalPlayer.IsActiveQuest(packet.QuestID))
return;
if (!GetPlayer().CanTakeQuest(quest, true))
@@ -646,7 +646,7 @@ namespace Game
{
WorldQuestUpdate response = new WorldQuestUpdate();
/// @todo: 7.x Has to be implemented
// @todo: 7.x Has to be implemented
//response.WorldQuestUpdates.push_back(WorldPackets::Quest::WorldQuestUpdateInfo(lastUpdate, questID, timer, variableID, value));
SendPacket(response);
+11 -11
View File
@@ -44,17 +44,17 @@ namespace Game
if (request.Words.Count > 4)
return;
/// @todo: handle following packet values
/// VirtualRealmNames
/// ShowEnemies
/// ShowArenaPlayers
/// ExactName
/// ServerInfo
// @todo: handle following packet values
// VirtualRealmNames
// ShowEnemies
// ShowArenaPlayers
// ExactName
// ServerInfo
request.Words.ForEach(p => p = p.ToLower());
request.Name.ToLower();
request.Guild.ToLower();
request.Name = request.Name.ToLower();
request.Guild = request.Guild.ToLower();
// client send in case not set max level value 100 but we support 255 max level,
// update it to show GMs with characters after 100 level
@@ -282,7 +282,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.DelFriend)]
void HandleDelFriend(DelFriend packet)
{
/// @todo: handle VirtualRealmAddress
// @todo: handle VirtualRealmAddress
GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Friend);
Global.SocialMgr.SendFriendStatus(GetPlayer(), FriendsResult.Removed, packet.Player.Guid);
@@ -336,7 +336,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.DelIgnore)]
void HandleDelIgnore(DelIgnore packet)
{
/// @todo: handle VirtualRealmAddress
// @todo: handle VirtualRealmAddress
Log.outDebug(LogFilter.Network, "WorldSession.HandleDelIgnoreOpcode: {0}", packet.Player.Guid.ToString());
GetPlayer().GetSocial().RemoveFromSocialList(packet.Player.Guid, SocialFlag.Ignored);
@@ -347,7 +347,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.SetContactNotes)]
void HandleSetContactNotes(SetContactNotes packet)
{
/// @todo: handle VirtualRealmAddress
// @todo: handle VirtualRealmAddress
Log.outDebug(LogFilter.Network, "WorldSession.HandleSetContactNotesOpcode: Contact: {0}, Notes: {1}", packet.Player.Guid.ToString(), packet.Notes);
GetPlayer().GetSocial().SetFriendNote(packet.Player.Guid, packet.Notes);
}
+1 -1
View File
@@ -469,7 +469,7 @@ namespace Game
if (unit == null)
return;
/// @todo Unit.SetCharmedBy: 28782 is not in world but 0 is trying to charm it! . crash
// @todo Unit.SetCharmedBy: 28782 is not in world but 0 is trying to charm it! . crash
if (!unit.IsInWorld)
return;
+2 -2
View File
@@ -28,7 +28,7 @@ namespace Game
{
UpdateListedAuctionableTokensResponse response = new UpdateListedAuctionableTokensResponse();
/// @todo: fix 6.x implementation
// @todo: fix 6.x implementation
response.UnkInt = updateListedAuctionableTokens.UnkInt;
response.Result = TokenResult.Success;
@@ -40,7 +40,7 @@ namespace Game
{
WowTokenMarketPriceResponse response = new WowTokenMarketPriceResponse();
/// @todo: 6.x fix implementation
// @todo: 6.x fix implementation
response.CurrentMarketPrice = 300000000;
response.UnkInt = requestWowTokenMarketPrice.UnkInt;
response.Result = TokenResult.Success;
+2 -2
View File
@@ -841,7 +841,7 @@ namespace Game.Loots
foreach (var group in Groups)
group.Value.Verify(lootstore, id, (byte)(group.Key + 1));
/// @todo References validity checks
// @todo References validity checks
}
public void CheckLootRefs(LootTemplateMap store, List<uint> ref_set)
{
@@ -992,7 +992,7 @@ namespace Game.Loots
public void Verify(LootStore lootstore, uint id, byte group_id = 0)
{
float chance = RawTotalChance();
if (chance > 101.0f) /// @todo replace with 100% when DBs will be ready
if (chance > 101.0f) // @todo replace with 100% when DBs will be ready
Log.outError(LogFilter.Sql, "Table '{0}' entry {1} group {2} has total chance > 100% ({3})", lootstore.GetName(), id, group_id, chance);
if (chance >= 100.0f && !EqualChanced.Empty())
+5 -5
View File
@@ -338,7 +338,7 @@ namespace Game.Maps
void DeleteFromWorld(Player player)
{
Global.ObjAccessor.RemoveObject(player);
RemoveUpdateObject(player); /// @todo I do not know why we need this, it should be removed in ~Object anyway
RemoveUpdateObject(player); // @todo I do not know why we need this, it should be removed in ~Object anyway
player.Dispose();
}
@@ -1147,8 +1147,8 @@ namespace Game.Maps
//This may happen when a player just logs in and a pet moves to a nearby unloaded cell
//To avoid this, we can load nearby cells when player log in
//But this check is always needed to ensure safety
/// @todo pets will disappear if this is outside CreatureRespawnRelocation
/// //need to check why pet is frequently relocated to an unloaded cell
// @todo pets will disappear if this is outside CreatureRespawnRelocation
//need to check why pet is frequently relocated to an unloaded cell
if (creature.IsPet())
((Pet)creature).Remove(PetSaveMode.NotInSlot, true);
else
@@ -4434,7 +4434,7 @@ namespace Game.Maps
public override bool AddPlayerToMap(Player player, bool initPlayer = true)
{
/// @todo Not sure about checking player level: already done in HandleAreaTriggerOpcode
// @todo Not sure about checking player level: already done in HandleAreaTriggerOpcode
// GMs still can teleport player in instance.
// Is it needed?
lock(_mapLock)
@@ -4623,7 +4623,7 @@ namespace Game.Maps
if (load)
{
/// @todo make a global storage for this
// @todo make a global storage for this
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_INSTANCE);
stmt.AddValue(0, GetId());
stmt.AddValue(1, i_InstanceId);
@@ -255,7 +255,7 @@ namespace Game.Movement
}
// look for startPoly/endPoly in current path
/// @todo we can merge it with getPathPolyByPosition() loop
// @todo we can merge it with getPathPolyByPosition() loop
bool startPolyFound = false;
bool endPolyFound = false;
uint pathStartIndex = 0;
@@ -314,7 +314,7 @@ namespace Game.Movement
// sub-path of optimal path is optimal
// take ~80% of the original length
/// @todo play with the values here
// @todo play with the values here
uint prefixPolyLength = (uint)(_polyLength * 0.8f + 0.5f);
Array.Copy(_pathPolyRefs, pathStartIndex, _pathPolyRefs, 0, prefixPolyLength);
@@ -523,7 +523,7 @@ namespace Game.Movement
{
// only happens if pass bad data to findStraightPath or navmesh is broken
// single point paths can be generated here
/// @todo check the exact cases
// @todo check the exact cases
Log.outDebug(LogFilter.Maps, "++ PathGenerator.BuildPointPath FAILED! path sized {0} returned\n", pointCount);
BuildShortcut();
pathType = PathType.NoPath;
@@ -921,9 +921,9 @@ namespace Game.Movement
_navMesh.calcTileLoc(point, ref tx, ref ty);
/// Workaround
/// For some reason, often the tx and ty variables wont get a valid value
/// Use this check to prevent getting negative tile coords and crashing on getTileAt
// Workaround
// For some reason, often the tx and ty variables wont get a valid value
// Use this check to prevent getting negative tile coords and crashing on getTileAt
if (tx < 0 || ty < 0)
return false;
+2 -2
View File
@@ -54,7 +54,7 @@ namespace Game.Movement
// Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed.
public bool Validate(Unit unit)
{
Func<bool, bool> CHECK = new Func<bool, bool>(exp =>
Func<bool, bool> CHECK = exp =>
{
if (!(exp))
{
@@ -62,7 +62,7 @@ namespace Game.Movement
return false;
}
return true;
});
};
if (!CHECK(path.Length > 1))
return false;
@@ -139,8 +139,8 @@ namespace Game.Network.Packets
foreach (var klass in SuccessInfo.Value.AvailableClasses)
{
_worldPacket.WriteUInt8(klass.Key); /// the current class
_worldPacket.WriteUInt8(klass.Value); /// the required Expansion
_worldPacket.WriteUInt8(klass.Key); // the current class
_worldPacket.WriteUInt8(klass.Value); // the required Expansion
}
_worldPacket.WriteBit(SuccessInfo.Value.IsExpansionTrial);
@@ -63,7 +63,7 @@ namespace Game.Network.Packets
public bool Success;
public bool IsDeletedCharacters; // used for character undelete list
public bool IsDemonHunterCreationAllowed = false; ///< used for demon hunter early access
public bool IsDemonHunterCreationAllowed = false; //used for demon hunter early access
public bool HasDemonHunterOnRealm = false;
public bool Unknown7x = false;
public bool IsAlliedRacesCreationAllowed = false;
@@ -72,7 +72,7 @@ namespace Game.Network.Packets
public Optional<uint> DisabledClassesMask = new Optional<uint>();
public List<CharacterInfo> Characters = new List<CharacterInfo>(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); ///<
public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); //
public class CharacterInfo
{
+2 -2
View File
@@ -716,7 +716,7 @@ namespace Game.Network.Packets
}
public ObjectGuid NoteeGUID;
public bool IsPublic; ///< 0 == Officer, 1 == Public
public bool IsPublic; // 0 == Officer, 1 == Public
public string Note;
}
@@ -736,7 +736,7 @@ namespace Game.Network.Packets
}
public ObjectGuid Member;
public bool IsPublic; ///< 0 == Officer, 1 == Public
public bool IsPublic; // 0 == Officer, 1 == Public
public string Note;
}
@@ -98,8 +98,8 @@ namespace Game.Network.Packets
{
_worldPacket.WritePackedGuid(PlayerGUID);
_worldPacket.WriteUInt8(LifetimeMaxRank);
_worldPacket.WriteUInt16(YesterdayHK); /// @todo: confirm order
_worldPacket.WriteUInt16(TodayHK); /// @todo: confirm order
_worldPacket.WriteUInt16(YesterdayHK); // @todo: confirm order
_worldPacket.WriteUInt16(TodayHK); // @todo: confirm order
_worldPacket.WriteUInt32(LifetimeHK);
}
@@ -184,7 +184,7 @@ namespace Game.Network.Packets
Item = new ItemInstance(item);
Index = index;
Usable = true; /// @todo
Usable = true; // @todo
for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant)
{
+2 -2
View File
@@ -305,8 +305,8 @@ namespace Game.Network.Packets
}
public InvUpdate Inv;
public byte Slot1; /// Source Slot
public byte Slot2; /// Destination Slot
public byte Slot1; // Source Slot
public byte Slot2; // Destination Slot
}
public class SwapItem : ClientPacket
@@ -41,7 +41,7 @@ namespace Game.Network.Packets
}
public int[] FactionStandings = new int[FactionCount];
public bool[] FactionHasBonus = new bool[FactionCount]; ///< @todo: implement faction bonus
public bool[] FactionHasBonus = new bool[FactionCount]; //@todo: implement faction bonus
public FactionFlags[] FactionFlags = new FactionFlags[FactionCount];
}
+1 -1
View File
@@ -209,7 +209,7 @@ namespace Game
{
initFactions.FactionFlags[pair.Key] = pair.Value.Flags;
initFactions.FactionStandings[pair.Key] = pair.Value.Standing;
/// @todo faction bonus
// @todo faction bonus
pair.Value.needSend = false;
}
+5 -5
View File
@@ -859,7 +859,7 @@ namespace Game
//to set mailtimer to return mails every day between 4 and 5 am
//mailtimer is increased when updating auctions
//one second is 1000 -(tested on win system)
/// @todo Get rid of magic numbers
// @todo Get rid of magic numbers
var localTime = Time.UnixTimeToDateTime(m_gameTime).ToLocalTime();
mail_timer = ((((localTime.Hour + 20) % 24) * Time.Hour * Time.InMilliseconds) / m_timers[WorldTimers.Auctions].GetInterval());
//1440
@@ -1212,7 +1212,7 @@ namespace Game
{
m_timers[WorldTimers.Blackmarket].Reset();
///- Update blackmarket, refresh auctions if necessary
//- Update blackmarket, refresh auctions if necessary
if ((blackmarket_timer * m_timers[WorldTimers.Blackmarket].GetInterval() >= WorldConfig.GetIntValue(WorldCfg.BlackmarketUpdatePeriod) * Time.Hour * Time.InMilliseconds) || blackmarket_timer == 0)
{
Global.BlackMarketMgr.RefreshAuctions();
@@ -1230,7 +1230,7 @@ namespace Game
UpdateSessions(diff);
RecordTimeDiff("UpdateSessions");
/// <li> Update uptime table
// <li> Update uptime table
if (m_timers[WorldTimers.UpTime].Passed())
{
uint tmpDiff = (uint)(m_gameTime - m_startTime);
@@ -1248,7 +1248,7 @@ namespace Game
DB.Login.Execute(stmt);
}
/// <li> Clean logs table
// <li> Clean logs table
if (WorldConfig.GetIntValue(WorldCfg.LogdbCleartime) > 0) // if not enabled, ignore the timer
{
if (m_timers[WorldTimers.CleanDB].Passed())
@@ -1580,7 +1580,7 @@ namespace Game
uint duration_secs = Time.TimeStringToSecs(duration);
/// Pick a player to ban if not online
// Pick a player to ban if not online
if (!pBanned)
{
guid = ObjectManager.GetPlayerGUIDByName(name);
+2 -2
View File
@@ -69,7 +69,7 @@ namespace Game
if (_player)
LogoutPlayer(true);
/// - If have unclosed socket, close it
// - If have unclosed socket, close it
for (byte i = 0; i < 2; ++i)
{
if (m_Socket[i] != null)
@@ -633,7 +633,7 @@ namespace Game
_accountLoginCallback = null;
}
//! HandlePlayerLoginOpcode
// HandlePlayerLoginOpcode
if (_charLoginCallback != null && _charLoginCallback.IsCompleted)
{
HandlePlayerLogin((LoginQueryHolder)_charLoginCallback.Result);
+6 -8
View File
@@ -388,7 +388,7 @@ namespace Game.Spells
var app = m_applications.LookupByKey(target.GetGUID());
/// @todo Figure out why this happens
// @todo Figure out why this happens
if (app == null)
{
Log.outError(LogFilter.Spells, "Aura._UnapplyForTarget, target: {0}, caster: {1}, spell: {2} was not found in owners application map!",
@@ -537,7 +537,7 @@ namespace Game.Spells
// owner has to be in world, or effect has to be applied to self
if (!m_owner.IsSelfOrInSameMap(unit))
{
/// @todo There is a crash caused by shadowfiend load addon
// @todo There is a crash caused by shadowfiend load addon
Log.outFatal(LogFilter.Spells, "Aura {0}: Owner {1} (map {2}) is not in the same map as target {3} (map {4}).", GetSpellInfo().Id,
m_owner.GetName(), m_owner.IsInWorld ? (int)m_owner.GetMap().GetId() : -1,
unit.GetName(), unit.IsInWorld ? (int)unit.GetMap().GetId() : -1);
@@ -1706,7 +1706,7 @@ namespace Game.Spells
if (procEffectMask == 0)
return 0;
/// @todo
// @todo
// do allow additional requirements for procs
// this is needed because this is the last moment in which you can prevent aura charge drop on proc
// and possibly a way to prevent default checks (if there're going to be any)
@@ -1720,7 +1720,7 @@ namespace Game.Spells
// Check if current equipment meets aura requirements
// do that only for passive spells
/// @todo this needs to be unified for all kinds of auras
// @todo this needs to be unified for all kinds of auras
Unit target = aurApp.GetTarget();
if (IsPassive() && target.IsTypeId(TypeId.Player))
{
@@ -2039,9 +2039,7 @@ namespace Game.Spells
if (eff.IsEffectAffected(m_spellInfo, aurEff.GetEffIndex()))
eff.Call(aurEff, dmgInfo, ref absorbAmount);
if (!defaultPrevented)
defaultPrevented = auraScript._IsDefaultActionPrevented();
defaultPrevented = auraScript._IsDefaultActionPrevented();
auraScript._FinishScriptCall();
}
}
@@ -2060,7 +2058,7 @@ namespace Game.Spells
}
}
public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, bool defaultPrevented)
public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, ref bool defaultPrevented)
{
foreach (var auraScript in m_loadedScripts)
{
+3 -3
View File
@@ -1938,7 +1938,7 @@ namespace Game.Spells
Unit target = aurApp.GetTarget();
// Vengeance of the Blue Flight (@todo REMOVE THIS!)
/// @workaround
// @workaround
if (m_spellInfo.Id == 45839)
{
if (apply)
@@ -4985,7 +4985,7 @@ namespace Game.Spells
HealInfo healInfo = new HealInfo(caster, target, heal, auraSpellInfo, auraSpellInfo.GetSchoolMask());
caster.HealBySpell(healInfo);
/// @todo: should proc other auras?
// @todo: should proc other auras?
int mana = caster.GetMaxPower(PowerType.Mana);
if (mana != 0)
{
@@ -5044,7 +5044,7 @@ namespace Game.Spells
triggerSpellId = 30571;
break;
// Doom
/// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase
// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase
// so instakill will be naturally done before trigger spell
case 31347:
{
+5 -5
View File
@@ -778,7 +778,7 @@ namespace Game.Spells
SpellTargetPosition st = Global.SpellMgr.GetSpellTargetPosition(m_spellInfo.Id, effIndex);
if (st != null)
{
/// @todo fix this check
// @todo fix this check
if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnits) || m_spellInfo.HasEffect(SpellEffectName.Bind))
dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation, st.target_mapId);
else if (st.target_mapId == m_caster.GetMapId())
@@ -1244,7 +1244,7 @@ namespace Game.Spells
void SelectEffectTypeImplicitTargets(uint effIndex)
{
// special case for SPELL_EFFECT_SUMMON_RAF_FRIEND and SPELL_EFFECT_SUMMON_PLAYER
/// @todo this is a workaround - target shouldn't be stored in target map for those spells
// @todo this is a workaround - target shouldn't be stored in target map for those spells
SpellEffectInfo effect = GetEffect(effIndex);
if (effect == null)
return;
@@ -1670,7 +1670,7 @@ namespace Game.Spells
if (m_spellInfo.Speed > 0.0f && m_caster != target)
{
// calculate spell incoming interval
/// @todo this is a hack
// @todo this is a hack
float dist = m_caster.GetDistance(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ());
if (dist < 5.0f)
@@ -2132,7 +2132,7 @@ namespace Game.Spells
else if (m_caster.IsFriendlyTo(unit))
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
/// @todo this cause soul transfer bugged
// @todo this cause soul transfer bugged
// 63881 - Malady of the Mind jump spell (Yogg-Saron)
if (m_spellInfo.Speed > 0.0f && unit.IsTypeId(TypeId.Player) && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881)
return SpellMissInfo.Evade;
@@ -4089,7 +4089,7 @@ namespace Game.Spells
resurrectRequest.SpellID = m_spellInfo.Id;
//packet.ReadBit("UseTimer"); /// @todo: 6.x Has to be implemented
//packet.ReadBit("UseTimer"); // @todo: 6.x Has to be implemented
resurrectRequest.Sickness = !m_caster.IsTypeId(TypeId.Player); // "you'll be afflicted with resurrection sickness"
resurrectRequest.Name = sentName;
-7
View File
@@ -972,12 +972,5 @@ namespace Game.Spells
public DateTime RechargeStart;
public DateTime RechargeEnd;
}
class CooldownDurations
{
public int Cooldown = -1;
public uint CategoryId = 0;
public int CategoryCooldown = -1;
}
}
}
+12 -3
View File
@@ -658,8 +658,8 @@ namespace Game.Entities
SpellInfo first = GetSpellInfo(pair.Key);
SpellInfo next = GetSpellInfo(pair.Value);
if (first == null || next != null)
continue;
if (!mSpellChains.ContainsKey(pair.Key))
mSpellChains[pair.Key] = new SpellChainNode();
mSpellChains[pair.Key].first = first;
mSpellChains[pair.Key].prev = null;
@@ -668,6 +668,9 @@ namespace Game.Entities
mSpellChains[pair.Key].rank = 1;
mSpellInfoMap[pair.Key].ChainEntry = mSpellChains[pair.Key];
if (!mSpellChains.ContainsKey(pair.Value))
mSpellChains[pair.Value] = new SpellChainNode();
mSpellChains[pair.Value].first = first;
mSpellChains[pair.Value].prev = first;
mSpellChains[pair.Value].next = null;
@@ -684,8 +687,14 @@ namespace Game.Entities
if (last == null)
break;
if (!mSpellChains.ContainsKey(nextPair.Key))
mSpellChains[nextPair.Key] = new SpellChainNode();
mSpellChains[nextPair.Key].next = last;
if (!mSpellChains.ContainsKey(nextPair.Value))
mSpellChains[nextPair.Value] = new SpellChainNode();
mSpellChains[nextPair.Value].first = first;
mSpellChains[nextPair.Value].prev = prev;
mSpellChains[nextPair.Value].next = null;
@@ -2433,7 +2442,7 @@ namespace Game.Entities
break;
case 56606: // Ride Jokkum
case 61791: // Ride Vehicle (Yogg-Saron)
/// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
spellInfo.GetEffect(0).BasePoints = 1;
break;
case 59630: // Black Magic
+1 -1
View File
@@ -314,7 +314,7 @@ namespace Game
// TIMING_CHECK
{
byte result = buff.ReadUInt8();
/// @todo test it.
// @todo test it.
if (result == 0x00)
{
Log.outWarn(LogFilter.Warden, "{0} failed timing check. Action: {1}", _session.GetPlayerInfo(), Penalty());
+2 -2
View File
@@ -136,7 +136,7 @@ namespace Game
return false;
}
/// Weather statistics:
// Weather statistics:
// 30% - no change
// 30% - weather gets better (if not fine) or change weather type
// 30% - weather worsens (if not fine)
@@ -178,7 +178,7 @@ namespace Game
if (m_type != WeatherType.Fine)
{
/// Radical change:
// Radical change:
// if light . heavy
// if medium . change weather type
// if heavy . 50% light, 50% change weather type