1
0

code warning fixes

This commit is contained in:
Emagi 2025-03-05 08:37:52 -05:00
parent fbe00fc46f
commit 54a215d1ba
8 changed files with 14 additions and 13 deletions

View File

@ -767,7 +767,7 @@ void Commands::Command_Bot_Help(Client* client, Seperator* sep) {
details += "18\tSarnak\n"; details += "18\tSarnak\n";
details += "19\tVampire\n"; details += "19\tVampire\n";
details += "20\tAerakyn\n"; details += "20\tAerakyn\n";
client->SendShowBook(client->GetPlayer(), title, 0, 1, details); client->SendShowBook(client->GetPlayer(), title, 0, 1, details.c_str());
return; return;
} }
else if (strncasecmp("class", sep->arg[0], 5) == 0) { else if (strncasecmp("class", sep->arg[0], 5) == 0) {
@ -822,7 +822,7 @@ void Commands::Command_Bot_Help(Client* client, Seperator* sep) {
details3 += "43\tSHAPER\n"; details3 += "43\tSHAPER\n";
details3 += "44\tCHANNELER\n"; details3 += "44\tCHANNELER\n";
client->SendShowBook(client->GetPlayer(), title, 0, 3, details, details2, details3); client->SendShowBook(client->GetPlayer(), title, 0, 3, details.c_str(), details2.c_str(), details3.c_str());
return; return;
} }
} }

View File

@ -4974,7 +4974,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
details4 += "\nSpawnScript: " + std::string(spawnScriptMsg) + "\n"; details4 += "\nSpawnScript: " + std::string(spawnScriptMsg) + "\n";
string title = string(spawn->GetName()) + "(" + to_string(spawn->GetDatabaseID()) + ")"; string title = string(spawn->GetName()) + "(" + to_string(spawn->GetDatabaseID()) + ")";
client->SendShowBook(client->GetPlayer(), title, 0, 4, details, details2, details3, details4); client->SendShowBook(client->GetPlayer(), title, 0, 4, details.c_str(), details2.c_str(), details3.c_str(), details4.c_str());
} }
else { else {
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn details (radius)"); client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn details (radius)");

View File

@ -6673,7 +6673,7 @@ int EQ2Emu_lua_GetWardValue(lua_State* state) {
else if (boost::iequals(type, "maxhitcount")) else if (boost::iequals(type, "maxhitcount"))
lua_interface->SetInt32Value(state, ward->MaxHitCount); lua_interface->SetInt32Value(state, ward->MaxHitCount);
else else
lua_interface->LogError("%s: LUA GetWardValue command argument type '%s' did not match any options", lua_interface->GetScriptName(state), type); lua_interface->LogError("%s: LUA GetWardValue command argument type '%s' did not match any options", lua_interface->GetScriptName(state), type.c_str());
spell->MSpellTargets.releasereadlock(__FUNCTION__, __LINE__); spell->MSpellTargets.releasereadlock(__FUNCTION__, __LINE__);
return 1; return 1;

View File

@ -689,7 +689,7 @@ void HTTPSClientPool::pollPeerHealth(const std::string& server, const std::strin
else if (!peer_manager.hasPrimary()) { else if (!peer_manager.hasPrimary()) {
std::string newPrimary = peer_manager.getPriorityPeer(); std::string newPrimary = peer_manager.getPriorityPeer();
if (newPrimary.size() > 0) { if (newPrimary.size() > 0) {
LogWrite(PEERING__INFO, 0, "Peering", "%s: NEW PRIMARY %s", __FUNCTION__, newPrimary); LogWrite(PEERING__INFO, 0, "Peering", "%s: NEW PRIMARY %s", __FUNCTION__, newPrimary.c_str());
peer_manager.setPrimary(newPrimary); peer_manager.setPrimary(newPrimary);
net.SetPrimary(false); net.SetPrimary(false);
} }
@ -710,7 +710,7 @@ void HTTPSClientPool::pollPeerHealth(const std::string& server, const std::strin
} }
} }
void HTTPSClientPool::pollPeerHealthData(auto client, const std::string& id, const std::string& server, const std::string& port) { void HTTPSClientPool::pollPeerHealthData(std::shared_ptr<HTTPSClient> client, const std::string& id, const std::string& server, const std::string& port) {
if (client == nullptr) { if (client == nullptr) {
} }

View File

@ -58,7 +58,7 @@ public:
// Send a request to a peer by ID and parse response as a ptree // Send a request to a peer by ID and parse response as a ptree
boost::property_tree::ptree sendRequestToPeer(const std::string& peerId, const std::string& target); boost::property_tree::ptree sendRequestToPeer(const std::string& peerId, const std::string& target);
boost::property_tree::ptree sendPostRequestToPeer(const std::string& peerId, const std::string& target, const std::string& jsonPayload); boost::property_tree::ptree sendPostRequestToPeer(const std::string& peerId, const std::string& target, const std::string& jsonPayload);
void pollPeerHealthData(auto client, const std::string& id, const std::string& server, const std::string& port); void pollPeerHealthData(std::shared_ptr<HTTPSClient> client, const std::string& id, const std::string& server, const std::string& port);
void startPolling(); // Starts asynchronous polling of peers void startPolling(); // Starts asynchronous polling of peers
void stopPolling(); // Stops the polling process void stopPolling(); // Stops the polling process

View File

@ -829,7 +829,7 @@ bool ZoneList::GetZoneByInstance(ZoneChangeDetails* zone_details, int32 instance
if(!ret && check_peers) { if(!ret && check_peers) {
std::string peerId = peer_manager.getZonePeerId("", 0, instance_id, zone_details); std::string peerId = peer_manager.getZonePeerId("", 0, instance_id, zone_details);
if(peerId.size() > 0) { if(peerId.size() > 0) {
LogWrite(WORLD__ERROR, 0, "World", "Peer %s is providing instanced zone %s for zone id %u instance id %u", peerId.c_str(), zone_details->zoneName, zone_id, instance_id); LogWrite(WORLD__ERROR, 0, "World", "Peer %s is providing instanced zone %s for zone id %u instance id %u", peerId.c_str(), zone_details->zoneName.c_str(), zone_id, instance_id);
return true; return true;
} }
} }
@ -3261,7 +3261,7 @@ void ZoneList::WatchdogHeartbeat()
if (oldest_process.size() > 0) { if (oldest_process.size() > 0) {
map<string, int32>::iterator itr = oldest_process.begin(); map<string, int32>::iterator itr = oldest_process.begin();
if(itr != oldest_process.end()) if(itr != oldest_process.end())
LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds.. while waiting for %s to reload...attempting shutdown", tmp->GetZoneName(), diff, itr->first); LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds.. while waiting for %s to reload...attempting shutdown", tmp->GetZoneName(), diff, itr->first.c_str());
else else
LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds... attempting shutdown", tmp->GetZoneName(), diff); LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds... attempting shutdown", tmp->GetZoneName(), diff);
@ -3279,7 +3279,7 @@ void ZoneList::WatchdogHeartbeat()
if (oldest_process.size() > 0) { if (oldest_process.size() > 0) {
map<string, int32>::iterator itr = oldest_process.begin(); map<string, int32>::iterator itr = oldest_process.begin();
if(itr != oldest_process.end()) if(itr != oldest_process.end())
LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds.. while waiting for %s to reload...", tmp->GetZoneName(), diff, itr->first); LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds.. while waiting for %s to reload...", tmp->GetZoneName(), diff, itr->first.c_str());
else else
LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds...", tmp->GetZoneName(), diff); LogWrite(WORLD__ERROR, 1, "World", "Zone %s is hung for %i milliseconds...", tmp->GetZoneName(), diff);
} }

View File

@ -67,7 +67,7 @@ RegionMap* RegionMap::LoadRegionMapfile(std::string filename, std::string zone_n
// Make sure file contents are for the correct zone // Make sure file contents are for the correct zone
if (found == std::string::npos) { if (found == std::string::npos) {
fclose(f); fclose(f);
LogWrite(REGION__ERROR, 0, "Region", "RegionMap::LoadRegionMapfile() map contents (%s) do not match its name (%s).", inFileName, zoneNameLwr.c_str()); LogWrite(REGION__ERROR, 0, "Region", "RegionMap::LoadRegionMapfile() map contents (%s) do not match its name (%s).", inFileName.c_str(), zoneNameLwr.c_str());
return nullptr; return nullptr;
} }

View File

@ -12310,7 +12310,7 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, int8 num_p
{ {
if (!sender) if (!sender)
{ {
LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title); LogWrite(CCLIENT__ERROR, 0, "Client", "SendShowBook missing sender for Player %s, book title %s", GetPlayer()->GetName(), title.c_str());
return; return;
} }
@ -12336,7 +12336,8 @@ void Client::SendShowBook(Spawn* sender, string title, int8 language, int8 num_p
std::string endString(""); std::string endString("");
for (int8 p = 0; p < num_pages; p++) for (int8 p = 0; p < num_pages; p++)
{ {
std::string page = va_arg(args, string); const char* pageChars = va_arg(args, const char*);
std::string page(pageChars);
switch (GetVersion()) switch (GetVersion())
{ {
// release client // release client