1
This commit is contained in:
parent
7cca0db8d7
commit
286f3055ef
@ -19,7 +19,6 @@ set(CMAKE_BUILD_TYPE "Debug")
|
||||
#set(CMAKE_BUILD_TYPE "Release")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DA8_TCP_SESSION2=1")
|
||||
|
||||
include_directories(
|
||||
AFTER
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "target_conn.h"
|
||||
#include "target_conn_mgr.h"
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
#include "mastersvr.h"
|
||||
#include "mastersvrmgr.h"
|
||||
#endif
|
||||
@ -87,7 +87,7 @@ bool App::Init(int argc, char* argv[])
|
||||
|
||||
if (!ParseOpt()) {
|
||||
terminated = true;
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
if (node_id <= 0) {
|
||||
a8::XPrintf("gameserver启动失败,缺少-n参数\n", {});
|
||||
} else if (node_id > MAX_NODE_ID) {
|
||||
@ -102,7 +102,13 @@ bool App::Init(int argc, char* argv[])
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
a8::XPrintf("wsproxy starting instance_id:%d pid:%d\n", {instance_id, getpid()});
|
||||
a8::XPrintf("wsproxy starting node_id:%d instance_id:%d pid:%d master_mode:%d\n",
|
||||
{
|
||||
node_id,
|
||||
instance_id,
|
||||
getpid(),
|
||||
MASTER_MODE
|
||||
});
|
||||
|
||||
loop_mutex_ = new std::mutex();
|
||||
loop_cond_ = new std::condition_variable();
|
||||
@ -157,7 +163,7 @@ void App::UnInit()
|
||||
{
|
||||
a8::XPrintf("wsproxy terminating instance_id:%d pid:%d\n", {instance_id, getpid()});
|
||||
GCListener::Instance()->UnInit();
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
MasterSvrMgr::Instance()->UnInit();
|
||||
#endif
|
||||
TargetConnMgr::Instance()->UnInit();
|
||||
@ -459,7 +465,7 @@ void App::ProcessIMMsg()
|
||||
case IM_ClientSocketDisconnect:
|
||||
{
|
||||
GameClientMgr::Instance()->OnClientDisconnect(pdelnode->params);
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
MasterSvrMgr::Instance()->RemoveRequest(pdelnode->params.param1, pdelnode->params.sender);
|
||||
#endif
|
||||
}
|
||||
@ -543,7 +549,7 @@ bool App::ParseOpt()
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
return instance_id > 0 && node_id > 0;
|
||||
#else
|
||||
return instance_id > 0;
|
||||
|
@ -35,7 +35,7 @@ void JsonDataMgr::Init()
|
||||
masterserver_cluster_json_file = a8::Format("../config/game%d.masterserver.cluster.json", {GAME_ID});
|
||||
#endif
|
||||
} else {
|
||||
#ifdef MASTER_MODE
|
||||
#if MASTER_MODE
|
||||
wsproxyserver_cluster_json_file = a8::Format("/var/data/conf_test/game%d/wsproxy/node%d/game%d.wsproxy.cluster.json",
|
||||
{
|
||||
GAME_ID,
|
||||
|
Loading…
x
Reference in New Issue
Block a user