1 mesaj
Avatar utilizator
Exy
Membru Începător Membru Începător
  • Mesaje: 5
  • Reacții: 9
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Jinno
  • Medalii

    *Descriere:

    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:
    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);
    			}
    #endif

    Aceasta 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);
    			}
    #endif

    In 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:
    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();
    }
    si o rescrieti astfel:
    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:
    Conținut: Ascuns
    Reacționează ❤️ 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.

    Backup TeraBox:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    *Link scanare VirusTotal (obligatoriu):

    Nou Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Nou Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele rapid & simplu.

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “FIX-uri”

    Informații

    Utilizatori ce navighează pe acest forum: NoLimes și 6 vizitatori

    Discord ID copiat: