1
This commit is contained in:
parent
90d4fbac8c
commit
36f7099354
@ -24,6 +24,7 @@ message SS_CMKcpHandshake
|
|||||||
optional string account_id = 2; //账号id
|
optional string account_id = 2; //账号id
|
||||||
optional string session_id = 3; //session id
|
optional string session_id = 3; //session id
|
||||||
optional string team_uuid = 4; //保留
|
optional string team_uuid = 4; //保留
|
||||||
|
optional int32 secret_key_place = 5; //私钥存放位置 0:存在用户协议前(老) 1:存在kcp底层协议头之后(新)
|
||||||
}
|
}
|
||||||
|
|
||||||
message SS_SMKcpHandshake
|
message SS_SMKcpHandshake
|
||||||
|
@ -127,3 +127,13 @@ void KcpSession::DecodeUserPacket(char* buf, int& offset, unsigned int buflen)
|
|||||||
f8::UdpLog::Instance()->Warning("收到kcp client非法数据包", {});
|
f8::UdpLog::Instance()->Warning("收到kcp client非法数据包", {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KcpSession::SetSecretKeyPlace(int secret_key_place)
|
||||||
|
{
|
||||||
|
secret_key_place_ = secret_key_place;
|
||||||
|
}
|
||||||
|
|
||||||
|
int KcpSession::GetSecretKeyPlace()
|
||||||
|
{
|
||||||
|
return secret_key_place_;
|
||||||
|
}
|
||||||
|
@ -19,6 +19,8 @@ public:
|
|||||||
int GetSocketHandle() { return socket_handle_; }
|
int GetSocketHandle() { return socket_handle_; }
|
||||||
long long GetSecretKey() { return secret_key_; }
|
long long GetSecretKey() { return secret_key_; }
|
||||||
void* GetSecretKeyDataPtr() { return &secret_key_; }
|
void* GetSecretKeyDataPtr() { return &secret_key_; }
|
||||||
|
void SetSecretKeyPlace(int secret_key_place);
|
||||||
|
int GetSecretKeyPlace();
|
||||||
|
|
||||||
void SendClientMsg(char* buf, int buf_len);
|
void SendClientMsg(char* buf, int buf_len);
|
||||||
virtual void OnRecvPacket(a8::UdpPacket* pkt) override;
|
virtual void OnRecvPacket(a8::UdpPacket* pkt) override;
|
||||||
@ -36,6 +38,7 @@ private:
|
|||||||
void UpdateInput();
|
void UpdateInput();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int secret_key_place_ = 0;
|
||||||
int socket_handle_ = 0;
|
int socket_handle_ = 0;
|
||||||
long long secret_key_ = 0;
|
long long secret_key_ = 0;
|
||||||
ikcpcb* kcp_ = nullptr;
|
ikcpcb* kcp_ = nullptr;
|
||||||
|
@ -25,3 +25,13 @@ void LongSession::UpdatePing()
|
|||||||
{
|
{
|
||||||
last_ping_tick_ = a8::XGetTickCount();
|
last_ping_tick_ = a8::XGetTickCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LongSession::SetSecretKeyPlace(int secret_key_place)
|
||||||
|
{
|
||||||
|
kcp_session_->SetSecretKeyPlace(secret_key_place);
|
||||||
|
}
|
||||||
|
|
||||||
|
int LongSession::GetSecretKeyPlace()
|
||||||
|
{
|
||||||
|
return kcp_session_->GetSecretKeyPlace();
|
||||||
|
}
|
||||||
|
@ -17,6 +17,8 @@ class LongSession
|
|||||||
|
|
||||||
std::shared_ptr<KcpSession> GetKcpSession() { return kcp_session_; }
|
std::shared_ptr<KcpSession> GetKcpSession() { return kcp_session_; }
|
||||||
void UpdatePing();
|
void UpdatePing();
|
||||||
|
void SetSecretKeyPlace(int secret_key_place);
|
||||||
|
int GetSecretKeyPlace();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long long last_ping_tick_ = 0;
|
long long last_ping_tick_ = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user