diff options
24 files changed, 186 insertions, 169 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 94dfc7adf8e..c6496deef11 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1098,7 +1098,7 @@ DROP TABLE IF EXISTS `character_reputation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_reputation` ( - `guid` bigint(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `faction` smallint(5) unsigned NOT NULL DEFAULT '0', `standing` int(11) NOT NULL DEFAULT '0', `flags` smallint(5) unsigned NOT NULL DEFAULT '0', @@ -1148,8 +1148,8 @@ DROP TABLE IF EXISTS `character_social`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_social` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier', - `friend` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Friend Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier', + `friend` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Friend Global Unique Identifier', `flags` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Friend Flags', `note` varchar(48) NOT NULL DEFAULT '' COMMENT 'Friend Note', PRIMARY KEY (`guid`,`friend`,`flags`), @@ -1174,7 +1174,7 @@ DROP TABLE IF EXISTS `character_spell`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_spell` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `spell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier', `active` tinyint(3) unsigned NOT NULL DEFAULT '1', `disabled` tinyint(3) unsigned NOT NULL DEFAULT '0', @@ -1199,7 +1199,7 @@ DROP TABLE IF EXISTS `character_spell_cooldown`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_spell_cooldown` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part', `spell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier', `item` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Item Identifier', `time` int(10) unsigned NOT NULL DEFAULT '0', @@ -1224,7 +1224,7 @@ DROP TABLE IF EXISTS `character_stats`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_stats` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part', `maxhealth` int(10) unsigned NOT NULL DEFAULT '0', `maxpower1` int(10) unsigned NOT NULL DEFAULT '0', `maxpower2` int(10) unsigned NOT NULL DEFAULT '0', @@ -1274,7 +1274,7 @@ DROP TABLE IF EXISTS `character_talent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_talent` ( - `guid` int(10) unsigned NOT NULL, + `guid` bigint(20) unsigned NOT NULL, `spell` mediumint(8) unsigned NOT NULL, `spec` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`,`spell`,`spec`) @@ -1299,10 +1299,10 @@ DROP TABLE IF EXISTS `character_void_storage`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_void_storage` ( `itemId` bigint(20) unsigned NOT NULL, - `playerGuid` int(10) unsigned NOT NULL, + `playerGuid` bigint(20) unsigned NOT NULL, `itemEntry` mediumint(8) unsigned NOT NULL, `slot` tinyint(3) unsigned NOT NULL, - `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', + `creatorGuid` bigint(20) unsigned NOT NULL DEFAULT '0', `randomProperty` int(10) unsigned NOT NULL DEFAULT '0', `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`itemId`), @@ -1328,7 +1328,7 @@ DROP TABLE IF EXISTS `characters`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `characters` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `account` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier', `name` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `slot` tinyint(3) unsigned NOT NULL DEFAULT '0', @@ -1363,7 +1363,7 @@ CREATE TABLE `characters` ( `trans_y` float NOT NULL DEFAULT '0', `trans_z` float NOT NULL DEFAULT '0', `trans_o` float NOT NULL DEFAULT '0', - `transguid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `transguid` bigint(20) unsigned NOT NULL DEFAULT '0', `extra_flags` smallint(5) unsigned NOT NULL DEFAULT '0', `stable_slots` tinyint(3) unsigned NOT NULL DEFAULT '0', `at_login` smallint(5) unsigned NOT NULL DEFAULT '0', @@ -1417,8 +1417,8 @@ DROP TABLE IF EXISTS `corpse`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `corpse` ( - `corpseGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier', + `corpseGuid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier', `posX` float NOT NULL DEFAULT '0', `posY` float NOT NULL DEFAULT '0', `posZ` float NOT NULL DEFAULT '0', @@ -1585,7 +1585,7 @@ DROP TABLE IF EXISTS `gm_surveys`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `gm_surveys` ( `surveyId` int(10) unsigned NOT NULL AUTO_INCREMENT, - `guid` int(10) unsigned NOT NULL DEFAULT '0', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0', `mainSurvey` int(10) unsigned NOT NULL DEFAULT '0', `overallComment` longtext NOT NULL, `createTime` int(10) unsigned NOT NULL DEFAULT '0', @@ -1611,7 +1611,7 @@ DROP TABLE IF EXISTS `gm_tickets`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `gm_tickets` ( `ticketId` int(10) unsigned NOT NULL AUTO_INCREMENT, - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier of ticket creator', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier of ticket creator', `name` varchar(12) NOT NULL COMMENT 'Name of ticket creator', `message` text NOT NULL, `createTime` int(10) unsigned NOT NULL DEFAULT '0', @@ -1620,8 +1620,8 @@ CREATE TABLE `gm_tickets` ( `posY` float NOT NULL DEFAULT '0', `posZ` float NOT NULL DEFAULT '0', `lastModifiedTime` int(10) unsigned NOT NULL DEFAULT '0', - `closedBy` int(10) NOT NULL DEFAULT '0', - `assignedTo` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'GUID of admin to whom ticket is assigned', + `closedBy` bigint(20) NOT NULL DEFAULT '0', + `assignedTo` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'GUID of admin to whom ticket is assigned', `comment` text NOT NULL, `response` text NOT NULL, `completed` tinyint(3) unsigned NOT NULL DEFAULT '0', diff --git a/sql/updates/characters/2014_10_24_00_characters.sql b/sql/updates/characters/2014_10_24_00_characters.sql new file mode 100644 index 00000000000..099c699367c --- /dev/null +++ b/sql/updates/characters/2014_10_24_00_characters.sql @@ -0,0 +1,16 @@ +ALTER TABLE `character_social` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_social` CHANGE `friend` `friend` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_spell` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_spell_cooldown` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_stats` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_talent` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_void_storage` CHANGE `playerGuid` `playerGuid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_void_storage` CHANGE `creatorGuid` `creatorGuid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `corpse` CHANGE `corpseGuid` `corpseGuid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `corpse` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `gm_surveys` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `gm_tickets` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `gm_tickets` CHANGE `closedBy` `closedBy` BIGINT(20) NOT NULL DEFAULT '0'; +ALTER TABLE `gm_tickets` CHANGE `assignedTo` `assignedTo` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `characters` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `characters` CHANGE `transguid` `transguid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2014_10_24_02_world.sql b/sql/updates/world/2014_10_24_02_world.sql new file mode 100644 index 00000000000..f0ff963de81 --- /dev/null +++ b/sql/updates/world/2014_10_24_02_world.sql @@ -0,0 +1,2 @@ +UPDATE `trinity_string` SET `content_default`=' %s (%s)' WHERE `entry`=329; +UPDATE `trinity_string` SET `content_default`='%s - owner: %s (%s account: %u) %s' WHERE `entry`=510; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 4abcf35fe57..9e632e64a82 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -81,7 +81,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId) { do { - ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt64()); // Kick if player is online if (Player* p = ObjectAccessor::FindConnectedPlayer(guid)) diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 562e2f40c80..e0200c6a9e8 100644 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -107,7 +107,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid) // 0 1 // SELECT name, class FROM characters WHERE guid = ? PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_CLASS); - stmt->setUInt32(0, playerGuid.GetCounter()); + stmt->setUInt64(0, playerGuid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index c7b199ba353..77399c5bbb9 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -103,8 +103,8 @@ void Corpse::SaveToDB() uint16 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE); - stmt->setUInt32(index++, GetGUID().GetCounter()); // corpseGuid - stmt->setUInt32(index++, GetOwnerGUID().GetCounter()); // guid + stmt->setUInt64(index++, GetGUID().GetCounter()); // corpseGuid + stmt->setUInt64(index++, GetOwnerGUID().GetCounter()); // guid stmt->setFloat (index++, GetPositionX()); // posX stmt->setFloat (index++, GetPositionY()); // posY stmt->setFloat (index++, GetPositionZ()); // posZ @@ -146,13 +146,13 @@ void Corpse::DeleteFromDB(SQLTransaction& trans) { // Only specific bones stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSE); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); } else { // all corpses (not bones) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_CORPSES); - stmt->setUInt32(0, GetOwnerGUID().GetCounter()); + stmt->setUInt64(0, GetOwnerGUID().GetCounter()); } trans->Append(stmt); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 01639630c08..b770d92367e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1963,7 +1963,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer) Field* fields = result->Fetch(); - ObjectGuid guid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + ObjectGuid guid(HIGHGUID_PLAYER, fields[0].GetUInt64()); std::string name = fields[1].GetString(); uint8 playerRace = fields[2].GetUInt8(); uint8 playerClass = fields[3].GetUInt8(); @@ -4304,7 +4304,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) void Player::_SaveSpellCooldowns(SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); time_t curTime = time(NULL); @@ -4801,14 +4801,14 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe // Delete char from social list of online chars stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_SOCIAL); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); PreparedQueryResult resultFriends = CharacterDatabase.Query(stmt); if (resultFriends) { do { - if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, (*resultFriends)[0].GetUInt32()))) + if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, (*resultFriends)[0].GetUInt64()))) { pFriend->GetSocial()->RemoveFromSocialList(playerguid, false); sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, playerguid, false); @@ -4817,7 +4817,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe } stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); @@ -4865,15 +4865,15 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE_BY_OWNER); @@ -4881,11 +4881,11 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); @@ -4909,7 +4909,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_EQUIPMENTSETS); @@ -4950,7 +4950,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILLS); @@ -4965,7 +4965,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_DELETE_INFO); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); CharacterDatabase.Execute(stmt); break; @@ -5016,7 +5016,7 @@ void Player::DeleteOldCharacters(uint32 keepDays) do { Field* fields = result->Fetch(); - Player::DeleteFromDB(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()), fields[1].GetUInt32(), true, true); + Player::DeleteFromDB(ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()), fields[1].GetUInt32(), true, true); } while (result->NextRow()); } @@ -7231,7 +7231,7 @@ void Player::_SaveCurrency(SQLTransaction& trans) { case PLAYERCURRENCY_NEW: stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_CURRENCY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt16(1, itr->first); stmt->setUInt32(2, itr->second.weekCount); stmt->setUInt32(3, itr->second.totalCount); @@ -7241,7 +7241,7 @@ void Player::_SaveCurrency(SQLTransaction& trans) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_CURRENCY); stmt->setUInt32(0, itr->second.weekCount); stmt->setUInt32(1, itr->second.totalCount); - stmt->setUInt32(2, GetGUID().GetCounter()); + stmt->setUInt64(2, GetGUID().GetCounter()); stmt->setUInt16(3, itr->first); trans->Append(stmt); break; @@ -7651,9 +7651,9 @@ uint32 Player::GetArenaTeamIdFromDB(ObjectGuid guid, uint8 type) uint32 Player::GetZoneIdFromDB(ObjectGuid guid) { - uint32 guidLow = guid.GetCounter(); + ObjectGuid::LowType guidLow = guid.GetCounter(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_ZONE); - stmt->setUInt32(0, guidLow); + stmt->setUInt64(0, guidLow); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -7665,7 +7665,7 @@ uint32 Player::GetZoneIdFromDB(ObjectGuid guid) { // stored zone is zero, use generic and slow zone detection stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ); - stmt->setUInt32(0, guidLow); + stmt->setUInt64(0, guidLow); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -7686,7 +7686,7 @@ uint32 Player::GetZoneIdFromDB(ObjectGuid guid) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ZONE); stmt->setUInt16(0, uint16(zone)); - stmt->setUInt32(1, guidLow); + stmt->setUInt64(1, guidLow); CharacterDatabase.Execute(stmt); } @@ -7698,7 +7698,7 @@ uint32 Player::GetZoneIdFromDB(ObjectGuid guid) uint32 Player::GetLevelFromDB(ObjectGuid guid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -17150,7 +17150,7 @@ void Player::_LoadBGData(PreparedQueryResult result) bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid guid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -17259,7 +17259,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); - stmt->setUInt32(1, guid.GetCounter()); + stmt->setUInt64(1, guid.GetCounter()); CharacterDatabase.Execute(stmt); return false; } @@ -17342,7 +17342,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder) InitPrimaryProfessions(); // to max set before any spell loaded // init saved position, and fix it later if problematic - uint32 transLowGUID = uint32(fields[31].GetUInt32()); + ObjectGuid::LowType transLowGUID = fields[31].GetUInt64(); Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); @@ -18162,8 +18162,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { uint32 zoneId = GetZoneId(); - std::map<uint32, Bag*> bagMap; // fast guid lookup for bags - std::map<uint32, Item*> invalidBagMap; // fast guid lookup for bags + std::map<ObjectGuid, Bag*> bagMap; // fast guid lookup for bags + std::map<ObjectGuid, Item*> invalidBagMap; // fast guid lookup for bags std::list<Item*> problematicItems; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -18211,18 +18211,18 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { if (IsBagPos(item->GetPos())) if (Bag* pBag = item->ToBag()) - bagMap[item->GetGUID().GetCounter()] = pBag; + bagMap[item->GetGUID()] = pBag; } else if (IsBagPos(item->GetPos())) if (item->IsBag()) - invalidBagMap[item->GetGUID().GetCounter()] = item; + invalidBagMap[item->GetGUID()] = item; } else { item->SetSlot(NULL_SLOT); // Item is in the bag, find the bag - std::map<uint32, Bag*>::iterator itr = bagMap.find(bagGuid.GetCounter()); + std::map<ObjectGuid, Bag*>::iterator itr = bagMap.find(bagGuid); if (itr != bagMap.end()) { ItemPosCountVec dest; @@ -18230,9 +18230,9 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) if (err == EQUIP_ERR_OK) item = StoreItem(dest, item, true); } - else if (invalidBagMap.find(bagGuid.GetCounter()) != invalidBagMap.end()) + else if (invalidBagMap.find(bagGuid) != invalidBagMap.end()) { - std::map<uint32, Item*>::iterator itr = invalidBagMap.find(bagGuid.GetCounter()); + std::map<ObjectGuid, Item*>::iterator itr = invalidBagMap.find(bagGuid); if (std::find(problematicItems.begin(), problematicItems.end(), itr->second) != problematicItems.end()) err = EQUIP_ERR_INTERNAL_BAG_ERROR; } @@ -18294,7 +18294,7 @@ void Player::_LoadVoidStorage(PreparedQueryResult result) uint64 itemId = fields[0].GetUInt64(); uint32 itemEntry = fields[1].GetUInt32(); uint8 slot = fields[2].GetUInt8(); - ObjectGuid creatorGuid(HIGHGUID_PLAYER, fields[3].GetUInt32()); + ObjectGuid creatorGuid(HIGHGUID_PLAYER, fields[3].GetUInt64()); uint32 randomProperty = fields[4].GetUInt32(); uint32 suffixFactor = fields[5].GetUInt32(); @@ -19383,7 +19383,7 @@ void Player::SaveToDB(bool create /*=false*/) //! Insert query /// @todo: Filter out more redundant fields that can take their default value at player create stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER); - stmt->setUInt32(index++, GetGUID().GetCounter()); + stmt->setUInt64(index++, GetGUID().GetCounter()); stmt->setUInt32(index++, GetSession()->GetAccountId()); stmt->setString(index++, GetName()); stmt->setUInt8(index++, getRace()); @@ -19406,10 +19406,10 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setFloat(index++, finiteAlways(GetTransOffsetY())); stmt->setFloat(index++, finiteAlways(GetTransOffsetZ())); stmt->setFloat(index++, finiteAlways(GetTransOffsetO())); - uint32 transLowGUID = 0; + ObjectGuid::LowType transLowGUID = 0; if (GetTransport()) transLowGUID = GetTransport()->GetGUID().GetCounter(); - stmt->setUInt32(index++, transLowGUID); + stmt->setUInt64(index++, transLowGUID); std::ostringstream ss; ss << m_taxi; @@ -19535,10 +19535,10 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setFloat(index++, finiteAlways(GetTransOffsetY())); stmt->setFloat(index++, finiteAlways(GetTransOffsetZ())); stmt->setFloat(index++, finiteAlways(GetTransOffsetO())); - uint32 transLowGUID = 0; + ObjectGuid::LowType transLowGUID = 0; if (GetTransport()) transLowGUID = GetTransport()->GetGUID().GetCounter(); - stmt->setUInt32(index++, transLowGUID); + stmt->setUInt64(index++, transLowGUID); std::ostringstream ss; ss << m_taxi; @@ -19627,7 +19627,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, IsInWorld() && !GetSession()->PlayerLogout() ? 1 : 0); // Index - stmt->setUInt32(index++, GetGUID().GetCounter()); + stmt->setUInt64(index++, GetGUID().GetCounter()); } SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -19684,7 +19684,7 @@ void Player::SaveGoldToDB(SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_MONEY); stmt->setUInt64(0, GetMoney()); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); trans->Append(stmt); } @@ -19921,17 +19921,17 @@ void Player::_SaveVoidStorage(SQLTransaction& trans) // DELETE FROM void_storage WHERE slot = ? AND playerGuid = ? stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT); stmt->setUInt8(0, i); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); } else { // REPLACE INTO character_inventory (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?) stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_VOID_STORAGE_ITEM); stmt->setUInt64(0, _voidStorageItems[i]->ItemId); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); stmt->setUInt32(2, _voidStorageItems[i]->ItemEntry); stmt->setUInt8(3, i); - stmt->setUInt32(4, _voidStorageItems[i]->CreatorGuid.GetCounter()); + stmt->setUInt64(4, _voidStorageItems[i]->CreatorGuid.GetCounter()); stmt->setUInt32(5, _voidStorageItems[i]->ItemRandomPropertyId); stmt->setUInt32(6, _voidStorageItems[i]->ItemSuffixFactor); } @@ -20304,7 +20304,7 @@ void Player::_SaveSpells(SQLTransaction& trans) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); stmt->setUInt32(0, itr->first); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); trans->Append(stmt); } @@ -20312,7 +20312,7 @@ void Player::_SaveSpells(SQLTransaction& trans) if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SPELL); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, itr->first); stmt->setBool(2, itr->second->active); stmt->setBool(3, itr->second->disabled); @@ -20343,13 +20343,13 @@ void Player::_SaveStats(SQLTransaction& trans) PreparedStatement* stmt = NULL; stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_STATS); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); uint8 index = 0; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_STATS); - stmt->setUInt32(index++, GetGUID().GetCounter()); + stmt->setUInt64(index++, GetGUID().GetCounter()); stmt->setUInt32(index++, GetMaxHealth()); for (uint8 i = 0; i < MAX_POWERS_PER_CLASS; ++i) @@ -20453,7 +20453,7 @@ void Player::SavePositionInDB(WorldLocation const& loc, uint16 zoneId, ObjectGui stmt->setFloat(3, loc.GetOrientation()); stmt->setUInt16(4, uint16(loc.GetMapId())); stmt->setUInt16(5, zoneId); - stmt->setUInt32(6, guid.GetCounter()); + stmt->setUInt64(6, guid.GetCounter()); CharacterDatabase.ExecuteOrAppend(trans, stmt); } @@ -20472,7 +20472,7 @@ void Player::SetUInt32ValueInArray(Tokenizer& Tokenizer, uint16 index, uint32 va void Player::Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PLAYERBYTES2); - stmt->setUInt32(0, customizeInfo->Guid.GetCounter()); + stmt->setUInt64(0, customizeInfo->Guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -20489,7 +20489,7 @@ void Player::Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransacti stmt->setUInt8(0, customizeInfo->Gender); stmt->setUInt32(1, customizeInfo->Skin | (customizeInfo->Face << 8) | (customizeInfo->HairStyle << 16) | (customizeInfo->HairColor << 24)); stmt->setUInt32(2, playerBytes2); - stmt->setUInt32(3, customizeInfo->Guid.GetCounter()); + stmt->setUInt64(3, customizeInfo->Guid.GetCounter()); CharacterDatabase.ExecuteOrAppend(trans, stmt); } @@ -26577,7 +26577,7 @@ void Player::RemoveAtLoginFlag(AtLoginFlags flags, bool persist /*= false*/) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(flags)); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -26707,7 +26707,7 @@ void Player::_SaveTalents(SQLTransaction& trans) if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, itr->first); stmt->setUInt8(2, itr->second->spec); trans->Append(stmt); @@ -26716,7 +26716,7 @@ void Player::_SaveTalents(SQLTransaction& trans) if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_TALENT); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, itr->first); stmt->setUInt8(2, itr->second->spec); trans->Append(stmt); diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 76e9fe7ec7a..7dcbcfe320c 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -62,8 +62,8 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, bool ignore) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS); stmt->setUInt8(0, flag); - stmt->setUInt32(1, GetPlayerGUID().GetCounter()); - stmt->setUInt32(2, friendGuid.GetCounter()); + stmt->setUInt64(1, GetPlayerGUID().GetCounter()); + stmt->setUInt64(2, friendGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -73,8 +73,8 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, bool ignore) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL); - stmt->setUInt32(0, GetPlayerGUID().GetCounter()); - stmt->setUInt32(1, friendGuid.GetCounter()); + stmt->setUInt64(0, GetPlayerGUID().GetCounter()); + stmt->setUInt64(1, friendGuid.GetCounter()); stmt->setUInt8(2, flag); CharacterDatabase.Execute(stmt); @@ -101,8 +101,8 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, bool ignor { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SOCIAL); - stmt->setUInt32(0, GetPlayerGUID().GetCounter()); - stmt->setUInt32(1, friendGuid.GetCounter()); + stmt->setUInt64(0, GetPlayerGUID().GetCounter()); + stmt->setUInt64(1, friendGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -113,8 +113,8 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, bool ignor PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS); stmt->setUInt8(0, flag); - stmt->setUInt32(1, GetPlayerGUID().GetCounter()); - stmt->setUInt32(2, friendGuid.GetCounter()); + stmt->setUInt64(1, GetPlayerGUID().GetCounter()); + stmt->setUInt64(2, friendGuid.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -131,8 +131,8 @@ void PlayerSocial::SetFriendNote(ObjectGuid const& friendGuid, std::string note) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE); stmt->setString(0, note); - stmt->setUInt32(1, GetPlayerGUID().GetCounter()); - stmt->setUInt32(2, friendGuid.GetCounter()); + stmt->setUInt64(1, GetPlayerGUID().GetCounter()); + stmt->setUInt64(2, friendGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -324,7 +324,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const { Field* fields = result->Fetch(); - friendGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + friendGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()); flags = fields[1].GetUInt8(); note = fields[2].GetString(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0aede6a1dca..b672669bcb7 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2184,7 +2184,7 @@ ObjectGuid ObjectMgr::GetPlayerGUIDByName(std::string const& name) const PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) - return ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + return ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt64()); return ObjectGuid::Empty; } @@ -2200,7 +2200,7 @@ bool ObjectMgr::GetPlayerNameByGUID(ObjectGuid guid, std::string& name) const PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -2223,7 +2223,7 @@ uint32 ObjectMgr::GetPlayerTeamByGUID(ObjectGuid guid) const PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_RACE); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -2246,7 +2246,7 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(ObjectGuid guid) const PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_GUID); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -6937,7 +6937,7 @@ void ObjectMgr::LoadCorpses() do { Field* fields = result->Fetch(); - uint32 guid = fields[15].GetUInt32(); + ObjectGuid::LowType guid = fields[15].GetUInt64(); CorpseType type = CorpseType(fields[12].GetUInt8()); if (type >= MAX_CORPSE_TYPE) { diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index bcd3560a845..04d0404d435 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2712,7 +2712,7 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId) // This will be prevent attempt to join many guilds and corrupt guild data integrity Player::RemovePetitionsAndSigns(guid, GUILD_CHARTER_TYPE); - uint32 lowguid = guid.GetCounter(); + ObjectGuid::LowType lowguid = guid.GetCounter(); // If rank was not passed, assign lowest possible rank if (rankId == GUILD_RANK_NONE) @@ -2737,7 +2737,7 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId) bool ok = false; // Player must exist PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD); - stmt->setUInt32(0, lowguid); + stmt->setUInt64(0, lowguid); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { Field* fields = result->Fetch(); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index e4275ad11b3..e11852e6566 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -70,7 +70,7 @@ bool LoginQueryHolder::Initialize() ObjectGuid::LowType lowGuid = m_guid.GetCounter(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_FROM, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); @@ -86,7 +86,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_AURAS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELL); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SPELLS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS); @@ -118,7 +118,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_INVENTORY, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_VOID_STORAGE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_VOID_STORAGE, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS); @@ -135,7 +135,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MAIL_DATE, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SOCIALLIST); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_HOMEBIND); @@ -143,7 +143,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_HOME_BIND, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SPELL_COOLDOWNS, stmt); if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED)) @@ -186,7 +186,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_GLYPHS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_TALENTS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_TALENTS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_ACCOUNT_DATA); @@ -240,14 +240,14 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) do { - ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt64()); TC_LOG_INFO("network", "Loading char guid %s from account %u.", guid.ToString().c_str(), GetAccountId()); Player::BuildEnumData(result, &data); // Do not allow banned characters to log in - if (!(*result)[20].GetUInt32()) + if (!(*result)[20].GetUInt64()) _legitCharacters.insert(guid); if (!sWorld->HasCharacterNameData(guid)) // This can happen if characters are inserted into the database manually. Core hasn't loaded name data yet. @@ -717,7 +717,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData) } PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_DATA_BY_GUID); - stmt->setUInt32(0, guid.GetCounter()); + stmt->setUInt64(0, guid.GetCounter()); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { @@ -997,7 +997,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->SendInitialPacketsAfterAddToMap(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE); - stmt->setUInt32(0, pCurrChar->GetGUID().GetCounter()); + stmt->setUInt64(0, pCurrChar->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_ONLINE); @@ -1214,7 +1214,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData) // and that there is no character with the desired new name PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_FREE_NAME); - stmt->setUInt32(0, renameInfo.Guid.GetCounter()); + stmt->setUInt64(0, renameInfo.Guid.GetCounter()); stmt->setUInt32(1, GetAccountId()); stmt->setUInt16(2, AT_LOGIN_RENAME); stmt->setUInt16(3, AT_LOGIN_RENAME); @@ -1242,7 +1242,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu stmt->setString(0, renameInfo->Name); stmt->setUInt16(1, AT_LOGIN_RENAME); - stmt->setUInt32(2, renameInfo->Guid.GetCounter()); + stmt->setUInt64(2, renameInfo->Guid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -1443,7 +1443,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) >> customizeInfo.Face; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); - stmt->setUInt32(0, customizeInfo.Guid.GetCounter()); + stmt->setUInt64(0, customizeInfo.Guid.GetCounter()); // TODO: Make async with callback PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -1495,7 +1495,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) } stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); - stmt->setUInt32(0, customizeInfo.Guid.GetCounter()); + stmt->setUInt64(0, customizeInfo.Guid.GetCounter()); result = CharacterDatabase.Query(stmt); if (result) @@ -1512,7 +1512,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); stmt->setString(0, customizeInfo.Name); stmt->setUInt16(1, uint16(AT_LOGIN_CUSTOMIZE)); - stmt->setUInt32(2, customizeInfo.Guid.GetCounter()); + stmt->setUInt64(2, customizeInfo.Guid.GetCounter()); trans->Append(stmt); @@ -1685,7 +1685,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // TO Do: Make async PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_AT_LOGIN_TITLES); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -1765,7 +1765,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt->setString(0, factionChangeInfo.Name); stmt->setUInt8(1, factionChangeInfo.Race); stmt->setUInt16(2, used_loginFlag); - stmt->setUInt32(3, lowGuid); + stmt->setUInt64(3, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); @@ -1858,7 +1858,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { // Delete all Flypaths stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); if (level > 7) @@ -1904,7 +1904,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXIMASK); stmt->setString(0, taximask); - stmt->setUInt32(1, lowGuid); + stmt->setUInt64(1, lowGuid); trans->Append(stmt); } @@ -1927,11 +1927,11 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { // Delete Friend List stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); } @@ -2049,13 +2049,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); - stmt->setUInt32(1, lowGuid); + stmt->setUInt64(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); stmt->setUInt32(1, (team == TEAM_ALLIANCE ? spell_horde : spell_alliance)); - stmt->setUInt32(2, lowGuid); + stmt->setUInt64(2, lowGuid); trans->Append(stmt); } @@ -2159,12 +2159,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE); stmt->setString(0, ss.str().c_str()); - stmt->setUInt32(1, lowGuid); + stmt->setUInt64(1, lowGuid); trans->Append(stmt); // unset any currently chosen title stmt = CharacterDatabase.GetPreparedStatement(CHAR_RES_CHAR_TITLES_FACTION_CHANGE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); } } @@ -2241,7 +2241,7 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT); stmt->setUInt8(0, position); - stmt->setUInt32(1, guids[i].GetCounter()); + stmt->setUInt64(1, guids[i].GetCounter()); trans->Append(stmt); } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 170d97dcbc9..ef9af08acaa 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -225,7 +225,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) } stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); - stmt->setUInt32(0, receiverGuid.GetCounter()); + stmt->setUInt64(0, receiverGuid.GetCounter()); result = CharacterDatabase.Query(stmt); if (result) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 36d96b46983..3d61cd4f798 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -691,7 +691,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result) if (result) { - IgnoreGuid = ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt32()); + IgnoreGuid = ObjectGuid(HIGHGUID_PLAYER, (*result)[0].GetUInt64()); if (!IgnoreGuid.IsEmpty()) { diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index 634f50ca012..9e5745ba655 100644 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -218,7 +218,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recvData) recvData >> comment; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY); - stmt->setUInt32(0, GetPlayer()->GetGUID().GetCounter()); + stmt->setUInt64(0, GetPlayer()->GetGUID().GetCounter()); stmt->setUInt32(1, nextSurveyID); stmt->setUInt32(2, mainSurvey); stmt->setString(3, comment); diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 7611fb8ce2d..4877ec27a20 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -53,7 +53,7 @@ bool GmTicket::LoadFromDB(Field* fields) // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket uint8 index = 0; _id = fields[ index].GetUInt32(); - _playerGuid = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt32()); + _playerGuid = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt64()); _playerName = fields[++index].GetString(); _message = fields[++index].GetString(); _createTime = fields[++index].GetUInt32(); @@ -62,8 +62,8 @@ bool GmTicket::LoadFromDB(Field* fields) _posY = fields[++index].GetFloat(); _posZ = fields[++index].GetFloat(); _lastModifiedTime = fields[++index].GetUInt32(); - _closedBy = ObjectGuid(uint64(0), uint64(fields[++index].GetInt32())); - _assignedTo = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt32()); + _closedBy = ObjectGuid(uint64(0), uint64(fields[++index].GetInt64())); + _assignedTo = ObjectGuid(HIGHGUID_PLAYER, fields[++index].GetUInt64()); _comment = fields[++index].GetString(); _response = fields[++index].GetString(); _completed = fields[++index].GetBool(); @@ -80,7 +80,7 @@ void GmTicket::SaveToDB(SQLTransaction& trans) const uint8 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET); stmt->setUInt32( index, _id); - stmt->setUInt32(++index, _playerGuid.GetCounter()); + stmt->setUInt64(++index, _playerGuid.GetCounter()); stmt->setString(++index, _playerName); stmt->setString(++index, _message); stmt->setUInt32(++index, uint32(_createTime)); @@ -89,8 +89,8 @@ void GmTicket::SaveToDB(SQLTransaction& trans) const stmt->setFloat (++index, _posY); stmt->setFloat (++index, _posZ); stmt->setUInt32(++index, uint32(_lastModifiedTime)); - stmt->setInt32 (++index, int32(_closedBy.GetCounter())); - stmt->setUInt32(++index, _assignedTo.GetCounter()); + stmt->setInt64 (++index, int64(_closedBy.GetCounter())); + stmt->setUInt64(++index, _assignedTo.GetCounter()); stmt->setString(++index, _comment); stmt->setString(++index, _response); stmt->setBool (++index, _completed); diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index e64bd4868bb..8d457687f22 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -218,7 +218,7 @@ std::string CreateDumpString(char const* tableName, QueryResult result) return ss.str(); } -std::string PlayerDumpWriter::GenerateWhereStr(char const* field, uint32 guid) +std::string PlayerDumpWriter::GenerateWhereStr(char const* field, ObjectGuid::LowType guid) { std::ostringstream wherestr; wherestr << field << " = '" << guid << '\''; @@ -247,25 +247,25 @@ std::string PlayerDumpWriter::GenerateWhereStr(char const* field, GUIDs const& g return wherestr.str(); } -void StoreGUID(QueryResult result, uint32 field, std::set<uint32>& guids) +void StoreGUID(QueryResult result, uint32 field, PlayerDumpWriter::GUIDs &guids) { Field* fields = result->Fetch(); - uint32 guid = fields[field].GetUInt32(); + ObjectGuid::LowType guid = fields[field].GetUInt64(); if (guid) guids.insert(guid); } -void StoreGUID(QueryResult result, uint32 data, uint32 field, std::set<uint32>& guids) +void StoreGUID(QueryResult result, uint32 data, uint32 field, PlayerDumpWriter::GUIDs& guids) { Field* fields = result->Fetch(); std::string dataStr = fields[data].GetString(); - uint32 guid = atoi(gettoknth(dataStr, field).c_str()); + ObjectGuid::LowType guid = atoll(gettoknth(dataStr, field).c_str()); if (guid) guids.insert(guid); } // Writing - High-level functions -bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tableFrom, char const*tableTo, DumpTableType type) +bool PlayerDumpWriter::DumpTable(std::string& dump, ObjectGuid::LowType guid, char const*tableFrom, char const*tableTo, DumpTableType type) { GUIDs const* guids = NULL; char const* fieldname = NULL; @@ -345,7 +345,7 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl return true; } -bool PlayerDumpWriter::GetDump(uint32 guid, std::string &dump) +bool PlayerDumpWriter::GetDump(ObjectGuid::LowType guid, std::string &dump) { dump = "IMPORTANT NOTE: THIS DUMPFILE IS MADE FOR USE WITH THE 'PDUMP' COMMAND ONLY - EITHER THROUGH INGAME CHAT OR ON CONSOLE!\n"; dump += "IMPORTANT NOTE: DO NOT apply it directly - it will irreversibly DAMAGE and CORRUPT your database! You have been warned!\n\n"; @@ -360,7 +360,7 @@ bool PlayerDumpWriter::GetDump(uint32 guid, std::string &dump) return true; } -DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, uint32 guid) +DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, ObjectGuid::LowType guid) { if (sWorld->getBoolConfig(CONFIG_PDUMP_NO_PATHS)) if (strstr(file.c_str(), "\\") || strstr(file.c_str(), "/")) @@ -399,7 +399,7 @@ void fixNULLfields(std::string &line) } } -DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid) +DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, std::string name, ObjectGuid::LowType guid) { uint32 charcount = AccountMgr::GetCharactersCount(account); if (charcount >= 10) @@ -413,10 +413,10 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s // make sure the same guid doesn't already exist and is safe to use bool incHighest = true; - if (guid != 0 && guid < sObjectMgr->_hiCharGuid) + if (guid && guid < sObjectMgr->_hiCharGuid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h index 8be71f1a819..5684d9d05e4 100644 --- a/src/server/game/Tools/PlayerDump.h +++ b/src/server/game/Tools/PlayerDump.h @@ -19,6 +19,7 @@ #ifndef _PLAYER_DUMP_H #define _PLAYER_DUMP_H +#include "ObjectGuid.h" #include <string> #include <map> #include <set> @@ -73,14 +74,14 @@ class PlayerDumpWriter : public PlayerDump public: PlayerDumpWriter() { } - bool GetDump(uint32 guid, std::string& dump); - DumpReturn WriteDump(std::string const& file, uint32 guid); + typedef std::set<ObjectGuid::LowType> GUIDs; + bool GetDump(ObjectGuid::LowType guid, std::string& dump); + DumpReturn WriteDump(std::string const& file, ObjectGuid::LowType guid); private: - typedef std::set<uint32> GUIDs; - bool DumpTable(std::string& dump, uint32 guid, char const*tableFrom, char const*tableTo, DumpTableType type); + bool DumpTable(std::string& dump, ObjectGuid::LowType guid, char const*tableFrom, char const*tableTo, DumpTableType type); std::string GenerateWhereStr(char const* field, GUIDs const& guids, GUIDs::const_iterator& itr); - std::string GenerateWhereStr(char const* field, uint32 guid); + std::string GenerateWhereStr(char const* field, ObjectGuid::LowType guid); GUIDs pets; GUIDs mails; @@ -92,7 +93,7 @@ class PlayerDumpReader : public PlayerDump public: PlayerDumpReader() { } - DumpReturn LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid); + DumpReturn LoadDump(std::string const& file, uint32 account, std::string name, ObjectGuid::LowType guid); }; #endif diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f51227151a5..b31c0b11d39 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -105,7 +105,7 @@ public: if (isNumeric(searchString.c_str())) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); - stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); + stmt->setUInt64(0, uint32(atoi(searchString.c_str()))); result = CharacterDatabase.Query(stmt); } // search by name @@ -133,7 +133,7 @@ public: DeletedInfo info; - info.guid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); + info.guid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64()); info.name = fields[1].GetString(); info.accountId = fields[2].GetUInt32(); @@ -220,11 +220,11 @@ public: PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO); stmt->setString(0, delInfo.name); stmt->setUInt32(1, delInfo.accountId); - stmt->setUInt32(2, delInfo.guid.GetCounter()); + stmt->setUInt64(2, delInfo.guid.GetCounter()); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); - stmt->setUInt32(0, delInfo.guid.GetCounter()); + stmt->setUInt64(0, delInfo.guid.GetCounter()); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) sWorld->AddCharacterNameData(delInfo.guid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[3].GetUInt8()); } @@ -252,7 +252,7 @@ public: // Update level and reset XP, everything else will be updated at login PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL); stmt->setUInt8(0, uint8(newLevel)); - stmt->setUInt32(1, playerGuid.GetCounter()); + stmt->setUInt64(1, playerGuid.GetCounter()); CharacterDatabase.Execute(stmt); } } @@ -382,7 +382,7 @@ public: { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_NAME_BY_GUID); stmt->setString(0, newName); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); } @@ -420,7 +420,7 @@ public: PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); } } @@ -483,12 +483,12 @@ public: { handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); - stmt->setUInt32(1, target->GetGUID().GetCounter()); + stmt->setUInt64(1, target->GetGUID().GetCounter()); } else { std::string oldNameLink = handler->playerLink(targetName); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.ToString().c_str()); } CharacterDatabase.Execute(stmt); @@ -511,13 +511,13 @@ public: { handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); - stmt->setUInt32(1, target->GetGUID().GetCounter()); + stmt->setUInt64(1, target->GetGUID().GetCounter()); } else { std::string oldNameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.ToString().c_str()); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); } CharacterDatabase.Execute(stmt); @@ -539,14 +539,14 @@ public: /// @todo add text into database handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); - stmt->setUInt32(1, target->GetGUID().GetCounter()); + stmt->setUInt64(1, target->GetGUID().GetCounter()); } else { std::string oldNameLink = handler->playerLink(targetName); /// @todo add text into database handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.ToString().c_str()); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); } CharacterDatabase.Execute(stmt); diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 20ebb24b6ad..2194d0a7605 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -282,14 +282,14 @@ public: do { Field* fields = result->Fetch(); - uint64 itemGuid = fields[0].GetUInt64(); - uint64 owner = fields[1].GetUInt64(); + ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64()); + ObjectGuid owner(HIGHGUID_PLAYER, fields[1].GetUInt64()); uint32 ownerAccountId = fields[2].GetUInt32(); std::string ownerName = fields[3].GetString(); char const* itemPos = "[in auction]"; - handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid.ToString().c_str(), ownerName.c_str(), owner.ToString().c_str(), ownerAccountId, itemPos); } while (result->NextRow()); } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 4c4bd5fb297..169d66d1222 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1280,10 +1280,10 @@ public: do { Field* characterFields = result2->Fetch(); - uint32 guid = characterFields[0].GetUInt32(); + ObjectGuid guid(HIGHGUID_PLAYER, characterFields[0].GetUInt64()); std::string name = characterFields[1].GetString(); - handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid); + handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid.ToString().c_str()); ++counter; } while (result2->NextRow() && (limit == -1 || counter < limit)); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 089f5e7a77b..caba2723ab4 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1517,7 +1517,7 @@ public: // Query informations from the DB stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO); - stmt->setUInt32(0, lowguid); + stmt->setUInt64(0, lowguid); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -1617,7 +1617,7 @@ public: // Can be used to query data from Characters database stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP); - stmt2->setUInt32(0, lowguid); + stmt2->setUInt64(0, lowguid); PreparedQueryResult result4 = CharacterDatabase.Query(stmt2); if (result4) diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 1b2fc2c0509..46fe0c64330 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -172,7 +172,7 @@ public: { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str()); @@ -246,7 +246,7 @@ public: { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); - stmt->setUInt32(1, targetGuid.GetCounter()); + stmt->setUInt64(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); std::string nameLink = handler->playerLink(targetName); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 16af55055a2..2ecf02ae945 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -448,7 +448,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHARACTER_AT_LOGIN, "SELECT at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PrepareStatement(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_AT_LOGIN_TITLES, "SELECT at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index ff53037a0ab..330f3cd1a2b 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -390,7 +390,6 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_GUID_NAME_BY_ACC, CHAR_SEL_POOL_QUEST_SAVE, CHAR_SEL_CHARACTER_AT_LOGIN, - CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, CHAR_SEL_CHAR_AT_LOGIN_TITLES, CHAR_SEL_INSTANCE, CHAR_SEL_CHAR_COD_ITEM_MAIL, |