Merge pull request #1715 from DarkflameUniverse/webapiv2

feat: Chat Web API (now with no threading)
This commit is contained in:
Gie "Max" Vanommeslaeghe
2025-01-17 22:38:15 +01:00
committed by GitHub
26 changed files with 49187 additions and 17 deletions

View File

@@ -82,7 +82,7 @@ void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, c
if (serverType == ServerType::Auth) bitStream.Write(ServiceId::Auth);
else if (serverType == ServerType::World) bitStream.Write(ServiceId::World);
else bitStream.Write(ServiceId::General);
bitStream.Write<uint64_t>(219818241584);
bitStream.Write<uint64_t>(219818307120);
server->Send(bitStream, sysAddr, false);
}

View File

@@ -97,3 +97,13 @@ void ChatPackets::SendMessageFail(const SystemAddress& sysAddr) {
//docs say there's a wstring here-- no idea what it's for, or if it's even needed so leaving it as is for now.
SEND_PACKET;
}
void ChatPackets::Announcement::Send() {
CBITSTREAM;
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, MessageType::Chat::GM_ANNOUNCE);
bitStream.Write<uint32_t>(title.size());
bitStream.Write(title);
bitStream.Write<uint32_t>(message.size());
bitStream.Write(message);
SEND_PACKET_BROADCAST;
}

View File

@@ -27,6 +27,13 @@ struct FindPlayerRequest{
};
namespace ChatPackets {
struct Announcement {
std::string title;
std::string message;
void Send();
};
void SendChatMessage(const SystemAddress& sysAddr, char chatChannel, const std::string& senderName, LWOOBJID playerObjectID, bool senderMythran, const std::u16string& message);
void SendSystemMessage(const SystemAddress& sysAddr, const std::u16string& message, bool broadcast = false);
void SendMessageFail(const SystemAddress& sysAddr);