1
This commit is contained in:
parent
3de96a8575
commit
97ce74378d
@ -3,7 +3,10 @@
|
||||
#include "longsession.h"
|
||||
#include "kcpsession.h"
|
||||
|
||||
void LongSession::Init()
|
||||
#include "ss_msgid.pb.h"
|
||||
#include "ss_proto.pb.h"
|
||||
|
||||
void LongSession::Init(f8::MsgHdr& hdr, const ss::SS_CMKcpHandshake& msg)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
namespace ss
|
||||
{
|
||||
class SS_CMKcpHandshake;
|
||||
}
|
||||
|
||||
class KcpSession;
|
||||
class LongSession
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
void Init();
|
||||
void Init(f8::MsgHdr& hdr, const ss::SS_CMKcpHandshake& msg);
|
||||
void UnInit();
|
||||
void Update(long long tick);
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "jsondatamgr.h"
|
||||
#include "longsession.h"
|
||||
#include "kcpsession.h"
|
||||
#include "GCListener.h"
|
||||
|
||||
#include "ss_msgid.pb.h"
|
||||
#include "ss_proto.pb.h"
|
||||
@ -59,7 +60,15 @@ void LongSessionMgr::_SS_CMKcpHandshake(f8::MsgHdr& hdr, const ss::SS_CMKcpHands
|
||||
return;
|
||||
}
|
||||
auto session = std::make_shared<LongSession>();
|
||||
session->Init(hdr, msg);
|
||||
socket_handle_hash_[session->GetKcpSession()->GetSocketHandle()] = session;
|
||||
|
||||
respmsg.set_conv(session->GetKcpSession()->GetSocketHandle());
|
||||
{
|
||||
long long secret_key = session->GetKcpSession()->GetSecretKey();
|
||||
respmsg.set_secret_key(&secret_key, sizeof(secret_key));
|
||||
}
|
||||
GCListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
|
||||
}
|
||||
|
||||
std::shared_ptr<LongSession> LongSessionMgr::GetSession(int socket_handle)
|
||||
|
Loading…
x
Reference in New Issue
Block a user