1
This commit is contained in:
parent
f1e98da3c9
commit
8a6b80fa4e
@ -368,7 +368,7 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
|
||||
if (hdr.msgid == ss::_SS_CMLogin ||
|
||||
hdr.msgid == ss::_SS_CMReconnect ||
|
||||
hdr.msgid == ss::_SS_CMKcpHandshake) {
|
||||
auto down_wp = DownStreamMgr::Instance()->GetGameClientBySocket(hdr.socket_handle);
|
||||
auto down_wp = DownStreamMgr::Instance()->GetDownStream(hdr.socket_handle);
|
||||
if (down_wp.expired()) {
|
||||
switch (hdr.msgid) {
|
||||
case ss::_SS_CMLogin:
|
||||
@ -418,7 +418,7 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
auto down_wp = DownStreamMgr::Instance()->GetGameClientBySocket(hdr.socket_handle);
|
||||
auto down_wp = DownStreamMgr::Instance()->GetDownStream(hdr.socket_handle);
|
||||
if (auto down = down_wp.lock(); !down_wp.expired()) {
|
||||
if (!down->conn.expired()) {
|
||||
down->conn.lock()->ForwardClientMsg(hdr);
|
||||
|
@ -41,7 +41,7 @@ void DownStreamMgr::UnInit()
|
||||
|
||||
void DownStreamMgr::OnClientDisconnect(int socket_handle)
|
||||
{
|
||||
auto down_wp = GetGameClientBySocket(socket_handle);
|
||||
auto down_wp = GetDownStream(socket_handle);
|
||||
if (auto down = down_wp.lock(); !down_wp.expired()) {
|
||||
if (!down->conn.expired()) {
|
||||
ss::SS_WSP_SocketDisconnect msg;
|
||||
@ -73,7 +73,7 @@ void DownStreamMgr::OnUpStreamConnect(int instance_id)
|
||||
|
||||
}
|
||||
|
||||
std::weak_ptr<DownStream> DownStreamMgr::GetGameClientBySocket(int sockhandle)
|
||||
std::weak_ptr<DownStream> DownStreamMgr::GetDownStream(int sockhandle)
|
||||
{
|
||||
auto itr = socket_hash_.find(sockhandle);
|
||||
return itr != socket_hash_.end() ? itr->second : nullptr;
|
||||
@ -83,7 +83,7 @@ void DownStreamMgr::BindUpStream(int socket_handle, int conn_instance_id)
|
||||
{
|
||||
std::weak_ptr<UpStream> conn = UpStreamMgr::Instance()->GetConnById(conn_instance_id);
|
||||
if (!conn.expired()) {
|
||||
auto down_wp = GetGameClientBySocket(socket_handle);
|
||||
auto down_wp = GetDownStream(socket_handle);
|
||||
if (auto down = down_wp.lock(); !down_wp.expired()) {
|
||||
down->conn = conn;
|
||||
} else {
|
||||
|
@ -17,7 +17,7 @@ class DownStreamMgr : public a8::Singleton<DownStreamMgr>
|
||||
|
||||
void OnUpStreamDisconnect(int instance_id);
|
||||
void OnUpStreamConnect(int instance_id);
|
||||
std::weak_ptr<DownStream> GetGameClientBySocket(int sockhande);
|
||||
std::weak_ptr<DownStream> GetDownStream(int sockhande);
|
||||
void BindUpStream(int socket_handle, int conn_instance_id);
|
||||
void AddPendingAccount(const std::string& account_id, int socket_handle, long long req_tick);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user