mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Abstracted the CDClient tables
There is now an option to utilize shared memory for some CDClient tables by adding `CD_PROVIDER_MEMORY=1` to the CMakeVariables.txt file. Allows masterconfig.ini to specify another run command for the world server, to allow for easier debugging through `valgrind`.
This commit is contained in:
@@ -445,7 +445,7 @@ Behavior::Behavior(const uint32_t behaviorId)
|
||||
|
||||
this->m_effectId = templateInDatabase.effectID;
|
||||
|
||||
this->m_effectHandle = *templateInDatabase.effectHandle != "" ? new std::string(*templateInDatabase.effectHandle) : nullptr;
|
||||
this->m_effectHandle = new std::string(CDTable::GetString(templateInDatabase.effectHandle));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1754,6 +1754,40 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
if (chatCommand == "statm" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER)
|
||||
{
|
||||
// Print and format the output of /proc/self/statm
|
||||
std::ifstream statm("/proc/self/statm");
|
||||
|
||||
if (!statm.is_open())
|
||||
{
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Failed to open /proc/self/statm");
|
||||
return;
|
||||
}
|
||||
|
||||
// Scan for the different fields
|
||||
uint64_t size, resident, share, text, lib, data, dirty;
|
||||
statm >> size >> resident >> share >> text >> lib >> data >> dirty;
|
||||
|
||||
// Get the page size
|
||||
size_t pageSize = sysconf(_SC_PAGESIZE);
|
||||
|
||||
// Print the output
|
||||
ChatPackets::SendSystemMessage(
|
||||
sysAddr,
|
||||
u"Size: " + GeneralUtils::to_u16string((float) ((double) size * pageSize / 1.024e6)) +
|
||||
u"MB\nResident: " + GeneralUtils::to_u16string((float) ((double) resident * pageSize / 1.024e6)) +
|
||||
u"MB\nShared: " + GeneralUtils::to_u16string((float) ((double) share * pageSize / 1.024e6)) +
|
||||
u"MB\nText: " + GeneralUtils::to_u16string((float) ((double) text * pageSize / 1.024e6)) +
|
||||
u"MB\nLibrary: " + GeneralUtils::to_u16string((float) ((double) lib * pageSize / 1.024e6)) +
|
||||
u"MB\nData: " + GeneralUtils::to_u16string((float) ((double) data * pageSize / 1.024e6)) +
|
||||
u"MB\nDirty: " + GeneralUtils::to_u16string((float) ((double) dirty * pageSize / 1.024e6)) +
|
||||
u"MB"
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (chatCommand == "rollloot" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_OPERATOR && args.size() >= 3) {
|
||||
uint32_t lootMatrixIndex = 0;
|
||||
uint32_t targetLot = 0;
|
||||
|
Reference in New Issue
Block a user