From 8532cdc6e6f3aa2aace0ff8c16a73fd60e9b789e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Nov 2018 10:14:51 +0800 Subject: [PATCH] rename wsproxy -> dbproxy --- server/dbproxy/CMakeLists.txt | 8 ++++---- server/dbproxy/GSListener.cc | 4 ++-- server/dbproxy/jsondatamgr.cc | 21 ++++++--------------- server/dbproxy/jsondatamgr.h | 5 +---- third_party/a8engine | 2 +- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/server/dbproxy/CMakeLists.txt b/server/dbproxy/CMakeLists.txt index f54c1b0..a1118e6 100644 --- a/server/dbproxy/CMakeLists.txt +++ b/server/dbproxy/CMakeLists.txt @@ -1,4 +1,4 @@ -project(wsproxy) +project(dbproxy) cmake_minimum_required(VERSION 2.8) set(CMAKE_BUILD_TYPE "Debug") @@ -39,7 +39,7 @@ set(EXECUTABLE_OUTPUT_PATH set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "_DEBUG") add_executable( - wsproxy ${SRC_LIST} + dbproxy ${SRC_LIST} ) add_custom_target(script_pb_protocol ALL) @@ -50,10 +50,10 @@ add_custom_command(TARGET script_pb_protocol # COMMAND python ../../tools/script/construct/build_protocol.py # COMMAND python ../../tools/script/construct/build_version_file.py ) -add_dependencies(wsproxy script_pb_protocol) +add_dependencies(dbproxy script_pb_protocol) target_link_libraries( - wsproxy + dbproxy pthread mysqlclient protobuf diff --git a/server/dbproxy/GSListener.cc b/server/dbproxy/GSListener.cc index d732319..461c631 100644 --- a/server/dbproxy/GSListener.cc +++ b/server/dbproxy/GSListener.cc @@ -1,7 +1,7 @@ #include "precompile.h" #include -#include +#include #include #include "framework/cpp/netmsghandler.h" @@ -12,7 +12,7 @@ #include "ss_proto.pb.h" #include "handlermgr.h" -class GSClientSession: public a8::WebSocketSession +class GSClientSession: public a8::MixedSession { public: diff --git a/server/dbproxy/jsondatamgr.cc b/server/dbproxy/jsondatamgr.cc index 25b8567..1a66d17 100644 --- a/server/dbproxy/jsondatamgr.cc +++ b/server/dbproxy/jsondatamgr.cc @@ -5,17 +5,13 @@ void JsonDataMgr::Init() { - std::string wsproxyserver_cluster_json_file; - std::string targetserver_cluster_json_file; + std::string dbproxyserver_cluster_json_file; if (getenv("is_dev_env")) { - wsproxyserver_cluster_json_file = "/var/data/conf_test/game1008/wsproxy/game1008.wsproxy.cluster.json"; - targetserver_cluster_json_file = "/var/data/conf_test/game1008/wsproxy/game1008.gameserver.cluster.json"; + dbproxyserver_cluster_json_file = "/var/data/conf_test/game1008/dbproxy/game1008.dbproxy.cluster.json"; } else { - wsproxyserver_cluster_json_file = "../config/game1008.wsproxy.cluster.json"; - targetserver_cluster_json_file = "../config/game1008.gameserver.cluster.json"; + dbproxyserver_cluster_json_file = "../config/game1008.dbproxy.cluster.json"; } - wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file); - targetserver_cluster_json_.ReadFromFile(targetserver_cluster_json_file); + dbproxyserver_cluster_json_.ReadFromFile(dbproxyserver_cluster_json_file); } void JsonDataMgr::UnInit() @@ -24,13 +20,8 @@ void JsonDataMgr::UnInit() std::shared_ptr JsonDataMgr::GetConf() { - if (App::Instance()->instance_id < 1 || App::Instance()->instance_id > wsproxyserver_cluster_json_.Size()) { + if (App::Instance()->instance_id < 1 || App::Instance()->instance_id > dbproxyserver_cluster_json_.Size()) { abort(); } - return wsproxyserver_cluster_json_[App::Instance()->instance_id - 1]; -} - -std::shared_ptr JsonDataMgr::GetTargetServerClusterConf() -{ - return std::make_shared(targetserver_cluster_json_); + return dbproxyserver_cluster_json_[App::Instance()->instance_id - 1]; } diff --git a/server/dbproxy/jsondatamgr.h b/server/dbproxy/jsondatamgr.h index d99fe56..5eb6c5d 100644 --- a/server/dbproxy/jsondatamgr.h +++ b/server/dbproxy/jsondatamgr.h @@ -11,10 +11,7 @@ class JsonDataMgr : public a8::Singleton void UnInit(); std::shared_ptr GetConf(); - std::shared_ptr GetTargetServerClusterConf(); private: - a8::XObject wsproxyserver_cluster_json_; - a8::XObject targetserver_cluster_json_; - + a8::XObject dbproxyserver_cluster_json_; }; diff --git a/third_party/a8engine b/third_party/a8engine index db3c252..55c5492 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit db3c2529f6dac0c045338b8336d8b4202737872c +Subproject commit 55c5492183c6191dd73be99013b0083be6a1b5be