diff --git a/server/gameserver/boxdrop.cc b/server/gameserver/boxdrop.cc index 2103a353..50f4e692 100644 --- a/server/gameserver/boxdrop.cc +++ b/server/gameserver/boxdrop.cc @@ -88,7 +88,7 @@ void BoxDrop::RequestAllocBoxNum() url_params->SetVal("session_id", session_id); HttpProxy::Instance()->HttpGet ( - [] + [room_wp = room_->weak_from_this()] (bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx) { if (ok) { @@ -101,6 +101,10 @@ void BoxDrop::RequestAllocBoxNum() !rsp_obj->HasKey("errcode")) { return; } + if (!room_wp.expired()) { + auto room = room_wp.lock(); + room->GetBoxDrop()->OnAllocOk(0); + } } else { f8::UdpLog::Instance()->Warning ("RequestAllocBoxNum error %s", @@ -188,3 +192,8 @@ bool BoxDrop::FillAccountIdSessionId(std::string account_id, std::string session }); return ok; } + +void BoxDrop::OnAllocOk(int box_num) +{ + +} diff --git a/server/gameserver/boxdrop.h b/server/gameserver/boxdrop.h index 93bfc305..524a82d8 100644 --- a/server/gameserver/boxdrop.h +++ b/server/gameserver/boxdrop.h @@ -22,6 +22,7 @@ class BoxDrop : public std::enable_shared_from_this void RequestAllocBoxNum(); int GetRemainNum(); bool FillAccountIdSessionId(std::string account_id, std::string session_id); + void OnAllocOk(int box_num); private: Room* room_ = nullptr;