diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-10-23 23:04:16 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-10-23 23:04:16 +0200 |
commit | a20fbfc8e086ca43669b2340d0612ef93b38b703 (patch) | |
tree | f2a4f3cf9131d4d022858771760a17056899fdc7 | |
parent | 1db15bd6859d70b55c4163227952c46a2e89d913 (diff) |
Core/Entities: Third part of converting int to bigint guids in database
-rw-r--r-- | sql/base/characters_database.sql | 72 | ||||
-rw-r--r-- | sql/updates/characters/2014_10_23_02_characters.sql | 36 | ||||
-rw-r--r-- | sql/updates/world/2014_10_23_01_world.sql | 1 | ||||
-rw-r--r-- | src/server/game/Entities/Item/Item.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Entities/Item/Item.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 124 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.h | 5 | ||||
-rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 54 | ||||
-rw-r--r-- | src/server/game/Handlers/ItemHandler.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Reputation/ReputationMgr.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_tele.cpp | 2 |
13 files changed, 180 insertions, 144 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 7a620dc3ecf..94dfc7adf8e 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -688,31 +688,31 @@ DROP TABLE IF EXISTS `character_equipmentsets`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_equipmentsets` ( - `guid` int(10) NOT NULL DEFAULT '0', + `guid` bigint(20) NOT NULL DEFAULT '0', `setguid` bigint(20) NOT NULL AUTO_INCREMENT, `setindex` tinyint(3) unsigned NOT NULL DEFAULT '0', `name` varchar(31) NOT NULL, `iconname` varchar(100) NOT NULL, `ignore_mask` int(11) unsigned NOT NULL DEFAULT '0', - `item0` int(11) unsigned NOT NULL DEFAULT '0', - `item1` int(11) unsigned NOT NULL DEFAULT '0', - `item2` int(11) unsigned NOT NULL DEFAULT '0', - `item3` int(11) unsigned NOT NULL DEFAULT '0', - `item4` int(11) unsigned NOT NULL DEFAULT '0', - `item5` int(11) unsigned NOT NULL DEFAULT '0', - `item6` int(11) unsigned NOT NULL DEFAULT '0', - `item7` int(11) unsigned NOT NULL DEFAULT '0', - `item8` int(11) unsigned NOT NULL DEFAULT '0', - `item9` int(11) unsigned NOT NULL DEFAULT '0', - `item10` int(11) unsigned NOT NULL DEFAULT '0', - `item11` int(11) unsigned NOT NULL DEFAULT '0', - `item12` int(11) unsigned NOT NULL DEFAULT '0', - `item13` int(11) unsigned NOT NULL DEFAULT '0', - `item14` int(11) unsigned NOT NULL DEFAULT '0', - `item15` int(11) unsigned NOT NULL DEFAULT '0', - `item16` int(11) unsigned NOT NULL DEFAULT '0', - `item17` int(11) unsigned NOT NULL DEFAULT '0', - `item18` int(11) unsigned NOT NULL DEFAULT '0', + `item0` bigint(20) unsigned NOT NULL DEFAULT '0', + `item1` bigint(20) unsigned NOT NULL DEFAULT '0', + `item2` bigint(20) unsigned NOT NULL DEFAULT '0', + `item3` bigint(20) unsigned NOT NULL DEFAULT '0', + `item4` bigint(20) unsigned NOT NULL DEFAULT '0', + `item5` bigint(20) unsigned NOT NULL DEFAULT '0', + `item6` bigint(20) unsigned NOT NULL DEFAULT '0', + `item7` bigint(20) unsigned NOT NULL DEFAULT '0', + `item8` bigint(20) unsigned NOT NULL DEFAULT '0', + `item9` bigint(20) unsigned NOT NULL DEFAULT '0', + `item10` bigint(20) unsigned NOT NULL DEFAULT '0', + `item11` bigint(20) unsigned NOT NULL DEFAULT '0', + `item12` bigint(20) unsigned NOT NULL DEFAULT '0', + `item13` bigint(20) unsigned NOT NULL DEFAULT '0', + `item14` bigint(20) unsigned NOT NULL DEFAULT '0', + `item15` bigint(20) unsigned NOT NULL DEFAULT '0', + `item16` bigint(20) unsigned NOT NULL DEFAULT '0', + `item17` bigint(20) unsigned NOT NULL DEFAULT '0', + `item18` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`setguid`), UNIQUE KEY `idx_set` (`guid`,`setguid`,`setindex`), KEY `Idx_setindex` (`setindex`) @@ -736,8 +736,8 @@ DROP TABLE IF EXISTS `character_gifts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_gifts` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `item_guid` int(10) unsigned NOT NULL DEFAULT '0', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0', + `item_guid` bigint(20) unsigned NOT NULL DEFAULT '0', `entry` int(10) unsigned NOT NULL DEFAULT '0', `flags` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`item_guid`), @@ -762,7 +762,7 @@ DROP TABLE IF EXISTS `character_glyphs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_glyphs` ( - `guid` int(10) unsigned NOT NULL, + `guid` bigint(20) unsigned NOT NULL, `spec` tinyint(3) unsigned NOT NULL DEFAULT '0', `glyph1` smallint(5) unsigned DEFAULT '0', `glyph2` smallint(5) unsigned DEFAULT '0', @@ -794,7 +794,7 @@ DROP TABLE IF EXISTS `character_homebind`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_homebind` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `mapId` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', `zoneId` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Zone Identifier', `posX` float NOT NULL DEFAULT '0', @@ -821,7 +821,7 @@ DROP TABLE IF EXISTS `character_instance`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_instance` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0', `instance` int(10) unsigned NOT NULL DEFAULT '0', `permanent` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`,`instance`), @@ -846,10 +846,10 @@ DROP TABLE IF EXISTS `character_inventory`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_inventory` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', - `bag` int(10) unsigned NOT NULL DEFAULT '0', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `bag` bigint(20) unsigned NOT NULL DEFAULT '0', `slot` tinyint(3) unsigned NOT NULL DEFAULT '0', - `item` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Item Global Unique Identifier', + `item` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Item Global Unique Identifier', PRIMARY KEY (`item`), UNIQUE KEY `guid` (`guid`,`bag`,`slot`), KEY `idx_guid` (`guid`) @@ -941,7 +941,7 @@ DROP TABLE IF EXISTS `character_queststatus`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', `status` tinyint(3) unsigned NOT NULL DEFAULT '0', `explored` tinyint(3) unsigned NOT NULL DEFAULT '0', @@ -976,7 +976,7 @@ DROP TABLE IF EXISTS `character_queststatus_daily`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus_daily` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', `time` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`,`quest`), @@ -1001,7 +1001,7 @@ DROP TABLE IF EXISTS `character_queststatus_monthly`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus_monthly` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', PRIMARY KEY (`guid`,`quest`), KEY `idx_guid` (`guid`) @@ -1025,7 +1025,7 @@ DROP TABLE IF EXISTS `character_queststatus_rewarded`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus_rewarded` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', `active` tinyint(10) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`guid`,`quest`) @@ -1049,7 +1049,7 @@ DROP TABLE IF EXISTS `character_queststatus_seasonal`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus_seasonal` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', `event` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Identifier', PRIMARY KEY (`guid`,`quest`), @@ -1074,7 +1074,7 @@ DROP TABLE IF EXISTS `character_queststatus_weekly`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_queststatus_weekly` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', PRIMARY KEY (`guid`,`quest`), KEY `idx_guid` (`guid`) @@ -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` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `guid` bigint(10) 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', @@ -1123,7 +1123,7 @@ DROP TABLE IF EXISTS `character_skills`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_skills` ( - `guid` int(10) unsigned NOT NULL COMMENT 'Global Unique Identifier', + `guid` bigint(20) unsigned NOT NULL COMMENT 'Global Unique Identifier', `skill` smallint(5) unsigned NOT NULL, `value` smallint(5) unsigned NOT NULL, `max` smallint(5) unsigned NOT NULL, diff --git a/sql/updates/characters/2014_10_23_02_characters.sql b/sql/updates/characters/2014_10_23_02_characters.sql new file mode 100644 index 00000000000..7861a548089 --- /dev/null +++ b/sql/updates/characters/2014_10_23_02_characters.sql @@ -0,0 +1,36 @@ +ALTER TABLE `character_equipmentsets` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item0` `item0` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item1` `item1` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item2` `item2` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item3` `item3` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item4` `item4` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item5` `item5` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item6` `item6` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item7` `item7` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item8` `item8` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item9` `item9` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item10` `item10` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item11` `item11` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item12` `item12` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item13` `item13` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item14` `item14` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item15` `item15` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item16` `item16` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item17` `item17` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_equipmentsets` CHANGE `item18` `item18` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_gifts` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_gifts` CHANGE `item_guid` `item_guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_glyphs` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_homebind` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_instance` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_inventory` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_inventory` CHANGE `bag` `bag` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_inventory` CHANGE `item` `item` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus_daily` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus_monthly` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus_rewarded` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus_seasonal` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_queststatus_weekly` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_reputation` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `character_skills` CHANGE `guid` `guid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2014_10_23_01_world.sql b/sql/updates/world/2014_10_23_01_world.sql new file mode 100644 index 00000000000..adedfe28d28 --- /dev/null +++ b/sql/updates/world/2014_10_23_01_world.sql @@ -0,0 +1 @@ +UPDATE `trinity_string` SET `content_default`='%s - owner: %s (%s account: %u) %s' WHERE `entry`=508; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 6ea0d4f8d85..2d29f9ccee4 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -362,8 +362,8 @@ void Item::SaveToDB(SQLTransaction& trans) if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER); - stmt->setUInt32(0, GetOwnerGUID().GetCounter()); - stmt->setUInt32(1, GetGUID().GetCounter()); + stmt->setUInt64(0, GetOwnerGUID().GetCounter()); + stmt->setUInt64(1, GetGUID().GetCounter()); trans->Append(stmt); } break; @@ -377,7 +377,7 @@ void Item::SaveToDB(SQLTransaction& trans) if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); } @@ -500,10 +500,10 @@ void Item::DeleteFromDB(SQLTransaction& trans) } /*static*/ -void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) +void Item::DeleteFromInventoryDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); - stmt->setUInt32(0, itemGuid); + stmt->setUInt64(0, itemGuid); trans->Append(stmt); } diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 7c01fe446e0..8c5bb535688 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -238,7 +238,7 @@ class Item : public Object virtual bool LoadFromDB(uint32 guid, ObjectGuid owner_guid, Field* fields, uint32 entry); static void DeleteFromDB(SQLTransaction& trans, uint32 itemGuid); virtual void DeleteFromDB(SQLTransaction& trans); - static void DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid); + static void DeleteFromInventoryDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid); // Lootable items and their contents void ItemContainerSaveLootToDB(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 35b44379d5c..e7f465bcadc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4837,31 +4837,31 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GIFT); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL); @@ -4913,7 +4913,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_EQUIPMENTSETS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER); @@ -4930,23 +4930,23 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_DAILY); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_WEEKLY); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_MONTHLY); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_SEASONAL); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT); @@ -4954,7 +4954,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILLS); - stmt->setUInt32(0, guid); + stmt->setUInt64(0, guid); trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); @@ -12444,7 +12444,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, pItem->GetGUID().GetCounter()); + stmt->setUInt64(0, pItem->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -17113,7 +17113,7 @@ void Player::_LoadEquipmentSets(PreparedQueryResult result) eqSet.state = EQUIPMENT_SET_UNCHANGED; for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) - eqSet.Items[i] = fields[5+i].GetUInt32(); + eqSet.Items[i] = fields[5 + i].GetUInt64(); m_EquipmentSets[index] = eqSet; @@ -17181,7 +17181,7 @@ void Player::SetHomebind(WorldLocation const& loc, uint32 areaId) stmt->setFloat (2, m_homebindX); stmt->setFloat (3, m_homebindY); stmt->setFloat (4, m_homebindZ); - stmt->setUInt32(5, GetGUID().GetCounter()); + stmt->setUInt64(5, GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } @@ -18174,7 +18174,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) Field* fields = result->Fetch(); if (Item* item = _LoadItem(trans, zoneId, timeDiff, fields)) { - uint32 bagGuid = fields[11].GetUInt32(); + ObjectGuid bagGuid(HIGHGUID_ITEM, fields[11].GetUInt64()); uint8 slot = fields[12].GetUInt8(); uint8 err = EQUIP_ERR_OK; @@ -18222,7 +18222,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { item->SetSlot(NULL_SLOT); // Item is in the bag, find the bag - std::map<uint32, Bag*>::iterator itr = bagMap.find(bagGuid); + std::map<ObjectGuid, Bag*>::iterator itr = bagMap.find(bagGuid); if (itr != bagMap.end()) { ItemPosCountVec dest; @@ -18238,8 +18238,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) } else { - TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?", - GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid, slot); + TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) which doesnt have a valid bag (Bag %s, slot: %u). Possible cheat?", + GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid.ToString().c_str(), slot); item->DeleteFromInventoryDB(trans); delete item; continue; @@ -18252,8 +18252,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) item->SetState(ITEM_UNCHANGED, this); else { - TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.", - GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid, slot, err); + TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (%s, name: '%s') has item (%s, entry: %u) which can't be loaded into inventory (Bag %s, slot: %u) by reason %u. Item will be sent by mail.", + GetGUID().ToString().c_str(), GetName().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid.ToString().c_str(), slot, err); item->DeleteFromInventoryDB(trans); problematicItems.push_back(item); } @@ -18927,7 +18927,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, instanceId); CharacterDatabase.Execute(stmt); @@ -18983,7 +18983,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, itr->second.save->GetInstanceId()); CharacterDatabase.Execute(stmt); @@ -19013,7 +19013,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b stmt->setUInt32(0, save->GetInstanceId()); stmt->setBool(1, permanent); - stmt->setUInt32(2, GetGUID().GetCounter()); + stmt->setUInt64(2, GetGUID().GetCounter()); stmt->setUInt32(3, bind.save->GetInstanceId()); CharacterDatabase.Execute(stmt); @@ -19023,7 +19023,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_INSTANCE); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, save->GetInstanceId()); stmt->setBool(2, permanent); @@ -19321,7 +19321,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) else { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } } @@ -19335,7 +19335,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) m_homebindZ = info->positionZ; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt16(1, m_homebindMapId); stmt->setUInt16(2, m_homebindAreaId); stmt->setFloat (3, m_homebindX); @@ -19804,7 +19804,7 @@ void Player::_SaveInventory(SQLTransaction& trans) continue; stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); - stmt->setUInt32(0, item->GetGUID().GetCounter()); + stmt->setUInt64(0, item->GetGUID().GetCounter()); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); @@ -19857,16 +19857,16 @@ void Player::_SaveInventory(SQLTransaction& trans) Item* test = GetItemByPos(item->GetBagSlot(), item->GetSlot()); if (test == NULL) { - uint32 bagTestGUID = 0; + ObjectGuid::LowType bagTestGUID = 0; if (Item* test2 = GetItemByPos(INVENTORY_SLOT_BAG_0, item->GetBagSlot())) bagTestGUID = test2->GetGUID().GetCounter(); TC_LOG_ERROR("entities.player", "Player(%s Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with %s (state %d) are incorrect, the player doesn't have an item at that position!", GetGUID().ToString().c_str(), GetName().c_str(), item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str(), (int32)item->GetState()); // according to the test that was just performed nothing should be in this slot, delete stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT); - stmt->setUInt32(0, bagTestGUID); + stmt->setUInt64(0, bagTestGUID); stmt->setUInt8(1, item->GetSlot()); - stmt->setUInt32(2, GetGUID().GetCounter()); + stmt->setUInt64(2, GetGUID().GetCounter()); trans->Append(stmt); // also THIS item should be somewhere else, cheat attempt @@ -19891,15 +19891,15 @@ void Player::_SaveInventory(SQLTransaction& trans) case ITEM_NEW: case ITEM_CHANGED: stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_INVENTORY_ITEM); - stmt->setUInt32(0, GetGUID().GetCounter()); - stmt->setUInt32(1, container ? container->GetGUID().GetCounter() : 0); + stmt->setUInt64(0, GetGUID().GetCounter()); + stmt->setUInt64(1, container ? container->GetGUID().GetCounter() : 0); stmt->setUInt8 (2, item->GetSlot()); - stmt->setUInt32(3, item->GetGUID().GetCounter()); + stmt->setUInt64(3, item->GetGUID().GetCounter()); trans->Append(stmt); break; case ITEM_REMOVED: stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); - stmt->setUInt32(0, item->GetGUID().GetCounter()); + stmt->setUInt64(0, item->GetGUID().GetCounter()); trans->Append(stmt); case ITEM_UNCHANGED: break; @@ -20072,7 +20072,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) uint8 index = 0; stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_QUESTSTATUS); - stmt->setUInt32(index++, GetGUID().GetCounter()); + stmt->setUInt64(index++, GetGUID().GetCounter()); stmt->setUInt32(index++, statusItr->first); stmt->setUInt8(index++, uint8(statusItr->second.Status)); stmt->setBool(index++, statusItr->second.Explored); @@ -20091,7 +20091,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) else { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, saveItr->first); trans->Append(stmt); } @@ -20104,7 +20104,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) if (saveItr->second == QUEST_DEFAULT_SAVE_TYPE) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_QUESTSTATUS_REWARDED); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, saveItr->first); trans->Append(stmt); @@ -20112,7 +20112,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) else if (saveItr->second == QUEST_FORCE_DELETE_SAVE_TYPE || !keepAbandoned) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, saveItr->first); trans->Append(stmt); } @@ -20135,15 +20135,15 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans) // we don't need transactions here. PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_DAILY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) { - if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) + if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_QUESTSTATUS_DAILY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); trans->Append(stmt); @@ -20155,7 +20155,7 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans) for (DFQuestsDoneList::iterator itr = m_DFQuests.begin(); itr != m_DFQuests.end(); ++itr) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_QUESTSTATUS_DAILY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, (*itr)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); trans->Append(stmt); @@ -20170,7 +20170,7 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans) // we don't need transactions here. PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_WEEKLY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); for (QuestSet::const_iterator iter = m_weeklyquests.begin(); iter != m_weeklyquests.end(); ++iter) @@ -20178,7 +20178,7 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans) uint32 questId = *iter; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_QUESTSTATUS_WEEKLY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, questId); trans->Append(stmt); } @@ -20193,7 +20193,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) // we don't need transactions here. PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_SEASONAL); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); for (SeasonalEventQuestMap::const_iterator iter = m_seasonalquests.begin(); iter != m_seasonalquests.end(); ++iter) @@ -20205,7 +20205,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) uint32 questId = *itr; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_QUESTSTATUS_SEASONAL); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, questId); stmt->setUInt32(2, eventId); trans->Append(stmt); @@ -20222,7 +20222,7 @@ void Player::_SaveMonthlyQuestStatus(SQLTransaction& trans) // we don't need transactions here. PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_QUESTSTATUS_MONTHLY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); for (QuestSet::const_iterator iter = m_monthlyquests.begin(); iter != m_monthlyquests.end(); ++iter) @@ -20230,7 +20230,7 @@ void Player::_SaveMonthlyQuestStatus(SQLTransaction& trans) uint32 questId = *iter; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_QUESTSTATUS_MONTHLY); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, questId); trans->Append(stmt); } @@ -20253,7 +20253,7 @@ void Player::_SaveSkills(SQLTransaction& trans) if (itr->second.uState == SKILL_DELETED) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_BY_SKILL); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt32(1, itr->first); trans->Append(stmt); @@ -20271,7 +20271,7 @@ void Player::_SaveSkills(SQLTransaction& trans) { case SKILL_NEW: stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILLS); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt16(1, uint16(itr->first)); stmt->setUInt16(2, value); stmt->setUInt16(3, max); @@ -20281,7 +20281,7 @@ void Player::_SaveSkills(SQLTransaction& trans) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SKILLS); stmt->setUInt16(0, value); stmt->setUInt16(1, max); - stmt->setUInt32(2, GetGUID().GetCounter()); + stmt->setUInt64(2, GetGUID().GetCounter()); stmt->setUInt16(3, uint16(itr->first)); trans->Append(stmt); break; @@ -25629,7 +25629,7 @@ void Player::_LoadSkills(PreparedQueryResult result) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); stmt->setUInt16(1, skill); CharacterDatabase.Execute(stmt); @@ -26431,7 +26431,7 @@ void Player::SendEquipmentSetList() if (itr->second.IgnoreMask & (1 << i)) data << ObjectGuid(uint64(0), uint64(1)); else - data << ObjectGuid(HIGHGUID_ITEM, 0, itr->second.Items[i]).WriteAsPacked(); + data << ObjectGuid(HIGHGUID_ITEM, itr->second.Items[i]); } ++count; // client have limit but it checked at loading and set @@ -26500,8 +26500,8 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans) stmt->setString(j++, eqset.IconName.c_str()); stmt->setUInt32(j++, eqset.IgnoreMask); for (uint8 i=0; i<EQUIPMENT_SLOT_END; ++i) - stmt->setUInt32(j++, eqset.Items[i]); - stmt->setUInt32(j++, GetGUID().GetCounter()); + stmt->setUInt64(j++, eqset.Items[i]); + stmt->setUInt64(j++, GetGUID().GetCounter()); stmt->setUInt64(j++, eqset.Guid); stmt->setUInt32(j, index); trans->Append(stmt); @@ -26510,14 +26510,14 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans) break; case EQUIPMENT_SET_NEW: stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_EQUIP_SET); - stmt->setUInt32(j++, GetGUID().GetCounter()); + stmt->setUInt64(j++, GetGUID().GetCounter()); stmt->setUInt64(j++, eqset.Guid); stmt->setUInt32(j++, index); stmt->setString(j++, eqset.Name.c_str()); stmt->setString(j++, eqset.IconName.c_str()); stmt->setUInt32(j++, eqset.IgnoreMask); for (uint8 i=0; i<EQUIPMENT_SLOT_END; ++i) - stmt->setUInt32(j++, eqset.Items[i]); + stmt->setUInt64(j++, eqset.Items[i]); trans->Append(stmt); eqset.state = EQUIPMENT_SET_UNCHANGED; ++itr; @@ -26665,7 +26665,7 @@ void Player::_LoadGlyphs(PreparedQueryResult result) void Player::_SaveGlyphs(SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); - stmt->setUInt32(0, GetGUID().GetCounter()); + stmt->setUInt64(0, GetGUID().GetCounter()); trans->Append(stmt); @@ -26674,7 +26674,7 @@ void Player::_SaveGlyphs(SQLTransaction& trans) uint8 index = 0; stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GLYPHS); - stmt->setUInt32(index++, GetGUID().GetCounter()); + stmt->setUInt64(index++, GetGUID().GetCounter()); stmt->setUInt8(index++, spec); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d951d884d30..5c0f0408d93 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -737,15 +737,14 @@ struct EquipmentSet { EquipmentSet() : Guid(0), IgnoreMask(0), state(EQUIPMENT_SET_NEW) { - for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i) - Items[i] = 0; + memset(Items, 0, sizeof(Items)); } uint64 Guid; std::string Name; std::string IconName; uint32 IgnoreMask; - uint32 Items[EQUIPMENT_SLOT_END]; + ObjectGuid::LowType Items[EQUIPMENT_SLOT_END]; EquipmentSetUpdateState state; }; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 9a7c2fcea16..e4275ad11b3 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -78,7 +78,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_GROUP, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_INSTANCE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURAS); @@ -90,31 +90,31 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SPELLS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS_DAILY); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_DAILY_QUEST_STATUS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS_WEEKLY); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_WEEKLY_QUEST_STATUS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS_MONTHLY); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS_SEASONAL); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SEASONAL_QUEST_STATUS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_REPUTATION); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_REPUTATION, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_INVENTORY); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_INVENTORY, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_VOID_STORAGE); @@ -139,7 +139,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_HOMEBIND); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_HOME_BIND, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS); @@ -170,7 +170,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_CRITERIA_PROGRESS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_EQUIPMENT_SETS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUF_PROFILES); @@ -182,7 +182,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BG_DATA, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GLYPHS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_GLYPHS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_TALENTS); @@ -194,7 +194,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SKILLS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_SKILLS, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_RANDOMBG); @@ -206,7 +206,7 @@ bool LoginQueryHolder::Initialize() res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_BANNED, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUSREW); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS_REW, stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES); @@ -1796,12 +1796,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // Switch Languages // delete all languages first stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_LANGUAGES); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); // Now add them back stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); // Faction specific languages if (team == TEAM_HORDE) @@ -1815,7 +1815,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) if (factionChangeInfo.Race != RACE_ORC && factionChangeInfo.Race != RACE_HUMAN) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); switch (factionChangeInfo.Race) { @@ -1937,11 +1937,11 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // Reset homebind and position stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); WorldLocation loc; uint16 zoneId = 0; @@ -1992,13 +1992,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? item_alliance : item_horde)); stmt->setUInt32(1, (team == TEAM_ALLIANCE ? item_horde : item_alliance)); - stmt->setUInt32(2, lowGuid); + stmt->setUInt64(2, lowGuid); trans->Append(stmt); } // Delete all current quests stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); // Quest conversion @@ -2008,20 +2008,20 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 quest_horde = it->second; stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); stmt->setUInt32(1, (team == TEAM_ALLIANCE ? quest_alliance : quest_horde)); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_FACTION_CHANGE); stmt->setUInt32(0, (team == TEAM_ALLIANCE ? quest_alliance : quest_horde)); stmt->setUInt32(1, (team == TEAM_ALLIANCE ? quest_horde : quest_alliance)); - stmt->setUInt32(2, lowGuid); + stmt->setUInt64(2, lowGuid); trans->Append(stmt); } // Mark all rewarded quests as "active" (will count for completed quests achievements) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); trans->Append(stmt); // Disable all old-faction specific quests @@ -2034,7 +2034,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) if (!(quest->GetRequiredRaces() & newRaceMask)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE_BY_QUEST); - stmt->setUInt32(0, lowGuid); + stmt->setUInt64(0, lowGuid); stmt->setUInt32(1, quest->GetQuestId()); trans->Append(stmt); } @@ -2070,7 +2070,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // select old standing set in db stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_REP_BY_FACTION); stmt->setUInt32(0, oldReputation); - stmt->setUInt32(1, lowGuid); + stmt->setUInt64(1, lowGuid); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { @@ -2090,14 +2090,14 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REP_BY_FACTION); stmt->setUInt32(0, newReputation); - stmt->setUInt32(1, lowGuid); + stmt->setUInt64(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE); stmt->setUInt16(0, uint16(newReputation)); stmt->setInt32(1, newDBRep); stmt->setUInt16(2, uint16(oldReputation)); - stmt->setUInt32(3, lowGuid); + stmt->setUInt64(3, lowGuid); trans->Append(stmt); } } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 6a303f870e5..677de370e34 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1030,8 +1030,8 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); - stmt->setUInt32(0, item->GetOwnerGUID().GetCounter()); - stmt->setUInt32(1, item->GetGUID().GetCounter()); + stmt->setUInt64(0, item->GetOwnerGUID().GetCounter()); + stmt->setUInt64(1, item->GetGUID().GetCounter()); stmt->setUInt32(2, item->GetEntry()); stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS)); trans->Append(stmt); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 76e741b4da0..6c2037a1ca6 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -251,7 +251,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM); - stmt->setUInt32(0, item->GetGUID().GetCounter()); + stmt->setUInt64(0, item->GetGUID().GetCounter()); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -275,7 +275,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); - stmt->setUInt32(0, item->GetGUID().GetCounter()); + stmt->setUInt64(0, item->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index b7a8bb58af2..b2b029e1df2 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -572,12 +572,12 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans) if (itr->second.needSave) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION); - stmt->setUInt32(0, _player->GetGUID().GetCounter()); + stmt->setUInt64(0, _player->GetGUID().GetCounter()); stmt->setUInt16(1, uint16(itr->second.ID)); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION); - stmt->setUInt32(0, _player->GetGUID().GetCounter()); + stmt->setUInt64(0, _player->GetGUID().GetCounter()); stmt->setUInt16(1, uint16(itr->second.ID)); stmt->setInt32(2, itr->second.Standing); stmt->setUInt16(3, uint16(itr->second.Flags)); diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index ff42027ffc8..20ebb24b6ad 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -181,10 +181,10 @@ public: do { Field* fields = result->Fetch(); - uint32 itemGuid = fields[0].GetUInt32(); + ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64()); uint32 itemBag = fields[1].GetUInt32(); uint8 itemSlot = fields[2].GetUInt8(); - uint32 ownerGuid = fields[3].GetUInt32(); + ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[3].GetUInt64()); uint32 ownerAccountId = fields[4].GetUInt32(); std::string ownerName = fields[5].GetString(); @@ -198,7 +198,7 @@ public: else itemPos = ""; - handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid.ToString().c_str(), ownerName.c_str(), ownerGuid.ToString().c_str(), ownerAccountId, itemPos); } while (result->NextRow()); diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 01b146b68c6..2aa5fdc40e6 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -135,7 +135,7 @@ public: else { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND); - stmt->setUInt32(0, target_guid.GetCounter()); + stmt->setUInt64(0, target_guid.GetCounter()); PreparedQueryResult resultDB = CharacterDatabase.Query(stmt); if (resultDB) |