mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 16:58:02 +00:00
Migrate getZoneX calls and npc types calls [skip ci]
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ bool Adventure::Process()
|
||||
|
||||
bool Adventure::CreateInstance()
|
||||
{
|
||||
uint32 zone_id = database.GetZoneID(adventure_template->zone);
|
||||
uint32 zone_id = content_db.GetZoneID(adventure_template->zone);
|
||||
if(!zone_id)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -771,7 +771,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
||||
sizeof(ServerPlayerClickedAdventureDoorReply_Struct));
|
||||
ServerPlayerClickedAdventureDoorReply_Struct *sr = (ServerPlayerClickedAdventureDoorReply_Struct*)pack->pBuffer;
|
||||
strcpy(sr->player, player);
|
||||
sr->zone_id = database.GetZoneID(t->zone);
|
||||
sr->zone_id = content_db.GetZoneID(t->zone);
|
||||
sr->instance_id = (*iter)->GetInstanceID();
|
||||
sr->x = t->dest_x;
|
||||
sr->y = t->dest_y;
|
||||
|
||||
+8
-8
@@ -785,7 +785,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
|
||||
if (tutorial_enabled) {
|
||||
zone_id = RuleI(World, TutorialZoneID);
|
||||
database.MoveCharacterToZone(charid, database.GetZoneName(zone_id));
|
||||
database.MoveCharacterToZone(charid, content_db.GetZoneName(zone_id));
|
||||
}
|
||||
else {
|
||||
LogInfo("[{}] is trying to go to tutorial but are not allowed", char_name);
|
||||
@@ -796,7 +796,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
}
|
||||
}
|
||||
|
||||
if (zone_id == 0 || !database.GetZoneName(zone_id)) {
|
||||
if (zone_id == 0 || !content_db.GetZoneName(zone_id)) {
|
||||
// This is to save people in an invalid zone, once it's removed from the DB
|
||||
database.MoveCharacterToZone(charid, "arena");
|
||||
LogInfo("Zone not found in database zone_id=[{}], moveing char to arena character:[{}]", zone_id, char_name);
|
||||
@@ -1154,7 +1154,7 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
else
|
||||
zone_server = zoneserver_list.FindByZoneID(zone_id);
|
||||
|
||||
const char *zone_name = database.GetZoneName(zone_id, true);
|
||||
const char *zone_name = content_db.GetZoneName(zone_id, true);
|
||||
if (zone_server) {
|
||||
if (false == enter_world_triggered) {
|
||||
//Drop any clients we own in other zones.
|
||||
@@ -1267,7 +1267,7 @@ void Client::Clearance(int8 response)
|
||||
return;
|
||||
}
|
||||
|
||||
const char* zonename = database.GetZoneName(zone_id);
|
||||
const char* zonename = content_db.GetZoneName(zone_id);
|
||||
if (zonename == 0) {
|
||||
LogInfo("zonename is nullptr in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
@@ -1322,7 +1322,7 @@ void Client::Clearance(int8 response)
|
||||
void Client::TellClientZoneUnavailable() {
|
||||
auto outapp = new EQApplicationPacket(OP_ZoneUnavail, sizeof(ZoneUnavail_Struct));
|
||||
ZoneUnavail_Struct* ua = (ZoneUnavail_Struct*)outapp->pBuffer;
|
||||
const char* zonename = database.GetZoneName(zone_id);
|
||||
const char* zonename = content_db.GetZoneName(zone_id);
|
||||
if (zonename)
|
||||
strcpy(ua->zonename, zonename);
|
||||
QueuePacket(outapp);
|
||||
@@ -1581,11 +1581,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f",
|
||||
database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
|
||||
content_db.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Bind location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||
database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
|
||||
content_db.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Home location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||
database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
|
||||
content_db.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
|
||||
|
||||
/* Starting Items inventory */
|
||||
content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin());
|
||||
|
||||
@@ -293,7 +293,7 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect
|
||||
if (cle->LSID())
|
||||
AppendAnyLenString(&output, &outsize, &outlen, "%s LSID: %i LSName: %s WorldAdmin: %i", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin());
|
||||
if (cle->CharID())
|
||||
AppendAnyLenString(&output, &outsize, &outlen, "%s CharID: %i CharName: %s Zone: %s (%i)", newline, cle->CharID(), cle->name(), database.GetZoneName(cle->zone()), cle->zone());
|
||||
AppendAnyLenString(&output, &outsize, &outlen, "%s CharID: %i CharName: %s Zone: %s (%i)", newline, cle->CharID(), cle->name(), content_db.GetZoneName(cle->zone()), cle->zone());
|
||||
if (outlen >= 3072) {
|
||||
connection->SendEmoteMessageRaw(to, 0, 0, 10, output);
|
||||
safe_delete(output);
|
||||
@@ -500,7 +500,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
countclients.Reset();
|
||||
while(countclients.MoreElements()){
|
||||
countcle = countclients.GetData();
|
||||
const char* tmpZone = database.GetZoneName(countcle->zone());
|
||||
const char* tmpZone = content_db.GetZoneName(countcle->zone());
|
||||
if (
|
||||
(countcle->Online() >= CLE_Status::Zoning) &&
|
||||
(!countcle->GetGM() || countcle->Anon() != 1 || admin >= countcle->Admin()) &&
|
||||
@@ -580,7 +580,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
while(iterator.MoreElements()) {
|
||||
cle = iterator.GetData();
|
||||
|
||||
const char* tmpZone = database.GetZoneName(cle->zone());
|
||||
const char* tmpZone = content_db.GetZoneName(cle->zone());
|
||||
if (
|
||||
(cle->Online() >= CLE_Status::Zoning) &&
|
||||
(!cle->GetGM() || cle->Anon() != 1 || admin >= cle->Admin()) &&
|
||||
@@ -965,7 +965,7 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct*
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
cle = iterator.GetData();
|
||||
const char* tmpZone = database.GetZoneName(cle->zone());
|
||||
const char* tmpZone = content_db.GetZoneName(cle->zone());
|
||||
if (
|
||||
(cle->Online() >= CLE_Status::Zoning)
|
||||
&& (whom == 0 || (
|
||||
@@ -1282,7 +1282,7 @@ void ClientList::GetClients(const char *zone_name, std::vector<ClientListEntry *
|
||||
iterator.Advance();
|
||||
}
|
||||
} else {
|
||||
uint32 zoneid = database.GetZoneID(zone_name);
|
||||
uint32 zoneid = content_db.GetZoneID(zone_name);
|
||||
while(iterator.MoreElements()) {
|
||||
ClientListEntry* tmp = iterator.GetData();
|
||||
if(tmp->zone() == zoneid)
|
||||
|
||||
+6
-6
@@ -541,7 +541,7 @@ void ConsoleZoneShutdown(
|
||||
s->ZoneServerID = atoi(args[0].c_str());
|
||||
}
|
||||
else {
|
||||
s->zoneid = database.GetZoneID(args[0].c_str());
|
||||
s->zoneid = content_db.GetZoneID(args[0].c_str());
|
||||
}
|
||||
|
||||
ZoneServer *zs = 0;
|
||||
@@ -549,7 +549,7 @@ void ConsoleZoneShutdown(
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
}
|
||||
else if (s->zoneid != 0) {
|
||||
zs = zoneserver_list.FindByName(database.GetZoneName(s->zoneid));
|
||||
zs = zoneserver_list.FindByName(content_db.GetZoneName(s->zoneid));
|
||||
}
|
||||
else {
|
||||
connection->SendLine("Error: ZoneShutdown: neither ID nor name specified");
|
||||
@@ -633,10 +633,10 @@ void ConsoleZoneLock(
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 tmp = database.GetZoneID(args[1].c_str());
|
||||
uint16 tmp = content_db.GetZoneID(args[1].c_str());
|
||||
if (tmp) {
|
||||
if (zoneserver_list.SetLockedZone(tmp, true)) {
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", database.GetZoneName(tmp));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", content_db.GetZoneName(tmp));
|
||||
}
|
||||
else {
|
||||
connection->SendLine("Failed to change lock");
|
||||
@@ -651,10 +651,10 @@ void ConsoleZoneLock(
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 tmp = database.GetZoneID(args[1].c_str());
|
||||
uint16 tmp = content_db.GetZoneID(args[1].c_str());
|
||||
if (tmp) {
|
||||
if (zoneserver_list.SetLockedZone(tmp, false)) {
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", database.GetZoneName(tmp));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", content_db.GetZoneName(tmp));
|
||||
}
|
||||
else {
|
||||
connection->SendLine("Failed to change lock");
|
||||
|
||||
@@ -616,7 +616,7 @@ void Console::ProcessCommand(const char* command) {
|
||||
if(sep.arg[1][0]==0 || sep.arg[2][0] == 0)
|
||||
SendMessage(1, "Usage: movechar [charactername] [zonename]");
|
||||
else {
|
||||
if (!database.GetZoneID(sep.arg[2]))
|
||||
if (!content_db.GetZoneID(sep.arg[2]))
|
||||
SendMessage(1, "Error: Zone '%s' not found", sep.arg[2]);
|
||||
else if (!database.CheckUsedName((char*) sep.arg[1])) {
|
||||
if (!database.MoveCharacterToZone((char*) sep.arg[1], (char*) sep.arg[2]))
|
||||
@@ -711,13 +711,13 @@ void Console::ProcessCommand(const char* command) {
|
||||
if (sep.arg[1][0] >= '0' && sep.arg[1][0] <= '9')
|
||||
s->ZoneServerID = atoi(sep.arg[1]);
|
||||
else
|
||||
s->zoneid = database.GetZoneID(sep.arg[1]);
|
||||
s->zoneid = content_db.GetZoneID(sep.arg[1]);
|
||||
|
||||
ZoneServer* zs = 0;
|
||||
if (s->ZoneServerID != 0)
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
else if (s->zoneid != 0)
|
||||
zs = zoneserver_list.FindByName(database.GetZoneName(s->zoneid));
|
||||
zs = zoneserver_list.FindByName(content_db.GetZoneName(s->zoneid));
|
||||
else
|
||||
SendMessage(1, "Error: ZoneShutdown: neither ID nor name specified");
|
||||
|
||||
@@ -828,10 +828,10 @@ void Console::ProcessCommand(const char* command) {
|
||||
zoneserver_list.ListLockedZones(0, this);
|
||||
}
|
||||
else if (strcasecmp(sep.arg[1], "lock") == 0 && admin >= 101) {
|
||||
uint16 tmp = database.GetZoneID(sep.arg[2]);
|
||||
uint16 tmp = content_db.GetZoneID(sep.arg[2]);
|
||||
if (tmp) {
|
||||
if (zoneserver_list.SetLockedZone(tmp, true))
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", database.GetZoneName(tmp));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", content_db.GetZoneName(tmp));
|
||||
else
|
||||
SendMessage(1, "Failed to change lock");
|
||||
}
|
||||
@@ -839,10 +839,10 @@ void Console::ProcessCommand(const char* command) {
|
||||
SendMessage(1, "Usage: #zonelock lock [zonename]");
|
||||
}
|
||||
else if (strcasecmp(sep.arg[1], "unlock") == 0 && admin >= 101) {
|
||||
uint16 tmp = database.GetZoneID(sep.arg[2]);
|
||||
uint16 tmp = content_db.GetZoneID(sep.arg[2]);
|
||||
if (tmp) {
|
||||
if (zoneserver_list.SetLockedZone(tmp, false))
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", database.GetZoneName(tmp));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", content_db.GetZoneName(tmp));
|
||||
else
|
||||
SendMessage(1, "Failed to change lock");
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void EQLConfig::StartZone(Const_char *zone_ref) {
|
||||
|
||||
bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
|
||||
//make sure the short name is valid.
|
||||
if(database.GetZoneID(short_name) == 0)
|
||||
if(content_db.GetZoneID(short_name) == 0)
|
||||
return false;
|
||||
|
||||
//database update
|
||||
@@ -191,7 +191,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
|
||||
|
||||
bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
||||
//make sure the short name is valid.
|
||||
if(database.GetZoneID(short_name) == 0)
|
||||
if(content_db.GetZoneID(short_name) == 0)
|
||||
return false;
|
||||
|
||||
//check internal state
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ std::map<std::string,std::string> EQW::GetPlayerDetails(Const_char *char_name) {
|
||||
res["character"] = cle->name();
|
||||
res["account"] = cle->AccountName();
|
||||
res["account_id"] = itoa(cle->AccountID());
|
||||
res["location_short"] = cle->zone()?database.GetZoneName(cle->zone()):"No Zone";
|
||||
res["location_short"] = cle->zone()?content_db.GetZoneName(cle->zone()):"No Zone";
|
||||
res["location_long"] = res["location_short"];
|
||||
res["location_id"] = itoa(cle->zone());
|
||||
res["ip"] = long2ip(cle->GetIP());
|
||||
|
||||
+2
-2
@@ -251,7 +251,7 @@ void ZSList::ListLockedZones(const char* to, WorldTCPConnection* connection) {
|
||||
int x = 0;
|
||||
for (auto &zone : pLockedZones) {
|
||||
if (zone) {
|
||||
connection->SendEmoteMessageRaw(to, 0, 0, 0, database.GetZoneName(zone, true));
|
||||
connection->SendEmoteMessageRaw(to, 0, 0, 0, content_db.GetZoneName(zone, true));
|
||||
x++;
|
||||
}
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void ZSList::SOPZoneBootup(const char* adminname, uint32 ZoneServerID, const cha
|
||||
ZoneServer* zs = 0;
|
||||
ZoneServer* zs2 = 0;
|
||||
uint32 zoneid;
|
||||
if (!(zoneid = database.GetZoneID(zonename)))
|
||||
if (!(zoneid = content_db.GetZoneID(zonename)))
|
||||
SendEmoteMessage(adminname, 0, 0, 0, "Error: SOP_ZoneBootup: zone '%s' not found in 'zone' table. Typo protection=ON.", zonename);
|
||||
else {
|
||||
if (ZoneServerID != 0)
|
||||
|
||||
@@ -86,7 +86,7 @@ ZoneServer::~ZoneServer() {
|
||||
bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
|
||||
is_booting_up = false;
|
||||
|
||||
const char* zn = MakeLowerString(database.GetZoneName(iZoneID));
|
||||
const char* zn = MakeLowerString(content_db.GetZoneName(iZoneID));
|
||||
char* longname;
|
||||
|
||||
if (iZoneID)
|
||||
@@ -566,7 +566,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
SetZone_Struct* szs = (SetZone_Struct*)pack->pBuffer;
|
||||
if (szs->zoneid != 0) {
|
||||
if (database.GetZoneName(szs->zoneid))
|
||||
if (content_db.GetZoneName(szs->zoneid))
|
||||
SetZone(szs->zoneid, szs->instanceid, szs->staticzone);
|
||||
else
|
||||
SetZone(0);
|
||||
@@ -648,7 +648,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
if (s->ZoneServerID != 0)
|
||||
zs = zoneserver_list.FindByID(s->ZoneServerID);
|
||||
else if (s->zoneid != 0)
|
||||
zs = zoneserver_list.FindByName(database.GetZoneName(s->zoneid));
|
||||
zs = zoneserver_list.FindByName(content_db.GetZoneName(s->zoneid));
|
||||
else
|
||||
zoneserver_list.SendEmoteMessage(s->adminname, 0, 0, 0, "Error: SOP_ZoneShutdown: neither ID nor name specified");
|
||||
|
||||
@@ -660,7 +660,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_ZoneBootup: {
|
||||
ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *)pack->pBuffer;
|
||||
zoneserver_list.SOPZoneBootup(s->adminname, s->ZoneServerID, database.GetZoneName(s->zoneid), s->makestatic);
|
||||
zoneserver_list.SOPZoneBootup(s->adminname, s->ZoneServerID, content_db.GetZoneName(s->zoneid), s->makestatic);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZoneStatus: {
|
||||
@@ -1018,13 +1018,13 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
break;
|
||||
case 1:
|
||||
if (zoneserver_list.SetLockedZone(s->zoneID, true))
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", database.GetZoneName(s->zoneID));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", content_db.GetZoneName(s->zoneID));
|
||||
else
|
||||
this->SendEmoteMessageRaw(s->adminname, 0, 0, 0, "Failed to change lock");
|
||||
break;
|
||||
case 2:
|
||||
if (zoneserver_list.SetLockedZone(s->zoneID, false))
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", database.GetZoneName(s->zoneID));
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", content_db.GetZoneName(s->zoneID));
|
||||
else
|
||||
this->SendEmoteMessageRaw(s->adminname, 0, 0, 0, "Failed to change lock");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user