This commit is contained in:
aozhiwei 2023-05-28 14:53:46 +08:00
parent da56c8447d
commit b67aa400f8
3 changed files with 5 additions and 2 deletions

View File

@ -36,12 +36,13 @@ void PlayerMgr::Init()
abort(); abort();
} }
}); });
auto web_socket = std::make_shared<a8::WebSocketClient> web_socket = std::make_shared<a8::WebSocketClient>
( (
*IoMgr::Instance()->GetIoContext(0), *IoMgr::Instance()->GetIoContext(0),
"192.168.100.21", "192.168.100.21",
7601 7601
); );
web_socket->Open();
} }
void PlayerMgr::UnInit() void PlayerMgr::UnInit()

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <a8/singleton.h> #include <a8/singleton.h>
#include <a8/websocketclient.h>
class Player; class Player;
class PlayerMgr : public a8::Singleton<PlayerMgr> class PlayerMgr : public a8::Singleton<PlayerMgr>
@ -17,5 +18,6 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
void UnInit(); void UnInit();
private: private:
std::shared_ptr<a8::WebSocketClient> web_socket;
std::map<std::string, std::shared_ptr<Player>> account_id_hash_; std::map<std::string, std::shared_ptr<Player>> account_id_hash_;
}; };

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit 33a65a4cf309412b9adcce44353293f06cd30010 Subproject commit 0a6ae557857a2923826bf498548a739b9ae8d248