1
This commit is contained in:
parent
db0d36269e
commit
3058200cd6
@ -88,7 +88,7 @@ void BoxDrop::RequestAllocBoxNum()
|
|||||||
url_params->SetVal("session_id", session_id);
|
url_params->SetVal("session_id", session_id);
|
||||||
HttpProxy::Instance()->HttpGet
|
HttpProxy::Instance()->HttpGet
|
||||||
(
|
(
|
||||||
[]
|
[room_wp = room_->weak_from_this()]
|
||||||
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||||
{
|
{
|
||||||
if (ok) {
|
if (ok) {
|
||||||
@ -101,6 +101,10 @@ void BoxDrop::RequestAllocBoxNum()
|
|||||||
!rsp_obj->HasKey("errcode")) {
|
!rsp_obj->HasKey("errcode")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!room_wp.expired()) {
|
||||||
|
auto room = room_wp.lock();
|
||||||
|
room->GetBoxDrop()->OnAllocOk(0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
f8::UdpLog::Instance()->Warning
|
f8::UdpLog::Instance()->Warning
|
||||||
("RequestAllocBoxNum error %s",
|
("RequestAllocBoxNum error %s",
|
||||||
@ -188,3 +192,8 @@ bool BoxDrop::FillAccountIdSessionId(std::string account_id, std::string session
|
|||||||
});
|
});
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BoxDrop::OnAllocOk(int box_num)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -22,6 +22,7 @@ class BoxDrop : public std::enable_shared_from_this<BoxDrop>
|
|||||||
void RequestAllocBoxNum();
|
void RequestAllocBoxNum();
|
||||||
int GetRemainNum();
|
int GetRemainNum();
|
||||||
bool FillAccountIdSessionId(std::string account_id, std::string session_id);
|
bool FillAccountIdSessionId(std::string account_id, std::string session_id);
|
||||||
|
void OnAllocOk(int box_num);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Room* room_ = nullptr;
|
Room* room_ = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user