mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
Every server now splits its packet counts by peer: its own connections (players on auth and worlds), its master link, or other servers (the worlds on chat, every server on master, a world's chat link, which is now counted too). HTTP requests carrying X-Darkflame-Server count as another server's, the dashboard counts its own requests to the UGC server, and each HTTP client address is counted. The report also gets each RakNet connection's statistics (worlds name the player on it), trimmed to the 32 busiest with the rest summed. Counting stays on the main loop, except the dashboard's UGC fetches, which only touch the locked recorder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
589 B
C++
18 lines
589 B
C++
#ifndef CHATSERVERLINK_H
|
|
#define CHATSERVERLINK_H
|
|
|
|
#include "PacketPriority.h"
|
|
|
|
struct LUBitStream;
|
|
|
|
// A world's connection to the chat server
|
|
namespace ChatServerLink {
|
|
// World -> chat: sends msg (a ChatPackets struct) over the world's chat connection
|
|
void Send(const LUBitStream& msg, PacketPriority priority = SYSTEM_PRIORITY, PacketReliability reliability = RELIABLE);
|
|
|
|
// Counts a packet the world received from chat in its traffic diagnostics (TrafficStats, as another server's)
|
|
void CountReceived(const unsigned char* data, unsigned int length);
|
|
}
|
|
|
|
#endif // CHATSERVERLINK_H
|