Misc fixes

This commit is contained in:
hondacrx
2020-08-20 23:21:53 -04:00
parent 35e28da605
commit 062eecf20b
6 changed files with 9 additions and 15 deletions
@@ -58,7 +58,7 @@ namespace Framework.Database
PrepareStatement(LoginStatements.DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?"); PrepareStatement(LoginStatements.DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?");
PrepareStatement(LoginStatements.INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)"); PrepareStatement(LoginStatements.INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)");
PrepareStatement(LoginStatements.SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?"); PrepareStatement(LoginStatements.SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?");
PrepareStatement(LoginStatements.INS_ACCOUNT, "INSERT INTO account(username, salt, verifier, reg_mail, email, joindate, battlenet_account, battlenet_index) VALUES(?, ?, ?, ?, ?, NOW(), ?, ?)"); PrepareStatement(LoginStatements.INS_ACCOUNT, "INSERT INTO account (username, salt, verifier, reg_mail, email, joindate, battlenet_account, battlenet_index) VALUES(?, ?, ?, ?, ?, NOW(), ?, ?)");
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.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_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?"); PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?");
+2 -5
View File
@@ -203,7 +203,7 @@ public class Log
} }
case AppenderType.File: case AppenderType.File:
{ {
string filename = ""; string filename;
if (tokens.Length < 4) if (tokens.Length < 4)
{ {
if (name != "Server") if (name != "Server")
@@ -236,7 +236,6 @@ public class Log
if (string.IsNullOrEmpty(appenderName)) if (string.IsNullOrEmpty(appenderName))
return; return;
LogLevel level = LogLevel.Disabled;
string name = appenderName.Substring(7); string name = appenderName.Substring(7);
string options = ConfigMgr.GetDefaultValue(appenderName, ""); string options = ConfigMgr.GetDefaultValue(appenderName, "");
@@ -254,7 +253,7 @@ public class Log
return; return;
} }
level = (LogLevel)uint.Parse(tokens[0]); LogLevel level = (LogLevel)uint.Parse(tokens[0]);
if (level > LogLevel.Fatal) if (level > LogLevel.Fatal)
{ {
Console.WriteLine("Log.CreateLoggerFromConfig: Wrong Log Level {0} for logger {1}", type, name); Console.WriteLine("Log.CreateLoggerFromConfig: Wrong Log Level {0} for logger {1}", type, name);
@@ -349,8 +348,6 @@ public class Log
appender.setRealmId(id); appender.setRealmId(id);
} }
static string GetLogsDir() { return m_logsDir; }
static Dictionary<byte, Appender> appenders = new Dictionary<byte, Appender>(); static Dictionary<byte, Appender> appenders = new Dictionary<byte, Appender>();
static Dictionary<LogFilter, Logger> loggers = new Dictionary<LogFilter, Logger>(); static Dictionary<LogFilter, Logger> loggers = new Dictionary<LogFilter, Logger>();
static string m_logsDir; static string m_logsDir;
-1
View File
@@ -21,7 +21,6 @@ using Game.Networking.Packets;
using Game.Spells; using Game.Spells;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Framework.Constants;
namespace Game.Entities namespace Game.Entities
{ {
+2 -2
View File
@@ -2206,10 +2206,10 @@ namespace Game.Maps
public bool IsInLineOfSight(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, LineOfSightChecks checks, ModelIgnoreFlags ignoreFlags) public bool IsInLineOfSight(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, LineOfSightChecks checks, ModelIgnoreFlags ignoreFlags)
{ {
if (checks.HasAnyFlag(LineOfSightChecks.Vmap) && Global.VMapMgr.IsInLineOfSight(PhasingHandler.GetTerrainMapId(phaseShift, this, x1, y1), x1, y1, z1, x2, y2, z2, ignoreFlags)) if (checks.HasAnyFlag(LineOfSightChecks.Vmap) && !Global.VMapMgr.IsInLineOfSight(PhasingHandler.GetTerrainMapId(phaseShift, this, x1, y1), x1, y1, z1, x2, y2, z2, ignoreFlags))
return false; return false;
if (WorldConfig.GetBoolValue(WorldCfg.CheckGobjectLos) && checks.HasAnyFlag(LineOfSightChecks.Gobject) && _dynamicTree.IsInLineOfSight(new Vector3(x1, y1, z1), new Vector3(x2, y2, z2), phaseShift)) if (WorldConfig.GetBoolValue(WorldCfg.CheckGobjectLos) && checks.HasAnyFlag(LineOfSightChecks.Gobject) && !_dynamicTree.IsInLineOfSight(new Vector3(x1, y1, z1), new Vector3(x2, y2, z2), phaseShift))
return false; return false;
return true; return true;
@@ -316,7 +316,6 @@ namespace Game.Networking.Packets
public byte[] IPv4; public byte[] IPv4;
public byte[] IPv6; public byte[] IPv6;
public string NameSocket; public string NameSocket;
} }
public enum AddressType public enum AddressType
+4 -5
View File
@@ -3140,8 +3140,8 @@ namespace Game.Spells
if (effect == null || !effect.IsEffect()) if (effect == null || !effect.IsEffect())
continue; continue;
targetMask |= effect.TargetA.GetExplicitTargetMask(srcSet, dstSet); targetMask |= effect.TargetA.GetExplicitTargetMask(ref srcSet, ref dstSet);
targetMask |= effect.TargetB.GetExplicitTargetMask(srcSet, dstSet); targetMask |= effect.TargetB.GetExplicitTargetMask(ref srcSet, ref dstSet);
// add explicit target flags based on spell effects which have SpellEffectImplicitTargetTypes.Explicit and no valid target provided // add explicit target flags based on spell effects which have SpellEffectImplicitTargetTypes.Explicit and no valid target provided
if (effect.GetImplicitTargetType() != SpellEffectImplicitTargetTypes.Explicit) if (effect.GetImplicitTargetType() != SpellEffectImplicitTargetTypes.Explicit)
@@ -3723,8 +3723,7 @@ namespace Game.Spells
public int CalcValue(Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1) public int CalcValue(Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1)
{ {
float throwAway; return CalcValue(out _, caster, bp, target, castItemId, itemLevel);
return CalcValue(out throwAway, caster, bp, target, castItemId, itemLevel);
} }
public int CalcValue(out float variance, Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1) public int CalcValue(out float variance, Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1)
@@ -4474,7 +4473,7 @@ namespace Game.Spells
return _target; return _target;
} }
public SpellCastTargetFlags GetExplicitTargetMask(bool srcSet, bool dstSet) public SpellCastTargetFlags GetExplicitTargetMask(ref bool srcSet, ref bool dstSet)
{ {
SpellCastTargetFlags targetMask = 0; SpellCastTargetFlags targetMask = 0;
if (GetTarget() == Targets.DestTraj) if (GetTarget() == Targets.DestTraj)