diff --git a/server/bin/monitor.sh b/server/bin/monitor.sh deleted file mode 100644 index 431c7fe..0000000 --- a/server/bin/monitor.sh +++ /dev/null @@ -1,11 +0,0 @@ -path_arr=$(echo $PWD|tr '/' '\n') -path_arr=(${path_arr}) -GAME_ID=${path_arr[-5]} - -if echo $GAME_ID | grep -q '[^0-9]' -then - echo 'game_id参数必须为数字' - exit 1 -fi - -python ../../third_party/tools/scripts/server/monitor.py masterserver${GAME_ID} '-n1 -i1' diff --git a/server/masterserver/CMakeLists.txt b/server/masterserver/CMakeLists.txt index fad02fe..2ce7a2e 100644 --- a/server/masterserver/CMakeLists.txt +++ b/server/masterserver/CMakeLists.txt @@ -79,9 +79,15 @@ aux_source_directory(. SRC_LIST ) -set(EXECUTABLE_OUTPUT_PATH - ${PROJECT_BINARY_DIR}/../bin -) +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(EXECUTABLE_OUTPUT_PATH + ${PROJECT_BINARY_DIR}/../bin/masterserver/bin + ) +else () + set(EXECUTABLE_OUTPUT_PATH + ${PROJECT_BINARY_DIR}/../bin + ) +endif() add_executable( masterserver${GAME_ID} ${SRC_LIST} diff --git a/server/masterserver/jsondatamgr.cc b/server/masterserver/jsondatamgr.cc index aca22c1..1d72292 100644 --- a/server/masterserver/jsondatamgr.cc +++ b/server/masterserver/jsondatamgr.cc @@ -7,30 +7,13 @@ void JsonDataMgr::Init() { - std::string masterserver_cluster_json_file; - if (!f8::IsOnlineEnv()) { - if (f8::IsTestEnv()) { - work_path_ = a8::Format("/root/pub/%d/%d/conf_test/game%d/masterserver.test", - { - GAME_ID, - f8::App::Instance()->GetInstanceId(), - GAME_ID - }); - } else { - work_path_ = a8::Format("/root/pub/%d/%d/conf_test/game%d/masterserver.dev", - { - GAME_ID, - f8::App::Instance()->GetInstanceId(), - GAME_ID - }); - } - } - masterserver_cluster_json_file = a8::Format("%s/node%d/game%d.masterserver.cluster.json", - { - work_path_, - f8::App::Instance()->GetNodeId(), - GAME_ID - }); + std::string masterserver_cluster_json_file = a8::Format + ("%s/node%d/game%d.masterserver.cluster.json", + { + work_path_, + f8::App::Instance()->GetNodeId(), + GAME_ID + }); masterserver_cluster_json_.ReadFromFile(masterserver_cluster_json_file); }