diff --git a/server/tools/protobuild/ss_msgid.proto b/server/tools/protobuild/ss_msgid.proto index 55b8f45..e65940c 100644 --- a/server/tools/protobuild/ss_msgid.proto +++ b/server/tools/protobuild/ss_msgid.proto @@ -4,6 +4,8 @@ package ss; enum SSMessageId_e { _SS_WSP_SocketDisconnect = 10; + _SS_WSP_RequestTargetServer = 11; + _SS_MS_ResponseTargetServer = 12; _SS_CMPing = 101; _SS_SMRpcError = 102; diff --git a/server/wsproxy/GCListener.cc b/server/wsproxy/GCListener.cc index ed32398..4360f4a 100644 --- a/server/wsproxy/GCListener.cc +++ b/server/wsproxy/GCListener.cc @@ -58,6 +58,13 @@ public: .SetParam3(saddr)); } + virtual bool HandleRedirect(const std::string& url, const std::string& querystr, + std::string& location) override + { + location = "ws://192.168.100.21:7101"; + return true; + } + virtual void OnDisConnect() override { App::Instance()->AddIMMsg(IM_ClientSocketDisconnect, diff --git a/server/wsproxy/jsondatamgr.cc b/server/wsproxy/jsondatamgr.cc index aec73a2..54c0289 100644 --- a/server/wsproxy/jsondatamgr.cc +++ b/server/wsproxy/jsondatamgr.cc @@ -6,28 +6,19 @@ void JsonDataMgr::Init() { std::string wsproxyserver_cluster_json_file; -#if MASTER_MODE std::string masterserver_cluster_json_file; -#else std::string targetserver_cluster_json_file; -#endif if (f8::IsOnlineEnv()) { wsproxyserver_cluster_json_file = a8::Format("../config/game%d.wsproxy.cluster.json", {GAME_ID}); -#if MASTER_MODE masterserver_cluster_json_file = a8::Format("../config/game%d.masterserver.cluster.json", {GAME_ID}); -#else targetserver_cluster_json_file = a8::Format("../config/game%d.gameserver.cluster.json", {GAME_ID}); -#endif } else { wsproxyserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.wsproxy.cluster.json", {GAME_ID, GAME_ID}); -#if MASTER_MODE masterserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.masterserver.cluster.json", {GAME_ID, GAME_ID}); -#else targetserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.gameserver.cluster.json", {GAME_ID, GAME_ID}); -#endif } wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file); #if MASTER_MODE @@ -49,14 +40,12 @@ std::shared_ptr JsonDataMgr::GetConf() return wsproxyserver_cluster_json_[App::Instance()->instance_id - 1]; } -#if MASTER_MODE std::shared_ptr JsonDataMgr::GetMasterServerClusterConf() { return std::make_shared(masterserver_cluster_json_); } -#else + std::shared_ptr JsonDataMgr::GetTargetServerClusterConf() { return std::make_shared(targetserver_cluster_json_); } -#endif diff --git a/server/wsproxy/jsondatamgr.h b/server/wsproxy/jsondatamgr.h index 8f69d59..bdc5bac 100644 --- a/server/wsproxy/jsondatamgr.h +++ b/server/wsproxy/jsondatamgr.h @@ -11,19 +11,12 @@ class JsonDataMgr : public a8::Singleton void UnInit(); std::shared_ptr GetConf(); -#if MASTER_MODE std::shared_ptr GetMasterServerClusterConf(); -#else std::shared_ptr GetTargetServerClusterConf(); -#endif - private: a8::XObject wsproxyserver_cluster_json_; -#if MASTER_MODE a8::XObject masterserver_cluster_json_; -#else a8::XObject targetserver_cluster_json_; -#endif }; diff --git a/third_party/a8engine b/third_party/a8engine index fc99a36..ff8c006 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit fc99a3615db9aabc1a77489e069a4e6af26d50d5 +Subproject commit ff8c00652d5367595c4adee8f95306ae1a46236b