Core/DB: Fixes sometimes wrong values added to DB, also fixes errors when trying to convert updatefield to object.

This commit is contained in:
hondacrx
2021-04-21 18:06:46 -04:00
parent 897ca11273
commit ba064327b0
30 changed files with 149 additions and 89 deletions
@@ -206,7 +206,7 @@ namespace Game.Entities
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_HEIRLOOMS);
stmt.AddValue(0, _owner.GetBattlenetAccountId());
stmt.AddValue(1, heirloom.Key);
stmt.AddValue(2, heirloom.Value.flags);
stmt.AddValue(2, (uint)heirloom.Value.flags);
trans.Append(stmt);
}
}
@@ -404,7 +404,7 @@ namespace Game.Entities
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_MOUNTS);
stmt.AddValue(0, _owner.GetBattlenetAccountId());
stmt.AddValue(1, mount.Key);
stmt.AddValue(2, mount.Value);
stmt.AddValue(2, (byte)mount.Value);
trans.Append(stmt);
}
}
+4 -4
View File
@@ -1778,7 +1778,7 @@ namespace Game.Entities
stmt.AddValue(index++, key.SpellId);
stmt.AddValue(index++, key.EffectMask);
stmt.AddValue(index++, recalculateMask);
stmt.AddValue(index++, aura.GetCastDifficulty());
stmt.AddValue(index++, (byte)aura.GetCastDifficulty());
stmt.AddValue(index++, aura.GetStackAmount());
stmt.AddValue(index++, aura.GetMaxDuration());
stmt.AddValue(index++, aura.GetDuration());
@@ -1911,7 +1911,7 @@ namespace Game.Entities
stmt.AddValue(1, GetActiveTalentGroup());
stmt.AddValue(2, pair.Key);
stmt.AddValue(3, pair.Value.GetAction());
stmt.AddValue(4, pair.Value.GetButtonType());
stmt.AddValue(4, (byte)pair.Value.GetButtonType());
trans.Append(stmt);
pair.Value.uState = ActionButtonUpdateState.UnChanged;
@@ -1919,7 +1919,7 @@ namespace Game.Entities
case ActionButtonUpdateState.Changed:
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_ACTION);
stmt.AddValue(0, pair.Value.GetAction());
stmt.AddValue(1, pair.Value.GetButtonType());
stmt.AddValue(1, (byte)pair.Value.GetButtonType());
stmt.AddValue(2, GetGUID().GetCounter());
stmt.AddValue(3, pair.Key);
stmt.AddValue(4, GetActiveTalentGroup());
@@ -1960,7 +1960,7 @@ namespace Game.Entities
stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_CHAR_QUESTSTATUS);
stmt.AddValue(0, GetGUID().GetCounter());
stmt.AddValue(1, save.Key);
stmt.AddValue(2, data.Status);
stmt.AddValue(2, (byte)data.Status);
stmt.AddValue(3, data.Timer / Time.InMilliseconds + GameTime.GetGameTime());
trans.Append(stmt);
+2 -2
View File
@@ -386,7 +386,7 @@ namespace Game.Entities
stmt.AddValue(0, save.GetInstanceId());
stmt.AddValue(1, permanent);
stmt.AddValue(2, extendState);
stmt.AddValue(2, (byte)extendState);
stmt.AddValue(3, GetGUID().GetCounter());
stmt.AddValue(4, bind.save.GetInstanceId());
@@ -399,7 +399,7 @@ namespace Game.Entities
stmt.AddValue(0, GetGUID().GetCounter());
stmt.AddValue(1, save.GetInstanceId());
stmt.AddValue(2, permanent);
stmt.AddValue(3, extendState);
stmt.AddValue(3, (byte)extendState);
DB.Characters.Execute(stmt);
}
}
+3 -3
View File
@@ -176,7 +176,7 @@ namespace Game.Entities
friendInfo.Flags |= flag;
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
stmt.AddValue(0, friendInfo.Flags);
stmt.AddValue(0, (byte)friendInfo.Flags);
stmt.AddValue(1, GetPlayerGUID().GetCounter());
stmt.AddValue(2, friendGuid.GetCounter());
DB.Characters.Execute(stmt);
@@ -190,7 +190,7 @@ namespace Game.Entities
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHARACTER_SOCIAL);
stmt.AddValue(0, GetPlayerGUID().GetCounter());
stmt.AddValue(1, friendGuid.GetCounter());
stmt.AddValue(2, flag);
stmt.AddValue(2, (byte)flag);
DB.Characters.Execute(stmt);
}
return true;
@@ -216,7 +216,7 @@ namespace Game.Entities
else
{
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHARACTER_SOCIAL_FLAGS);
stmt.AddValue(0, friendInfo.Flags);
stmt.AddValue(0, (byte)friendInfo.Flags);
stmt.AddValue(1, GetPlayerGUID().GetCounter());
stmt.AddValue(2, friendGuid.GetCounter());
DB.Characters.Execute(stmt);