mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 23:08:31 +00:00
feat: slashcommands for showall, findplayer, get/openhttpmoninfo, and debug world packet (#1545)
* feat: showall, findplayer, get/openhttpmoninfo http monitor info is planned to be used later, just putting in info that i've since reverse engineered and don't want lost Additionally add debug world packet for duture dev use Tested all new commands and variation of command arguments * fix missing newline at eofs * address most feedback * Compormise and use struct with (de)serialize * remove httpmoninfo commands
This commit is contained in:
@@ -287,4 +287,39 @@ namespace GMGreaterThanZeroCommands {
|
||||
std::string name = entity->GetCharacter()->GetName() + " - " + args;
|
||||
GameMessages::SendSetName(entity->GetObjectID(), GeneralUtils::UTF8ToUTF16(name), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void ShowAll(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||
bool displayZoneData = true;
|
||||
bool displayIndividualPlayers = true;
|
||||
const auto splitArgs = GeneralUtils::SplitString(args, ' ');
|
||||
|
||||
if (!splitArgs.empty() && !splitArgs.at(0).empty()) displayZoneData = splitArgs.at(0) == "1";
|
||||
if (splitArgs.size() > 1) displayIndividualPlayers = splitArgs.at(1) == "1";
|
||||
|
||||
ShowAllRequest request {
|
||||
.requestor = entity->GetObjectID(),
|
||||
.displayZoneData = displayZoneData,
|
||||
.displayIndividualPlayers = displayIndividualPlayers
|
||||
};
|
||||
|
||||
CBITSTREAM;
|
||||
request.Serialize(bitStream);
|
||||
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
|
||||
}
|
||||
|
||||
void FindPlayer(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||
if (args.empty()) {
|
||||
GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given");
|
||||
return;
|
||||
}
|
||||
|
||||
FindPlayerRequest request {
|
||||
.requestor = entity->GetObjectID(),
|
||||
.playerName = LUWString(args)
|
||||
};
|
||||
|
||||
CBITSTREAM;
|
||||
request.Serialize(bitStream);
|
||||
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user