diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 4763fdb9..0d1b1b7f 100644 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -176,7 +176,7 @@ bool App::Init(int argc, char* argv[]) mt::MetaMgr::Instance()->Init(); SelfChecker::Init(); EntityFactory::Instance()->Init(); - uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id); + uuid_.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id); KillMgr::Instance()->Init(); RoomMgr::Instance()->Init(); MatchMgr::Instance()->Init(); @@ -498,7 +498,7 @@ bool App::ParseOpt() long long App::NewUuid() { - return uuid.Generate(); + return uuid_.Generate(); } bool App::HasFlag(int flag) diff --git a/server/gameserver/app.h b/server/gameserver/app.h index ebde2f22..53839b4a 100644 --- a/server/gameserver/app.h +++ b/server/gameserver/app.h @@ -59,7 +59,6 @@ public: int argc = 0; char** argv = nullptr; volatile bool terminated = false; - a8::uuid::SnowFlake uuid; public: int instance_id = 0; @@ -82,6 +81,8 @@ private: std::set flags; private: + a8::uuid::SnowFlake uuid_; + long long last_run_tick_ = 0; std::mutex *loop_mutex_ = nullptr; std::condition_variable *loop_cond_ = nullptr;