aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_character.cpp8
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp18
-rw-r--r--src/server/scripts/Commands/cs_go.cpp4
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp19
-rw-r--r--src/server/scripts/Commands/cs_group.cpp2
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp14
-rw-r--r--src/server/scripts/Commands/cs_list.cpp22
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp8
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp46
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp2
-rw-r--r--src/server/scripts/Commands/cs_send.cpp6
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp40
12 files changed, 92 insertions, 97 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index b31c0b11d39..1b664204784 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -909,11 +909,11 @@ public:
guidStr = strtok(NULL, " ");
}
- uint32 guid = 0;
+ ObjectGuid::LowType guid = UI64LIT(0);
if (guidStr)
{
- guid = uint32(atoi(guidStr));
+ guid = strtoull(guidStr, nullptr, 10);
if (!guid)
{
handler->PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
@@ -969,7 +969,7 @@ public:
ObjectGuid guid;
// character name can't start from number
if (isNumeric(playerStr))
- guid = ObjectGuid(HIGHGUID_PLAYER, uint32(atoi(playerStr)));
+ guid = ObjectGuid(HIGHGUID_PLAYER, strtoull(playerStr, nullptr, 10));
else
{
std::string name = handler->extractPlayerNameFromLink(playerStr);
@@ -990,7 +990,7 @@ public:
return false;
}
- switch (PlayerDumpWriter().WriteDump(fileStr, uint32(guid.GetCounter())))
+ switch (PlayerDumpWriter().WriteDump(fileStr, guid.GetCounter()))
{
case DUMP_SUCCESS:
handler->PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS);
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index f93208a4186..678dd91c87d 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -373,7 +373,7 @@ public:
GameObject* obj = handler->GetNearbyGameObject();
if (!obj)
{
- handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, 0);
+ handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, UI64LIT(0));
handler->SetSentErrorMessage(true);
ifs.close();
return false;
@@ -385,7 +385,7 @@ public:
GameObject* obj = handler->GetNearbyGameObject();
if (!obj)
{
- handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, 0);
+ handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, UI64LIT(0));
handler->SetSentErrorMessage(true);
ifs.close();
return false;
@@ -928,7 +928,7 @@ public:
Map* map = handler->GetSession()->GetPlayer()->GetMap();
- if (!v->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_VEHICLE), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
+ if (!v->Create(sObjectMgr->GetGenerator<HIGHGUID_VEHICLE>()->Generate(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
{
delete v;
return false;
@@ -987,10 +987,10 @@ public:
if (!e || !f)
return false;
- uint32 guid = (uint32)atoi(e);
+ ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
uint32 index = (uint32)atoi(f);
- Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
+ Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
if (!i)
return false;
@@ -1000,7 +1000,7 @@ public:
uint32 value = i->GetUInt32Value(index);
- handler->PSendSysMessage("Item %u: value at %u is %u", guid, index, value);
+ handler->PSendSysMessage("Item " UI64FMTD ": value at %u is %u", guid, index, value);
return true;
}
@@ -1017,11 +1017,11 @@ public:
if (!e || !f || !g)
return false;
- uint32 guid = (uint32)atoi(e);
+ ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
uint32 index = (uint32)atoi(f);
uint32 value = (uint32)atoi(g);
- Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
+ Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
if (!i)
return false;
@@ -1043,7 +1043,7 @@ public:
if (!e)
return false;
- uint32 guid = (uint32)atoi(e);
+ ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index a7fa77fbe97..cd0e1dd9ea3 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -135,7 +135,7 @@ public:
float z = fields[2].GetFloat();
float o = fields[3].GetFloat();
uint32 mapId = fields[4].GetUInt16();
- uint32 guid = fields[5].GetUInt32();
+ ObjectGuid::LowType guid = fields[5].GetUInt64();
uint32 id = fields[6].GetUInt32();
Transport* transport = NULL;
@@ -278,7 +278,7 @@ public:
if (!id)
return false;
- int32 guid = atoi(id);
+ ObjectGuid::LowType guid = strtoull(id, nullptr, 10);
if (!guid)
return false;
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index cacb9e1f543..7086aa82e6f 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -81,7 +81,7 @@ public:
if (!id)
return false;
- uint32 guidLow = atoi(id);
+ ObjectGuid::LowType guidLow = strtoull(id, nullptr, 10);
if (!guidLow)
return false;
@@ -150,7 +150,7 @@ public:
Map* map = player->GetMap();
GameObject* object = new GameObject;
- uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
+ ObjectGuid::LowType guidLow = sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate();
if (!object->Create(guidLow, objectInfo->entry, map, 0, x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
@@ -293,14 +293,15 @@ public:
bool found = false;
float x, y, z, o;
- uint32 guidLow, id, phase;
+ ObjectGuid::LowType guidLow;
+ uint32 id, phase;
uint16 mapId;
uint32 poolId;
do
{
Field* fields = result->Fetch();
- guidLow = fields[0].GetUInt32();
+ guidLow = fields[0].GetUInt64();
id = fields[1].GetUInt32();
x = fields[2].GetFloat();
y = fields[3].GetFloat();
@@ -353,7 +354,7 @@ public:
if (!id)
return false;
- uint32 guidLow = atoi(id);
+ ObjectGuid::LowType guidLow = strtoull(id, nullptr, 10);
if (!guidLow)
return false;
@@ -401,7 +402,7 @@ public:
if (!id)
return false;
- uint32 guidLow = atoi(id);
+ ObjectGuid::LowType guidLow = strtoull(id, nullptr, 10);
if (!guidLow)
return false;
@@ -450,7 +451,7 @@ public:
if (!id)
return false;
- uint32 guidLow = atoi(id);
+ ObjectGuid::LowType guidLow = strtoull(id, nullptr, 10);
if (!guidLow)
return false;
@@ -569,7 +570,7 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
+ ObjectGuid::LowType guid = fields[0].GetUInt64();
uint32 entry = fields[1].GetUInt32();
float x = fields[2].GetFloat();
float y = fields[3].GetFloat();
@@ -638,7 +639,7 @@ public:
if (!id)
return false;
- uint32 guidLow = atoi(id);
+ ObjectGuid::LowType guidLow = strtoull(id, nullptr, 10);
if (!guidLow)
return false;
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index 3d524b79e79..5112a2f2e2c 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -269,7 +269,7 @@ public:
const char* onlineState = "";
// Parse the guid to uint32...
- ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
+ ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
// ... and try to extract a player out of it.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget))
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index bbf7feb9aa8..977e6ceb1e3 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -160,7 +160,7 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
return false;
- uint32 guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
+ ObjectGuid::LowType guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
if (!guildId)
return false;
@@ -186,7 +186,7 @@ public:
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &target_name))
return false;
- uint32 guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
+ ObjectGuid::LowType guildId = target ? target->GetGuildId() : Player::GetGuildIdFromDB(targetGuid);
if (!guildId)
return false;
@@ -254,15 +254,9 @@ public:
if (args && args[0] != '\0')
{
if (isNumeric(args))
- {
- uint32 guildId = uint32(atoi(args));
- guild = sGuildMgr->GetGuildById(guildId);
- }
+ guild = sGuildMgr->GetGuildById(strtoull(args, nullptr, 10));
else
- {
- std::string guildName = args;
- guild = sGuildMgr->GetGuildByName(guildName);
- }
+ guild = sGuildMgr->GetGuildByName(args);
}
else if (Player* target = handler->getSelectedPlayerOrSelf())
guild = target->GetGuild();
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 2afac2ab0c2..44e4f8714cd 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -109,7 +109,7 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
+ ObjectGuid::LowType guid = fields[0].GetUInt64();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
float z = fields[3].GetFloat();
@@ -235,9 +235,9 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 itemGuid = fields[0].GetUInt32();
- uint32 itemSender = fields[1].GetUInt32();
- uint32 itemReceiver = fields[2].GetUInt32();
+ ObjectGuid::LowType itemGuid = fields[0].GetUInt64();
+ ObjectGuid::LowType itemSender = fields[1].GetUInt64();
+ ObjectGuid::LowType itemReceiver = fields[2].GetUInt64();
uint32 itemSenderAccountId = fields[3].GetUInt32();
std::string itemSenderName = fields[4].GetString();
uint32 itemReceiverAccount = fields[5].GetUInt32();
@@ -398,7 +398,7 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
+ ObjectGuid::LowType guid = fields[0].GetUInt64();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
float z = fields[3].GetFloat();
@@ -476,7 +476,7 @@ public:
if (!*args)
return false;
- ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
+ ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
{
@@ -487,7 +487,7 @@ public:
return false;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_COUNT);
- stmt->setUInt32(0, targetGuid.GetCounter());
+ stmt->setUInt64(0, targetGuid.GetCounter());
PreparedQueryResult queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
{
@@ -499,7 +499,7 @@ public:
handler->PSendSysMessage(LANG_ACCOUNT_LIST_BAR);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_INFO);
- stmt->setUInt32(0, targetGuid.GetCounter());
+ stmt->setUInt64(0, targetGuid.GetCounter());
PreparedQueryResult queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
@@ -508,9 +508,9 @@ public:
{
Field* queryFields = queryResult->Fetch();
uint32 messageId = queryFields[0].GetUInt32();
- uint32 senderId = queryFields[1].GetUInt32();
+ ObjectGuid::LowType senderId = queryFields[1].GetUInt64();
std::string sender = queryFields[2].GetString();
- uint32 receiverId = queryFields[3].GetUInt32();
+ ObjectGuid::LowType receiverId = queryFields[3].GetUInt64();
std::string receiver = queryFields[4].GetString();
std::string subject = queryFields[5].GetString();
uint64 deliverTime = queryFields[6].GetUInt32();
@@ -536,7 +536,7 @@ public:
{
uint32 item_guid = (*result2)[0].GetUInt32();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_ITEMS);
- stmt->setUInt32(0, item_guid);
+ stmt->setUInt64(0, item_guid);
PreparedQueryResult result3 = CharacterDatabase.Query(stmt);
if (result3)
{
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index c1aee9620b8..f07dc7c18c9 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1390,7 +1390,7 @@ public:
PreparedStatement* stmt = NULL;
// To make sure we get a target, we convert our guid to an omniversal...
- ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
+ ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
// ... and make sure we get a target, somehow.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
@@ -1479,7 +1479,7 @@ public:
std::string zoneName = handler->GetTrinityString(LANG_UNKNOWN);
// Guild data print variables defined so that they exist, but are not necessarily used
- ObjectGuid::LowType guildId = 0;
+ ObjectGuid::LowType guildId = UI64LIT(0);
uint8 guildRankId = 0;
std::string guildName;
std::string guildRank;
@@ -1735,7 +1735,7 @@ public:
// Mail Data - an own query, because it may or may not be useful.
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
PreparedStatement* stmt4 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
- stmt4->setUInt32(0, lowguid);
+ stmt4->setUInt64(0, lowguid);
PreparedQueryResult result6 = CharacterDatabase.Query(stmt4);
if (result6)
{
@@ -2124,7 +2124,7 @@ public:
return false;
}
- int32 guid = atoi(guidStr);
+ ObjectGuid::LowType guid = strtoull(guidStr, nullptr, 10);
if (!guid)
{
handler->SendSysMessage(LANG_BAD_VALUE);
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 57506661cf4..feba03d259e 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -261,7 +261,7 @@ public:
if (Transport* trans = chr->GetTransport())
{
- uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
+ ObjectGuid::LowType guid = sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate();
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
data.id = id;
data.phaseMask = chr->GetPhaseMask();
@@ -279,7 +279,7 @@ public:
}
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
delete creature;
return false;
@@ -290,7 +290,7 @@ public:
creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
- uint32 db_guid = creature->GetDBTableGUIDLow();
+ ObjectGuid::LowType db_guid = creature->GetDBTableGUIDLow();
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells()
// current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior
@@ -374,7 +374,7 @@ public:
char* guidStr = strtok((char*)args, " ");
char* waitStr = strtok((char*)NULL, " ");
- uint32 lowGuid = atoi((char*)guidStr);
+ ObjectGuid::LowType lowGuid = strtoull(guidStr, nullptr, 10);
Creature* creature = NULL;
@@ -409,7 +409,7 @@ public:
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
- stmt->setUInt32(1, lowGuid);
+ stmt->setUInt64(1, lowGuid);
WorldDatabase.Execute(stmt);
@@ -522,7 +522,7 @@ public:
if (!cId)
return false;
- uint32 lowguid = atoi(cId);
+ ObjectGuid::LowType lowguid = strtoull(cId, nullptr, 10);
if (!lowguid)
return false;
@@ -799,7 +799,7 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
+ ObjectGuid::LowType guid = fields[0].GetUInt64();
uint32 entry = fields[1].GetUInt32();
float x = fields[2].GetFloat();
float y = fields[3].GetFloat();
@@ -825,7 +825,7 @@ public:
//move selected creature
static bool HandleNpcMoveCommand(ChatHandler* handler, char const* args)
{
- uint32 lowguid = 0;
+ ObjectGuid::LowType lowguid = UI64LIT(0);
Creature* creature = handler->getSelectedCreature();
@@ -836,7 +836,7 @@ public:
if (!cId)
return false;
- lowguid = atoi(cId);
+ lowguid = strtoull(cId, nullptr, 10);
/* FIXME: impossible without entry
if (lowguid)
@@ -902,7 +902,7 @@ public:
stmt->setFloat(1, y);
stmt->setFloat(2, z);
stmt->setFloat(3, o);
- stmt->setUInt32(4, lowguid);
+ stmt->setUInt64(4, lowguid);
WorldDatabase.Execute(stmt);
@@ -986,7 +986,7 @@ public:
if (!guid_str)
return false;
- uint32 lowguid = 0;
+ ObjectGuid::LowType lowguid = UI64LIT(0);
Creature* creature = NULL;
if (dontdel_str)
@@ -1028,7 +1028,7 @@ public:
}
else // case .setmovetype #creature_guid $move_type (with selected creature)
{
- lowguid = atoi((char*)guid_str);
+ lowguid = strtoull(guid_str, nullptr, 10);
/* impossible without entry
if (lowguid)
@@ -1142,14 +1142,14 @@ public:
mtype = RANDOM_MOTION_TYPE;
Creature* creature = handler->getSelectedCreature();
- uint32 guidLow = 0;
+ ObjectGuid::LowType guidLow = UI64LIT(0);
if (creature)
guidLow = creature->GetDBTableGUIDLow();
else
return false;
- creature->SetRespawnRadius((float)option);
+ creature->SetRespawnRadius(option);
creature->SetDefaultMovementType(mtype);
creature->GetMotionMaster()->Initialize();
if (creature->IsAlive()) // dead creature will reset movement generator at respawn
@@ -1162,7 +1162,7 @@ public:
stmt->setFloat(0, option);
stmt->setUInt8(1, uint8(mtype));
- stmt->setUInt32(2, guidLow);
+ stmt->setUInt64(2, guidLow);
WorldDatabase.Execute(stmt);
@@ -1191,7 +1191,7 @@ public:
}
Creature* creature = handler->getSelectedCreature();
- uint32 guidLow = 0;
+ ObjectGuid::LowType guidLow = UI64LIT(0);
if (creature)
guidLow = creature->GetDBTableGUIDLow();
@@ -1201,7 +1201,7 @@ public:
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
stmt->setUInt32(0, uint32(spawnTime));
- stmt->setUInt32(1, guidLow);
+ stmt->setUInt64(1, guidLow);
WorldDatabase.Execute(stmt);
@@ -1323,7 +1323,7 @@ public:
return false;
}
- ObjectGuid receiver_guid(HIGHGUID_PLAYER, uint32(atol(receiver_str)));
+ ObjectGuid receiver_guid(HIGHGUID_PLAYER, strtoull(receiver_str, nullptr, 10));
// check online security
Player* receiver = ObjectAccessor::FindPlayer(receiver_guid);
@@ -1455,7 +1455,7 @@ public:
if (!*args)
return false;
- uint32 leaderGUID = (uint32) atoi((char*)args);
+ ObjectGuid::LowType leaderGUID = strtoull(args, nullptr, 10);
Creature* creature = handler->getSelectedCreature();
if (!creature || !creature->GetDBTableGUIDLow())
@@ -1465,7 +1465,7 @@ public:
return false;
}
- uint32 lowguid = creature->GetDBTableGUIDLow();
+ ObjectGuid::LowType lowguid = creature->GetDBTableGUIDLow();
if (creature->GetFormation())
{
handler->PSendSysMessage("Selected creature is already member of group %u", creature->GetFormation()->GetId());
@@ -1489,8 +1489,8 @@ public:
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
- stmt->setUInt32(0, leaderGUID);
- stmt->setUInt32(1, lowguid);
+ stmt->setUInt64(0, leaderGUID);
+ stmt->setUInt64(1, lowguid);
stmt->setFloat(2, group_member->follow_dist);
stmt->setFloat(3, group_member->follow_angle);
stmt->setUInt32(4, uint32(group_member->groupAI));
@@ -1507,7 +1507,7 @@ public:
if (!*args)
return false;
- uint32 linkguid = (uint32) atoi((char*)args);
+ ObjectGuid::LowType linkguid = strtoull(args, nullptr, 10);
Creature* creature = handler->getSelectedCreature();
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 6abc7032d0d..b5186bdb948 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -243,7 +243,7 @@ public:
// prepare Quest Tracker datas
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
stmt->setUInt32(0, quest->GetQuestId());
- stmt->setUInt32(1, player->GetGUID().GetCounter());
+ stmt->setUInt64(1, player->GetGUID().GetCounter());
// add to Quest Tracker
CharacterDatabase.Execute(stmt);
diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp
index 1c13403a5a5..8c0ba551423 100644
--- a/src/server/scripts/Commands/cs_send.cpp
+++ b/src/server/scripts/Commands/cs_send.cpp
@@ -77,7 +77,7 @@ public:
std::string text = msgText;
// from console show not existed sender
- MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : UI64LIT(0), MAIL_STATIONERY_GM);
/// @todo Fix poor design
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -176,7 +176,7 @@ public:
}
// from console show not existed sender
- MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : UI64LIT(0), MAIL_STATIONERY_GM);
// fill mail
MailDraft draft(subject, text);
@@ -236,7 +236,7 @@ public:
std::string text = msgText;
// from console show not existed sender
- MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
+ MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : UI64LIT(0), MAIL_STATIONERY_GM);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index f8ef57e53c4..2222a929538 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -150,7 +150,7 @@ public:
path_number = strtok((char*)args, " ");
uint32 pathid = 0;
- uint32 guidLow = 0;
+ ObjectGuid::LowType guidLow = UI64LIT(0);
Creature* target = handler->getSelectedCreature();
// Did player provide a path_id?
@@ -183,7 +183,7 @@ public:
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID);
- stmt->setUInt32(0, guidLow);
+ stmt->setUInt64(0, guidLow);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -192,13 +192,13 @@ public:
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ADDON_PATH);
stmt->setUInt32(0, pathid);
- stmt->setUInt32(1, guidLow);
+ stmt->setUInt64(1, guidLow);
}
else
{
stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_ADDON);
- stmt->setUInt32(0, guidLow);
+ stmt->setUInt64(0, guidLow);
stmt->setUInt32(1, pathid);
}
@@ -207,7 +207,7 @@ public:
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
- stmt->setUInt32(1, guidLow);
+ stmt->setUInt64(1, guidLow);
WorldDatabase.Execute(stmt);
@@ -246,8 +246,8 @@ public:
return true;
}
- uint32 guidLow = target->GetDBTableGUIDLow();
- if (guidLow == 0)
+ ObjectGuid::LowType guidLow = target->GetDBTableGUIDLow();
+ if (!guidLow)
{
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target is not saved to DB.");
return true;
@@ -261,14 +261,14 @@ public:
}
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON);
- stmt->setUInt32(0, guidLow);
+ stmt->setUInt64(0, guidLow);
WorldDatabase.Execute(stmt);
target->UpdateWaypointID(0);
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
stmt->setUInt8(0, uint8(IDLE_MOTION_TYPE));
- stmt->setUInt32(1, guidLow);
+ stmt->setUInt64(1, guidLow);
WorldDatabase.Execute(stmt);
target->LoadPath(0);
@@ -577,7 +577,7 @@ public:
// Check the creature
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID);
- stmt->setUInt32(0, wpGuid.GetCounter());
+ stmt->setUInt64(0, wpGuid.GetCounter());
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
@@ -674,7 +674,7 @@ public:
}
// re-create
Creature* wpCreature2 = new Creature();
- if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
+ if (!wpCreature2->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -790,7 +790,7 @@ public:
}
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID);
- stmt->setUInt32(0, target->GetGUID().GetCounter());
+ stmt->setUInt64(0, target->GetGUID().GetCounter());
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
@@ -849,7 +849,7 @@ public:
do
{
Field* fields = result2->Fetch();
- uint32 wpguid = fields[0].GetUInt32();
+ ObjectGuid::LowType wpguid = fields[0].GetUInt64();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpguid));
if (!creature)
@@ -858,7 +858,7 @@ public:
hasError = true;
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
- stmt->setUInt32(0, wpguid);
+ stmt->setUInt64(0, wpguid);
WorldDatabase.Execute(stmt);
}
else
@@ -894,7 +894,7 @@ public:
float o = chr->GetOrientation();
Creature* wpCreature = new Creature();
- if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
+ if (!wpCreature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@@ -906,7 +906,7 @@ public:
// Set "wpguid" column to the visual waypoint
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
- stmt->setUInt32(0, wpCreature->GetGUID().GetCounter());
+ stmt->setUInt64(0, wpCreature->GetGUID().GetCounter());
stmt->setUInt32(1, pathid);
stmt->setUInt32(2, point);
WorldDatabase.Execute(stmt);
@@ -959,7 +959,7 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete creature;
@@ -1011,7 +1011,7 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete creature;
@@ -1054,7 +1054,7 @@ public:
do
{
Field* fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
+ ObjectGuid::LowType guid = fields[0].GetUInt64();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, guid));
if (!creature)
{
@@ -1062,7 +1062,7 @@ public:
hasError = true;
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
- stmt->setUInt32(0, guid);
+ stmt->setUInt64(0, guid);
WorldDatabase.Execute(stmt);
}
else