xGalardo 13 Posted September 1, 2021 Share Posted September 1, 2021 (edited) Hello! Today I successfully added the max yang to the server, but unfortunately I found 1 "bug", which I tried to fix, but unfortunately I couldn't. If anyone could help me with this, I would appreciate it. Also, please excuse my bad English. Bug Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium WeedHex 636 Posted September 1, 2021 Premium Share Posted September 1, 2021 (edited) 33 minutes ago, xGalardo said: Hello! Today I successfully added the max yang to the server, but unfortunately I found 1 "bug", which I tried to fix, but unfortunately I couldn't. If anyone could help me with this, I would appreciate it. Also, please excuse my bad English. Bug Show the relative codes Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
xGalardo 13 Posted September 2, 2021 Author Share Posted September 2, 2021 (edited) tables.h Quote typedef struct SRefineTable { //DWORD src_vnum; //DWORD result_vnum; DWORD id; BYTE material_count; #ifdef ENABLE_LONG_LONG_GOLD long long cost; #else int cost; #endif int prob; TRefineMaterial materials[REFINE_MATERIAL_MAX_NUM]; } TRefineTable; server/packet.h Quote typedef struct SPacketGCRefineInformaion { BYTE header; BYTE type; WORD pos; DWORD src_vnum; DWORD result_vnum; BYTE material_count; #ifdef ENABLE_LONG_LONG_GOLD long long cost; #else int cost; #endif int prob; TRefineMaterial materials[REFINE_MATERIAL_MAX_NUM]; } TPacketGCRefineInformation; char_item.cpp Quote // REFINE_COST #ifdef ENABLE_LONG_LONG_GOLD long long cost = ComputeRefineFee(prt->cost); #else int cost = ComputeRefineFee(prt->cost); #endif int RefineChance = GetQuestFlag("main_quest_lv7.refine_chance"); if (RefineChance > 0) { if (!item->CheckItemUseLevel(20) || item->GetType() != ITEM_WEAPON) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ą«·á °ł·® ±âȸ´Â 20 ŔĚÇĎŔÇ ą«±â¸¸ °ˇ´ÉÇŐ´Ď´Ů")); return false; } cost = 0; SetQuestFlag("main_quest_lv7.refine_chance", RefineChance - 1); } // END_OF_REFINE_COST Client/Packet.h Quote typedef struct SRefineTable { DWORD src_vnum; DWORD result_vnum; BYTE material_count; #ifdef ENABLE_LONG_LONG_GOLD long long cost; #else int cost; #endif int prob; TMaterial materials[REFINE_MATERIAL_MAX_NUM]; } TRefineTable; PythonNetworkStreamPhaseGame.cpp Quote bool CPythonNetworkStream::RecvRefineInformationPacket() { TPacketGCRefineInformation kRefineInfoPacket; if (!Recv(sizeof(kRefineInfoPacket), &kRefineInfoPacket)) return false; TRefineTable & rkRefineTable = kRefineInfoPacket.refine_table; PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenRefineDialog", Py_BuildValue("(iiii)", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob)); for (int i = 0; i < rkRefineTable.material_count; ++i) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "AppendMaterialToRefineDialog", Py_BuildValue("(ii)", rkRefineTable.materials[i].vnum, rkRefineTable.materials[i].count)); } #ifdef _DEBUG Tracef(" >> RecvRefineInformationPacket(pos=%d, result_vnum=%d, cost=%d, prob=%d)\n", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob); #endif return true; } bool CPythonNetworkStream::RecvRefineInformationPacketNew() { TPacketGCRefineInformationNew kRefineInfoPacket; if (!Recv(sizeof(kRefineInfoPacket), &kRefineInfoPacket)) return false; TRefineTable & rkRefineTable = kRefineInfoPacket.refine_table; PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenRefineDialog", Py_BuildValue("(iiiii)", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob, kRefineInfoPacket.type) ); for (int i = 0; i < rkRefineTable.material_count; ++i) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "AppendMaterialToRefineDialog", Py_BuildValue("(ii)", rkRefineTable.materials[i].vnum, rkRefineTable.materials[i].count)); } #ifdef _DEBUG Tracef(" >> RecvRefineInformationPacketNew(pos=%d, result_vnum=%d, cost=%d, prob=%d, type=%d)\n", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob, kRefineInfoPacket.type); #endif return true; } I suspect PythonNetworkPhaseGame, I haven't found much code related to refine elsewhere. Where there is sysser, I have also rewritten them, of course. Edited September 2, 2021 by xGalardo forget Link to comment Share on other sites More sharing options...
xDiiZeRx 42 Posted September 2, 2021 Share Posted September 2, 2021 But it's likely that even on the server side it needs to be modified, because it doesn't take away the yang, it adds it. 1 Link to comment Share on other sites More sharing options...
Avvex 0 Posted September 2, 2021 Share Posted September 2, 2021 (edited) 11 hours ago, xGalardo said: tables.h server/packet.h char_item.cpp Client/Packet.h PythonNetworkStreamPhaseGame.cpp I suspect PythonNetworkPhaseGame, I haven't found much code related to refine elsewhere. Where there is sysser, I have also rewritten them, of course. PythonNetworkStreamPhaseGame.cpp Py_BuildValue("(iiii)", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob)); to Py_BuildValue("(iiLi)", kRefineInfoPacket.pos, kRefineInfoPacket.refine_table.result_vnum, rkRefineTable.cost, rkRefineTable.prob)); and search under (iiiii) to iiLii) Edited September 2, 2021 by Avvex Link to comment Share on other sites More sharing options...
xGalardo 13 Posted September 2, 2021 Author Share Posted September 2, 2021 So I've tried it, no change. Link to comment Share on other sites More sharing options...
xGalardo 13 Posted September 4, 2021 Author Share Posted September 4, 2021 up Link to comment Share on other sites More sharing options...
Endymion 323 Posted September 4, 2021 Share Posted September 4, 2021 bool CPythonNetworkStream::RecvRefineInformationPacketNew() (iiii) -> (iiOi) rkRefineTable.cost -> PyLong_FromLongLong(rkRefineTable.cost) 1 1 Link to comment Share on other sites More sharing options...
xGalardo 13 Posted September 5, 2021 Author Share Posted September 5, 2021 Thank you man! Working! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now