mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 05:11:29 +00:00
* Cache EntityList::GetRaidByClient * Adjustments [skip ci] * Update entity [skip ci] * More cleanup [skip ci] * More tweaks [skip ci] * Cleanup [skip ci] * Fix bugs with UCS reconnection on crash / exit, not adding soft deleted characters, put main loop on UV lib * Reduce log spam that should be debugging; send keepalives to clients so that they properly prune from the connection list * Shutdown the eventloop to properly shutdown the zone versus calling a hard exit
31 lines
904 B
C++
31 lines
904 B
C++
#ifndef UCS_H
|
|
#define UCS_H
|
|
|
|
#include "../common/types.h"
|
|
#include "../common/net/servertalk_server_connection.h"
|
|
#include "../common/servertalk.h"
|
|
#include "../common/event/timer.h"
|
|
#include <memory>
|
|
|
|
class UCSConnection
|
|
{
|
|
public:
|
|
UCSConnection();
|
|
void SetConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection);
|
|
void ProcessPacket(uint16 opcode, EQ::Net::Packet &p);
|
|
void SendPacket(ServerPacket* pack);
|
|
void Disconnect() { if(connection && connection->Handle()) connection->Handle()->Disconnect(); }
|
|
void SendMessage(const char *From, const char *Message);
|
|
private:
|
|
inline std::string GetIP() const { return (connection && connection->Handle()) ? connection->Handle()->RemoteIP() : 0; }
|
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> connection;
|
|
|
|
/**
|
|
* Keepalive
|
|
*/
|
|
std::unique_ptr<EQ::Timer> m_keepalive;
|
|
void OnKeepAlive(EQ::Timer *t);
|
|
};
|
|
|
|
#endif /*UCS_H_*/
|