商城购买修正
This commit is contained in:
@@ -106,6 +106,8 @@ void Controller::init()
|
||||
|
||||
HOOK_SETUP(DisPatcher_ReturnToSelectCharacter_dispatch_sig);
|
||||
|
||||
HOOK_SETUP(Init);
|
||||
|
||||
LOG("Controller::init()");
|
||||
|
||||
}
|
||||
@@ -230,7 +232,7 @@ int Controller::hook_DisPatcher_MoveMap_dispatch_sig(void* a1, CUser* pUser, Pac
|
||||
{
|
||||
//ENUM_PACK_RET_TYPE ret = CDispatch::Get()->MoveMap_dispatch_sig(a1, pUser, pBuf);
|
||||
//int result = (ret == PAK_ERROR) ? 1 : 0;
|
||||
return Get()->old_DisPatcher_MoveMap_dispatch_sig(a1,pUser,pBuf);
|
||||
return Get()->old_DisPatcher_MoveMap_dispatch_sig(a1, pUser, pBuf);
|
||||
}
|
||||
|
||||
int Controller::hook_Inter_LoadEtc_dispatch_sig(void* a1, CUser* pUser, char* a3)
|
||||
@@ -247,46 +249,8 @@ int Controller::hook_DisPatcher_ReturnToSelectCharacter_dispatch_sig(void* a1, C
|
||||
|
||||
void Controller::hook_importCashShopItemList(const std::string* str)
|
||||
{
|
||||
if (str == NULL) return;
|
||||
if (*str == "[start end id]")
|
||||
{
|
||||
int item_id_begin_ = ScanInt();
|
||||
int item_id_end_ = ScanInt();
|
||||
|
||||
CGameDataManager::Get()->set_cera_award_begin_id(item_id_begin_);
|
||||
CGameDataManager::Get()->set_cera_award_end_id(item_id_end_);
|
||||
}
|
||||
else if (*str == "[reward item]")
|
||||
{
|
||||
int _total = ScanInt();
|
||||
for (int i = 0; i < _total; i++)
|
||||
{
|
||||
int count_ = ScanInt();
|
||||
int item_id = ScanInt();
|
||||
int item_num = ScanInt();
|
||||
CGameDataManager::Get()->add_cera_awarw_item(count_, item_id, item_num);
|
||||
}
|
||||
}
|
||||
else if (*str == "[start end package]")
|
||||
{
|
||||
int item_id_begin_ = ScanInt();
|
||||
int item_id_end_ = ScanInt();
|
||||
|
||||
CGameDataManager::Get()->set_cera_award_package_begin_id(item_id_begin_);
|
||||
CGameDataManager::Get()->set_cera_award_package_end_id(item_id_end_);
|
||||
}
|
||||
else if (*str == "[package item]")
|
||||
{
|
||||
int _total = ScanInt();
|
||||
for (int i = 0; i < _total; i++)
|
||||
{
|
||||
int count_ = ScanInt();
|
||||
int item_id = ScanInt();
|
||||
int item_num = ScanInt();
|
||||
CGameDataManager::Get()->add_cera_award_package_item(count_, item_id, item_num);
|
||||
}
|
||||
}
|
||||
|
||||
if (str != NULL)
|
||||
CDispatch::Get()->importCashShopItemList(str);
|
||||
}
|
||||
|
||||
void Controller::hook_ProcessIPG_ResultOutput(CUser* user, int Goods_No, int item_id, int Cera_Type, InterfacePacketBuf* pbuf)
|
||||
@@ -299,3 +263,13 @@ int Controller::hook_Dispatcher_BuyCeraShopItem_dispatch_sig(void* a1, CUser* pU
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Controller::hook_Init(int a1, char** a2)
|
||||
{
|
||||
auto result = Get()->old_Init(a1, a2);
|
||||
if (result)
|
||||
{
|
||||
CDispatch::Get()->Init_done(a1, (const char**)a2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user