Drachenseelen-Refine-Protokoll aus dem Client-Engine-Code entfernen
Dritter, zuvor uebersehener Teil der Drachenseelen-Entfernung: das Visual-Studio-Projekt, das Metin2Client.exe baut und die an Python exponierten Module (player/chr/item/app/net) bereitstellt. Entfernt: NEW_AFFECT_DRAGON_SOUL_QUALIFIED/_DECK1/_DECK2 (InstanceBase.h + Python-Bindings), das komplette Refine-Netzwerkprotokoll (HEADER_CG/GC_DRAGON_SOUL_REFINE, TPacketCG/GCDragonSoulRefine, Send/RecvDragonSoulRefine(Packet) inkl. aller Aufrufstellen, playerSendDragonSoulRefine, DS_SUB_HEADER_*-Bindings in gleich zwei Modulen), playerIsDSEquipmentSlot, sowie die ungenutzten EDragonSoulStepTypes-Enum. Sicherheitsprinzip wie serverseitig beachtet: ESlotType, EWindows und CItemData::EItemType sind sequentielle Enums, in denen SLOT_TYPE_DRAGON_SOUL_INVENTORY / DRAGON_SOUL_INVENTORY / ITEM_TYPE_DS / ITEM_TYPE_SPECIAL_DS mitten drin liegen und mit dem Server sowie gespeicherten Item-Daten synchron bleiben muessen (u.a. wegen BELT_INVENTORY danach) - diese bleiben bewusst als reservierte, ungenutzte Werte stehen, ebenso EDragonSoulGradeTypes (wird noch von c_DragonSoul_Inventory_Count zur Groessenberechnung des aDSItem[]-Arrays gebraucht). WICHTIG: Dieses Projekt kann ich nicht selbst kompilieren (Windows/Visual Studio). Bitte einmal durchbauen und mir Fehler zurückmelden.
This commit is contained in:
@@ -1288,24 +1288,6 @@ PyObject * playerIsEquipmentSlot(PyObject* poSelf, PyObject* poArgs)
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
|
||||
PyObject * playerIsDSEquipmentSlot(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
BYTE bWindowType;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bWindowType))
|
||||
return Py_BuildException();
|
||||
int iSlotIndex;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
|
||||
return Py_BuildException();
|
||||
|
||||
if (INVENTORY == bWindowType)
|
||||
if (iSlotIndex >= c_DragonSoul_Equip_Start)
|
||||
if (iSlotIndex <= c_DragonSoul_Equip_End)
|
||||
return Py_BuildValue("i", 1);
|
||||
|
||||
return Py_BuildValue("i", 0);
|
||||
|
||||
}
|
||||
|
||||
PyObject * playerIsCostumeSlot(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
int iSlotIndex;
|
||||
@@ -2120,50 +2102,6 @@ PyObject * playerIsAvailableBeltInventoryCell(PyObject* poSelf, PyObject* poArgs
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// 용혼석 강화
|
||||
PyObject* playerSendDragonSoulRefine(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
BYTE bSubHeader;
|
||||
PyObject* pDic;
|
||||
TItemPos RefineItemPoses[DS_REFINE_WINDOW_MAX_NUM];
|
||||
if (!PyTuple_GetByte(poArgs, 0, &bSubHeader))
|
||||
return Py_BuildException();
|
||||
switch (bSubHeader)
|
||||
{
|
||||
case DS_SUB_HEADER_CLOSE:
|
||||
break;
|
||||
case DS_SUB_HEADER_DO_UPGRADE:
|
||||
case DS_SUB_HEADER_DO_IMPROVEMENT:
|
||||
case DS_SUB_HEADER_DO_REFINE:
|
||||
{
|
||||
if (!PyTuple_GetObject(poArgs, 1, &pDic))
|
||||
return Py_BuildException();
|
||||
int pos = 0;
|
||||
PyObject* key, *value;
|
||||
int size = PyDict_Size(pDic);
|
||||
|
||||
while (PyDict_Next(pDic, &pos, &key, &value))
|
||||
{
|
||||
int i = PyInt_AsLong(key);
|
||||
if (i > DS_REFINE_WINDOW_MAX_NUM)
|
||||
return Py_BuildException();
|
||||
|
||||
if (!PyTuple_GetByte(value, 0, &RefineItemPoses[i].window_type)
|
||||
|| !PyTuple_GetInteger(value, 1, &RefineItemPoses[i].cell))
|
||||
{
|
||||
return Py_BuildException();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
CPythonNetworkStream& rns=CPythonNetworkStream::Instance();
|
||||
rns.SendDragonSoulRefinePacket(bSubHeader, RefineItemPoses);
|
||||
|
||||
return Py_BuildNone();
|
||||
}
|
||||
void initPlayer()
|
||||
{
|
||||
static PyMethodDef s_methods[] =
|
||||
@@ -2273,7 +2211,6 @@ void initPlayer()
|
||||
|
||||
{ "isItem", playerisItem, METH_VARARGS },
|
||||
{ "IsEquipmentSlot", playerIsEquipmentSlot, METH_VARARGS },
|
||||
{ "IsDSEquipmentSlot", playerIsDSEquipmentSlot, METH_VARARGS },
|
||||
{ "IsCostumeSlot", playerIsCostumeSlot, METH_VARARGS },
|
||||
{ "IsValuableItem", playerIsValuableItem, METH_VARARGS },
|
||||
{ "IsOpenPrivateShop", playerIsOpenPrivateShop, METH_VARARGS },
|
||||
@@ -2333,7 +2270,6 @@ void initPlayer()
|
||||
|
||||
{ "GetItemLink", playerGetItemLink, METH_VARARGS },
|
||||
{ "SlotTypeToInvenType", playerSlotTypeToInvenType, METH_VARARGS },
|
||||
{ "SendDragonSoulRefine", playerSendDragonSoulRefine, METH_VARARGS },
|
||||
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
||||
@@ -2555,18 +2491,4 @@ void initPlayer()
|
||||
PyModule_AddIntConstant(poModule, "AUTO_POTION_TYPE_HP", CPythonPlayer::AUTO_POTION_TYPE_HP);
|
||||
PyModule_AddIntConstant(poModule, "AUTO_POTION_TYPE_SP", CPythonPlayer::AUTO_POTION_TYPE_SP);
|
||||
|
||||
// 용혼석
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_PAGE_SIZE", c_DragonSoul_Inventory_Box_Size);
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_PAGE_COUNT", DRAGON_SOUL_GRADE_MAX);
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_SLOT_COUNT", c_DragonSoul_Inventory_Count);
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_SLOT_START", c_DragonSoul_Equip_Start);
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_PAGE_COUNT", DS_DECK_MAX_NUM);
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_FIRST_SIZE", c_DragonSoul_Equip_Slot_Max);
|
||||
|
||||
// 용혼석 개량창
|
||||
PyModule_AddIntConstant(poModule, "DRAGON_SOUL_REFINE_CLOSE", DS_SUB_HEADER_CLOSE);
|
||||
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_UPGRADE", DS_SUB_HEADER_DO_UPGRADE);
|
||||
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_IMPROVEMENT", DS_SUB_HEADER_DO_IMPROVEMENT);
|
||||
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_REFINE", DS_SUB_HEADER_DO_REFINE);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user