Core/Misc: Fixes

DB: Lots of DB fixes
This commit is contained in:
hondacrx
2018-06-09 12:03:02 -04:00
parent 2d2a9eac16
commit 1289bc3ed1
38 changed files with 53938 additions and 11 deletions
+1 -1
View File
@@ -341,7 +341,7 @@ namespace Game.Chat
string name = args.NextString();
string level = args.NextString();
if (string.IsNullOrEmpty(type) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(level) || name.IsEmpty() || level.IsEmpty() || (type[0] != 'a' && type[0] != 'l'))
if (type.IsEmpty() || name.IsEmpty() || level.IsEmpty() || (type[0] != 'a' && type[0] != 'l'))
return false;
return Log.SetLogLevel(name, level, type[0] == 'l');
@@ -381,20 +381,20 @@ namespace Game.Maps
public void Update()
{
long now = Time.UnixTime;
long t;
while (!m_resetTimeQueue.Empty())
{
t = m_resetTimeQueue.First().Key;
if (t >= now)
var pair = m_resetTimeQueue.First();
long time = pair.Key;
if (time >= now)
break;
InstResetEvent Event = m_resetTimeQueue.First().Value;
InstResetEvent Event = pair.Value;
if (Event.type == 0)
{
// for individual normal instances, max creature respawn + X hours
_ResetInstance(Event.mapid, Event.instanceId);
m_resetTimeQueue.Remove(m_resetTimeQueue.First());
m_resetTimeQueue.Remove(pair);
}
else
{
@@ -407,7 +407,7 @@ namespace Game.Maps
++Event.type;
ScheduleReset(true, resetTime - ResetTimeDelay[Event.type - 1], Event);
}
m_resetTimeQueue.Remove(m_resetTimeQueue.First());
m_resetTimeQueue.Remove(pair);
}
}
}
@@ -535,9 +535,9 @@ namespace Game.Maps
// Update it in the DB
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GLOBAL_INSTANCE_RESETTIME);
stmt.AddValue(0, next_reset);
stmt.AddValue(1, mapid);
stmt.AddValue(2, difficulty);
stmt.AddValue(0, (uint)next_reset);
stmt.AddValue(1, (ushort)mapid);
stmt.AddValue(2, (byte)difficulty);
DB.Characters.Execute(stmt);
}
+1 -1
View File
@@ -117,7 +117,7 @@ namespace Game
SoundTurnIn = fields.Read<uint>(102);
AreaGroupID = fields.Read<uint>(103);
LimitTime = fields.Read<uint>(104);
AllowableRaces = fields.Read<long>(105);
AllowableRaces = (long)fields.Read<ulong>(105);
QuestRewardID = fields.Read<uint>(106);
Expansion = fields.Read<int>(107);