1
This commit is contained in:
parent
1786a4371d
commit
892af52a25
@ -17,12 +17,15 @@ public:
|
||||
const sockaddr_in& GetAddr() const { return remote_addr_; }
|
||||
a8::UdpListener* GetUdpListener() { return udp_listener_; }
|
||||
void UpdateInput();
|
||||
int GetSocketHandle() { return socket_handle_; }
|
||||
long long GetSecretKey() { return secret_key_; }
|
||||
|
||||
private:
|
||||
void DecodePacket(char* buf, int& offset, unsigned int buflen);
|
||||
|
||||
private:
|
||||
long long init_tick_ = 0;
|
||||
long long secret_key_ = 0;
|
||||
a8::UdpListener* udp_listener_ = nullptr;
|
||||
ikcpcb* kcp_ = nullptr;
|
||||
int socket_handle_ = 0;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "longsession.h"
|
||||
#include "kcpsession.h"
|
||||
|
||||
void LongSession::Init()
|
||||
{
|
||||
@ -11,3 +12,13 @@ void LongSession::UnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int LongSession::GetSocketHandle()
|
||||
{
|
||||
return kcp_session_->GetSocketHandle();
|
||||
}
|
||||
|
||||
long long LongSession::GetSecretKey()
|
||||
{
|
||||
return kcp_session_->GetSecretKey();
|
||||
}
|
||||
|
@ -8,11 +8,9 @@ class LongSession
|
||||
|
||||
void Init();
|
||||
void UnInit();
|
||||
int GetSocketHandle() const { return socket_handle_; }
|
||||
long long GetSecretKey() const { return secret_key_; }
|
||||
int GetSocketHandle();
|
||||
long long GetSecretKey();
|
||||
|
||||
private:
|
||||
int socket_handle_ = a8::INVALID_SOCKET_HANDLE;
|
||||
long long secret_key_ = 0;
|
||||
std::shared_ptr<KcpSession> kcp_session_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user