rename wsproxy -> dbproxy

This commit is contained in:
aozhiwei 2018-11-01 10:14:51 +08:00
parent b726c4e16b
commit 8532cdc6e6
5 changed files with 14 additions and 26 deletions

View File

@ -1,4 +1,4 @@
project(wsproxy) project(dbproxy)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_BUILD_TYPE "Debug")
@ -39,7 +39,7 @@ set(EXECUTABLE_OUTPUT_PATH
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "_DEBUG") set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG "_DEBUG")
add_executable( add_executable(
wsproxy ${SRC_LIST} dbproxy ${SRC_LIST}
) )
add_custom_target(script_pb_protocol ALL) 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_protocol.py
# COMMAND python ../../tools/script/construct/build_version_file.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( target_link_libraries(
wsproxy dbproxy
pthread pthread
mysqlclient mysqlclient
protobuf protobuf

View File

@ -1,7 +1,7 @@
#include "precompile.h" #include "precompile.h"
#include <google/protobuf/message.h> #include <google/protobuf/message.h>
#include <a8/websocketsession.h> #include <a8/mixedsession.h>
#include <a8/tcplistener.h> #include <a8/tcplistener.h>
#include "framework/cpp/netmsghandler.h" #include "framework/cpp/netmsghandler.h"
@ -12,7 +12,7 @@
#include "ss_proto.pb.h" #include "ss_proto.pb.h"
#include "handlermgr.h" #include "handlermgr.h"
class GSClientSession: public a8::WebSocketSession class GSClientSession: public a8::MixedSession
{ {
public: public:

View File

@ -5,17 +5,13 @@
void JsonDataMgr::Init() void JsonDataMgr::Init()
{ {
std::string wsproxyserver_cluster_json_file; std::string dbproxyserver_cluster_json_file;
std::string targetserver_cluster_json_file;
if (getenv("is_dev_env")) { if (getenv("is_dev_env")) {
wsproxyserver_cluster_json_file = "/var/data/conf_test/game1008/wsproxy/game1008.wsproxy.cluster.json"; dbproxyserver_cluster_json_file = "/var/data/conf_test/game1008/dbproxy/game1008.dbproxy.cluster.json";
targetserver_cluster_json_file = "/var/data/conf_test/game1008/wsproxy/game1008.gameserver.cluster.json";
} else { } else {
wsproxyserver_cluster_json_file = "../config/game1008.wsproxy.cluster.json"; dbproxyserver_cluster_json_file = "../config/game1008.dbproxy.cluster.json";
targetserver_cluster_json_file = "../config/game1008.gameserver.cluster.json";
} }
wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file); dbproxyserver_cluster_json_.ReadFromFile(dbproxyserver_cluster_json_file);
targetserver_cluster_json_.ReadFromFile(targetserver_cluster_json_file);
} }
void JsonDataMgr::UnInit() void JsonDataMgr::UnInit()
@ -24,13 +20,8 @@ void JsonDataMgr::UnInit()
std::shared_ptr<a8::XObject> JsonDataMgr::GetConf() std::shared_ptr<a8::XObject> 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(); abort();
} }
return wsproxyserver_cluster_json_[App::Instance()->instance_id - 1]; return dbproxyserver_cluster_json_[App::Instance()->instance_id - 1];
}
std::shared_ptr<a8::XObject> JsonDataMgr::GetTargetServerClusterConf()
{
return std::make_shared<a8::XObject>(targetserver_cluster_json_);
} }

View File

@ -11,10 +11,7 @@ class JsonDataMgr : public a8::Singleton<JsonDataMgr>
void UnInit(); void UnInit();
std::shared_ptr<a8::XObject> GetConf(); std::shared_ptr<a8::XObject> GetConf();
std::shared_ptr<a8::XObject> GetTargetServerClusterConf();
private: private:
a8::XObject wsproxyserver_cluster_json_; a8::XObject dbproxyserver_cluster_json_;
a8::XObject targetserver_cluster_json_;
}; };

@ -1 +1 @@
Subproject commit db3c2529f6dac0c045338b8336d8b4202737872c Subproject commit 55c5492183c6191dd73be99013b0083be6a1b5be