Core/DB: Fixes sometimes wrong values added to DB, also fixes errors when trying to convert updatefield to object.
This commit is contained in:
@@ -98,7 +98,7 @@ namespace BNetServer.Networking
|
||||
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UpdBnetLastLoginInfo);
|
||||
stmt.AddValue(0, GetRemoteIpEndPoint().ToString());
|
||||
stmt.AddValue(1, Enum.Parse(typeof(Locale), locale));
|
||||
stmt.AddValue(1, (byte)Enum.Parse(typeof(Locale), locale));
|
||||
stmt.AddValue(2, os);
|
||||
stmt.AddValue(3, accountInfo.Id);
|
||||
|
||||
|
||||
@@ -30,11 +30,71 @@ namespace Framework.Database
|
||||
CommandText = commandText;
|
||||
}
|
||||
|
||||
public void AddValue(int index, object value)
|
||||
public void AddValue(int index, sbyte value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, byte value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, short value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, ushort value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, int value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, uint value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, long value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, ulong value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, float value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, byte[] value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, string value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddValue(int index, bool value)
|
||||
{
|
||||
Parameters.Add(index, value);
|
||||
}
|
||||
|
||||
public void AddNull(int index)
|
||||
{
|
||||
Parameters.Add(index, null);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Parameters.Clear();
|
||||
|
||||
@@ -141,7 +141,7 @@ class DBAppender : Appender
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_LOG);
|
||||
stmt.AddValue(0, Time.DateTimeToUnixTime(message.mtime));
|
||||
stmt.AddValue(1, realmId);
|
||||
stmt.AddValue(2, message.type);
|
||||
stmt.AddValue(2, message.type.ToString());
|
||||
stmt.AddValue(3, (byte)message.level);
|
||||
stmt.AddValue(4, message.text);
|
||||
DB.Login.Execute(stmt);
|
||||
|
||||
@@ -297,7 +297,7 @@ public class RealmManager : Singleton<RealmManager>
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LOGIN_INFO);
|
||||
stmt.AddValue(0, keyData);
|
||||
stmt.AddValue(1, clientAddress.ToString());
|
||||
stmt.AddValue(2, locale);
|
||||
stmt.AddValue(2, (byte)locale);
|
||||
stmt.AddValue(3, os);
|
||||
stmt.AddValue(4, accountName);
|
||||
DB.Login.DirectExecute(stmt);
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace Game
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt.AddValue(5, null);
|
||||
stmt.AddValue(6, null);
|
||||
stmt.AddNull(5);
|
||||
stmt.AddNull(6);
|
||||
}
|
||||
DB.Login.DirectExecute(stmt); // Enforce saving, otherwise AddGroup can fail
|
||||
|
||||
|
||||
@@ -117,8 +117,8 @@ namespace Game
|
||||
return AccountOpResult.BadLink;
|
||||
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK);
|
||||
stmt.AddValue(0, null);
|
||||
stmt.AddValue(1, null);
|
||||
stmt.AddNull(0);
|
||||
stmt.AddNull(1);
|
||||
stmt.AddValue(2, gameAccountId);
|
||||
DB.Login.Execute(stmt);
|
||||
return AccountOpResult.Ok;
|
||||
|
||||
@@ -689,9 +689,9 @@ namespace Game.BattleGrounds
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PVPSTATS_BATTLEGROUND);
|
||||
stmt.AddValue(0, battlegroundId);
|
||||
stmt.AddValue(1, GetWinner());
|
||||
stmt.AddValue(1, (byte)GetWinner());
|
||||
stmt.AddValue(2, GetUniqueBracketId());
|
||||
stmt.AddValue(3, GetTypeID(true));
|
||||
stmt.AddValue(3, (byte)GetTypeID(true));
|
||||
DB.Characters.Execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -223,10 +223,10 @@ namespace Game
|
||||
stmt.AddValue(1, calendarEvent.OwnerGuid.GetCounter());
|
||||
stmt.AddValue(2, calendarEvent.Title);
|
||||
stmt.AddValue(3, calendarEvent.Description);
|
||||
stmt.AddValue(4, calendarEvent.EventType);
|
||||
stmt.AddValue(4, (byte)calendarEvent.EventType);
|
||||
stmt.AddValue(5, calendarEvent.TextureId);
|
||||
stmt.AddValue(6, calendarEvent.Date);
|
||||
stmt.AddValue(7, calendarEvent.Flags);
|
||||
stmt.AddValue(7, (uint)calendarEvent.Flags);
|
||||
stmt.AddValue(8, calendarEvent.LockDate);
|
||||
trans.Append(stmt);
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
@@ -239,9 +239,9 @@ namespace Game
|
||||
stmt.AddValue(1, invite.EventId);
|
||||
stmt.AddValue(2, invite.InviteeGuid.GetCounter());
|
||||
stmt.AddValue(3, invite.SenderGuid.GetCounter());
|
||||
stmt.AddValue(4, invite.Status);
|
||||
stmt.AddValue(4, (byte)invite.Status);
|
||||
stmt.AddValue(5, invite.ResponseTime);
|
||||
stmt.AddValue(6, invite.Rank);
|
||||
stmt.AddValue(6, (byte)invite.Rank);
|
||||
stmt.AddValue(7, invite.Note);
|
||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Game.Chat
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHANNEL);
|
||||
stmt.AddValue(0, _channelName);
|
||||
stmt.AddValue(1, _channelTeam);
|
||||
stmt.AddValue(1, (uint)_channelTeam);
|
||||
SQLResult result = DB.Characters.Query(stmt);
|
||||
|
||||
if (!result.IsEmpty()) //load
|
||||
@@ -97,7 +97,7 @@ namespace Game.Chat
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHANNEL);
|
||||
stmt.AddValue(0, _channelName);
|
||||
stmt.AddValue(1, _channelTeam);
|
||||
stmt.AddValue(1, (uint)_channelTeam);
|
||||
DB.Characters.Execute(stmt);
|
||||
Log.outDebug(LogFilter.ChatSystem, "Channel({0}) saved in database", _channelName);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace Game.Chat
|
||||
stmt.AddValue(2, _channelPassword);
|
||||
stmt.AddValue(3, banlist);
|
||||
stmt.AddValue(4, _channelName);
|
||||
stmt.AddValue(5, _channelTeam);
|
||||
stmt.AddValue(5, (uint)_channelTeam);
|
||||
DB.Characters.Execute(stmt);
|
||||
|
||||
Log.outDebug(LogFilter.ChatSystem, "Channel({0}) updated in database", _channelName);
|
||||
@@ -156,7 +156,7 @@ namespace Game.Chat
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHANNEL_USAGE);
|
||||
stmt.AddValue(0, _channelName);
|
||||
stmt.AddValue(1, _channelTeam);
|
||||
stmt.AddValue(1, (uint)_channelTeam);
|
||||
DB.Characters.Execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Game.Chat
|
||||
handler.SendSysMessage(CypherStrings.RenamePlayerGuid, oldNameLink, targetGuid.ToString());
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt.AddValue(0, AtLoginFlags.Rename);
|
||||
stmt.AddValue(0, (ushort)AtLoginFlags.Rename);
|
||||
stmt.AddValue(1, targetGuid.GetCounter());
|
||||
DB.Characters.Execute(stmt);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt.AddValue(0, AtLoginFlags.Customize);
|
||||
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
||||
if (target)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target));
|
||||
@@ -350,7 +350,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt.AddValue(0, AtLoginFlags.ChangeFaction);
|
||||
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeFaction);
|
||||
if (target)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CustomizePlayer, handler.GetNameLink(target));
|
||||
@@ -378,7 +378,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt.AddValue(0, AtLoginFlags.ChangeRace);
|
||||
stmt.AddValue(0, (ushort)AtLoginFlags.ChangeRace);
|
||||
if (target)
|
||||
{
|
||||
// @todo add text into database
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
||||
stmt.AddValue(0, entry);
|
||||
stmt.AddValue(1, disableType);
|
||||
stmt.AddValue(1, (byte)disableType);
|
||||
SQLResult result = DB.World.Query(stmt);
|
||||
if (!result.IsEmpty())
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.INS_DISABLES);
|
||||
stmt.AddValue(0, entry);
|
||||
stmt.AddValue(1, disableType);
|
||||
stmt.AddValue(1, (byte)disableType);
|
||||
stmt.AddValue(2, flags);
|
||||
stmt.AddValue(3, disableComment);
|
||||
DB.World.Execute(stmt);
|
||||
@@ -261,7 +261,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_DISABLES);
|
||||
stmt.AddValue(0, entry);
|
||||
stmt.AddValue(1, disableType);
|
||||
stmt.AddValue(1, (byte)disableType);
|
||||
SQLResult result = DB.World.Query(stmt);
|
||||
if (result.IsEmpty())
|
||||
{
|
||||
@@ -271,7 +271,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
stmt = DB.World.GetPreparedStatement(WorldStatements.DEL_DISABLES);
|
||||
stmt.AddValue(0, entry);
|
||||
stmt.AddValue(1, disableType);
|
||||
stmt.AddValue(1, (byte)disableType);
|
||||
DB.World.Execute(stmt);
|
||||
|
||||
handler.SendSysMessage("Remove Disabled {0} (Id: {1})", disableTypeStr, entry);
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace Game.Chat
|
||||
{
|
||||
// Get the accounts with GM Level >0
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_GM_ACCOUNTS);
|
||||
stmt.AddValue(0, AccountTypes.Moderator);
|
||||
stmt.AddValue(0, (byte)AccountTypes.Moderator);
|
||||
stmt.AddValue(1, Global.WorldMgr.GetRealm().Id.Index);
|
||||
SQLResult result = DB.Login.Query(stmt);
|
||||
|
||||
|
||||
@@ -772,7 +772,7 @@ namespace Game.Chat
|
||||
|
||||
// Update movement type
|
||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE);
|
||||
stmt.AddValue(0, MovementGeneratorType.Waypoint);
|
||||
stmt.AddValue(0, (byte)MovementGeneratorType.Waypoint);
|
||||
stmt.AddValue(1, lowGuid);
|
||||
DB.World.Execute(stmt);
|
||||
|
||||
@@ -1435,7 +1435,7 @@ namespace Game.Chat
|
||||
|
||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_SPAWN_DISTANCE);
|
||||
stmt.AddValue(0, option);
|
||||
stmt.AddValue(1, mtype);
|
||||
stmt.AddValue(1, (byte)mtype);
|
||||
stmt.AddValue(2, guidLow);
|
||||
|
||||
DB.World.Execute(stmt);
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Game.DungeonFinding
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_LFG_DATA);
|
||||
stmt.AddValue(0, db_guid);
|
||||
stmt.AddValue(1, GetDungeon(guid));
|
||||
stmt.AddValue(2, GetState(guid));
|
||||
stmt.AddValue(2, (uint)GetState(guid));
|
||||
trans.Append(stmt);
|
||||
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
|
||||
@@ -1207,12 +1207,12 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, 0);
|
||||
stmt.AddValue(index++, GetHealth());
|
||||
stmt.AddValue(index++, GetPower(PowerType.Mana));
|
||||
stmt.AddValue(index++, GetDefaultMovementType());
|
||||
stmt.AddValue(index++, (byte)GetDefaultMovementType());
|
||||
stmt.AddValue(index++, npcflag);
|
||||
stmt.AddValue(index++, unitFlags);
|
||||
stmt.AddValue(index++, unitFlags2);
|
||||
stmt.AddValue(index++, unitFlags3);
|
||||
stmt.AddValue(index++, dynamicflags);
|
||||
stmt.AddValue(index++, (uint)dynamicflags);
|
||||
trans.Append(stmt);
|
||||
|
||||
DB.World.CommitTransaction(trans);
|
||||
|
||||
@@ -995,7 +995,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, m_worldRotation.W);
|
||||
stmt.AddValue(index++, m_respawnDelayTime);
|
||||
stmt.AddValue(index++, GetGoAnimProgress());
|
||||
stmt.AddValue(index++, GetGoState());
|
||||
stmt.AddValue(index++, (byte)GetGoState());
|
||||
DB.World.Execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
+20
-20
@@ -113,7 +113,7 @@ namespace Game.Entities
|
||||
// Current pet (slot 0)
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_PET_BY_ENTRY_AND_SLOT);
|
||||
stmt.AddValue(0, ownerid);
|
||||
stmt.AddValue(1, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(1, (byte)PetSaveMode.AsCurrent);
|
||||
}
|
||||
else if (petEntry != 0)
|
||||
{
|
||||
@@ -121,16 +121,16 @@ namespace Game.Entities
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2);
|
||||
stmt.AddValue(0, ownerid);
|
||||
stmt.AddValue(1, petEntry);
|
||||
stmt.AddValue(2, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(3, PetSaveMode.LastStableSlot);
|
||||
stmt.AddValue(2, (byte)PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(3, (byte)PetSaveMode.LastStableSlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Any current or other non-stabled pet (for hunter "call pet")
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_PET_BY_SLOT);
|
||||
stmt.AddValue(0, ownerid);
|
||||
stmt.AddValue(1, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(2, PetSaveMode.LastStableSlot);
|
||||
stmt.AddValue(1, (byte)PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(2, (byte)PetSaveMode.LastStableSlot);
|
||||
}
|
||||
|
||||
SQLResult result = DB.Characters.Query(stmt);
|
||||
@@ -266,14 +266,14 @@ namespace Game.Entities
|
||||
if (result.Read<byte>(7) != 0)
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID);
|
||||
stmt.AddValue(0, PetSaveMode.NotInSlot);
|
||||
stmt.AddValue(0, (byte)PetSaveMode.NotInSlot);
|
||||
stmt.AddValue(1, ownerid);
|
||||
stmt.AddValue(2, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(2, (byte)PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(3, GetCharmInfo().GetPetNumber());
|
||||
DB.Characters.Execute(stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_ID);
|
||||
stmt.AddValue(0, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(0, (byte)PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(1, ownerid);
|
||||
stmt.AddValue(2, GetCharmInfo().GetPetNumber());
|
||||
DB.Characters.Execute(stmt);
|
||||
@@ -422,9 +422,9 @@ namespace Game.Entities
|
||||
if (mode <= PetSaveMode.LastStableSlot)
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_PET_SLOT_BY_SLOT);
|
||||
stmt.AddValue(0, PetSaveMode.NotInSlot);
|
||||
stmt.AddValue(0, (byte)PetSaveMode.NotInSlot);
|
||||
stmt.AddValue(1, ownerLowGUID);
|
||||
stmt.AddValue(2, mode);
|
||||
stmt.AddValue(2, (byte)mode);
|
||||
trans.Append(stmt);
|
||||
}
|
||||
|
||||
@@ -433,8 +433,8 @@ namespace Game.Entities
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_BY_SLOT);
|
||||
stmt.AddValue(0, ownerLowGUID);
|
||||
stmt.AddValue(1, PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(2, PetSaveMode.LastStableSlot);
|
||||
stmt.AddValue(1, (byte)PetSaveMode.AsCurrent);
|
||||
stmt.AddValue(2, (byte)PetSaveMode.LastStableSlot);
|
||||
trans.Append(stmt);
|
||||
}
|
||||
|
||||
@@ -445,17 +445,17 @@ namespace Game.Entities
|
||||
stmt.AddValue(2, ownerLowGUID);
|
||||
stmt.AddValue(3, GetNativeDisplayId());
|
||||
stmt.AddValue(4, GetLevel());
|
||||
stmt.AddValue(5, (uint)m_unitData.PetExperience);
|
||||
stmt.AddValue(6, GetReactState());
|
||||
stmt.AddValue(7, mode);
|
||||
stmt.AddValue(5, m_unitData.PetExperience);
|
||||
stmt.AddValue(6, (byte)GetReactState());
|
||||
stmt.AddValue(7, (byte)mode);
|
||||
stmt.AddValue(8, GetName());
|
||||
stmt.AddValue(9, HasPetFlag(UnitPetFlags.CanBeRenamed) ? 0 : 1);
|
||||
stmt.AddValue(10, curhealth);
|
||||
stmt.AddValue(11, curmana);
|
||||
stmt.AddValue(12, GenerateActionBarData());
|
||||
stmt.AddValue(13, GameTime.GetGameTime());
|
||||
stmt.AddValue(14, (uint)m_unitData.CreatedBySpell);
|
||||
stmt.AddValue(15, GetPetType());
|
||||
stmt.AddValue(14, m_unitData.CreatedBySpell);
|
||||
stmt.AddValue(15, (byte)GetPetType());
|
||||
stmt.AddValue(16, m_petSpecialization);
|
||||
trans.Append(stmt);
|
||||
|
||||
@@ -823,14 +823,14 @@ namespace Game.Entities
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||
stmt.AddValue(1, pair.Key);
|
||||
stmt.AddValue(2, pair.Value.active);
|
||||
stmt.AddValue(2, (byte)pair.Value.active);
|
||||
trans.Append(stmt);
|
||||
break;
|
||||
case PetSpellState.New:
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PET_SPELL);
|
||||
stmt.AddValue(0, GetCharmInfo().GetPetNumber());
|
||||
stmt.AddValue(1, pair.Key);
|
||||
stmt.AddValue(2, pair.Value.active);
|
||||
stmt.AddValue(2, (byte)pair.Value.active);
|
||||
trans.Append(stmt);
|
||||
break;
|
||||
case PetSpellState.Unchanged:
|
||||
@@ -976,7 +976,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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1542,7 +1542,7 @@ namespace Game
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GAME_EVENT_SAVE);
|
||||
stmt.AddValue(0, event_id);
|
||||
stmt.AddValue(1, mGameEvent[event_id].state);
|
||||
stmt.AddValue(1, (byte)mGameEvent[event_id].state);
|
||||
stmt.AddValue(2, mGameEvent[event_id].nextstart != 0 ? mGameEvent[event_id].nextstart : 0L);
|
||||
trans.Append(stmt);
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
|
||||
@@ -1028,7 +1028,7 @@ namespace Game
|
||||
|
||||
stmt.AddValue(0, id);
|
||||
stmt.AddValue(1, zoneId);
|
||||
stmt.AddValue(2, team);
|
||||
stmt.AddValue(2, (uint)team);
|
||||
|
||||
DB.World.Execute(stmt);
|
||||
}
|
||||
@@ -1076,7 +1076,7 @@ namespace Game
|
||||
|
||||
stmt.AddValue(0, id);
|
||||
stmt.AddValue(1, zoneId);
|
||||
stmt.AddValue(2, team);
|
||||
stmt.AddValue(2, (uint)team);
|
||||
|
||||
DB.World.Execute(stmt);
|
||||
}
|
||||
@@ -4785,7 +4785,7 @@ namespace Game
|
||||
stmt.AddValue(2, vItem.maxcount);
|
||||
stmt.AddValue(3, vItem.incrtime);
|
||||
stmt.AddValue(4, vItem.ExtendedCost);
|
||||
stmt.AddValue(5, vItem.Type);
|
||||
stmt.AddValue(5, (byte)vItem.Type);
|
||||
|
||||
DB.World.Execute(stmt);
|
||||
}
|
||||
@@ -9184,7 +9184,7 @@ namespace Game
|
||||
stmt.AddValue(1, m.sender);
|
||||
stmt.AddValue(2, curTime + 30 * Time.Day);
|
||||
stmt.AddValue(3, curTime);
|
||||
stmt.AddValue(4, MailCheckMask.Returned);
|
||||
stmt.AddValue(4, (byte)MailCheckMask.Returned);
|
||||
stmt.AddValue(5, m.messageID);
|
||||
DB.Characters.Execute(stmt);
|
||||
foreach (var itemInfo in m.items)
|
||||
|
||||
@@ -381,9 +381,9 @@ namespace Game.Groups
|
||||
|
||||
stmt.AddValue(0, m_dbStoreId);
|
||||
stmt.AddValue(1, member.guid.GetCounter());
|
||||
stmt.AddValue(2, member.flags);
|
||||
stmt.AddValue(2, (byte)member.flags);
|
||||
stmt.AddValue(3, member.group);
|
||||
stmt.AddValue(4, member.roles);
|
||||
stmt.AddValue(4, (byte)member.roles);
|
||||
|
||||
DB.Characters.Execute(stmt);
|
||||
|
||||
@@ -1846,7 +1846,7 @@ namespace Game.Groups
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_LEGACY_RAID_DIFFICULTY);
|
||||
|
||||
stmt.AddValue(0, m_legacyRaidDifficulty);
|
||||
stmt.AddValue(0, (byte)m_legacyRaidDifficulty);
|
||||
stmt.AddValue(1, m_dbStoreId);
|
||||
|
||||
DB.Characters.Execute(stmt);
|
||||
@@ -2480,7 +2480,7 @@ namespace Game.Groups
|
||||
// Preserve the new setting in the db
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_FLAG);
|
||||
|
||||
stmt.AddValue(0, slot.flags);
|
||||
stmt.AddValue(0, (byte)slot.flags);
|
||||
stmt.AddValue(1, guid.GetCounter());
|
||||
|
||||
DB.Characters.Execute(stmt);
|
||||
|
||||
@@ -2802,7 +2802,7 @@ namespace Game.Guilds
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_EVENTLOG);
|
||||
stmt.AddValue(index, m_guildId);
|
||||
stmt.AddValue(++index, m_guid);
|
||||
stmt.AddValue(++index, m_eventType);
|
||||
stmt.AddValue(++index, (byte)m_eventType);
|
||||
stmt.AddValue(++index, m_playerGuid1);
|
||||
stmt.AddValue(++index, m_playerGuid2);
|
||||
stmt.AddValue(++index, m_newRank);
|
||||
@@ -2883,7 +2883,7 @@ namespace Game.Guilds
|
||||
stmt.AddValue(index, m_guildId);
|
||||
stmt.AddValue(++index, m_guid);
|
||||
stmt.AddValue(++index, m_bankTabId);
|
||||
stmt.AddValue(++index, m_eventType);
|
||||
stmt.AddValue(++index, (byte)m_eventType);
|
||||
stmt.AddValue(++index, m_playerGuid);
|
||||
stmt.AddValue(++index, m_itemOrMoney);
|
||||
stmt.AddValue(++index, m_itemStackCount);
|
||||
@@ -2973,7 +2973,7 @@ namespace Game.Guilds
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GUILD_NEWS);
|
||||
stmt.AddValue(index, m_guildId);
|
||||
stmt.AddValue(++index, GetGUID());
|
||||
stmt.AddValue(++index, GetNewsType());
|
||||
stmt.AddValue(++index, (byte)GetNewsType());
|
||||
stmt.AddValue(++index, GetPlayerGuid().GetCounter());
|
||||
stmt.AddValue(++index, GetFlags());
|
||||
stmt.AddValue(++index, GetValue());
|
||||
@@ -3100,7 +3100,7 @@ namespace Game.Guilds
|
||||
stmt.AddValue(0, m_guildId);
|
||||
stmt.AddValue(1, m_rankId);
|
||||
stmt.AddValue(2, m_name);
|
||||
stmt.AddValue(3, m_rights);
|
||||
stmt.AddValue(3, (uint)m_rights);
|
||||
stmt.AddValue(4, m_bankMoneyPerDay);
|
||||
DB.Characters.ExecuteOrAppend(trans, stmt);
|
||||
}
|
||||
@@ -3124,7 +3124,7 @@ namespace Game.Guilds
|
||||
stmt.AddValue(0, m_guildId);
|
||||
stmt.AddValue(1, i);
|
||||
stmt.AddValue(2, m_rankId);
|
||||
stmt.AddValue(3, rightsAndSlots.GetRights());
|
||||
stmt.AddValue(3, (sbyte)rightsAndSlots.GetRights());
|
||||
stmt.AddValue(4, rightsAndSlots.GetSlots());
|
||||
trans.Append(stmt);
|
||||
}
|
||||
@@ -3155,7 +3155,7 @@ namespace Game.Guilds
|
||||
m_rights = rights;
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GUILD_RANK_RIGHTS);
|
||||
stmt.AddValue(0, m_rights);
|
||||
stmt.AddValue(0, (uint)m_rights);
|
||||
stmt.AddValue(1, m_rankId);
|
||||
stmt.AddValue(2, m_guildId);
|
||||
DB.Characters.Execute(stmt);
|
||||
@@ -3188,7 +3188,7 @@ namespace Game.Guilds
|
||||
stmt.AddValue(0, m_guildId);
|
||||
stmt.AddValue(1, rightsAndSlots.GetTabId());
|
||||
stmt.AddValue(2, m_rankId);
|
||||
stmt.AddValue(3, rightsAndSlots.GetRights());
|
||||
stmt.AddValue(3, (sbyte)rightsAndSlots.GetRights());
|
||||
stmt.AddValue(4, rightsAndSlots.GetSlots());
|
||||
DB.Characters.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -1252,7 +1252,7 @@ namespace Game
|
||||
// Update name and at_login flag in the db
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
||||
stmt.AddValue(0, renameInfo.NewName);
|
||||
stmt.AddValue(1, atLoginFlags);
|
||||
stmt.AddValue(1, (ushort)atLoginFlags);
|
||||
stmt.AddValue(2, lowGuid);
|
||||
trans.Append(stmt);
|
||||
|
||||
@@ -1467,7 +1467,7 @@ namespace Game
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_NAME_AT_LOGIN);
|
||||
stmt.AddValue(0, customizeInfo.CharName);
|
||||
stmt.AddValue(1, atLoginFlags);
|
||||
stmt.AddValue(1, (ushort)atLoginFlags);
|
||||
stmt.AddValue(2, lowGuid);
|
||||
trans.Append(stmt);
|
||||
|
||||
@@ -1794,7 +1794,7 @@ namespace Game
|
||||
// Race Change
|
||||
{
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_RACE);
|
||||
stmt.AddValue(0, factionChangeInfo.RaceID);
|
||||
stmt.AddValue(0, (byte)factionChangeInfo.RaceID);
|
||||
stmt.AddValue(1, lowGuid);
|
||||
|
||||
trans.Append(stmt);
|
||||
|
||||
@@ -345,8 +345,8 @@ namespace Game
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PET_SLOTS_DETAIL);
|
||||
stmt.AddValue(0, guid.GetCounter());
|
||||
stmt.AddValue(1, PetSaveMode.FirstStableSlot);
|
||||
stmt.AddValue(2, PetSaveMode.LastStableSlot);
|
||||
stmt.AddValue(1, (byte)PetSaveMode.FirstStableSlot);
|
||||
stmt.AddValue(2, (byte)PetSaveMode.LastStableSlot);
|
||||
|
||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(SendStablePetCallback, guid));
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ namespace Game
|
||||
stmt.AddValue(0, _player.GetGUID().GetCounter());
|
||||
stmt.AddValue(1, factionState.Id);
|
||||
stmt.AddValue(2, factionState.Standing);
|
||||
stmt.AddValue(3, factionState.Flags);
|
||||
stmt.AddValue(3, (ushort)factionState.Flags);
|
||||
trans.Append(stmt);
|
||||
|
||||
factionState.needSave = false;
|
||||
|
||||
@@ -527,7 +527,7 @@ namespace Game
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_ACCOUNT_DATA);
|
||||
stmt.AddValue(0, GetAccountId());
|
||||
stmt.AddValue(1, type);
|
||||
stmt.AddValue(1, (byte)type);
|
||||
stmt.AddValue(2, time);
|
||||
stmt.AddValue(3, data);
|
||||
DB.Characters.Execute(stmt);
|
||||
@@ -540,7 +540,7 @@ namespace Game
|
||||
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.REP_PLAYER_ACCOUNT_DATA);
|
||||
stmt.AddValue(0, m_GUIDLow);
|
||||
stmt.AddValue(1, type);
|
||||
stmt.AddValue(1, (byte)type);
|
||||
stmt.AddValue(2, time);
|
||||
stmt.AddValue(3, data);
|
||||
DB.Characters.Execute(stmt);
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace Game.SupportSystem
|
||||
stmt.AddValue(++idx, _pos.Z);
|
||||
stmt.AddValue(++idx, _facing);
|
||||
stmt.AddValue(++idx, _targetCharacterGuid.GetCounter());
|
||||
stmt.AddValue(++idx, _complaintType);
|
||||
stmt.AddValue(++idx, (byte)_complaintType);
|
||||
if (_chatLog.ReportLineIndex.HasValue)
|
||||
stmt.AddValue(++idx, _chatLog.ReportLineIndex.Value);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user