mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
29 lines
1003 B
C++
29 lines
1003 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);
|
|
const std::shared_ptr<EQ::Net::ServertalkServerConnection> &GetConnection() const;
|
|
inline bool IsConnected() const { return connection->Handle() ? connection->Handle()->IsConnected() : false; }
|
|
|
|
private:
|
|
inline std::string GetIP() const { return (connection && connection->Handle()) ? connection->Handle()->RemoteIP() : 0; }
|
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> connection;
|
|
|
|
};
|
|
|
|
#endif /*UCS_H_*/
|