diff --git a/server/tools/scripts/ci/wsproxy/boundle.sh b/server/tools/scripts/ci/wsproxy/boundle.sh index 5206e39..e06e3e5 100644 --- a/server/tools/scripts/ci/wsproxy/boundle.sh +++ b/server/tools/scripts/ci/wsproxy/boundle.sh @@ -1,6 +1,6 @@ cd third_party/wsproxy/server/wsproxy -python ../tools/scripts/construct/build_pb.py -cmake . +python ../tools/scripts/construct/build_pb.py --nohooks 1 +cmake $1 . make clean make cp ../bin/wsproxy ../../../../bin/ diff --git a/server/tools/scripts/construct/build_pb.py b/server/tools/scripts/construct/build_pb.py index 00252dd..466f960 100644 --- a/server/tools/scripts/construct/build_pb.py +++ b/server/tools/scripts/construct/build_pb.py @@ -6,6 +6,7 @@ import sys import time import threading import subprocess +from optparse import OptionParser g_is_terminated = False def is_terminated(): @@ -64,7 +65,17 @@ def rebuild(): def repair_githooks(): os.system('/bin/bash ../tools/scripts/githooks/install.sh') -repair_githooks() +parser = OptionParser(usage="%prog [options]") +parser.add_option( + "-n", + "--nohooks", + dest = "nohooks", + help = "no repair git hooks", +) +(options, args) = parser.parse_args() +if not options.nohooks: + repair_githooks() + if need_rebuild(): rebuild() else: diff --git a/server/wsproxy/CMakeLists.txt b/server/wsproxy/CMakeLists.txt index 910da79..1a88675 100644 --- a/server/wsproxy/CMakeLists.txt +++ b/server/wsproxy/CMakeLists.txt @@ -1,9 +1,17 @@ project(wsproxy) cmake_minimum_required(VERSION 2.8) +if (${GAME_ID}) + message(GAME_ID: ${GAME_ID}) +else() + set(GAME_ID 1008) + message(GAME_ID: ${GAME_ID}) +endif() + set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_CXX_FLAGS_RELEASE "-std=gnu++11 -fsanitize=address -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11") +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID}") include_directories( AFTER diff --git a/server/wsproxy/constant.h b/server/wsproxy/constant.h index 7819b90..3589b6b 100644 --- a/server/wsproxy/constant.h +++ b/server/wsproxy/constant.h @@ -31,7 +31,7 @@ enum PlayerState_e PS_WaitingMatch }; -const char* const PROJ_NAME = "game1008_wsproxy"; +const char* const PROJ_NAME = "game" A8_MACRO_STR(GAME_ID) "_gameserver"; const char* const PROJ_ROOT = "/data/logs/%s"; const int POSTFIX_LEN = 7; diff --git a/server/wsproxy/jsondatamgr.cc b/server/wsproxy/jsondatamgr.cc index 25b8567..40d62c4 100644 --- a/server/wsproxy/jsondatamgr.cc +++ b/server/wsproxy/jsondatamgr.cc @@ -8,11 +8,13 @@ void JsonDataMgr::Init() std::string wsproxyserver_cluster_json_file; std::string targetserver_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"; + wsproxyserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.wsproxy.cluster.json", + {GAME_ID, GAME_ID}); + targetserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/game%d.gameserver.cluster.json", + {GAME_ID, GAME_ID}); } else { - wsproxyserver_cluster_json_file = "../config/game1008.wsproxy.cluster.json"; - targetserver_cluster_json_file = "../config/game1008.gameserver.cluster.json"; + wsproxyserver_cluster_json_file = a8::Format("../config/game%d.wsproxy.cluster.json", {GAME_ID}); + targetserver_cluster_json_file = a8::Format("../config/game%d.gameserver.cluster.json", {GAME_ID}); } wsproxyserver_cluster_json_.ReadFromFile(wsproxyserver_cluster_json_file); targetserver_cluster_json_.ReadFromFile(targetserver_cluster_json_file); diff --git a/third_party/a8engine b/third_party/a8engine index 972852f..ab6f413 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit 972852f335e1245614b2349a780de93b4d1d7bcb +Subproject commit ab6f41321c5925b5a26f4a106f784551a172ecc9 diff --git a/third_party/framework b/third_party/framework index 803b181..1813384 160000 --- a/third_party/framework +++ b/third_party/framework @@ -1 +1 @@ -Subproject commit 803b1812d08fe8c3b3eea9371f8d9b0bead93c6d +Subproject commit 18133846b6672634219c080064b7a24720d17588