2022-9-2 23:34:04
This commit is contained in:
parent
b3ddde5254
commit
981b40bd96
82
src/base.h
82
src/base.h
|
|
@ -5,7 +5,6 @@ namespace base
|
||||||
namespace CGameManager
|
namespace CGameManager
|
||||||
{
|
{
|
||||||
const int G_CGameManager = 0x080CC18E;
|
const int G_CGameManager = 0x080CC18E;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Dispatcher_UseJewel
|
namespace Dispatcher_UseJewel
|
||||||
|
|
@ -19,6 +18,12 @@ namespace base
|
||||||
{
|
{
|
||||||
const int Init = 0x08299FA0;
|
const int Init = 0x08299FA0;
|
||||||
const int Init_fix_1 = 0x0829C075;
|
const int Init_fix_1 = 0x0829C075;
|
||||||
|
|
||||||
|
|
||||||
|
//base
|
||||||
|
const int s_pSecuProtectionField = 0x0941F7CC;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CParty
|
namespace CParty
|
||||||
|
|
@ -38,6 +43,8 @@ namespace base
|
||||||
const int getCurCharacLastPlayTick = 0x82A66AA;
|
const int getCurCharacLastPlayTick = 0x82A66AA;
|
||||||
const int get_level_up_exp = 0x0864E3BA;
|
const int get_level_up_exp = 0x0864E3BA;
|
||||||
const int getCurCharacInvenW = 0x80DA28E;
|
const int getCurCharacInvenW = 0x80DA28E;
|
||||||
|
const int _checkItemMovable = 0x0865F1E1;
|
||||||
|
const int getCurCharacInvenR = 0x080DA27E;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CUser
|
namespace CUser
|
||||||
|
|
@ -57,6 +64,11 @@ namespace base
|
||||||
const int isGMUser = 0x0814589C;
|
const int isGMUser = 0x0814589C;
|
||||||
const int exchange_interspace = 0x0865F7B0;
|
const int exchange_interspace = 0x0865F7B0;
|
||||||
const int setLastPacketID = 0x0867CBC4;
|
const int setLastPacketID = 0x0867CBC4;
|
||||||
|
const int GetAccountCargo = 0x0822FC22;
|
||||||
|
const int CheckInTrade = 0x080DA2FE;
|
||||||
|
const int IsExistAccountCargo = 0x0822FC30;
|
||||||
|
const int send_itemspace = 0x0865DB6C;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CStackableItem
|
namespace CStackableItem
|
||||||
|
|
@ -70,6 +82,12 @@ namespace base
|
||||||
{
|
{
|
||||||
const int is_stackable = 0x80F12FA;
|
const int is_stackable = 0x80F12FA;
|
||||||
const int IsRoutingItem = 0x08150F18;
|
const int IsRoutingItem = 0x08150F18;
|
||||||
|
const int GetAttachType = 0x080F12E2;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CEquipItem
|
||||||
|
{
|
||||||
|
const int GetItemType = 0x08514D26;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Inven_Item
|
namespace Inven_Item
|
||||||
|
|
@ -78,6 +96,9 @@ namespace base
|
||||||
const int isEmpty = 0x811ED66;
|
const int isEmpty = 0x811ED66;
|
||||||
const int getKey = 0x850D14E;
|
const int getKey = 0x850D14E;
|
||||||
const int isEquipableItemType = 0x08150812;
|
const int isEquipableItemType = 0x08150812;
|
||||||
|
const int IsTradeLimitAttachTypeItem = 0x081201DC;
|
||||||
|
const int GetItemSpace = 0x083481E2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CDataManager
|
namespace CDataManager
|
||||||
|
|
@ -93,6 +114,7 @@ namespace base
|
||||||
const int use_money = 0x84FF54C;
|
const int use_money = 0x84FF54C;
|
||||||
const int gain_money = 0x84FF29C;
|
const int gain_money = 0x84FF29C;
|
||||||
const int GetInvenRef = 0x84FC1DE;
|
const int GetInvenRef = 0x84FC1DE;
|
||||||
|
const int GetInvenSlot = 0x084FB918;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace DB_UpdateAvatarJewelSlot
|
namespace DB_UpdateAvatarJewelSlot
|
||||||
|
|
@ -193,7 +215,65 @@ namespace base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace CSecu_ProtectionField
|
||||||
|
{
|
||||||
|
const int Check = 0x08288A02;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CAccountCargo
|
||||||
|
{
|
||||||
|
const int GetCapacity = 0x0822F012;
|
||||||
|
const int GetMoney = 0x0822F020;
|
||||||
|
const int CAccountCargo = 0x08289794;
|
||||||
|
const int SetDBData = 0x08289816;
|
||||||
|
const int Clear = 0x0828986C;
|
||||||
|
const int ResetSlot = 0x082898C0;
|
||||||
|
const int GetSlot = 0x082898F8;
|
||||||
|
const int GetSlotRef = 0x08289A0C;
|
||||||
|
const int CheckInsertCondition = 0x08289A4A;
|
||||||
|
const int InsertItem = 0x08289C82;
|
||||||
|
const int DeleteItem = 0x08289E3C;
|
||||||
|
const int MoveItem = 0x08289F26;
|
||||||
|
const int DepositMoney = 0x0828A12A;
|
||||||
|
const int WithdrawMoney = 0x0828A2F6;
|
||||||
|
const int CheckMoneyLimit = 0x0828A4CA;
|
||||||
|
const int CheckValidSlot = 0x0828A554;
|
||||||
|
const int GetEmptySlot = 0x0828A580;
|
||||||
|
const int CheckSlotEmpty = 0x0828A5D4;
|
||||||
|
const int GetSpecificItemSlot = 0x0828A61A;
|
||||||
|
const int CheckStackLimit = 0x0828A670;
|
||||||
|
const int AddMoney = 0x0828A742;
|
||||||
|
const int SubMoney = 0x0828A764;
|
||||||
|
const int GetItemCount = 0x0828A794;
|
||||||
|
const int SendNotifyMoney = 0x0828A7DC;
|
||||||
|
const int SendItemList = 0x0828A88A;
|
||||||
|
const int MakeItemPacket = 0x0828AB1C;
|
||||||
|
const int CreateAccountCargo = 0x0828AD72;
|
||||||
|
const int UpgradeAccountCargo = 0x0828B0B2;
|
||||||
|
const int SendNotifyRecipe = 0x0828B3D0;
|
||||||
|
const int DeleteAccountCargo = 0x0828B4EC;
|
||||||
|
const int SetStable = 0x0844DC16;
|
||||||
|
const int SetCapacity = 0x084EBE46;
|
||||||
|
const int IsAlter = 0x08695A0C;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace stMoveItemParam
|
||||||
|
{
|
||||||
|
const int stMoveItemParam_make = 0x08230CD4;
|
||||||
|
const int stMoveItemParam_destroy = 0x08248062;
|
||||||
|
const int stMoveItemParam_del = 0x08248092;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace cUserHistoryLog
|
||||||
|
{
|
||||||
|
const int AccountCargoAddItem = 0x086868B4;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace AvatarRechargeServer
|
||||||
|
{
|
||||||
|
const int Get = 0x081935A2;
|
||||||
|
const int SendDurability = 0x08190416;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,23 +71,23 @@ int Controller::hook_IPacketDispatcher_ParamBase_dispatch_template(int a1, int a
|
||||||
Controller::Get()->old_IPacketDispatcher_ParamBase_dispatch_template(a1, a2, a3);
|
Controller::Get()->old_IPacketDispatcher_ParamBase_dispatch_template(a1, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pUser, PacketBuf* pBuf)
|
int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* user, PacketBuf* pBuf)
|
||||||
{
|
{
|
||||||
printf("getCurCharacName :%s \n", pUser->getCurCharacName().c_str());
|
printf("getCurCharacName :%s \n", user->getCurCharacName().c_str());
|
||||||
printf("getCurCharacNo :%d \n", pUser->getCurCharacNo());
|
printf("getCurCharacNo :%d \n", user->getCurCharacNo());
|
||||||
printf("get_buf_ptr :%p %p \n", pBuf->get_buf_ptr(0));
|
printf("get_buf_ptr :%p %p \n", pBuf->get_buf_ptr(0));
|
||||||
printf("get_len :%d \n", pBuf->get_len());
|
printf("get_len :%d \n", pBuf->get_len());
|
||||||
|
|
||||||
// printf("pBuf :%s \n", Util::ToHexString((const unsigned char*)pBuf->get_buf_ptr(0),40).c_str());
|
// printf("pBuf :%s \n", Util::ToHexString((const unsigned char*)pBuf->get_buf_ptr(0),40).c_str());
|
||||||
int state = pUser->get_state();
|
int state = user->get_state();
|
||||||
LOG("state :%d \n", state);
|
LOG("state :%d \n", state);
|
||||||
//校验角色状态是否允许镶嵌
|
//校验角色状态是否允许镶嵌
|
||||||
if (state != 3)
|
if (state != 3)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int isEnableAvatarSocketAction = pUser->isEnableAvatarSocketAction();
|
int isEnableAvatarSocketAction = user->isEnableAvatarSocketAction();
|
||||||
if (isEnableAvatarSocketAction)
|
if (isEnableAvatarSocketAction)
|
||||||
pUser->SendCmdErrorPacket(205, (unsigned char)isEnableAvatarSocketAction);
|
user->SendCmdErrorPacket(205, (unsigned char)isEnableAvatarSocketAction);
|
||||||
//解析packet_buf
|
//解析packet_buf
|
||||||
|
|
||||||
//时装所在的背包槽
|
//时装所在的背包槽
|
||||||
|
|
@ -100,14 +100,14 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
int emblem_cnt = pBuf->get_byte();
|
int emblem_cnt = pBuf->get_byte();
|
||||||
LOG("emblem_cnt :%d \n", emblem_cnt);
|
LOG("emblem_cnt :%d \n", emblem_cnt);
|
||||||
|
|
||||||
if (pUser->CheckItemLock(2, avartar_inven_slot))
|
if (user->CheckItemLock(2, avartar_inven_slot))
|
||||||
{
|
{
|
||||||
pUser->SendCmdErrorPacket(205, 213);
|
user->SendCmdErrorPacket(205, 213);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取时装道具
|
//获取时装道具
|
||||||
CInventory* inven = pUser->getCurCharacInvenW();
|
CInventory* inven = user->getCurCharacInvenW();
|
||||||
if (!inven)
|
if (!inven)
|
||||||
{
|
{
|
||||||
LOG("pUser->getCurCharacInvenW : error \n");
|
LOG("pUser->getCurCharacInvenW : error \n");
|
||||||
|
|
@ -120,7 +120,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//校验时装 数据是否合法
|
//校验时装 数据是否合法
|
||||||
if (avartar->isEmpty() || (avartar->getKey() != avartar_item_id) || pUser->CheckItemLock(2, avartar_inven_slot))
|
if (avartar->isEmpty() || (avartar->getKey() != avartar_item_id) || user->CheckItemLock(2, avartar_inven_slot))
|
||||||
{
|
{
|
||||||
|
|
||||||
LOG("avartar->isEmpty() || avartar->getKey() || pUser->CheckItemLock() : error \n");
|
LOG("avartar->isEmpty() || avartar->getKey() || pUser->CheckItemLock() : error \n");
|
||||||
|
|
@ -155,7 +155,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
if (emblem->isEmpty() || (emblem->getKey() != emblem_item_id) || (avartar_socket_slot >= 3))
|
if (emblem->isEmpty() || (emblem->getKey() != emblem_item_id) || (avartar_socket_slot >= 3))
|
||||||
{
|
{
|
||||||
LOG("emblem->isEmpty() || (emblem->getKey() : error \n");
|
LOG("emblem->isEmpty() || (emblem->getKey() : error \n");
|
||||||
pUser->SendCmdErrorPacket(205, 209);
|
user->SendCmdErrorPacket(205, 209);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,14 +166,14 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
if (!DataManager)
|
if (!DataManager)
|
||||||
{
|
{
|
||||||
LOG("CDataManager::G_CDataManager() : error \n");
|
LOG("CDataManager::G_CDataManager() : error \n");
|
||||||
pUser->SendCmdErrorPacket(205, 209);
|
user->SendCmdErrorPacket(205, 209);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
CItem* citem = DataManager->find_item(emblem_item_id);
|
CItem* citem = DataManager->find_item(emblem_item_id);
|
||||||
if (!citem)
|
if (!citem)
|
||||||
{
|
{
|
||||||
LOG("DataManager->find_item() : error \n");
|
LOG("DataManager->find_item() : error \n");
|
||||||
pUser->SendCmdErrorPacket(205, 209);
|
user->SendCmdErrorPacket(205, 209);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
if (!citem->is_stackable() || (citem->GetItemType() != 20))
|
if (!citem->is_stackable() || (citem->GetItemType() != 20))
|
||||||
{
|
{
|
||||||
LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
|
LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
|
||||||
pUser->SendCmdErrorPacket(205, 209);
|
user->SendCmdErrorPacket(205, 209);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
{
|
{
|
||||||
//插槽类型不匹配
|
//插槽类型不匹配
|
||||||
LOG("emblem_socket_type & avartar_socket_type\n");
|
LOG("emblem_socket_type & avartar_socket_type\n");
|
||||||
pUser->SendCmdErrorPacket(205, 209);
|
user->SendCmdErrorPacket(205, 209);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LOG("avartar_socket_slot:%d emblem_inven_slot:%d emblem_item_id:%d\n", avartar_socket_slot, emblem_inven_slot, emblem_item_id);
|
LOG("avartar_socket_slot:%d emblem_inven_slot:%d emblem_item_id:%d\n", avartar_socket_slot, emblem_inven_slot, emblem_item_id);
|
||||||
|
|
@ -206,7 +206,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
{
|
{
|
||||||
//删除徽章
|
//删除徽章
|
||||||
int emblem_inven_slot = avartar_socket_slot.second.first;
|
int emblem_inven_slot = avartar_socket_slot.second.first;
|
||||||
inven->delete_item(1, emblem_inven_slot, 1, 8, 1);
|
inven->delete_item(CInventory::INVENTORY_TYPE_ITEM, emblem_inven_slot, 1, 8, 1);
|
||||||
|
|
||||||
//设置时装插槽数据
|
//设置时装插槽数据
|
||||||
int emblem_item_id = avartar_socket_slot.second.second;
|
int emblem_item_id = avartar_socket_slot.second.second;
|
||||||
|
|
@ -215,10 +215,10 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
}
|
}
|
||||||
|
|
||||||
//时装插槽数据存档
|
//时装插槽数据存档
|
||||||
DB_UpdateAvatarJewelSlot::makeRequest(pUser->getCurCharacNo(), avartar->get_ui_id(), (void*)jewel_socket_data);
|
DB_UpdateAvatarJewelSlot::makeRequest(user->getCurCharacNo(), avartar->get_ui_id(), (void*)jewel_socket_data);
|
||||||
|
|
||||||
//通知客户端时装数据已更新
|
//通知客户端时装数据已更新
|
||||||
pUser->SendUpdateItemList(1, 1, avartar_inven_slot);
|
user->SendUpdateItemList(1, 1, avartar_inven_slot);
|
||||||
LOG("徽章镶嵌完毕!!!");
|
LOG("徽章镶嵌完毕!!!");
|
||||||
//回包给客户端
|
//回包给客户端
|
||||||
InterfacePacketBuf* packet_guard = (InterfacePacketBuf*)PacketGuard::NewPacketGuard();
|
InterfacePacketBuf* packet_guard = (InterfacePacketBuf*)PacketGuard::NewPacketGuard();
|
||||||
|
|
@ -226,7 +226,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
|
||||||
packet_guard->put_header(1, 204);
|
packet_guard->put_header(1, 204);
|
||||||
packet_guard->put_int(1);
|
packet_guard->put_int(1);
|
||||||
packet_guard->finalize(1);
|
packet_guard->finalize(1);
|
||||||
pUser->Send((PacketGuard*)packet_guard);
|
user->Send((PacketGuard*)packet_guard);
|
||||||
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
|
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,6 +258,7 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* us
|
||||||
|
|
||||||
if (packet_id == Packet_UseEquipmentMoveItem)
|
if (packet_id == Packet_UseEquipmentMoveItem)
|
||||||
{
|
{
|
||||||
|
int result = 0;
|
||||||
PacketBuf* v25 = PacketBuf::NewPacketBuf();
|
PacketBuf* v25 = PacketBuf::NewPacketBuf();
|
||||||
user->setLastPacketID(packet_id);
|
user->setLastPacketID(packet_id);
|
||||||
v25->bind_packet(packet_src, packet_len);
|
v25->bind_packet(packet_src, packet_len);
|
||||||
|
|
@ -271,11 +272,14 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* us
|
||||||
, Util::ToHexString((const unsigned char*)packet_src, packet_len).c_str()
|
, Util::ToHexString((const unsigned char*)packet_src, packet_len).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
int result = CDispatch::Get()->UseEquipmentMoveItem(user, v25);
|
if (v25)
|
||||||
|
{
|
||||||
|
ENUM_PACK_RET_TYPE ret = CDispatch::Get()->UseEquipmentMoveItem(user, v25);
|
||||||
|
|
||||||
|
result = (ret == PAK_ERROR) ? 1 : 0;
|
||||||
|
|
||||||
|
PacketBuf::DelPacketBuf(v25);
|
||||||
PacketBuf::DelPacketBuf(v25);
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return Controller::Get()->old_PacketDispatcher_doDispatch(a1, user, packet_class, packet_id, packet_src, packet_len, a7, a8);
|
return Controller::Get()->old_PacketDispatcher_doDispatch(a1, user, packet_class, packet_id, packet_src, packet_len, a7, a8);
|
||||||
|
|
|
||||||
324
src/dispatch.cpp
324
src/dispatch.cpp
|
|
@ -18,115 +18,249 @@ CDispatch::~CDispatch()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||||
{
|
{
|
||||||
int result = 0;
|
|
||||||
|
|
||||||
if (pBuf)
|
if (user->get_state() != 3)
|
||||||
{
|
{
|
||||||
int equipment_pos = pBuf->get_short(); //装备位置
|
LOG(u8"玩家状态不正常!");
|
||||||
int equipment_id = pBuf->get_int(); //装备代码
|
return PAK_IGNORE;
|
||||||
int item_pos = pBuf->get_short(); //物品位置
|
}
|
||||||
|
|
||||||
|
int v110 = CSecu_ProtectionField::Get()->Check(user, 38);
|
||||||
|
if (v110)
|
||||||
|
{
|
||||||
|
user->SendCmdErrorPacket(84, v110);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG(u8"UseEquipmentMoveItem :%s ", Util::ToHexString((const unsigned char*)pBuf->get_buf_ptr(0), 40).c_str());
|
||||||
|
int equipment_pos = pBuf->get_short(); //装备位置
|
||||||
|
int equipment_id = pBuf->get_int(); //装备代码
|
||||||
|
int item_pos = pBuf->get_short(); //物品位置
|
||||||
|
|
||||||
|
//1 物品栏 2 时装
|
||||||
|
if (user->CheckItemLock(1, equipment_pos))
|
||||||
|
{
|
||||||
|
user->SendCmdErrorPacket(84, 0xD5);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
CInventory* invenR = user->getCurCharacInvenR();
|
||||||
|
if (!invenR)
|
||||||
|
{
|
||||||
|
LOG(u8"user->getCurCharacInvenW : error \n");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Inven_Item* equipment_InvenRef = invenR->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
||||||
|
if (!equipment_InvenRef)
|
||||||
|
{
|
||||||
|
LOG(u8"inven->GetInvenRef : error \n");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
Inven_Item* item_avartar = invenR->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos);
|
||||||
|
if (!item_avartar)
|
||||||
|
{
|
||||||
|
LOG(u8"inven->GetInvenRef : error \n");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (equipment_InvenRef->isEmpty())
|
||||||
|
{
|
||||||
|
LOG(u8"equipment_InvenRef->isEmpty");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
if (equipment_InvenRef->getKey() != equipment_id)
|
||||||
|
{
|
||||||
|
LOG(u8"equipment_InvenRef->getKey() != equipment_id");
|
||||||
|
user->SendCmdErrorPacket(4, 0);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item_avartar->isEmpty())
|
||||||
|
{
|
||||||
|
LOG(u8"item_avartar->isEmpty");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int item_id = item_avartar->getKey();
|
||||||
|
|
||||||
|
CDataManager* DataManager = CDataManager::G_CDataManager();
|
||||||
|
|
||||||
|
if (!DataManager)
|
||||||
|
{
|
||||||
|
LOG(u8"G_CDataManager error");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
CItem* equipment_citem = DataManager->find_item(equipment_id);
|
||||||
|
CItem* item_citem = DataManager->find_item(item_id);
|
||||||
|
LOG(u8"equipment_citem +12: %p"
|
||||||
|
, *(int*)equipment_citem + 12
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!equipment_citem || !item_citem)
|
||||||
|
{
|
||||||
|
LOG(u8"!equipment_citem || !item_citem");
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG(u8"UseEquipmentMoveItem [ equipment_pos:%d equipment_id:%d item_pos:%d item_id:%d ]"
|
||||||
|
, equipment_pos
|
||||||
|
, equipment_id
|
||||||
|
, item_pos
|
||||||
|
, item_id
|
||||||
|
);
|
||||||
|
|
||||||
|
//Data: equipment_citem->GetItemType=147418664 item_citem->is_stackable=1 item_citem->GetItemType=11
|
||||||
|
int equipment_Type = ((CEquipItem*)equipment_citem)->GetItemType();
|
||||||
|
|
||||||
|
LOG(u8"Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d"
|
||||||
|
, (*(int(**)(CItem*))(*(int*)equipment_citem + 12))(equipment_citem)
|
||||||
|
, item_citem->is_stackable()
|
||||||
|
, item_citem->GetItemType()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//1 物品栏 2 时装
|
if (equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11)
|
||||||
if (user->CheckItemLock(1, equipment_pos))
|
{
|
||||||
|
LOG(u8"equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11");
|
||||||
|
user->SendCmdErrorPacket(84, 0xD5);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item_citem->is_stackable() != true || item_citem->GetItemType() != ITEM_TYPE_CONSUMABLES)
|
||||||
|
{
|
||||||
|
LOG(u8"item_citem->is_stackable() != true || item_citem->GetItemType() != ITEM_TYPE_CONSUMABLES");
|
||||||
|
|
||||||
|
//没有镜像手机认证,无法使用该功能
|
||||||
|
user->SendCmdErrorPacket(205, 209);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
int v9 = 0; //返回给客户端的错误码
|
||||||
|
switch (item_id)
|
||||||
|
{
|
||||||
|
case ITEM_ID_KUAJIESHI:
|
||||||
|
{
|
||||||
|
LOG(u8"user->CheckInTrade:%d", user->CheckInTrade());
|
||||||
|
|
||||||
|
if (user->CheckInTrade())
|
||||||
{
|
{
|
||||||
user->SendCmdErrorPacket(83, 213);
|
v9 = 19;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
if (!user->IsExistAccountCargo())
|
||||||
CInventory* inven = user->getCurCharacInvenW();
|
|
||||||
if (!inven)
|
|
||||||
{
|
{
|
||||||
LOG("user->getCurCharacInvenW : error \n");
|
v9 = 19;
|
||||||
return result;
|
LOG(u8"user->IsExistAccountCargo :%d", user->IsExistAccountCargo());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
Inven_Item* equipment_avartar = inven->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
|
||||||
if (!equipment_avartar)
|
|
||||||
{
|
{
|
||||||
LOG("inven->GetInvenRef : error \n");
|
CAccountCargo* AccountCargo = user->GetAccountCargo();
|
||||||
return result;
|
|
||||||
|
invenR = user->getCurCharacInvenR();
|
||||||
|
|
||||||
|
Inven_Item ins_item = {};
|
||||||
|
|
||||||
|
invenR->GetInvenSlot(&ins_item, CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
||||||
|
|
||||||
|
|
||||||
|
LOG(u8"ins_item.IsTradeLimitAttachTypeItem :%d", ins_item.IsTradeLimitAttachTypeItem());
|
||||||
|
LOG(u8"AccountCargo->CheckInsertCondition :%d", AccountCargo->CheckInsertCondition(&ins_item));
|
||||||
|
|
||||||
|
int empty_slot = 0;
|
||||||
|
if (AccountCargo->CheckSlotEmpty(empty_slot) != 1)
|
||||||
|
{
|
||||||
|
empty_slot = AccountCargo->GetEmptySlot();
|
||||||
|
if (empty_slot < 0)
|
||||||
|
{
|
||||||
|
v9 = 4;
|
||||||
|
LOG("AccountCargo->CheckSlotEmpty :%d", empty_slot);
|
||||||
|
return PAK_IGNORE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG(u8"empty_slot :%d", empty_slot);
|
||||||
|
//inven->delete_item(1, emblem_inven_slot, 1, 8, 1);
|
||||||
|
auto invenW = user->getCurCharacInvenW();
|
||||||
|
InterfacePacketBuf* packet_guard = (InterfacePacketBuf*)PacketGuard::NewPacketGuard();
|
||||||
|
|
||||||
|
if (invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, equipment_pos, 1, 37, 1) && invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, item_pos, 1, 37, 1))
|
||||||
|
{
|
||||||
|
int a9 = AccountCargo->InsertItem(&ins_item, empty_slot);
|
||||||
|
user->SendUpdateItemList(1, ins_item.GetItemSpace(), equipment_pos);
|
||||||
|
user->SendUpdateItemList(1, item_avartar->GetItemSpace(), item_pos);
|
||||||
|
user->send_itemspace(12);
|
||||||
|
|
||||||
|
packet_guard->put_header(1, 2000);
|
||||||
|
packet_guard->put_int(1);
|
||||||
|
packet_guard->finalize(1);
|
||||||
|
user->Send((PacketGuard*)packet_guard);
|
||||||
|
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
|
||||||
|
LOG(u8"user->Send((PacketGuard*)packet_guard)", a9);
|
||||||
|
return PAK_OK;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
packet_guard->put_header(1, 2000);
|
||||||
|
packet_guard->put_int(0);
|
||||||
|
packet_guard->finalize(0);
|
||||||
|
user->Send((PacketGuard*)packet_guard);
|
||||||
|
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
|
||||||
|
}
|
||||||
|
return PAK_IGNORE;
|
||||||
}
|
}
|
||||||
Inven_Item* item_avartar = inven->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos);
|
|
||||||
if (!item_avartar)
|
|
||||||
{
|
|
||||||
LOG("inven->GetInvenRef : error \n");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (equipment_avartar->isEmpty() )
|
|
||||||
{
|
|
||||||
LOG("服务器背包为空");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
if (equipment_avartar->getKey() != equipment_id)
|
|
||||||
{
|
|
||||||
LOG("需要操作的装备ID和数据库的装备ID不一致");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item_avartar->isEmpty())
|
|
||||||
{
|
|
||||||
LOG("需要操作的物品为空");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int item_id = item_avartar->getKey();
|
|
||||||
|
|
||||||
CDataManager* DataManager = CDataManager::G_CDataManager();
|
|
||||||
|
|
||||||
if (!DataManager)
|
|
||||||
{
|
|
||||||
LOG("G_CDataManager 错误");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
CItem* equipment_citem = DataManager->find_item(equipment_id);
|
|
||||||
CItem* item_citem = DataManager->find_item(item_id);
|
|
||||||
|
|
||||||
if (!equipment_citem || !item_citem)
|
|
||||||
{
|
|
||||||
LOG("获取pvf中数据失败!");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG("UseEquipmentMoveItem [ equipment_pos:%d equipment_id:%d item_pos:%d item_id:%d ]"
|
|
||||||
, equipment_pos
|
|
||||||
, equipment_id
|
|
||||||
, item_pos
|
|
||||||
, item_id
|
|
||||||
);
|
|
||||||
|
|
||||||
//Data: equipment_citem->GetItemType=147418664 item_citem->is_stackable=1 item_citem->GetItemType=11
|
|
||||||
LOG("Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d"
|
|
||||||
, equipment_citem->GetItemType()
|
|
||||||
, item_citem->is_stackable()
|
|
||||||
, item_citem->GetItemType()
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
//if (!item_citem->is_stackable() || (equipment_citem->GetItemType() != 20))
|
|
||||||
//{
|
|
||||||
// LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
|
|
||||||
// pUser->SendCmdErrorPacket(205, 209);
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
|
|
||||||
/*
|
|
||||||
缓冲Call (2000)
|
|
||||||
密钥Call (装备位置,2)
|
|
||||||
密钥Call (装备代码,4)
|
|
||||||
密钥Call (物品位置,2)
|
|
||||||
发包Call ()
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
break;
|
||||||
|
case ITEM_ID_YIJIRUHUN:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
//if (!item_citem->is_stackable() || (equipment_citem->GetItemType() != 20))
|
||||||
|
//{
|
||||||
|
// LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
|
||||||
|
// pUser->SendCmdErrorPacket(205, 209);
|
||||||
|
// return 0;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*
|
||||||
|
[DNF_PROJECT] Recv() class:1 id:2000 len:21 packet_data :01 D0 07 15 00 00 00 36 E2 41 37 12 00 09 00 AD 6B 00 00 03 00
|
||||||
|
[DNF_PROJECT] UseEquipmentMoveItem :01 D0 07 15 00 00 00 36 E2 41 37 12 00 09 00 AD 6B 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
|
||||||
|
[DNF_PROJECT] UseEquipmentMoveItem [ equipment_pos:9 equipment_id:27565 item_pos:3 item_id:2660238 ]
|
||||||
|
|
||||||
|
[DNF_PROJECT] Data: equipment_citem->GetItemType=0 item_citem->is_stackable=1 item_citem->GetItemType=11
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
缓冲Call (2000)
|
||||||
|
密钥Call (装备位置,2)
|
||||||
|
密钥Call (装备代码,4)
|
||||||
|
密钥Call (物品位置,2)
|
||||||
|
发包Call ()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return PAK_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public:
|
||||||
CDispatch();
|
CDispatch();
|
||||||
~CDispatch();
|
~CDispatch();
|
||||||
public:
|
public:
|
||||||
int UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf);
|
ENUM_PACK_RET_TYPE UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
||||||
21
src/enum.h
21
src/enum.h
|
|
@ -6,3 +6,24 @@ enum ENUM_PACKET_ID
|
||||||
Packet_UseEquipmentMoveItem = 2000,
|
Packet_UseEquipmentMoveItem = 2000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ENUM_PACK_RET_TYPE
|
||||||
|
{
|
||||||
|
PAK_OK = 0,
|
||||||
|
PAK_IGNORE = 1,
|
||||||
|
PAK_ERROR = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ENUM_ITEM_TYPE
|
||||||
|
{
|
||||||
|
ITEM_TYPE_EQUIPMENT = 0,
|
||||||
|
ITEM_TYPE_CONSUMABLES = 11,
|
||||||
|
ITEM_TYPE_JEWEL = 20,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ENUM_ITEM_ID
|
||||||
|
{
|
||||||
|
ITEM_ID_YIJIRUHUN = 2660238, //一击入魂蜜蜡
|
||||||
|
ITEM_ID_KUAJIESHI = 20220831, //测试跨界石
|
||||||
|
|
||||||
|
};
|
||||||
277
src/sdk_class.h
277
src/sdk_class.h
|
|
@ -25,6 +25,7 @@ template<typename R, typename A, typename ... ARG> R CallT(A call_addr, const AR
|
||||||
return R();
|
return R();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CAccountCargo;
|
||||||
class DB_UpdateAvatarJewelSlot;
|
class DB_UpdateAvatarJewelSlot;
|
||||||
class CInventory;
|
class CInventory;
|
||||||
class CStackableItem;
|
class CStackableItem;
|
||||||
|
|
@ -100,6 +101,17 @@ public:
|
||||||
typedef CInventory* (*__func)(CUserCharacInfo* a1);
|
typedef CInventory* (*__func)(CUserCharacInfo* a1);
|
||||||
return ((__func)base::CUserCharacInfo::getCurCharacInvenW)(this);
|
return ((__func)base::CUserCharacInfo::getCurCharacInvenW)(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _checkItemMovable(int a2, int a3, int a4, int a5, int a6, int a7)
|
||||||
|
{
|
||||||
|
CallT<bool>(base::CUserCharacInfo::_checkItemMovable, this, a2, a3, a4, a5, a6, a7);
|
||||||
|
}
|
||||||
|
|
||||||
|
CInventory* getCurCharacInvenR()
|
||||||
|
{
|
||||||
|
return CallT<CInventory*>(base::CUserCharacInfo::getCurCharacInvenR, this);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CUser : public CUserCharacInfo
|
class CUser : public CUserCharacInfo
|
||||||
|
|
@ -167,6 +179,161 @@ public:
|
||||||
return CallT<CUser*>(base::CUser::setLastPacketID, this, a2);
|
return CallT<CUser*>(base::CUser::setLastPacketID, this, a2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAccountCargo* GetAccountCargo()
|
||||||
|
{
|
||||||
|
return CallT<CAccountCargo*>(base::CUser::GetAccountCargo, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CheckInTrade()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CUser::CheckInTrade, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsExistAccountCargo()
|
||||||
|
{
|
||||||
|
return CallT<bool>(base::CUser::IsExistAccountCargo, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
int send_itemspace(int a2)
|
||||||
|
{
|
||||||
|
return CallT<bool>(base::CUser::send_itemspace, this, a2);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class CAccountCargo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
int GetCapacity()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetCapacity, this);
|
||||||
|
}
|
||||||
|
int GetMoney()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetMoney, this);
|
||||||
|
}
|
||||||
|
int SetDBData(CUser* a2, Inven_Item* a3, uint a4, uint a5)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SetDBData, this, a2, a3, a4, a5);
|
||||||
|
}
|
||||||
|
int Clear()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::Clear, this);
|
||||||
|
}
|
||||||
|
int ResetSlot(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::ResetSlot, this, a2);
|
||||||
|
}
|
||||||
|
int* GetSlot(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int*>(base::CAccountCargo::GetSlot, this, a2);
|
||||||
|
}
|
||||||
|
int GetSlotRef(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetSlotRef, this, a2);
|
||||||
|
}
|
||||||
|
int CheckInsertCondition(Inven_Item* a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CheckInsertCondition, this, a2);
|
||||||
|
}
|
||||||
|
int InsertItem(Inven_Item* a2, int a3)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::InsertItem, this, a2, a3);
|
||||||
|
}
|
||||||
|
int DeleteItem(int a2, int a3)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::DeleteItem, this, a2, a3);
|
||||||
|
}
|
||||||
|
int MoveItem(int a2, int a3)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::MoveItem, this, a2, a3);
|
||||||
|
}
|
||||||
|
int DepositMoney(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::DepositMoney, this, a2);
|
||||||
|
}
|
||||||
|
int WithdrawMoney(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::WithdrawMoney, this, a2);
|
||||||
|
}
|
||||||
|
int CheckMoneyLimit(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CheckMoneyLimit, this, a2);
|
||||||
|
}
|
||||||
|
int CheckValidSlot(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CheckValidSlot, this);
|
||||||
|
}
|
||||||
|
int GetEmptySlot()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetEmptySlot, this);
|
||||||
|
}
|
||||||
|
int CheckSlotEmpty(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CheckSlotEmpty, this, a2);
|
||||||
|
}
|
||||||
|
int GetSpecificItemSlot(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetSpecificItemSlot, this, a2);
|
||||||
|
}
|
||||||
|
int CheckStackLimit(int a2, int a3, int a4)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CheckStackLimit, this);
|
||||||
|
}
|
||||||
|
int AddMoney(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::AddMoney, this, a2);
|
||||||
|
}
|
||||||
|
int SubMoney(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SubMoney, this, a2);
|
||||||
|
}
|
||||||
|
int GetItemCount()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::GetItemCount, this);
|
||||||
|
}
|
||||||
|
int SendNotifyMoney(int a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SendNotifyMoney, this, a2);
|
||||||
|
}
|
||||||
|
int SendItemList()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SendItemList, this);
|
||||||
|
}
|
||||||
|
int MakeItemPacket(PacketGuard* a2, int a3)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::MakeItemPacket, this, a2, a3);
|
||||||
|
}
|
||||||
|
int CreateAccountCargo(CUser* a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::CreateAccountCargo, this, a2);
|
||||||
|
}
|
||||||
|
int UpgradeAccountCargo(CUser* a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::UpgradeAccountCargo, this, a2);
|
||||||
|
}
|
||||||
|
int SendNotifyRecipe(CUser* a2, int a3, bool a4)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SendNotifyRecipe, this, a2, a3, a4);
|
||||||
|
}
|
||||||
|
int DeleteAccountCargo(CUser* a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::DeleteAccountCargo, this, a2);
|
||||||
|
}
|
||||||
|
int SetStable()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SetStable, this);
|
||||||
|
}
|
||||||
|
int SetCapacity(uint a2)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::SetCapacity, this, a2);
|
||||||
|
}
|
||||||
|
int IsAlter(void)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CAccountCargo::IsAlter, this);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CStackableItem
|
class CStackableItem
|
||||||
|
|
@ -191,9 +358,9 @@ class CItem : public CStackableItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//道具是否为消耗品
|
//道具是否为消耗品
|
||||||
int is_stackable()
|
bool is_stackable()
|
||||||
{
|
{
|
||||||
typedef int (*__func)(CItem* a1);
|
typedef bool (*__func)(CItem* a1);
|
||||||
return ((__func)base::CItem::is_stackable)(this);
|
return ((__func)base::CItem::is_stackable)(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,12 +370,30 @@ public:
|
||||||
return ((__func)base::CItem::IsRoutingItem)(this);
|
return ((__func)base::CItem::IsRoutingItem)(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GetAttachType()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CItem::GetAttachType, this);
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CEquipItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int GetItemType()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CEquipItem::GetItemType, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
class Inven_Item
|
class Inven_Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
unsigned char UnknownData_NUSL[0x3D];
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
//获取道具附加信息
|
//获取道具附加信息
|
||||||
WongWork::CAvatarItemMgr* get_add_info()
|
WongWork::CAvatarItemMgr* get_add_info()
|
||||||
{
|
{
|
||||||
|
|
@ -239,6 +424,17 @@ public:
|
||||||
{
|
{
|
||||||
return *(int*)(this + 0x7);
|
return *(int*)(this + 0x7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsTradeLimitAttachTypeItem()
|
||||||
|
{
|
||||||
|
return CallT<bool>(base::Inven_Item::IsTradeLimitAttachTypeItem, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetItemSpace()
|
||||||
|
{
|
||||||
|
return CallT<int>(base::Inven_Item::GetItemSpace, this);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDataManager
|
class CDataManager
|
||||||
|
|
@ -261,6 +457,7 @@ public:
|
||||||
class CInventory
|
class CInventory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum INVENTORY_TYPE : int
|
enum INVENTORY_TYPE : int
|
||||||
{
|
{
|
||||||
INVENTORY_TYPE_BODY = 0, //身上穿的装备
|
INVENTORY_TYPE_BODY = 0, //身上穿的装备
|
||||||
|
|
@ -276,10 +473,10 @@ public:
|
||||||
return ((__func)base::CInventory::GetAvatarItemMgrR)(this);
|
return ((__func)base::CInventory::GetAvatarItemMgrR)(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
int delete_item(int a2, int a3, int a4, int a5, int a6)
|
int delete_item(INVENTORY_TYPE a2, int pos, int num, int a5, int a6 = 1)
|
||||||
{
|
{
|
||||||
typedef int (*__func)(CInventory* a1, int a2, int a3, int a4, int a5, int a6);
|
typedef int (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3, int a4, int a5, int a6);
|
||||||
return ((__func)base::CInventory::delete_item)(this, a2, a3, a4, a5, a6);
|
return ((__func)base::CInventory::delete_item)(this, a2, pos, num, a5, a6);
|
||||||
}
|
}
|
||||||
|
|
||||||
//使用金币
|
//使用金币
|
||||||
|
|
@ -302,6 +499,14 @@ public:
|
||||||
typedef Inven_Item* (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3);
|
typedef Inven_Item* (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3);
|
||||||
return ((__func)base::CInventory::GetInvenRef)(this, a2, a3);
|
return ((__func)base::CInventory::GetInvenRef)(this, a2, a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Inven_Item* GetInvenSlot(Inven_Item* a2, INVENTORY_TYPE a3, int a4)
|
||||||
|
{
|
||||||
|
typedef Inven_Item* (__attribute__((__stdcall__))* fnCInventory_GetInvenSlot)(Inven_Item* dest, CInventory* pThis, int space, int location);
|
||||||
|
static fnCInventory_GetInvenSlot CInventory_GetInvenSlot = (fnCInventory_GetInvenSlot)(base::CInventory::GetInvenSlot);
|
||||||
|
return CInventory_GetInvenSlot(a2, this, a3, a4);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DB_UpdateAvatarJewelSlot
|
class DB_UpdateAvatarJewelSlot
|
||||||
|
|
@ -321,6 +526,7 @@ public:
|
||||||
static PacketBuf* NewPacketBuf()
|
static PacketBuf* NewPacketBuf()
|
||||||
{
|
{
|
||||||
void* v62 = malloc(0x20000);
|
void* v62 = malloc(0x20000);
|
||||||
|
if (!v62) return NULL;
|
||||||
return CallT<PacketBuf*>(base::PacketBuf::PacketBuf_make, v62);
|
return CallT<PacketBuf*>(base::PacketBuf::PacketBuf_make, v62);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -447,6 +653,7 @@ public:
|
||||||
{
|
{
|
||||||
void* v62 = malloc(0x20000);
|
void* v62 = malloc(0x20000);
|
||||||
typedef int (*__func)(void* a1);
|
typedef int (*__func)(void* a1);
|
||||||
|
if (!v62) return NULL;
|
||||||
((__func)base::PacketGuard::PacketGuard_make)(v62);
|
((__func)base::PacketGuard::PacketGuard_make)(v62);
|
||||||
return (PacketGuard*)v62;
|
return (PacketGuard*)v62;
|
||||||
}
|
}
|
||||||
|
|
@ -474,7 +681,67 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CSecu_ProtectionField
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static CSecu_ProtectionField* Get()
|
||||||
|
{
|
||||||
|
return (CSecu_ProtectionField*)(*(int*)base::GlobalData::s_pSecuProtectionField);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Check(CUser* a2, int a3)
|
||||||
|
{
|
||||||
|
return CallT<int>(base::CSecu_ProtectionField::Check, this, a2, a3);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class stMoveItemParam
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static stMoveItemParam* NewstMoveItemParam()
|
||||||
|
{
|
||||||
|
void* v62 = malloc(0x20000);
|
||||||
|
if (!v62) return NULL;
|
||||||
|
CallT<int>(base::stMoveItemParam::stMoveItemParam_make, v62);
|
||||||
|
return (stMoveItemParam*)v62;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DelstMoveItemParam(stMoveItemParam* a1)
|
||||||
|
{
|
||||||
|
CallT<int>(base::stMoveItemParam::stMoveItemParam_destroy, a1);
|
||||||
|
free(a1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DelstMoveItemParam2(stMoveItemParam* a1)
|
||||||
|
{
|
||||||
|
CallT<int>(base::stMoveItemParam::stMoveItemParam_del, a1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class cUserHistoryLog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class AvatarRechargeServer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static AvatarRechargeServer* Get()
|
||||||
|
{
|
||||||
|
return CallT<AvatarRechargeServer*>(base::AvatarRechargeServer::Get);
|
||||||
|
}
|
||||||
|
|
||||||
|
char SendDurability(CUser* a2, char a3, short a4, char a5, int a6)
|
||||||
|
{
|
||||||
|
return CallT<char>(base::AvatarRechargeServer::SendDurability, this, a2, a3, a4, a5, a6);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // __DXFBASE_H__
|
#endif // __DXFBASE_H__
|
||||||
|
|
|
||||||
1504
test/main.cc
1504
test/main.cc
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue