mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
feat: refactor slash commands system into more scalable system (#1510)
* WIP, but working * Scaffolding * testing and making it compile again * move all commands to functions * renaming to compile * fix failing tests idk how these werent failing before. Seems to have been magic. * move commandss into their namespace make help command useful fix mac error TODO: remove the multiple not founds/ rework the structure to split into help and handling * Just need to fill out the fields, but it's all there templated * Add all aliases, register missing commands * All help text * remove test logs * improvements pass through added code for optimizations and cleanup as well as reduce the amount of scoping for readability and maintainability * Update SlashCommandHandler.cpp * only save command if it is a GM command * simplify if checks * remove broken delimiter * Update SlashCommandHandler.cpp * Update SlashCommandHandler.cpp --------- Co-authored-by: David Markowitz <EmosewaMC@gmail.com>
This commit is contained in:
@@ -6197,3 +6197,15 @@ void GameMessages::HandleCancelDonationOnPlayer(RakNet::BitStream& inStream, Ent
|
||||
if (!characterComponent) return;
|
||||
characterComponent->SetCurrentInteracting(LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
void GameMessages::SendSlashCommandFeedbackText(Entity* entity, std::u16string text) {
|
||||
CBITSTREAM;
|
||||
CMSGHEADER;
|
||||
|
||||
bitStream.Write(entity->GetObjectID());
|
||||
bitStream.Write(eGameMessageType::SLASH_COMMAND_TEXT_FEEDBACK);
|
||||
bitStream.Write<uint32_t>(text.size());
|
||||
bitStream.Write(text);
|
||||
auto sysAddr = entity->GetSystemAddress();
|
||||
SEND_PACKET;
|
||||
}
|
||||
|
@@ -664,6 +664,8 @@ namespace GameMessages {
|
||||
void HandleRemoveDonationItem(RakNet::BitStream& inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||
void HandleConfirmDonationOnPlayer(RakNet::BitStream& inStream, Entity* entity);
|
||||
void HandleCancelDonationOnPlayer(RakNet::BitStream& inStream, Entity* entity);
|
||||
|
||||
void SendSlashCommandFeedbackText(Entity* entity, std::u16string text);
|
||||
};
|
||||
|
||||
#endif // GAMEMESSAGES_H
|
||||
|
Reference in New Issue
Block a user