From efd77daa0b1bdd5a530aa84ef95572642bdc4bf1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 15 Aug 2024 19:25:37 +0800 Subject: [PATCH] 1 --- server/robotserver/GGListener.cc | 5 +++-- server/robotserver/playermgr.cc | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/robotserver/GGListener.cc b/server/robotserver/GGListener.cc index 8668ad2c..924ad3eb 100644 --- a/server/robotserver/GGListener.cc +++ b/server/robotserver/GGListener.cc @@ -11,6 +11,7 @@ #include #include "app.h" +#include "jsondatamgr.h" #include "handlermgr.h" class GCClientSession: public a8::MixedSession @@ -102,8 +103,8 @@ void GGListener::Init() tcp_listener_->on_error = GSListeneron_error; tcp_listener_->bind_address = "0.0.0.0"; - tcp_listener_->bind_port = 3333; - //tcp_listener_->bind_port = JsonDataMgr::Instance()->GetConf()->At("listen_port")->AsXValue(); + //tcp_listener_->bind_port = 3333; + tcp_listener_->bind_port = JsonDataMgr::Instance()->GetConf()->At("listen_port")->AsXValue(); tcp_listener_->Open(); f8::MsgQueue::Instance()->RegisterCallBack diff --git a/server/robotserver/playermgr.cc b/server/robotserver/playermgr.cc index 148e433c..d8ddd354 100644 --- a/server/robotserver/playermgr.cc +++ b/server/robotserver/playermgr.cc @@ -21,7 +21,7 @@ void PlayerMgr::Init() int count = 0; f8::Timer::Instance()->SetInterval ( - 1, + 200, [this, count] (int et, const a8::Args* args) mutable { if (et == a8::TIMER_EXEC_EVENT) { @@ -32,7 +32,7 @@ void PlayerMgr::Init() account_id_hash_[hum->GetAccountId()] = hum; socket_id_hash_[hum->GetSocketId()] = hum; ++count; - if (count >= 200) { + if (count >= 1) { f8::Timer::Instance()->DeleteCurrentTimer(); } }