TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Battlenet::Services::Connection Class Reference

#include <ConnectionService.h>

Public Member Functions

 Connection (Session *session)
 
uint32 HandleConnect (connection::v1::ConnectRequest const *request, connection::v1::ConnectResponse *respons) override
 
uint32 HandleKeepAlive (NoData const *request) override
 
uint32 HandleRequestDisconnect (connection::v1::DisconnectRequest const *request) override
 
- Public Member Functions inherited from Battlenet::Service< connection::v1::ConnectionService >
 Service (Session *session)
 

Private Types

typedef Service
< connection::v1::ConnectionService
ConnectionService
 

Additional Inherited Members

- Protected Member Functions inherited from Battlenet::Service< connection::v1::ConnectionService >
void SendRequest (uint32 serviceHash, uint32 methodId, google::protobuf::Message const *request, std::function< void(MessageBuffer)> callback) override
 
void SendRequest (uint32 serviceHash, uint32 methodId, google::protobuf::Message const *request) override
 
void SendResponse (uint32, uint32, uint32 token, uint32 status) override
 
void SendResponse (uint32, uint32, uint32 token, google::protobuf::Message const *response) override
 
std::string GetCallerInfo () const override
 
- Protected Attributes inherited from Battlenet::Service< connection::v1::ConnectionService >
Session_session
 

Member Typedef Documentation

Constructor & Destructor Documentation

Battlenet::Services::Connection::Connection ( Session session)
25  : ConnectionService(session)
26 {
27 }
Service< connection::v1::ConnectionService > ConnectionService
Definition: ConnectionService.h:33

Member Function Documentation

uint32 Battlenet::Services::Connection::HandleConnect ( connection::v1::ConnectRequest const request,
connection::v1::ConnectResponse respons 
)
override
30 {
31  if (request->has_client_id())
32  response->mutable_client_id()->CopyFrom(request->client_id());
33 
34  std::chrono::system_clock::duration now = std::chrono::system_clock::now().time_since_epoch();
35 
36  response->mutable_server_id()->set_label(GetPID());
37  response->mutable_server_id()->set_epoch(std::chrono::duration_cast<Seconds>(now).count());
38  response->set_server_time(std::chrono::duration_cast<Milliseconds>(now).count());
39 
40  response->set_use_bindless_rpc(request->use_bindless_rpc());
41  return ERROR_OK;
42 }
Definition: BattlenetRpcErrorCodes.h:25
uint32 GetPID()
Definition: Util.cpp:236

+ Here is the call graph for this function:

uint32 Battlenet::Services::Connection::HandleKeepAlive ( NoData const request)
override
45 {
46  return ERROR_OK;
47 }
Definition: BattlenetRpcErrorCodes.h:25
uint32 Battlenet::Services::Connection::HandleRequestDisconnect ( connection::v1::DisconnectRequest const request)
override
50 {
51  connection::v1::DisconnectNotification disconnectNotification;
52  disconnectNotification.set_error_code(request->error_code());
53  ForceDisconnect(&disconnectNotification);
54 
56  return ERROR_OK;
57 }
Definition: connection_service.pb.h:974
void DelayedCloseSocket()
Marks the socket for closing after write buffer becomes empty.
Definition: Socket.h:157
void set_error_code(::google::protobuf::uint32 value)
Definition: connection_service.pb.h:2097
Definition: BattlenetRpcErrorCodes.h:25

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: