From 5a051c97cc46566f1013d67e443239a15754b8e0 Mon Sep 17 00:00:00 2001 From: azw Date: Sun, 9 Apr 2023 06:59:55 +0000 Subject: [PATCH] 1 --- server/wsproxy/app.cc | 2 +- server/wsproxy/client.h | 2 +- server/wsproxy/gameclientmgr.cc | 6 +++--- server/wsproxy/gameclientmgr.h | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/wsproxy/app.cc b/server/wsproxy/app.cc index 22c7886..44a16b9 100644 --- a/server/wsproxy/app.cc +++ b/server/wsproxy/app.cc @@ -444,7 +444,7 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr) return; } } else { - GameClient* client = GameClientMgr::Instance()->GetGameClientBySocket(hdr.socket_handle); + Client* client = GameClientMgr::Instance()->GetGameClientBySocket(hdr.socket_handle); if (client) { conn = client->conn; } diff --git a/server/wsproxy/client.h b/server/wsproxy/client.h index f225c95..45a4198 100644 --- a/server/wsproxy/client.h +++ b/server/wsproxy/client.h @@ -1,7 +1,7 @@ #pragma once class TargetConn; -class GameClient +class Client { public: int socket_handle = a8::INVALID_SOCKET_HANDLE; diff --git a/server/wsproxy/gameclientmgr.cc b/server/wsproxy/gameclientmgr.cc index fab4d89..6baa53b 100644 --- a/server/wsproxy/gameclientmgr.cc +++ b/server/wsproxy/gameclientmgr.cc @@ -67,7 +67,7 @@ void GameClientMgr::OnTargetServerConnect(a8::XParams& param) } #endif -GameClient* GameClientMgr::GetGameClientBySocket(int sockhandle) +Client* GameClientMgr::GetGameClientBySocket(int sockhandle) { auto itr = socket_hash_.find(sockhandle); return itr != socket_hash_.end() ? itr->second : nullptr; @@ -77,11 +77,11 @@ void GameClientMgr::BindTargetConn(int socket_handle, int conn_instance_id) { TargetConn* conn = TargetConnMgr::Instance()->GetConnById(conn_instance_id); if (conn) { - GameClient* client = GetGameClientBySocket(socket_handle); + Client* client = GetGameClientBySocket(socket_handle); if (client) { client->conn = conn; } else { - client = new GameClient(); + client = new Client(); client->socket_handle = socket_handle; client->conn = conn; socket_hash_[client->socket_handle] = client; diff --git a/server/wsproxy/gameclientmgr.h b/server/wsproxy/gameclientmgr.h index b4cbbb1..f1e8ec4 100644 --- a/server/wsproxy/gameclientmgr.h +++ b/server/wsproxy/gameclientmgr.h @@ -2,7 +2,7 @@ #include -class GameClient; +class Client; class GameClientMgr : public a8::Singleton { private: @@ -19,7 +19,7 @@ class GameClientMgr : public a8::Singleton void OnTargetServerDisconnect(a8::XParams& param); void OnTargetServerConnect(a8::XParams& param); #endif - GameClient* GetGameClientBySocket(int sockhande); + Client* GetGameClientBySocket(int sockhande); void BindTargetConn(int socket_handle, int conn_instance_id); void AddPendingAccount(const std::string& account_id, int socket_handle, long long req_tick); @@ -29,7 +29,7 @@ private: private: a8::Attacher timer_attacher_; - std::map socket_hash_; + std::map socket_hash_; #if 0 std::map> pending_account_hash_; #endif