This commit is contained in:
aozhiwei 2024-08-15 19:25:37 +08:00
parent 6524322d0a
commit efd77daa0b
2 changed files with 5 additions and 4 deletions

View File

@ -11,6 +11,7 @@
#include <f8/udplog.h> #include <f8/udplog.h>
#include "app.h" #include "app.h"
#include "jsondatamgr.h"
#include "handlermgr.h" #include "handlermgr.h"
class GCClientSession: public a8::MixedSession class GCClientSession: public a8::MixedSession
@ -102,8 +103,8 @@ void GGListener::Init()
tcp_listener_->on_error = GSListeneron_error; tcp_listener_->on_error = GSListeneron_error;
tcp_listener_->bind_address = "0.0.0.0"; tcp_listener_->bind_address = "0.0.0.0";
tcp_listener_->bind_port = 3333; //tcp_listener_->bind_port = 3333;
//tcp_listener_->bind_port = JsonDataMgr::Instance()->GetConf()->At("listen_port")->AsXValue(); tcp_listener_->bind_port = JsonDataMgr::Instance()->GetConf()->At("listen_port")->AsXValue();
tcp_listener_->Open(); tcp_listener_->Open();
f8::MsgQueue::Instance()->RegisterCallBack f8::MsgQueue::Instance()->RegisterCallBack

View File

@ -21,7 +21,7 @@ void PlayerMgr::Init()
int count = 0; int count = 0;
f8::Timer::Instance()->SetInterval f8::Timer::Instance()->SetInterval
( (
1, 200,
[this, count] (int et, const a8::Args* args) mutable [this, count] (int et, const a8::Args* args) mutable
{ {
if (et == a8::TIMER_EXEC_EVENT) { if (et == a8::TIMER_EXEC_EVENT) {
@ -32,7 +32,7 @@ void PlayerMgr::Init()
account_id_hash_[hum->GetAccountId()] = hum; account_id_hash_[hum->GetAccountId()] = hum;
socket_id_hash_[hum->GetSocketId()] = hum; socket_id_hash_[hum->GetSocketId()] = hum;
++count; ++count;
if (count >= 200) { if (count >= 1) {
f8::Timer::Instance()->DeleteCurrentTimer(); f8::Timer::Instance()->DeleteCurrentTimer();
} }
} }