In cazul in care implementarea inventarului K este gresita / incompleta, poate aparea aceasta problema.
Nu poti vinde nimic, clientul nu mai comunica cu serverul putina vreme si iti iei disconnect de la server sau se deblocheaza dupa ceva vreme.
Topicul M2Dev original:
Tutorial aplicare:
Disclaimer: Desigur, structura fisierelor voastre poate putin sa difere, adaptati tutorialul la ce aveti voi!
Serverside:
In input_main.cpp cautati structura:
Aceasta structura o modificati sa arate astfel:
In fisierul packet.h cautati structura:
O modificati sa arate astfel:
typedef struct command_shop_sell
Code:
#ifdef ENABLE_SPECIAL_STORAGE
case SHOP_SUBHEADER_CG_SELL2: //revisar
{
if (uiBytes < sizeof(TPacketCGShopSell))
return -1;
TPacketCGShopSell * muck = (TPacketCGShopSell *) c_pData;
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, muck->pos, muck->count, muck->byType);
return sizeof(TPacketCGShopSell);
}
#else
case SHOP_SUBHEADER_CG_SELL2:
{
if (uiBytes < sizeof(BYTE)+sizeof(uint16_t))
return -1;
UINT pos = *reinterpret_cast<const UINT*>(c_pData++);
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, pos, count);
return sizeof(UINT) + sizeof(uint16_t);
}
#endifAceasta structura o modificati sa arate astfel:
Code:
#ifdef ENABLE_SPECIAL_STORAGE
case SHOP_SUBHEADER_CG_SELL2: //revisar
{
if (uiBytes < sizeof(TPacketCGShopSell))
return -1;
const TPacketCGShopSell* p = reinterpret_cast<const TPacketCGShopSell*>(c_pData);
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, p->wPos, p->wCount, p->bType);
return sizeof(TPacketCGShopSell);
}
#else
case SHOP_SUBHEADER_CG_SELL2:
{
if (uiBytes < sizeof(BYTE)+sizeof(uint16_t))
return -1;
UINT pos = *reinterpret_cast<const UINT*>(c_pData++);
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, pos, count);
return sizeof(UINT) + sizeof(uint16_t);
}
#endifIn fisierul packet.h cautati structura:
Code:
typedef struct command_shop_sell
{
BYTE pos;
BYTE count;
#ifdef ENABLE_SPECIAL_STORAGE
BYTE byType;
#endif
} TPacketCGShopSell;O modificati sa arate astfel:
typedef struct command_shop_sell
Code:
{
typedef struct command_shop_sell
{
WORD wPos;
WORD wCount;
BYTE bType;
} TPacketCGShopSell;
Clientside:
in fisierul PythonNetworkStreamPhaseGameItem.cpp cautati structura:
si o rescrieti astfel:
In Packet.h, cautati structura:
adaugati:
In fisierul PythonNetworkStreamModule.cpp, va asigurati ca aveti urmatoarea structura astfel:
Code:
bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, uint16_t byCount
#ifdef ENABLE_SPECIAL_STORAGE
, BYTE byType
#endif
)
{
if (!__CanActMainInstance())
return true;
TPacketCGShop PacketShop;
PacketShop.header = HEADER_CG_SHOP;
PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;
if (!Send(PacketShop))
{
Tracef("SendShopSellPacket Error\n");
return false;
}
if (!Send(bySlot))
{
Tracef("SendShopAddSellPacket Error\n");
return false;
}
if (!Send(byCount))
{
Tracef("SendShopAddSellPacket Error\n");
return false;
}
#ifdef ENABLE_SPECIAL_STORAGE
if (!Send(byType))
{
Tracef("SendShopAddSellPacket Error\n");
return false;
}
#endif
#ifdef ENABLE_SPECIAL_STORAGE
Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%d, byType=%d)\n", bySlot, byCount, byType);
#else
Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%d)\n", bySlot, byCount);
#endif
return SendSequence();
}Code:
bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, WORD wCount, BYTE byType)
{
if (!__CanActMainInstance())
return true;
TPacketCGShop PacketShop;
PacketShop.header = HEADER_CG_SHOP;
PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;
if (!Send(sizeof(TPacketCGShop), &PacketShop))
{
Tracef("PacketCGShop Error\n");
return false;
}
TPacketCGShopSell SellPacket;
SellPacket.wPos = wSlot;
SellPacket.wCount = wCount;
SellPacket.byType = byType;
if (!Send(sizeof(TPacketCGShopSell), &SellPacket))
{
Tracef("PacketCGShopSell Error\n");
return false;
}
Tracef(" SendShopSellPacketNew(wSlot=%d, wCount=%d, byType=%d)\n", wSlot, wCount, byType);
return SendSequence();
}In Packet.h, cautati structura:
dupa aceste linii:
Code:
SHOP_SUBHEADER_CG_SELL2,
};adaugati:
Code:
typedef struct command_shop_sell
{
WORD wPos;
WORD wCount;
BYTE bType;
} TPacketCGShopSell;In fisierul PythonNetworkStreamModule.cpp, va asigurati ca aveti urmatoarea structura astfel:
Code:
PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs)
{
int iSlotNumber;
if (!PyTuple_GetInteger(poArgs, 0, &iSlotNumber))
return Py_BuildException();
int iCount;
if (!PyTuple_GetInteger(poArgs, 1, &iCount))
return Py_BuildException();
#ifdef ENABLE_SPECIAL_STORAGE
int iType;
if (!PyTuple_GetInteger(poArgs, 2, &iType))
return Py_BuildException();
#endif
CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
rkNetStream.SendShopSellPacketNew(iSlotNumber, iCount
#ifdef ENABLE_SPECIAL_STORAGE
, iType
#endif
);
return Py_BuildNone();
}*Poze / Video:
Inainte de fix:
Dupa fix:
*Link download / Code:
Discord:
Backup Mega:
Backup TeraBox:
Conținut: Ascuns
Reacționează
la acest mesaj și conținutul se va afișa automat.
la acest mesaj și conținutul se va afișa automat.Backup Mega:
Conținut: Ascuns
Reacționează
la acest mesaj și conținutul se va afișa automat.
la acest mesaj și conținutul se va afișa automat.Backup TeraBox:
Conținut: Ascuns
Reacționează
la acest mesaj și conținutul se va afișa automat.
la acest mesaj și conținutul se va afișa automat.*Link scanare VirusTotal (obligatoriu):

