This commit is contained in:
aozhiwei 2023-11-28 21:40:55 +08:00
parent 4ec177ee82
commit 1ba1679407
3 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,8 @@ public:
behaviac::EBTStatus CoJoin(); behaviac::EBTStatus CoJoin();
behaviac::EBTStatus CoUpdateGame(); behaviac::EBTStatus CoUpdateGame();
void SetOwner(std::shared_ptr<Player> owner) { owner_ = owner; }
public: public:
private: private:

View File

@ -26,6 +26,7 @@ void Player::Init(int idx, const std::string& account_id)
if (!agent_) { if (!agent_) {
abort(); abort();
} }
agent_->SetOwner(shared_from_this());
f8::BtMgr::Instance()->BtLoad(agent_, "android/test"); f8::BtMgr::Instance()->BtLoad(agent_, "android/test");
f8::BtMgr::Instance()->BtSetCurrent(agent_, "android/test"); f8::BtMgr::Instance()->BtSetCurrent(agent_, "android/test");

View File

@ -10,7 +10,7 @@ namespace a8
} }
class AndroidAgent; class AndroidAgent;
class Player class Player : public std::enable_shared_from_this<Player>
{ {
public: public:
enum { HID = HID_Player }; enum { HID = HID_Player };