Misc. fixes

This commit is contained in:
hondacrx
2019-01-16 19:43:07 -05:00
parent ec7807eaac
commit 758aae32e0
7 changed files with 39 additions and 13 deletions
@@ -62,7 +62,7 @@ namespace Framework.Database
PrepareStatement(LoginStatements.INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL");
PrepareStatement(LoginStatements.UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY, "UPDATE account SET lock_country = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY, "UPDATE account SET lock_country = ? WHERE id = ?");
PrepareStatement(LoginStatements.INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)");
PrepareStatement(LoginStatements.UPD_USERNAME, "UPDATE account SET username = ?, sha_pass_hash = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_PASSWORD, "UPDATE account SET sha_pass_hash = ? WHERE id = ?");
@@ -212,7 +212,7 @@ namespace Framework.Database
INS_REALM_CHARACTERS_INIT,
UPD_EXPANSION,
UPD_ACCOUNT_LOCK,
UPD_ACCOUNT_LOCK_CONTRY,
UPD_ACCOUNT_LOCK_COUNTRY,
INS_LOG,
UPD_USERNAME,
UPD_PASSWORD,
+2 -2
View File
@@ -757,7 +757,7 @@ namespace Game.Chat
if (!result.IsEmpty())
{
string country = result.Read<string>(0);
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY);
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
stmt.AddValue(0, country);
stmt.AddValue(1, handler.GetSession().GetAccountId());
DB.Login.Execute(stmt);
@@ -771,7 +771,7 @@ namespace Game.Chat
}
else if (param == "off")
{
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY);
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_ACCOUNT_LOCK_COUNTRY);
stmt.AddValue(0, "00");
stmt.AddValue(1, handler.GetSession().GetAccountId());
DB.Login.Execute(stmt);
+10 -7
View File
@@ -1754,14 +1754,17 @@ namespace Game.DataStorage
areaEntry = CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID);
}
MapRecord mapEntry = CliDB.MapStorage.LookupByKey(mapId);
if (mapEntry != null)
if (mapId > 0)
{
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], (int)mapEntry.Id);
if (mapEntry.ParentMapID >= 0)
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.ParentMapID);
if (mapEntry.CosmeticParentMapID >= 0)
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.CosmeticParentMapID);
MapRecord mapEntry = CliDB.MapStorage.LookupByKey(mapId);
if (mapEntry != null)
{
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], (int)mapEntry.Id);
if (mapEntry.ParentMapID >= 0)
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.ParentMapID);
if (mapEntry.CosmeticParentMapID >= 0)
iterateUiMapAssignments(_uiMapAssignmentByMap[(int)system], mapEntry.CosmeticParentMapID);
}
}
return nearestMapAssignment.UiMapAssignment;
+1 -1
View File
@@ -1504,7 +1504,7 @@ namespace Game.DungeonFinding
else if (dungeon.expansion > (uint)expansion)
lockStatus = LfgLockStatusType.InsufficientExpansion;
else if (Global.DisableMgr.IsDisabledFor(DisableType.Map, dungeon.map, player))
lockStatus = LfgLockStatusType.RaidLocked;
lockStatus = LfgLockStatusType.NotInSeason;
else if (Global.DisableMgr.IsDisabledFor(DisableType.LFGMap, dungeon.map, player))
lockStatus = LfgLockStatusType.RaidLocked;
else if (dungeon.difficulty > Difficulty.Normal && player.GetBoundInstance(dungeon.map, dungeon.difficulty) != null)
+1 -1
View File
@@ -544,7 +544,7 @@ namespace Game.Entities
}
// Check if angular distance changed
bool turn = MathFunctions.fuzzyGt(Math.PI - Math.Abs(Math.Abs(GetOrientation() - orientation) - Math.PI), 0.0f);
bool turn = MathFunctions.fuzzyGt((float)Math.PI - Math.Abs(Math.Abs(GetOrientation() - orientation) - (float)Math.PI), 0.0f);
// G3D::fuzzyEq won't help here, in some cases magnitudes differ by a little more than G3D::eps, but should be considered equal
bool relocated = (teleport ||
Math.Abs(GetPositionX() - x) > 0.001f ||