kodepiko 38 Posted September 24, 2015 Share Posted September 24, 2015 Hello, I'm trying to raise limit of maximum item price at (private)shop, I change: root/uitooltip.py - def CutMoneyString, int() to long() root/uiprivateshopbuilder.py - def AcceptInputPrice, int to long root/uicommon.py - __OnValueUpdate, int to long root/uipickmoney.py (also for exchange yang) - def OnAccept, int to long At server/client source I changed everything (when I try to buy an item which is showing 0 yang price, system says I dont have too much yang (for ex. 3.000.000.000) and it's correct - when my yang amount is lower of course so price is correct via packets, but I think it's problem by showing that price somewhere in python :/ I searched for int() but I didn't find anymore... Maybe some of you did item prices 2kkk+ and can help me? Regards Link to comment Share on other sites More sharing options...
xRdy2Kill 65 Posted September 24, 2015 Share Posted September 24, 2015 did you change the money in uicommon? i mean this. money = 0 if text and text.isdigit(): try: money = long(text) except ValueError: #money = 2110000000 money = 19999999999 // This is the money of your shop Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 24, 2015 Author Share Posted September 24, 2015 (edited) did you change the money in uicommon? i mean this. money = 0 if text and text.isdigit(): try: money = long(text) except ValueError: #money = 2110000000 money = 19999999999 // This is the money of your shop Yes, as I writed this is OnValueUpdate, I do it this way: def __OnValueUpdate(self): ui.EditLine.OnIMEUpdate(self.inputValue) text = self.inputValue.GetText() money = 0 if text: try: money = long(text) except ValueError: money = 9999999999999 self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money)) @update It's my fault, I missed some shop item price packets and values in client binary. I don't know how to handle this: PythonShop.cpp (if I edit it this way I have error -C2665: 'PyTuple_GetInteger' : none of the 4 overloads could convert all the argument types) PyObject * shopAddPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs) { BYTE bItemWindowType; if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType)) return Py_BuildException(); WORD wItemSlotIndex; if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex)) return Py_BuildException(); int iDisplaySlotIndex; if (!PyTuple_GetInteger(poArgs, 2, &iDisplaySlotIndex)) return Py_BuildException(); long long iPrice; if (!PyTuple_GetInteger(poArgs, 3, &iPrice)) return Py_BuildException(); CPythonShop::Instance().AddPrivateShopItemStock(TItemPos(bItemWindowType, wItemSlotIndex), iDisplaySlotIndex, iPrice); return Py_BuildNone(); } and how handle PythonNetworkStreamPhaseGame.cpp ??? case SHOP_SUBHEADER_GC_UPDATE_PRICE: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetShopSellingPrice", Py_BuildValue("(i)", *(int *)&vecBuffer[0])); just change (int *) to (long long *)? Edited September 24, 2015 by kodepiko Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 26, 2015 Author Share Posted September 26, 2015 (edited) At now I have problem only with showing item price via private shop viewing by visitor (when I setup my shop I see correct price 2kkk+), if price extends 2kkk+ it shows 0 yang, but when I try to buy it I need real amount (for ex. 4kkk), so anyone can help me - where I should find this value? I think it's this part: (PythonNetworkStreamPhaseGame.cpp) case SHOP_SUBHEADER_GC_UPDATE_PRICE: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetShopSellingPrice", Py_BuildValue("(i)", *(int *)&vecBuffer[0])); break; but I don't really know how to deal with it to make it long long (I tried change (int *) to (long long *) but no effect I have edited (PythonShop.cpp) PyObject * shopGetPrivateShopItemPrice(PyObject * poSelf, PyObject * poArgs) { BYTE bItemWindowType; if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType)) return Py_BuildException(); WORD wItemSlotIndex; if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex)) return Py_BuildException(); long long iValue = CPythonShop::Instance().GetPrivateShopItemPrice(TItemPos(bItemWindowType, wItemSlotIndex)); return PyLong_FromLongLong(iValue); } and PyObject * shopAddPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs) { BYTE bItemWindowType; if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType)) return Py_BuildException(); WORD wItemSlotIndex; if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex)) return Py_BuildException(); int iDisplaySlotIndex; if (!PyTuple_GetInteger(poArgs, 2, &iDisplaySlotIndex)) return Py_BuildException(); long long iPrice; if (!PyTuple_GetLongLong(poArgs, 3, &iPrice)) return Py_BuildException(); CPythonShop::Instance().AddPrivateShopItemStock(TItemPos(bItemWindowType, wItemSlotIndex), iDisplaySlotIndex, iPrice); return Py_BuildNone(); } Edited September 26, 2015 by kodepiko Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 28, 2015 Author Share Posted September 28, 2015 (edited) I have problem only with showing value at client by python at following cases: Showing item price (2kkk+) in private shop (It just say 0 yang) Showing amount of gold (4kkk+) in trade window (It says crazy numbers like 118.244.221 yang above the limit) Can anyone help me where I can find this values at client source? I think packets are edtied correctly because I still can give someone for ex. 10kkk and he receive this without problem, also as item price it works fine client/PythonExchangeModule.cpp (I'm wrong or something? :/) PyObject * exchangeGetElkFromSelf(PyObject * poSelf, PyObject * poArgs) { return PyLong_FromLongLong(CPythonExchange::Instance().GetElkFromSelf()); } PyObject * exchangeGetElkFromTarget(PyObject * poSelf, PyObject * poArgs) { return PyLong_FromLongLong(CPythonExchange::Instance().GetElkFromTarget()); } client/PythonExchange.cpp void CPythonExchange::SetElkToTarget(long long elk) { m_victim.elk = elk; } void CPythonExchange::SetElkToSelf(long long elk) { m_self.elk = elk; } long long CPythonExchange::GetElkFromTarget() { return m_victim.elk; } long long CPythonExchange::GetElkFromSelf() { return m_self.elk; } Edited September 28, 2015 by kodepiko Link to comment Share on other sites More sharing options...
kodepiko 38 Posted September 30, 2015 Author Share Posted September 30, 2015 Someone can help me with client part of showing correctly item price at private shop and yang value at trade? For successful help I can do something for you (quest / php / give nice package of pets or mounts) Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19730 Posted September 30, 2015 Honorable Member Share Posted September 30, 2015 case SHOP_SUBHEADER_GC_UPDATE_PRICE: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetShopSellingPrice", Py_BuildValue("(i)", *(int *)&vecBuffer[0])); break; This is not compatible with long long, but you should do this way: case SHOP_SUBHEADER_GC_UPDATE_PRICE: PyObject *args = PyTuple_New(1); PyTuple_SetItem(args, 0, PyLong_FromLongLong(*(long long *)&vecBuffer[0])); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetShopSellingPrice", args); As here, this is not useful with long long: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", Py_BuildValue("(i)", (int)PointChange.amount)); Replace with: PyObject *args = PyTuple_New(1); PyTuple_SetItem(args, 0, PyLong_FromLongLong(PointChange.amount)); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", args); 1 Link to comment Share on other sites More sharing options...
Premium TAUMP 850 Posted October 1, 2015 Premium Share Posted October 1, 2015 (edited) Same problem. Exchange with yang is ok but shop nope. Edited October 1, 2015 by .T4Ump 1 Link to comment Share on other sites More sharing options...
Great 16 Posted October 1, 2015 Share Posted October 1, 2015 Same problem. Exchange with yang is ok but shop nope. You too forgot about function which you get prices in uitooltip for privateshop 1 Link to comment Share on other sites More sharing options...
Premium TAUMP 850 Posted October 1, 2015 Premium Share Posted October 1, 2015 Same problem. Exchange with yang is ok but shop nope. You too forgot about function which you get prices in uitooltip for privateshop Oh, thanks i try 1 Link to comment Share on other sites More sharing options...
kodepiko 38 Posted October 1, 2015 Author Share Posted October 1, 2015 (edited) I still have problem with trade window - private shop price is working Did I miss something? PythonExchange.cpp void CPythonExchange::SetElkToTarget(long long elk) { m_victim.elk = elk; } void CPythonExchange::SetElkToSelf(long long elk) { m_self.elk = elk; } long long CPythonExchange::GetElkFromTarget() { return m_victim.elk; } long long CPythonExchange::GetElkFromSelf() { return m_self.elk; } PythonNetworkStreamModule.cpp PyObject* netSendExchangeElkAddPacket(PyObject* poSelf, PyObject* poArgs) { long long iElk; if (!PyTuple_GetLongLong(poArgs, 0, &iElk)) return Py_BuildException(); CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendExchangeElkAddPacket(iElk); return Py_BuildNone(); } PythonExchangeModule.cpp PyObject * exchangeGetElkFromSelf(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("L", CPythonExchange::Instance().GetElkFromSelf()); } PyObject * exchangeGetElkFromTarget(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("L", CPythonExchange::Instance().GetElkFromTarget()); } No matter I use Py_BuildValue or PyLong_Fromlonglong method, I don't know what I can miss.. Still showing max value of 4kkk+ yang at trade. Of course exchanging more than 4kkk+ is successful, just problem with showing correctly amount of yang in trade window Edited October 1, 2015 by kodepiko Link to comment Share on other sites More sharing options...
Premium TAUMP 850 Posted October 1, 2015 Premium Share Posted October 1, 2015 I still have problem with trade window - private shop price is working Did I miss something? PythonExchange.cpp void CPythonExchange::SetElkToTarget(long long elk) { m_victim.elk = elk; } void CPythonExchange::SetElkToSelf(long long elk) { m_self.elk = elk; } long long CPythonExchange::GetElkFromTarget() { return m_victim.elk; } long long CPythonExchange::GetElkFromSelf() { return m_self.elk; } PythonNetworkStreamModule.cpp PyObject* netSendExchangeElkAddPacket(PyObject* poSelf, PyObject* poArgs) { long long iElk; if (!PyTuple_GetLongLong(poArgs, 0, &iElk)) return Py_BuildException(); CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendExchangeElkAddPacket(iElk); return Py_BuildNone(); } PythonExchangeModule.cpp PyObject * exchangeGetElkFromSelf(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("L", CPythonExchange::Instance().GetElkFromSelf()); } PyObject * exchangeGetElkFromTarget(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("L", CPythonExchange::Instance().GetElkFromTarget()); } Still showing max value of 4kkk+ yang at trade. Of course exchanging more than 4kkk+ is successful, just problem with showing correctly amount of yang in trade window add me skype t4ump.new 1 Link to comment Share on other sites More sharing options...
kodepiko 38 Posted October 1, 2015 Author Share Posted October 1, 2015 I forgot to change arg1 at exchange_packet in exchange.cpp - and its all.. I'm blind sometimes Thank you guys for responding, thread solved. Link to comment Share on other sites More sharing options...
Premium TAUMP 850 Posted October 2, 2015 Premium Share Posted October 2, 2015 Great, help me Thanks 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