This commit is contained in:
azw 2023-09-13 14:39:10 +00:00
parent 3b30957e37
commit 90b90c1d44
3 changed files with 16 additions and 38 deletions

View File

@ -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'

View File

@ -79,9 +79,15 @@ aux_source_directory(.
SRC_LIST SRC_LIST
) )
set(EXECUTABLE_OUTPUT_PATH if (CMAKE_BUILD_TYPE STREQUAL "Debug")
${PROJECT_BINARY_DIR}/../bin set(EXECUTABLE_OUTPUT_PATH
) ${PROJECT_BINARY_DIR}/../bin/masterserver/bin
)
else ()
set(EXECUTABLE_OUTPUT_PATH
${PROJECT_BINARY_DIR}/../bin
)
endif()
add_executable( add_executable(
masterserver${GAME_ID} ${SRC_LIST} masterserver${GAME_ID} ${SRC_LIST}

View File

@ -7,30 +7,13 @@
void JsonDataMgr::Init() void JsonDataMgr::Init()
{ {
std::string masterserver_cluster_json_file; std::string masterserver_cluster_json_file = a8::Format
if (!f8::IsOnlineEnv()) { ("%s/node%d/game%d.masterserver.cluster.json",
if (f8::IsTestEnv()) { {
work_path_ = a8::Format("/root/pub/%d/%d/conf_test/game%d/masterserver.test", work_path_,
{ f8::App::Instance()->GetNodeId(),
GAME_ID, 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
});
masterserver_cluster_json_.ReadFromFile(masterserver_cluster_json_file); masterserver_cluster_json_.ReadFromFile(masterserver_cluster_json_file);
} }