mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Merge pull request #1715 from DarkflameUniverse/webapiv2
feat: Chat Web API (now with no threading)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user