diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 48 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/World/action_ip_logger.cpp | 3 |
4 files changed, 32 insertions, 33 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 6e808bea980..a99ad2e8752 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -509,8 +509,8 @@ public: if (!target) return false; - handler->PSendSysMessage("Loot recipient for creature %s (GUID %u, SpawnID %u) is %s", - target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetSpawnId(), + handler->PSendSysMessage("Loot recipient for creature %s (%s, SpawnID %u) is %s", + target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetSpawnId(), target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName().c_str() : "offline") : "no loot recipient"); return true; } @@ -599,7 +599,7 @@ public: break; } - handler->PSendSysMessage("bag: %d slot: %d guid: %d - state: %s", bagSlot, item->GetSlot(), item->GetGUID().GetCounter(), st.c_str()); + handler->PSendSysMessage("bag: %d slot: %d %s - state: %s", bagSlot, item->GetSlot(), item->GetGUID().ToString().c_str(), st.c_str()); } if (updateQueue.empty()) handler->PSendSysMessage("The player's updatequeue is empty"); @@ -620,7 +620,7 @@ public: if (item->GetSlot() != i) { - handler->PSendSysMessage("Item with slot %d and guid %d has an incorrect slot value: %d", i, item->GetGUID().GetCounter(), item->GetSlot()); + handler->PSendSysMessage("Item with slot %d and %s has an incorrect slot value: %d", i, item->GetGUID().ToString().c_str(), item->GetSlot()); error = true; continue; } @@ -644,28 +644,28 @@ public: uint16 qp = item->GetQueuePos(); if (qp > updateQueue.size()) { - handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) larger than the update queue size! ", item->GetSlot(), item->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item with slot %d and %s has its queuepos (%d) larger than the update queue size! ", item->GetSlot(), item->GetGUID().ToString().c_str(), qp); error = true; continue; } if (updateQueue[qp] == nullptr) { - handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item with slot %d and %s has its queuepos (%d) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().ToString().c_str(), qp); error = true; continue; } if (updateQueue[qp] != item) { - handler->PSendSysMessage("The item with slot %d and guid %d has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)", item->GetSlot(), item->GetGUID().GetCounter(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().GetCounter()); + handler->PSendSysMessage("The item with slot %d and %s has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, %s)", item->GetSlot(), item->GetGUID().ToString().c_str(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString().c_str()); error = true; continue; } } else if (item->GetState() != ITEM_UNCHANGED) { - handler->PSendSysMessage("The item with slot %d and guid %d is not in queue but should be (state: %d)!", item->GetSlot(), item->GetGUID().GetCounter(), item->GetState()); + handler->PSendSysMessage("The item with slot %d and %s is not in queue but should be (state: %d)!", item->GetSlot(), item->GetGUID().ToString().c_str(), item->GetState()); error = true; continue; } @@ -680,7 +680,7 @@ public: if (item2->GetSlot() != j) { - handler->PSendSysMessage("The item in bag %d and slot %d (guid: %d) has an incorrect slot value: %d", bag->GetSlot(), j, item2->GetGUID().GetCounter(), item2->GetSlot()); + handler->PSendSysMessage("The item in bag %d and slot %d (%s) has an incorrect slot value: %d", bag->GetSlot(), j, item2->GetGUID().ToString().c_str(), item2->GetSlot()); error = true; continue; } @@ -712,28 +712,28 @@ public: uint16 qp = item2->GetQueuePos(); if (qp > updateQueue.size()) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) larger than the update queue size! ", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item in bag %d at slot %d having %s has a queuepos (%d) larger than the update queue size! ", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), qp); error = true; continue; } if (updateQueue[qp] == nullptr) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item in bag %d at slot %d having %s has a queuepos (%d) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), qp); error = true; continue; } if (updateQueue[qp] != item2) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().GetCounter()); + handler->PSendSysMessage("The item in bag %d at slot %d having %s has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, %s)", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString().c_str()); error = true; continue; } } else if (item2->GetState() != ITEM_UNCHANGED) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d is not in queue but should be (state: %d)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), item2->GetState()); + handler->PSendSysMessage("The item in bag %d at slot %d having %s is not in queue but should be (state: %d)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), item2->GetState()); error = true; continue; } @@ -808,21 +808,21 @@ public: ThreatManager& mgr = target->GetThreatManager(); if (!target->IsAlive()) { - handler->PSendSysMessage("%s (GUID %u) is not alive.%s", target->GetName().c_str(), target->GetGUID().GetCounter(), target->IsEngaged() ? " (It is, however, engaged. Huh?)" : ""); + handler->PSendSysMessage("%s (%s) is not alive.%s", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->IsEngaged() ? " (It is, however, engaged. Huh?)" : ""); return true; } uint32 count = 0; auto const& threatenedByMe = target->GetThreatManager().GetThreatenedByMeList(); if (threatenedByMe.empty()) - handler->PSendSysMessage("%s (GUID %u) does not threaten any units.", target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage("%s (%s) does not threaten any units.", target->GetName().c_str(), target->GetGUID().ToString().c_str()); else { - handler->PSendSysMessage("List of units threatened by %s (GUID %u)", target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage("List of units threatened by %s (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str()); for (auto const& pair : threatenedByMe) { Unit* unit = pair.second->GetOwner(); - handler->PSendSysMessage(" %u. %s (GUID %u, SpawnID %u) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUID().GetCounter(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0, pair.second->GetThreat()); + handler->PSendSysMessage(" %u. %s (%s, SpawnID %u) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUID().ToString().c_str(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0, pair.second->GetThreat()); } handler->SendSysMessage("End of threatened-by-me list."); } @@ -832,9 +832,9 @@ public: if (!mgr.IsThreatListEmpty(true)) { if (target->IsEngaged()) - handler->PSendSysMessage("Threat list of %s (GUID %u, SpawnID %u):", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); + handler->PSendSysMessage("Threat list of %s (%s, SpawnID %u):", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); else - handler->PSendSysMessage("%s (GUID %u, SpawnID %u) is not engaged, but still has a threat list? Well, here it is:", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); + handler->PSendSysMessage("%s (%s, SpawnID %u) is not engaged, but still has a threat list? Well, here it is:", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); count = 0; Unit* fixateVictim = mgr.GetFixateTarget(); @@ -868,19 +868,19 @@ public: default: tauntStr = ""; } - handler->PSendSysMessage(" %u. %s (GUID %u) - threat %f%s%s", ++count, unit->GetName().c_str(), unit->GetGUID().GetCounter(), ref->GetThreat(), tauntStr, onlineStr); + handler->PSendSysMessage(" %u. %s (%s) - threat %f%s%s", ++count, unit->GetName().c_str(), unit->GetGUID().ToString().c_str(), ref->GetThreat(), tauntStr, onlineStr); } handler->SendSysMessage("End of threat list."); } else if (!target->IsEngaged()) - handler->PSendSysMessage("%s (GUID %u, SpawnID %u) is not currently engaged.", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); + handler->PSendSysMessage("%s (%s, SpawnID %u) is not currently engaged.", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); else - handler->PSendSysMessage("%s (GUID %u, SpawnID %u) seems to be engaged, but does not have a threat list??", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); + handler->PSendSysMessage("%s (%s, SpawnID %u) seems to be engaged, but does not have a threat list??", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0); } else if (target->IsEngaged()) - handler->PSendSysMessage("%s (GUID %u) is currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage("%s (%s) is currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().ToString().c_str()); else - handler->PSendSysMessage("%s (GUID %u) is not currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage("%s (%s) is not currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().ToString().c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index b7bc562053a..56e5dd52642 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -188,10 +188,10 @@ public: do { Field* fields = result->Fetch(); - uint32 itemGuid = fields[0].GetUInt32(); + ObjectGuid itemGuid = ObjectGuid::Create<HighGuid::Item>(fields[0].GetUInt32()); uint32 itemBag = fields[1].GetUInt32(); uint8 itemSlot = fields[2].GetUInt8(); - uint32 ownerGuid = fields[3].GetUInt32(); + ObjectGuid ownerGuid = ObjectGuid::Create<HighGuid::Player>(fields[3].GetUInt32()); uint32 ownerAccountId = fields[4].GetUInt32(); std::string ownerName = fields[5].GetString(); @@ -205,7 +205,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/Northrend/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp index df5e4641552..5953458f119 100644 --- a/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp @@ -170,13 +170,13 @@ class spell_ioc_parachute_ic : public AuraScript class StartLaunchEvent : public BasicEvent { public: - StartLaunchEvent(Position const& pos, ObjectGuid::LowType lowGuid) : _pos(pos), _lowGuid(lowGuid) + StartLaunchEvent(Position const& pos, ObjectGuid const& guid) : _pos(pos), _guid(guid) { } bool Execute(uint64 /*time*/, uint32 /*diff*/) override { - Player* player = ObjectAccessor::FindPlayerByLowGUID(_lowGuid); + Player* player = ObjectAccessor::FindPlayer(_guid); if (!player || !player->GetVehicle()) return true; @@ -191,7 +191,7 @@ class StartLaunchEvent : public BasicEvent private: Position _pos; - ObjectGuid::LowType _lowGuid; + ObjectGuid _guid; }; // 66218 - Launch @@ -204,7 +204,7 @@ class spell_ioc_launch : public SpellScript if (!GetCaster()->ToCreature() || !GetExplTargetDest()) return; - GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), ASSERT_NOTNULL(GetHitPlayer())->GetGUID().GetCounter()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms)); + GetCaster()->ToCreature()->m_Events.AddEvent(new StartLaunchEvent(*GetExplTargetDest(), ASSERT_NOTNULL(GetHitPlayer())->GetGUID()), GetCaster()->ToCreature()->m_Events.CalculateTime(2500ms)); } void Register() override diff --git a/src/server/scripts/World/action_ip_logger.cpp b/src/server/scripts/World/action_ip_logger.cpp index f5e1f05569d..71550d2a800 100644 --- a/src/server/scripts/World/action_ip_logger.cpp +++ b/src/server/scripts/World/action_ip_logger.cpp @@ -206,7 +206,6 @@ class CharacterActionIpLogger : public PlayerScript // We declare all the required variables uint32 playerGuid = player->GetSession()->GetAccountId(); - ObjectGuid::LowType characterGuid = player->GetGUID().GetCounter(); uint32 realmId = realm.Id.Realm; const std::string currentIp = player->GetSession()->GetRemoteAddress(); std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it... @@ -240,7 +239,7 @@ class CharacterActionIpLogger : public PlayerScript LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_CHAR_IP_LOGGING); stmt->setUInt32(0, playerGuid); - stmt->setUInt64(1, characterGuid); + stmt->setUInt64(1, player->GetGUID().GetCounter()); stmt->setUInt32(2, realmId); stmt->setUInt8(3, aType); stmt->setString(4, currentIp); // We query the ip here. |
