36 lines
661 B
C++
36 lines
661 B
C++
#include "precompile.h"
|
|
|
|
#include <f8/netmsghandler.h>
|
|
|
|
#include "longsession.h"
|
|
#include "kcpsession.h"
|
|
|
|
#include "ss_msgid.pb.h"
|
|
#include "ss_proto.pb.h"
|
|
|
|
void LongSession::Init(f8::MsgHdr& hdr, const ss::SS_CMKcpHandshake& msg)
|
|
{
|
|
kcp_session_ = std::make_shared<KcpSession>();
|
|
kcp_session_->Init(hdr.socket_handle, msg.secret_key_place());
|
|
}
|
|
|
|
void LongSession::UnInit()
|
|
{
|
|
kcp_session_->UnInit();
|
|
}
|
|
|
|
void LongSession::Update(long long tick)
|
|
{
|
|
GetKcpSession()->Update(tick);
|
|
}
|
|
|
|
void LongSession::UpdatePing()
|
|
{
|
|
last_ping_tick_ = a8::XGetTickCount();
|
|
}
|
|
|
|
int LongSession::GetSecretKeyPlace()
|
|
{
|
|
return kcp_session_->GetSecretKeyPlace();
|
|
}
|