Core/Entities: Second part of required database changes for migrating guids to 128 bit - all fields storing lowguid must be extended to uint64
This commit is contained in:
@@ -358,7 +358,7 @@ DROP TABLE IF EXISTS `character_account_data`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_account_data` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`data` blob NOT NULL,
|
||||
@@ -383,7 +383,7 @@ DROP TABLE IF EXISTS `character_achievement`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_achievement` (
|
||||
`guid` int(10) unsigned NOT NULL,
|
||||
`guid` bigint(20) unsigned NOT NULL,
|
||||
`achievement` smallint(5) unsigned NOT NULL,
|
||||
`date` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`guid`,`achievement`)
|
||||
@@ -407,7 +407,7 @@ DROP TABLE IF EXISTS `character_achievement_progress`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_achievement_progress` (
|
||||
`guid` int(10) unsigned NOT NULL,
|
||||
`guid` bigint(20) unsigned NOT NULL,
|
||||
`criteria` smallint(5) unsigned NOT NULL,
|
||||
`counter` bigint(20) unsigned NOT NULL,
|
||||
`date` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -432,7 +432,7 @@ DROP TABLE IF EXISTS `character_action`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_action` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`spec` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`button` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`action` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -458,7 +458,7 @@ DROP TABLE IF EXISTS `character_arena_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_arena_stats` (
|
||||
`guid` int(10) NOT NULL,
|
||||
`guid` bigint(20) NOT NULL,
|
||||
`slot` tinyint(3) NOT NULL,
|
||||
`matchMakerRating` smallint(5) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`slot`)
|
||||
@@ -482,7 +482,7 @@ DROP TABLE IF EXISTS `character_aura`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_aura` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`caster_guid` binary(16) NOT NULL COMMENT 'Full Global Unique Identifier',
|
||||
`item_guid` binary(16) unsigned NOT NULL DEFAULT '0',
|
||||
`spell` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -519,7 +519,7 @@ DROP TABLE IF EXISTS `character_banned`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_banned` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`bandate` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`unbandate` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`bannedby` varchar(50) NOT NULL,
|
||||
@@ -546,7 +546,7 @@ DROP TABLE IF EXISTS `character_battleground_data`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_battleground_data` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`instanceId` int(10) unsigned NOT NULL COMMENT 'Instance Identifier',
|
||||
`team` smallint(5) unsigned NOT NULL,
|
||||
`joinX` float NOT NULL DEFAULT '0',
|
||||
@@ -578,7 +578,7 @@ DROP TABLE IF EXISTS `character_battleground_random`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_battleground_random` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`guid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -600,7 +600,7 @@ DROP TABLE IF EXISTS `character_cuf_profiles`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_cuf_profiles` (
|
||||
`guid` int(10) unsigned NOT NULL COMMENT 'Character Guid',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Guid',
|
||||
`id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-4)',
|
||||
`name` varchar(12) NOT NULL COMMENT 'Profile Name',
|
||||
`frameHeight` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Height',
|
||||
@@ -636,7 +636,7 @@ DROP TABLE IF EXISTS `character_currency`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_currency` (
|
||||
`guid` int(10) unsigned NOT NULL,
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`currency` smallint(5) unsigned NOT NULL,
|
||||
`total_count` int(10) unsigned NOT NULL,
|
||||
`week_count` int(10) unsigned NOT NULL,
|
||||
@@ -661,7 +661,7 @@ DROP TABLE IF EXISTS `character_declinedname`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `character_declinedname` (
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
|
||||
`genitive` varchar(15) NOT NULL DEFAULT '',
|
||||
`dative` varchar(15) NOT NULL DEFAULT '',
|
||||
`accusative` varchar(15) NOT NULL DEFAULT '',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
ALTER TABLE `character_account_data` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_achievement` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_achievement_progress` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_action` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_arena_stats` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_aura` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_banned` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_battleground_data` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_battleground_random` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_cuf_profiles` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_currency` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `character_declinedname` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
|
||||
@@ -173,9 +173,6 @@ struct ScriptedAI : public CreatureAI
|
||||
// Called when spell hits a target
|
||||
void SpellHitTarget(Unit* /*target*/, SpellInfo const* /*spell*/) override { }
|
||||
|
||||
//Called at waypoint reached or PointMovement end
|
||||
void MovementInform(uint32 /*type*/, uint32 /*id*/) override { }
|
||||
|
||||
// Called when AI is temporarily replaced or put back when possess is applied or removed
|
||||
void OnPossess(bool /*apply*/) { }
|
||||
|
||||
|
||||
@@ -514,11 +514,11 @@ void AchievementMgr<Player>::DeleteFromDB(ObjectGuid guid)
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
@@ -557,11 +557,11 @@ void AchievementMgr<Player>::SaveToDB(SQLTransaction& trans)
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||
stmt->setUInt16(0, iter->first);
|
||||
stmt->setUInt32(1, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt64(1, GetOwner()->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
stmt->setUInt32(2, uint32(iter->second.date));
|
||||
trans->Append(stmt);
|
||||
@@ -578,14 +578,14 @@ void AchievementMgr<Player>::SaveToDB(SQLTransaction& trans)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
trans->Append(stmt);
|
||||
|
||||
if (iter->second.counter)
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT_PROGRESS);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
stmt->setUInt32(2, iter->second.counter);
|
||||
stmt->setUInt32(3, uint32(iter->second.date));
|
||||
|
||||
@@ -475,7 +475,7 @@ void AuctionHouseObject::Update()
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
///- Either cancel the auction if there was no bidder
|
||||
if (auction->bidder == 0)
|
||||
if (!auction->bidder)
|
||||
{
|
||||
sAuctionMgr->SendAuctionExpiredMail(auction, trans);
|
||||
sScriptMgr->OnAuctionExpire(this, auction);
|
||||
|
||||
@@ -64,16 +64,16 @@ enum MailAuctionAnswers
|
||||
struct AuctionEntry
|
||||
{
|
||||
uint32 Id;
|
||||
uint64 auctioneer; // creature low guid
|
||||
uint64 itemGUIDLow;
|
||||
ObjectGuid::LowType auctioneer; // creature low guid
|
||||
ObjectGuid::LowType itemGUIDLow;
|
||||
uint32 itemEntry;
|
||||
uint32 itemCount;
|
||||
uint64 owner;
|
||||
ObjectGuid::LowType owner;
|
||||
uint32 startbid; //maybe useless
|
||||
uint32 bid;
|
||||
uint32 buyout;
|
||||
time_t expire_time;
|
||||
uint64 bidder;
|
||||
ObjectGuid::LowType bidder;
|
||||
uint32 deposit; //deposit can be calculated only when creating auction
|
||||
AuctionHouseEntry const* auctionHouseEntry; // in AuctionHouse.dbc
|
||||
uint32 factionTemplateId;
|
||||
@@ -145,12 +145,12 @@ class AuctionHouseMgr
|
||||
return &instance;
|
||||
}
|
||||
|
||||
typedef std::unordered_map<uint64, Item*> ItemMap;
|
||||
typedef std::unordered_map<ObjectGuid::LowType, Item*> ItemMap;
|
||||
|
||||
AuctionHouseObject* GetAuctionsMap(uint32 factionTemplateId);
|
||||
AuctionHouseObject* GetBidsMap(uint32 factionTemplateId);
|
||||
|
||||
Item* GetAItem(uint64 id)
|
||||
Item* GetAItem(ObjectGuid::LowType id)
|
||||
{
|
||||
ItemMap::const_iterator itr = mAitems.find(id);
|
||||
if (itr != mAitems.end())
|
||||
|
||||
@@ -63,7 +63,7 @@ bool ArenaTeam::Create(ObjectGuid captainGuid, uint8 type, std::string const& te
|
||||
EmblemColor = emblemColor;
|
||||
BorderStyle = borderStyle;
|
||||
BorderColor = borderColor;
|
||||
uint64 captainLowGuid = captainGuid.GetCounter();
|
||||
ObjectGuid::LowType captainLowGuid = captainGuid.GetCounter();
|
||||
|
||||
// Save arena team to db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
|
||||
@@ -134,7 +134,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid)
|
||||
|
||||
// Try to get player's match maker rating from db and fall back to config setting if not found
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);
|
||||
stmt->setUInt32(0, playerGuid.GetCounter());
|
||||
stmt->setUInt64(0, playerGuid.GetCounter());
|
||||
stmt->setUInt8(1, GetSlot());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class ObjectGuid
|
||||
return HighGuid((temp == HIGHGUID_CORPSE || temp == HIGHGUID_AREATRIGGER) ? temp : ((temp >> 4) & 0x00000FFF));
|
||||
}
|
||||
uint32 GetEntry() const { return HasEntry() ? uint32((_low >> 32) & UI64LIT(0x00000000000FFFFF)) : 0; }
|
||||
uint32 GetCounter() const
|
||||
LowType GetCounter() const
|
||||
{
|
||||
return uint32(_low & UI64LIT(0x00000000FFFFFFFF));
|
||||
}
|
||||
@@ -290,11 +290,12 @@ namespace std
|
||||
template<>
|
||||
struct hash<ObjectGuid>
|
||||
{
|
||||
public:
|
||||
size_t operator()(ObjectGuid const& key) const
|
||||
{
|
||||
return boost::hash_range(reinterpret_cast<uint64 const*>(&key), reinterpret_cast<uint64 const*>(&key) + 2);
|
||||
}
|
||||
public:
|
||||
size_t operator()(ObjectGuid const& key) const
|
||||
{
|
||||
return boost::hash_range(reinterpret_cast<uint64 const*>(&key), reinterpret_cast<uint64 const*>(&key) + 2);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4649,7 +4649,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
updateRealmChars = false;
|
||||
|
||||
// Convert guid to low GUID for CharacterNameData, but also other methods on success
|
||||
uint32 guid = playerguid.GetCounter();
|
||||
ObjectGuid::LowType guid = playerguid.GetCounter();
|
||||
uint32 charDelete_method = sWorld->getIntConfig(CONFIG_CHARDELETE_METHOD);
|
||||
|
||||
if (deleteFinally)
|
||||
@@ -4821,19 +4821,19 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GIFT);
|
||||
@@ -4905,7 +4905,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENTS);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS);
|
||||
@@ -4926,7 +4926,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS);
|
||||
@@ -19698,7 +19698,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
{
|
||||
case ACTIONBUTTON_NEW:
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, GetActiveSpec());
|
||||
stmt->setUInt8(2, itr->first);
|
||||
stmt->setUInt32(3, itr->second.GetAction());
|
||||
@@ -19712,7 +19712,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACTION);
|
||||
stmt->setUInt32(0, itr->second.GetAction());
|
||||
stmt->setUInt8(1, uint8(itr->second.GetType()));
|
||||
stmt->setUInt32(2, GetGUID().GetCounter());
|
||||
stmt->setUInt64(2, GetGUID().GetCounter());
|
||||
stmt->setUInt8(3, itr->first);
|
||||
stmt->setUInt8(4, GetActiveSpec());
|
||||
trans->Append(stmt);
|
||||
@@ -19722,7 +19722,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
break;
|
||||
case ACTIONBUTTON_DELETED:
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, itr->first);
|
||||
stmt->setUInt8(2, GetActiveSpec());
|
||||
trans->Append(stmt);
|
||||
@@ -19739,7 +19739,7 @@ void Player::_SaveActions(SQLTransaction& trans)
|
||||
void Player::_SaveAuras(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr)
|
||||
@@ -19772,7 +19772,7 @@ void Player::_SaveAuras(SQLTransaction& trans)
|
||||
|
||||
uint8 index = 0;
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA);
|
||||
stmt->setUInt32(index++, GetGUID().GetCounter());
|
||||
stmt->setUInt64(index++, GetGUID().GetCounter());
|
||||
stmt->setBinary(index++, itr->second->GetCasterGUID().GetRawValue());
|
||||
stmt->setBinary(index++, itr->second->GetCastItemGUID().GetRawValue());
|
||||
stmt->setUInt32(index++, itr->second->GetId());
|
||||
@@ -19950,14 +19950,14 @@ void Player::_SaveCUFProfiles(SQLTransaction& trans)
|
||||
{
|
||||
// DELETE FROM character_cuf_profiles WHERE guid = ? and id = ?
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_CUF_PROFILES);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
// REPLACE INTO character_cuf_profiles (guid, id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_CUF_PROFILES);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, i);
|
||||
stmt->setString(2, _CUFProfiles[i]->ProfileName);
|
||||
stmt->setUInt16(3, _CUFProfiles[i]->FrameHeight);
|
||||
@@ -26535,11 +26535,11 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
|
||||
void Player::_SaveBGData(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
/* guid, bgInstanceID, bgTeam, x, y, z, o, map, taxi[0], taxi[1], mountSpell */
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_BGDATA);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt32(1, m_bgData.bgInstanceID);
|
||||
stmt->setUInt16(2, m_bgData.bgTeam);
|
||||
stmt->setFloat (3, m_bgData.joinPos.GetPositionX());
|
||||
@@ -26755,7 +26755,7 @@ void Player::UpdateSpecCount(uint8 count)
|
||||
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr)
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, 1);
|
||||
stmt->setUInt8(2, itr->first);
|
||||
stmt->setUInt32(3, itr->second.GetAction());
|
||||
@@ -26770,7 +26770,7 @@ void Player::UpdateSpecCount(uint8 count)
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC);
|
||||
stmt->setUInt8(0, GetActiveSpec());
|
||||
stmt->setUInt32(1, GetGUID().GetCounter());
|
||||
stmt->setUInt64(1, GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
}
|
||||
@@ -26936,7 +26936,7 @@ void Player::ActivateSpec(uint8 spec)
|
||||
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
stmt->setUInt8(1, GetActiveSpec());
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
_LoadActions(result);
|
||||
@@ -27286,7 +27286,7 @@ void Player::SetRandomWinner(bool isWinner)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BATTLEGROUND_RANDOM);
|
||||
|
||||
stmt->setUInt32(0, GetGUID().GetCounter());
|
||||
stmt->setUInt64(0, GetGUID().GetCounter());
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData)
|
||||
|
||||
if (price < auction->buyout || auction->buyout == 0)
|
||||
{
|
||||
if (auction->bidder > 0)
|
||||
if (auction->bidder)
|
||||
{
|
||||
if (auction->bidder == player->GetGUID().GetCounter())
|
||||
player->ModifyMoney(-int64(price - auction->bid));
|
||||
@@ -568,7 +568,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData)
|
||||
Item* pItem = sAuctionMgr->GetAItem(auction->itemGUIDLow);
|
||||
if (pItem)
|
||||
{
|
||||
if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid
|
||||
if (auction->bidder) // If we have a bidder, we have to send him the money he paid
|
||||
{
|
||||
uint32 auctionCut = auction->GetAuctionCut();
|
||||
if (!player->HasEnoughMoney((uint64)auctionCut)) //player doesn't have enough money, maybe message needed
|
||||
|
||||
@@ -72,7 +72,7 @@ void WorldSession::SendBattleGroundList(ObjectGuid guid, BattlegroundTypeId bgTy
|
||||
|
||||
void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
uint32 bgTypeId_;
|
||||
ObjectGuid::LowType bgTypeId_;
|
||||
uint32 instanceId;
|
||||
uint8 asGroup;
|
||||
bool isPremade = false;
|
||||
|
||||
@@ -67,7 +67,7 @@ bool LoginQueryHolder::Initialize()
|
||||
SetSize(MAX_PLAYER_LOGIN_QUERY);
|
||||
|
||||
bool res = true;
|
||||
uint64 lowGuid = m_guid.GetCounter();
|
||||
ObjectGuid::LowType lowGuid = m_guid.GetCounter();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
@@ -82,7 +82,7 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURAS);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_AURAS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELL);
|
||||
@@ -122,7 +122,7 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_VOID_STORAGE, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ACTIONS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILCOUNT);
|
||||
@@ -149,7 +149,7 @@ bool LoginQueryHolder::Initialize()
|
||||
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_DECLINED_NAMES, stmt);
|
||||
}
|
||||
|
||||
@@ -162,11 +162,11 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ARENA_INFO, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ACHIEVEMENTS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_CRITERIA_PROGRESS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS);
|
||||
@@ -174,11 +174,11 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_EQUIPMENT_SETS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUF_PROFILES);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_BGDATA);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BG_DATA, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GLYPHS);
|
||||
@@ -190,7 +190,7 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_TALENTS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SKILLS);
|
||||
@@ -198,11 +198,11 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SKILLS, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_RANDOMBG);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_RANDOM_BG, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_BANNED);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BANNED, stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUSREW);
|
||||
@@ -1235,22 +1235,21 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guidLow = fields[0].GetUInt32();
|
||||
std::string oldName = fields[1].GetString();
|
||||
std::string oldName = fields[0].GetString();
|
||||
|
||||
// Update name and at_login flag in the db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_NAME);
|
||||
|
||||
stmt->setString(0, renameInfo->Name);
|
||||
stmt->setUInt16(1, AT_LOGIN_RENAME);
|
||||
stmt->setUInt32(2, guidLow);
|
||||
stmt->setUInt32(2, renameInfo->Guid.GetCounter());
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
// Removed declined name from db
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_DECLINED_NAME);
|
||||
|
||||
stmt->setUInt32(0, guidLow);
|
||||
stmt->setUInt64(0, renameInfo->Guid.GetCounter());
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -1321,11 +1320,11 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData)
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
|
||||
for (uint8 i = 0; i < 5; i++)
|
||||
stmt->setString(i+1, declinedname.name[i]);
|
||||
@@ -1518,7 +1517,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_DECLINED_NAME);
|
||||
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
|
||||
stmt->setUInt64(0, customizeInfo.Guid.GetCounter());
|
||||
|
||||
trans->Append(stmt);
|
||||
|
||||
@@ -1670,7 +1669,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
>> factionChangeInfo.Face
|
||||
>> factionChangeInfo.Race;
|
||||
|
||||
uint32 lowGuid = factionChangeInfo.Guid.GetCounter();
|
||||
ObjectGuid::LowType lowGuid = factionChangeInfo.Guid.GetCounter();
|
||||
|
||||
// get the players old (at this moment current) race
|
||||
CharacterNameData const* nameData = sWorld->GetCharacterNameData(factionChangeInfo.Guid);
|
||||
@@ -1770,7 +1769,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
trans->Append(stmt);
|
||||
|
||||
sWorld->UpdateCharacterNameData(factionChangeInfo.Guid, factionChangeInfo.Name, factionChangeInfo.Gender, factionChangeInfo.Race);
|
||||
@@ -1974,13 +1973,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||
stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde));
|
||||
stmt->setUInt32(1, lowGuid);
|
||||
stmt->setUInt64(1, lowGuid);
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde));
|
||||
stmt->setUInt16(1, uint16(team == TEAM_ALLIANCE ? achiev_horde : achiev_alliance));
|
||||
stmt->setUInt32(2, lowGuid);
|
||||
stmt->setUInt64(2, lowGuid);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -526,8 +526,8 @@ void WorldSession::HandleRequestCemeteryList(WorldPacket& /*recvPacket*/)
|
||||
|
||||
if (graveyardIds.empty())
|
||||
{
|
||||
TC_LOG_DEBUG("network", "No graveyards found for zone %u for player %u (team %u) in CMSG_REQUEST_CEMETERY_LIST",
|
||||
zoneId, m_GUIDLow, team);
|
||||
TC_LOG_DEBUG("network", "No graveyards found for zone %u for %s (team %u) in CMSG_REQUEST_CEMETERY_LIST",
|
||||
zoneId, _player->GetGUID().ToString().c_str(), team);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ void WorldSession::HandleQuestNPCQuery(WorldPacket& recvData)
|
||||
|
||||
if (!sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Unknown quest %u in CMSG_QUEST_NPC_QUERY by player %u", questId, m_GUIDLow);
|
||||
TC_LOG_DEBUG("network", "WORLD: Unknown quest %u in CMSG_QUEST_NPC_QUERY by %s", questId, _player->GetGUID().ToString().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ MailSender::MailSender(Player* sender)
|
||||
|
||||
MailReceiver::MailReceiver(Player* receiver) : m_receiver(receiver), m_receiver_lowguid(receiver->GetGUID().GetCounter()) { }
|
||||
|
||||
MailReceiver::MailReceiver(Player* receiver, uint64 receiver_lowguid) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid)
|
||||
MailReceiver::MailReceiver(Player* receiver, ObjectGuid::LowType receiver_lowguid) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid)
|
||||
{
|
||||
ASSERT(!receiver || receiver->GetGUID().GetCounter() == receiver_lowguid);
|
||||
}
|
||||
|
||||
@@ -102,15 +102,15 @@ class MailSender
|
||||
class MailReceiver
|
||||
{
|
||||
public: // Constructors
|
||||
explicit MailReceiver(uint64 receiver_lowguid) : m_receiver(NULL), m_receiver_lowguid(receiver_lowguid) { }
|
||||
explicit MailReceiver(ObjectGuid::LowType receiver_lowguid) : m_receiver(NULL), m_receiver_lowguid(receiver_lowguid) { }
|
||||
MailReceiver(Player* receiver);
|
||||
MailReceiver(Player* receiver, uint64 receiver_lowguid);
|
||||
MailReceiver(Player* receiver, ObjectGuid::LowType receiver_lowguid);
|
||||
public: // Accessors
|
||||
Player* GetPlayer() const { return m_receiver; }
|
||||
uint32 GetPlayerGUIDLow() const { return m_receiver_lowguid; }
|
||||
ObjectGuid::LowType GetPlayerGUIDLow() const { return m_receiver_lowguid; }
|
||||
private:
|
||||
Player* m_receiver;
|
||||
uint64 m_receiver_lowguid;
|
||||
ObjectGuid::LowType m_receiver_lowguid;
|
||||
};
|
||||
|
||||
class MailDraft
|
||||
|
||||
@@ -146,7 +146,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
|
||||
}
|
||||
|
||||
if (!creature)
|
||||
TC_LOG_ERROR("scripts", "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
|
||||
TC_LOG_ERROR("scripts", "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.",
|
||||
scriptInfo->GetDebugInfo().c_str(),
|
||||
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(),
|
||||
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str());
|
||||
|
||||
@@ -89,7 +89,7 @@ enum Opcodes
|
||||
CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x0000,
|
||||
CMSG_BATTLEFIELD_STATUS = 0x0000,
|
||||
CMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000,
|
||||
CMSG_BATTLEMASTER_JOIN = 0x0000,
|
||||
CMSG_BATTLEMASTER_JOIN = 0x0327,
|
||||
CMSG_BATTLEMASTER_JOIN_ARENA = 0x0000,
|
||||
CMSG_BATTLEMASTER_JOIN_RATED = 0x0000,
|
||||
CMSG_BATTLEMASTER_HELLO = 0x0000,
|
||||
|
||||
@@ -750,12 +750,14 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask)
|
||||
|
||||
void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string const& data)
|
||||
{
|
||||
uint32 id = 0;
|
||||
uint32 index = 0;
|
||||
if ((1 << type) & GLOBAL_CACHE_MASK)
|
||||
{
|
||||
id = GetAccountId();
|
||||
index = CHAR_REP_ACCOUNT_DATA;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_ACCOUNT_DATA);
|
||||
stmt->setUInt32(0, GetAccountId());
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
stmt->setString(3, data);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,16 +765,14 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
|
||||
if (!m_GUIDLow)
|
||||
return;
|
||||
|
||||
id = m_GUIDLow;
|
||||
index = CHAR_REP_PLAYER_ACCOUNT_DATA;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_ACCOUNT_DATA);
|
||||
stmt->setUInt64(0, m_GUIDLow);
|
||||
stmt->setUInt8(1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
stmt->setString(3, data);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index);
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt8 (1, type);
|
||||
stmt->setUInt32(2, uint32(tm));
|
||||
stmt->setString(3, data);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
m_accountData[type].Time = tm;
|
||||
m_accountData[type].Data = data;
|
||||
|
||||
@@ -1094,7 +1094,7 @@ class WorldSession
|
||||
// characters who failed on Player::BuildEnumData shouldn't login
|
||||
GuidSet _legitCharacters;
|
||||
|
||||
uint32 m_GUIDLow; // set logined or recently logout player (while m_playerRecentlyLogout set)
|
||||
ObjectGuid::LowType m_GUIDLow; // set logined or recently logout player (while m_playerRecentlyLogout set)
|
||||
Player* _player;
|
||||
std::shared_ptr<WorldSocket> m_Socket;
|
||||
std::string m_Address; // Current Remote Address
|
||||
|
||||
@@ -2508,32 +2508,27 @@ bool World::RemoveBanAccount(BanMode mode, std::string const& nameOrIP)
|
||||
BanReturn World::BanCharacter(std::string const& name, std::string const& duration, std::string const& reason, std::string const& author)
|
||||
{
|
||||
Player* pBanned = ObjectAccessor::FindConnectedPlayerByName(name);
|
||||
uint32 guid = 0;
|
||||
ObjectGuid guid;
|
||||
|
||||
uint32 duration_secs = TimeStringToSecs(duration);
|
||||
|
||||
/// Pick a player to ban if not online
|
||||
if (!pBanned)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!resultCharacter)
|
||||
guid = sObjectMgr->GetPlayerGUIDByName(name);
|
||||
if (guid.IsEmpty())
|
||||
return BAN_NOTFOUND; // Nobody to ban
|
||||
|
||||
guid = (*resultCharacter)[0].GetUInt32();
|
||||
}
|
||||
else
|
||||
guid = pBanned->GetGUID().GetCounter();
|
||||
guid = pBanned->GetGUID();
|
||||
|
||||
// make sure there is only one active ban
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_BAN);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
stmt->setUInt32(1, duration_secs);
|
||||
stmt->setString(2, author);
|
||||
stmt->setString(3, reason);
|
||||
@@ -2549,28 +2544,20 @@ BanReturn World::BanCharacter(std::string const& name, std::string const& durati
|
||||
bool World::RemoveBanCharacter(std::string const& name)
|
||||
{
|
||||
Player* pBanned = ObjectAccessor::FindConnectedPlayerByName(name);
|
||||
uint32 guid = 0;
|
||||
ObjectGuid guid;
|
||||
|
||||
/// Pick a player to ban if not online
|
||||
if (!pBanned)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!resultCharacter)
|
||||
return false;
|
||||
|
||||
guid = (*resultCharacter)[0].GetUInt32();
|
||||
guid = sObjectMgr->GetPlayerGUIDByName(name);
|
||||
if (guid.IsEmpty())
|
||||
return false; // Nobody to ban
|
||||
}
|
||||
else
|
||||
guid = pBanned->GetGUID().GetCounter();
|
||||
|
||||
if (!guid)
|
||||
return false;
|
||||
guid = pBanned->GetGUID();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
|
||||
stmt->setUInt32(0, guid);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -300,28 +300,23 @@ public:
|
||||
return false;
|
||||
|
||||
Player* target = ObjectAccessor::FindPlayerByName(args);
|
||||
uint32 targetGuid = 0;
|
||||
ObjectGuid targetGuid;
|
||||
std::string name(args);
|
||||
|
||||
if (!target)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!resultCharacter)
|
||||
targetGuid = sObjectMgr->GetPlayerGUIDByName(name);
|
||||
if (targetGuid.IsEmpty())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_BANINFO_NOCHARACTER);
|
||||
return false;
|
||||
}
|
||||
|
||||
targetGuid = (*resultCharacter)[0].GetUInt32();
|
||||
}
|
||||
else
|
||||
targetGuid = target->GetGUID().GetCounter();
|
||||
targetGuid = target->GetGUID();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
|
||||
stmt->setUInt32(0, targetGuid);
|
||||
stmt->setUInt64(0, targetGuid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (!result)
|
||||
{
|
||||
@@ -521,7 +516,7 @@ public:
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
|
||||
stmt2->setUInt32(0, fields[0].GetUInt32());
|
||||
stmt2->setUInt64(0, fields[0].GetUInt64());
|
||||
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
|
||||
if (banResult)
|
||||
handler->PSendSysMessage("%s", (*banResult)[0].GetCString());
|
||||
@@ -543,7 +538,7 @@ public:
|
||||
std::string char_name = fields[1].GetString();
|
||||
|
||||
PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
|
||||
stmt2->setUInt32(0, fields[0].GetUInt32());
|
||||
stmt2->setUInt64(0, fields[0].GetUInt64());
|
||||
PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
|
||||
if (banInfo)
|
||||
{
|
||||
|
||||
@@ -368,7 +368,7 @@ public:
|
||||
|
||||
// Remove declined name from db
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_DECLINED_NAME);
|
||||
stmt->setUInt32(0, targetGuid.GetCounter());
|
||||
stmt->setUInt64(0, targetGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
if (target)
|
||||
|
||||
@@ -1437,7 +1437,7 @@ public:
|
||||
// Account data print variables
|
||||
std::string userName = handler->GetTrinityString(LANG_ERROR);
|
||||
uint32 accId = 0;
|
||||
uint32 lowguid = targetGuid.GetCounter();
|
||||
ObjectGuid::LowType lowguid = targetGuid.GetCounter();
|
||||
std::string eMail = handler->GetTrinityString(LANG_ERROR);
|
||||
std::string regMail = handler->GetTrinityString(LANG_ERROR);
|
||||
uint32 security = 0;
|
||||
@@ -1603,7 +1603,7 @@ public:
|
||||
{
|
||||
banType = handler->GetTrinityString(LANG_CHARACTER);
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt64(0, lowguid);
|
||||
result2 = CharacterDatabase.Query(stmt);
|
||||
}
|
||||
|
||||
@@ -1615,8 +1615,6 @@ public:
|
||||
banReason = fields[3].GetString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Can be used to query data from Characters database
|
||||
stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
|
||||
stmt2->setUInt32(0, lowguid);
|
||||
@@ -2436,22 +2434,16 @@ public:
|
||||
if (targetName)
|
||||
{
|
||||
// Check for offline players
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
|
||||
stmt->setString(0, name);
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
ObjectGuid guid = sObjectMgr->GetPlayerGUIDByName(name);
|
||||
if (guid.IsEmpty())
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
// If player found: delete his freeze aura
|
||||
Field* fields = result->Fetch();
|
||||
uint32 lowGuid = fields[0].GetUInt32();
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
stmt->setUInt64(0, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
|
||||
|
||||
@@ -51,7 +51,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"cb.guid, c.slot, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "
|
||||
"LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
|
||||
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_FREE_NAME, "SELECT name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH);
|
||||
PrepareStatement(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH);
|
||||
@@ -457,7 +457,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, "SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid = ? AND type = ? LIMIT 1", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_MAIL, "SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = ? ORDER BY id DESC", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(CHAR_SEL_MAIL_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH);
|
||||
|
||||
@@ -399,7 +399,6 @@ enum CharacterDatabaseStatements
|
||||
CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID,
|
||||
CHAR_SEL_MAIL,
|
||||
CHAR_SEL_CHAR_PLAYERBYTES2,
|
||||
CHAR_SEL_CHAR_GUID_BY_NAME,
|
||||
CHAR_DEL_CHAR_AURA_FROZEN,
|
||||
CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM,
|
||||
CHAR_SEL_MAIL_COUNT_ITEM,
|
||||
|
||||
Reference in New Issue
Block a user