[C++/Python] Tüm Envanter ve Slot Sorunlarının Giderilmesi

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 40

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Kemer Envanter Sorunları Fix, 5x+ Envanter Sorunları Fix İtem taşma Sorunları fix. Dragon soul Fix.

Aşşağıdaki Kodları Uyguladığımızda Kısaca Neler yapmış olduk.

1. Kemer Envanterinde Kullanılmayan Slotlar Kullanıma Açıldı.
2. Kemer Envanterinde İtem var iken Kemer Değişmez veya Çıkmaz.
3. 5x 8x 9x 12x 15x 18x Envanterli Oyun yapılabilir hale getirildi.
4. Ticaret Yaparken İtem Taşma Sorunu Fixlendi.
5. Dragon soul Sistem yuvaları Düzenli hale geldi.
6. Aklıma gelmeyen Daha bir çok Slot Envanter sorunları Çözülecektir.

Aşşağıdaki Anlatımları Kesinlikle en az 5x Envanter kullananların eklemesi gerekir. 4 envanter Kullanıcılarının eklemesine gerek yoktur. Çünki 4 envanter ile sınırı Aşmıyorsunuz.

Asıl sorun Game'lerde BYTE ve 255 olarak yapılandırılması ve bunları UINT ve 1000 yaparak tüm sorunlara elveda diyeceğiz.

Şimdi Başlayalım

common/tables.h Açılır ve Aratılır
Kod:
typedef struct SQuickslot{     BYTE    type;     BYTE    pos; } TQuickslot;

Değiştirilir.
Kod:
typedef struct SQuickslot{     BYTE    type;     UINT    pos; } TQuickslot;

game/src/char.h Açılır ve Aratılır
Kod:
BYTE            bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];

Değiştirilir
Kod:
UINT            bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];

1.Aratılır
Kod:
void            SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos);

1.Değiştirilir
Kod:
void            SyncQuickslot(BYTE bType, UINT bOldPos, UINT bNewPos);

2.Aratılır
Kod:
bool            GetQuickslot(BYTE pos, TQuickslot ** ppSlot);

2.Değiştirilir
Kod:
bool            GetQuickslot(UINT pos, TQuickslot ** ppSlot);

3.Aratılır
Kod:
bool            SetQuickslot(BYTE pos, TQuickslot & rSlot);

3.Değiştirilir
Kod:
bool            SetQuickslot(UINT pos, TQuickslot & rSlot);

4.Aratılır
Kod:
bool            DelQuickslot(BYTE pos);

4.Değiştirilir
Kod:
bool            DelQuickslot(UINT pos);

5.Aratılır
Kod:
bool            SwapQuickslot(BYTE a, BYTE b);

5.Değiştirilir
Kod:
bool            SwapQuickslot(UINT a, UINT b);

6.Aratılır
Kod:
void            ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos);

6.Değiştirilir
Kod:
void            ChainQuickslotItem(LPITEM pItem, BYTE bType, UINT bOldPos);

7.Aratılır
Kod:
void            SetWear(BYTE bCell, LPITEM item);

7.Değiştirilir
Kod:
void            SetWear(UINT bCell, LPITEM item);

8.Aratılır
Kod:
LPITEM            GetWear(BYTE bCell) const;

8.Değiştirilir
Kod:
LPITEM            GetWear(UINT bCell) const;

9.Aratılır
Kod:
bool            RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell = -1);

9.Değiştirilir
Kod:
bool            RefineInformation(UINT bCell, BYTE bType, int iAdditionalCell = -1);

10.Aratılır
Kod:
bool            SwapItem(BYTE bCell, BYTE bDestCell);

10.Değiştirilir
Kod:
bool            SwapItem(UINT bCell, UINT bDestCell);


game/src/char_battle.cpp Açılır ve Aratılır 2x defa Aratın
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots[i], 255);

Değiştirilir 2x
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots[i], 1000);

Aratılır 2x defa Aratın
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 255);

Değiştirilir 2x
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 1000);


game/src/char_item.cpp Açılır ve Aratılır
Kod:
LPITEM CHARACTER::GetWear(BYTE bCell) const

Değiştirilir
Kod:
LPITEM CHARACTER::GetWear(UINT bCell) const

1.Aratılır
Kod:
void CHARACTER::SetWear(BYTE bCell, LPITEM item)

1.Değiştirilir
Kod:
void CHARACTER::SetWear(UINT bCell, LPITEM item)

2.Aratılır
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);

2.Değiştirilir
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 1000);

3.Aratılır
Kod:
BYTE bCell = Cell.cell;

3.Değiştirilir
Kod:
UINT bCell = Cell.cell;

4.Aratılır 2x Aratılır
Kod:
if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)

4.Değiştirilir 2x
Kod:
if (m_pointsInstant.bItemGrid[bCell] == (UINT)iExceptionCell)

5.Aratılır 2x Aratılır
Kod:
BYTE p = bCell + (5 * j);

5.Değiştirilir 2x
Kod:
UINT p = bCell + (5 * j);

6.Aratılır 3x Aratılır
Kod:
BYTE bCell = item->GetCell();

6.Değiştirilir 3x
Kod:
UINT bCell = item->GetCell();

7.Aratılır
Kod:
bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)

7.Değiştirilir
Kod:
bool CHARACTER::RefineInformation(UINT bCell, BYTE bType, int iAdditionalCell)

8.Aratılır
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 255);

8.Değiştirilir
Kod:
SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 1000);

9.Aratılır
Kod:
bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)

9.Değiştirilir
Kod:
bool CHARACTER::SwapItem(UINT bCell, UINT bDestCell)

10.Aratılır
Kod:
BYTE bEquipCell = item2->GetCell() - INVENTORY_MAX_NUM;

10.Değiştirilir
Kod:
INT bEquipCell = item2->GetCell() - INVENTORY_MAX_NUM;

11.Aratılır
Kod:
BYTE bInvenCell = item1->GetCell();

11.Değiştirilir
Kod:
UINT bInvenCell = item1->GetCell();

12.Aratılır
Kod:
BYTE bCell1 = item1->GetCell();

12.Değiştirilir
Kod:
UINT bCell1 = item1->GetCell();

13.Aratılır
Kod:
BYTE bCell2 = item2->GetCell();

13.Değiştirilir
Kod:
UINT bCell2 = item2->GetCell();

14.Aratılır
Kod:
BYTE bOldCell = item->GetCell();

14.Değiştirilir
Kod:
UINT bOldCell = item->GetCell();


game/src/char_quickslot.cpp Açılır ve Aratılır
Kod:
void CHARACTER::SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos)

Değiştirilir
Kod:
void CHARACTER::SyncQuickslot(BYTE bType, UINT bOldPos, UINT bNewPos)

1.Aratılır
Kod:
if (bNewPos == 255)

1.Değiştirilir
Kod:
if (bNewPos == 1000)

2.Aratılır
Kod:
bool CHARACTER::GetQuickslot(BYTE pos, TQuickslot ** ppSlot)

2.Değiştirilir
Kod:
bool CHARACTER::GetQuickslot(UINT pos, TQuickslot ** ppSlot)

3.Aratılır
Kod:
bool CHARACTER::SetQuickslot(BYTE pos, TQuickslot & rSlot)

3.Değiştirilir
Kod:
bool CHARACTER::SetQuickslot(UINT pos, TQuickslot & rSlot)

4.Aratılır
Kod:
bool CHARACTER::DelQuickslot(BYTE pos)

4.Değiştirilir
Kod:
bool CHARACTER::DelQuickslot(UINT pos)

5.Aratılır
Kod:
bool CHARACTER::SwapQuickslot(BYTE a, BYTE b)

5.Değiştirilir
Kod:
bool CHARACTER::SwapQuickslot(UINT a, UINT b)

6.Aratılır
Kod:
void CHARACTER::ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos)

6.Değiştirilir
Kod:
void CHARACTER::ChainQuickslotItem(LPITEM pItem, BYTE bType, UINT bOldPos)


game/src/cmd_general.cpp Açın ve Aratın
Kod:
for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i)

Değiştirin
Kod:
for (UINT i=0; i<INVENTORY_MAX_NUM; ++i)

game/src/cmd_gm.cpp Açın ve Aratın
Kod:
ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);

Değiştirin
Kod:
ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 1000);

Aratılır 3x Aratın
Kod:
BYTE cell = 0;

Değiştirin 3x
Kod:
UINT cell = 0;


game/src/exchange.cpp Açın ve Aratın
Kod:
m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

Değiştirin
Kod:
m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 1000);


game/src/fishing.cpp Açın ve Aratın 2x Aratın
Kod:
BYTE bCell = rod->GetCell();

Değiştirin
Kod:
UINT bCell = rod->GetCell();


game/src/input_main.cpp Açın ve Aratın
Kod:
if (uiBytes < sizeof(BYTE) + sizeof(BYTE))

Değiştirin
Kod:
if (uiBytes < sizeof(UINT) + sizeof(BYTE))

1.Aratın
Kod:
BYTE pos = *(c_pData++);                 BYTE count = *(c_pData);

1.Değiştirin
Kod:
UINT pos = *reinterpret_cast<const UINT*>(c_pData++);                 BYTE count = *(c_pData);

2.Aratın
Kod:
CShopManager::instance().Sell(ch, pos, count);                 return sizeof(BYTE) + sizeof(BYTE);

2.Değiştirin
Kod:
CShopManager::instance().Sell(ch, pos, count);                 return sizeof(UINT) + sizeof(BYTE);

3.Aratın
Kod:
ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, p->ItemPos.cell, 255);

3.Değiştirin
Kod:
ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, p->ItemPos.cell, 1000);


game/src/item.cpp Açın ve Aratın
Kod:
pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, wCell, 255);

Değiştirin
Kod:
pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, wCell, 1000);

1.Aratın
Kod:
m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, m_wCell, 255);

1.Değiştirin
Kod:
m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, m_wCell, 1000);

2.Aratın
Kod:
bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)

2.Değiştirin
Kod:
bool CItem::EquipTo(LPCHARACTER ch, UINT bWearCell)

game/src/item.h Açın ve Aratın
Kod:
bool        EquipTo(LPCHARACTER ch, BYTE bWearCell);

Değiştirin
Kod:
bool        EquipTo(LPCHARACTER ch, UINT bWearCell);


game/src/item_manager.cpp Açın ve Aratın
Kod:
o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

Değiştirin
Kod:
o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 1000);


game/src/minig.cpp Açın ve 2x Aratın
Kod:
BYTE bCell = rkOldPick.GetCell();

Değiştirin 2.x
Kod:
UINT bCell = rkOldPick.GetCell();

game/src/packet.h Açın ve Aratın
Kod:
typedef struct command_quickslot_add{     BYTE    header;     BYTE    pos;     TQuickslot    slot;

Değiştirin
Kod:
typedef struct command_quickslot_add{     BYTE    header;     UINT    pos;     TQuickslot    slot;

1.Aratın
Kod:
typedef struct command_quickslot_del{     BYTE    header;     BYTE    pos; } TPacketCGQuickslotDel;

1.Değiştirin
Kod:
typedef struct command_quickslot_del{     BYTE    header;     UINT    pos; } TPacketCGQuickslotDel;

2.Aratın
Kod:
typedef struct command_quickslot_swap{     BYTE    header;     BYTE    pos;     BYTE    change_pos; } TPacketCGQuickslotSwap;

2.Değiştirin
Kod:
typedef struct command_quickslot_swap{     BYTE    header;     UINT    pos;     UINT    change_pos; } TPacketCGQuickslotSwap;

3.Aratın
Kod:
typedef struct packet_item_del{     BYTE    header;     BYTE    pos; } TPacketGCItemDel;

3.Değiştirin
Kod:
typedef struct packet_item_del{     BYTE    header;     UINT    pos; } TPacketGCItemDel;

4.Aratın
Kod:
struct packet_quickslot_add{     BYTE    header;     BYTE    pos;     TQuickslot    slot; };

4.Değiştirin
Kod:
struct packet_quickslot_add{     BYTE    header;     UINT    pos;     TQuickslot    slot; };

5.Aratın
Kod:
struct packet_quickslot_del{     BYTE    header;     BYTE    pos; };

5.Değiştirin
Kod:
struct packet_quickslot_del{     BYTE    header;     UINT    pos; };

6.Aratın
Kod:
struct packet_quickslot_swap{     BYTE    header;     BYTE    pos;     BYTE    pos_to; };

6.Değiştirin
Kod:
struct packet_quickslot_swap{     BYTE    header;     UINT    pos;     UINT    pos_to; };

7.Aratın
Kod:
typedef struct SPacketCGRefine{     BYTE    header;     BYTE    pos;     BYTE    type; } TPacketCGRefine;

7.Değiştirin
Kod:
typedef struct SPacketCGRefine{     BYTE    header;     UINT    pos;     BYTE    type; } TPacketCGRefine;

8.Aratın
Kod:
typedef struct SPacketCGRequestRefineInfo{     BYTE    header;     BYTE    pos; } TPacketCGRequestRefineInfo;

8.Değiştirin
Kod:
typedef struct SPacketCGRequestRefineInfo{     BYTE    header;     UINT    pos; } TPacketCGRequestRefineInfo;

9.Aratın
Kod:
typedef struct SPacketGCRefineInformaion{     BYTE    header;     BYTE    type;     BYTE    pos;     DWORD    src_vnum;     DWORD    result_vnum;     BYTE    material_count;

9.Değiştirin
Kod:
typedef struct SPacketGCRefineInformaion{     BYTE    header;     BYTE    type;     UINT    pos;     DWORD    src_vnum;     DWORD    result_vnum;     BYTE    material_count;


game/src/questlua_global.cpp Açın ve 2x Aratın
Kod:
BYTE bCell = (BYTE) lua_tonumber(L,-1);

Değiştirin 2x
Kod:
UINT bCell = lua_tonumber(L, -1);


game/src/questlua_item.cpp Açın ve Aratın
Kod:
BYTE bCell = pItem->GetCell();

Değiştirin
Kod:
UINT bCell = pItem->GetCell();

game/src/questlua_pc.cpp Açın ve Aratın
Kod:
BYTE bCell = (BYTE)lua_tonumber(L, 1);

Değiştirin
Kod:
UINT bCell = lua_tonumber(L, 1);

game/src/safebox.cpp Açın ve Aratın
Kod:
LPITEM CSafebox::GetItem(BYTE bCell)

Değiştirin
Kod:
LPITEM CSafebox::GetItem(INT bCell)

Aratın
Kod:
bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)

Değiştirin
Kod:
bool CSafebox::MoveItem(INT bCell, INT bDestCell, BYTE count)


game/src/safebox.h Açın ve Aratın
Kod:
bool        MoveItem(BYTE bCell, BYTE bDestCell, BYTE count);

Değiştirin
Kod:
bool        MoveItem(INT bCell, INT bDestCell, BYTE count);

Aratın
Kod:
LPITEM        GetItem(BYTE bCell);

Değiştirin
Kod:
LPITEM        GetItem(INT bCell);


game/src/shop.cpp Açın ve Aratın
Kod:
m_pkPC->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

Değiştirin
Kod:
m_pkPC->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 1000);


game/src/shop_manager.cpp Açın ve Aratın
Kod:
void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)

Değiştirin
Kod:
void CShopManager::Sell(LPCHARACTER ch, UINT bCell, BYTE bCount)

game/src/shop_manager.h Açın ve Aratın
Kod:
void    Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);

Değiştirin
Kod:
void    Sell(LPCHARACTER ch, UINT bCell, BYTE bCount = 0);


Game SRC'de İşimiz Bitti

Client Source:

Client/UserInterface/AbstractPlayer.h Açalım ve Aratalım
Kod:
virtual void    AddQuickSlot(int QuickslotIndex, char IconType, char IconPosition) = 0;

Değiştirin
Kod:
virtual void    AddQuickSlot(int QuickslotIndex, char IconType, INT IconPosition) = 0;

Client/UserInterface/GameType.h Açalım ve Aratalım
Kod:
typedef struct SQuickSlot {      BYTE Type;      BYTE Position; } TQuickSlot;

Değiştirin
Kod:
typedef struct SQuickSlot {      BYTE Type;      UINT Position; } TQuickSlot;


Client/UserInterface/Packet.h Açalım ve Aratalım
Kod:
typedef struct command_quickslot_add{     BYTE        header;     BYTE        pos;     TQuickSlot    slot; }TPacketCGQuickSlotAdd;

Değiştirin
Kod:
typedef struct command_quickslot_add{     BYTE        header;     UINT        pos;     TQuickSlot    slot; }TPacketCGQuickSlotAdd;

1.Aratın
Kod:
typedef struct command_quickslot_del{     BYTE        header;     BYTE        pos; }TPacketCGQuickSlotDel;

1.Değiştirin
Kod:
typedef struct command_quickslot_del{     BYTE        header;     UINT        pos; }TPacketCGQuickSlotDel;

2.Aratın
Kod:
typedef struct command_quickslot_swap{     BYTE        header;     BYTE        pos;     BYTE        change_pos; }TPacketCGQuickSlotSwap;

2.Değiştirin
Kod:
typedef struct command_quickslot_swap{     BYTE        header;     UINT        pos;     UINT        change_pos; }TPacketCGQuickSlotSwap;

3.Aratın
Kod:
typedef struct SPacketCGRefine{     BYTE        header;     BYTE        pos;     BYTE        type; } TPacketCGRefine;

3.Değiştirin
Kod:
typedef struct SPacketCGRefine{     BYTE        header;     UINT        pos;     BYTE        type; } TPacketCGRefine;

4.Aratın 2 defa var ise 2 sinide değiştirin
Kod:
typedef struct packet_item_del{     BYTE        header;     BYTE        pos; } TPacketGCItemDel;

4.Değiştirin kaç tane varsa
Kod:
typedef struct packet_item_del{     BYTE        header;     UINT        pos; } TPacketGCItemDel;

5.Aratın
Kod:
typedef struct packet_quickslot_add{     BYTE        header;     BYTE        pos;     TQuickSlot    slot; } TPacketGCQuickSlotAdd;

5.Değiştirin
Kod:
typedef struct packet_quickslot_add{     BYTE        header;     UINT        pos;     TQuickSlot    slot; } TPacketGCQuickSlotAdd;

6.Aratın
Kod:
typedef struct packet_quickslot_del{     BYTE        header;     BYTE        pos; } TPacketGCQuickSlotDel;

6.Değiştirin
Kod:
typedef struct packet_quickslot_del{     BYTE        header;     UINT        pos; } TPacketGCQuickSlotDel;

7.Aratın
Kod:
typedef struct packet_quickslot_swap{     BYTE        header;     BYTE        pos;     BYTE        change_pos; } TPacketGCQuickSlotSwap;

7.Değiştirin
Kod:
typedef struct packet_quickslot_swap{     BYTE        header;     UINT        pos;     UINT        change_pos; } TPacketGCQuickSlotSwap;

8.Aratın
Kod:
typedef struct SPacketGCRefineInformation{     BYTE            header;     BYTE            pos;     TRefineTable    refine_table; } TPacketGCRefineInformation;

8.Değiştirin
Kod:
typedef struct SPacketGCRefineInformation{     BYTE            header;     UINT            pos;     TRefineTable    refine_table; } TPacketGCRefineInformation;

9.Aratın
Kod:
typedef struct SPacketGCRefineInformationNew{     BYTE            header;     BYTE            type;     BYTE            pos;     TRefineTable    refine_table; } TPacketGCRefineInformationNew;

9.Değiştirin
Kod:
typedef struct SPacketGCRefineInformationNew{     BYTE            header;     BYTE            type;     UINT            pos;     TRefineTable    refine_table; } TPacketGCRefineInformationNew;


Client/UserInterface/PythonNetworkStream.h Açın ve Aratın
Kod:
bool SendQuickSlotAddPacket(BYTE wpos, BYTE type, BYTE pos);
Değiştirin
Kod:
bool SendQuickSlotAddPacket(UINT wpos, BYTE type, UINT pos);

1.Aratın
Kod:
bool SendQuickSlotDelPacket(BYTE wpos);
1.Değiştirin
Kod:
bool SendQuickSlotDelPacket(UINT wpos);

2.Aratın
Kod:
bool SendQuickSlotMovePacket(BYTE wpos, BYTE change_pos);
2.Değiştirin
Kod:
bool SendQuickSlotMovePacket(UINT wpos, UINT change_pos);

3.Aratın
Kod:
bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount);
3.Değiştirin
Kod:
bool SendShopSellPacketNew(UINT bySlot, BYTE byCount);

4.Aratın
Kod:
bool SendRefinePacket(BYTE byPos, BYTE byType);
4.Değiştirin
Kod:
bool SendRefinePacket(UINT byPos, BYTE byType);


Client/UserInterface/PythonNetworkStreamPhaseGame.cpp Açın ve Aratın
Kod:
bool CPythonNetworkStream::SendRefinePacket(BYTE byPos, BYTE byType)
Değiştirin
Kod:
bool CPythonNetworkStream::SendRefinePacket(UINT byPos, BYTE byType)

Client/UserInterface/PythonNetworkStreamPhaseGameItem.cpp Açın ve Aratın
Kod:
bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount)
Değiştirin
Kod:
bool CPythonNetworkStream::SendShopSellPacketNew(UINT bySlot, BYTE byCount)
Üstteki Değiştirdiğimiz Kodun Hemen Altındaki Kod Bloğunu Tamamen Alttaki kod ile Değiştirin
Kod:
{        if (!__CanActMainInstance())         return true;        if (__IsEquipItemInSlot(pos))     {         if (CPythonExchange::Instance().isTrading())         {             if (pos.IsEquipCell() || change_pos.IsEquipCell())             {                 PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_EXCHANGE"));                 return true;             }         }         if (CPythonShop::Instance().IsOpen())         {             if (pos.IsEquipCell() || change_pos.IsEquipCell())             {                 PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_SHOP"));                 return true;             }         }         if (__IsPlayerAttacking())             return true;     }     __PlayInventoryItemDropSound(pos);     TPacketCGItemMove    itemMovePacket;     itemMovePacket.header = HEADER_CG_ITEM_MOVE;     itemMovePacket.pos = pos;     itemMovePacket.change_pos = change_pos;     itemMovePacket.num = num;     if (!Send(sizeof(TPacketCGItemMove), &itemMovePacket))     {         Tracen("SendItemMovePacket Error");         return false;     }     return SendSequence(); }

Aratın
Kod:
bool CPythonNetworkStream::SendQuickSlotAddPacket(BYTE wpos, BYTE type, BYTE pos)
Değiştirin
Kod:
bool CPythonNetworkStream::SendQuickSlotAddPacket(UINT wpos, BYTE type, UINT pos)

Aratın
Kod:
bool CPythonNetworkStream::SendQuickSlotDelPacket(BYTE pos)
Değiştirin
Kod:
bool CPythonNetworkStream::SendQuickSlotDelPacket(UINT pos)

Aratın
Kod:
bool CPythonNetworkStream::SendQuickSlotMovePacket(BYTE pos, BYTE change_pos)
Değiştirin
Kod:
bool CPythonNetworkStream::SendQuickSlotMovePacket(UINT pos, UINT change_pos)

Client/UserInterface/PythonPlayer.cpp Açılır ve Aratılır
Kod:
for (BYTE i = 0; i < QUICKSLOT_MAX_NUM; ++i)
Değiştirin
Kod:
for (UINT i = 0; i < QUICKSLOT_MAX_NUM; ++i)

1.Aratın
Kod:
rkNetStream.SendQuickSlotMovePacket((BYTE) dwGlobalSrcSlotIndex, (BYTE)dwGlobalDstSlotIndex);
1.Değiştirin
Kod:
rkNetStream.SendQuickSlotMovePacket((UINT) dwGlobalSrcSlotIndex, (UINT)dwGlobalDstSlotIndex);

2.Aratın
Kod:
rkNetStream.SendQuickSlotAddPacket((BYTE)dwGlobalSlotIndex, (BYTE)dwWndType, (BYTE)dwWndItemPos);
2.Değiştirin
Kod:
rkNetStream.SendQuickSlotAddPacket((UINT)dwGlobalSlotIndex, (BYTE)dwWndType, (UINT)dwWndItemPos);

3.Aratın
Kod:
rkNetStream.SendQuickSlotDelPacket((BYTE)dwGlobalSlotIndex);
3.Değiştirin
Kod:
rkNetStream.SendQuickSlotDelPacket((UINT)dwGlobalSlotIndex);

4.Aratın
Kod:
void CPythonPlayer::AddQuickSlot(int QuickSlotIndex, char IconType, char IconPosition)
4.Değiştirin
Kod:
void CPythonPlayer::AddQuickSlot(int QuickSlotIndex, char IconType, INT IconPosition)



Client/UserInterface/PythonPlayer.h Açılır ve Aratılır
Kod:
void    AddQuickSlot(int QuickslotIndex, char IconType, char IconPosition);
Değiştirin
Kod:
void    AddQuickSlot(int QuickslotIndex, char IconType, INT IconPosition);


Sorun yaşayan ve yazım hataları olan kısımlar mevcut ise konu altından bildirin yardımcı olayım. İyi kullanımlar.
Metin2 Özel Sunucularında C++/Python Kullanımıyla Envanter ve Slot Sorunlarını Giderme Rehberi

Giriş
Metin2 özel sunucu geliştirme sürecinde, oyuncuların sürekli olarak kullandığı envanter ve slot sistemi kritik öneme sahiptir. Bu sistemde yaşanan herhangi bir aksaklık doğrudan oyun deneyimini etkiler. Bu yazıda, C++ ve Python tabanlı çözümlerle tüm envanter ve slot sorunlarının nasıl giderileceği detaylı şekilde ele alınacaktır.

Envanter Sistemi Nedir?
Envanter, oyuncunun sahip olduğu eşyaları, itemleri ve bunları kullanabilmesi için gerekli olan yapıdır. Metin2 özel sunucularda bu sistem genellikle client-side (py) ve server-side (C++) olmak üzere iki katmanda çalışır. Py dosyaları arayüz ve kullanıcı etkileşimini sağlarken, C++ tarafı veri işleme, kontrol ve veritabanı işlemleri gibi temel işlevleri üstlenir.

Python Tarafında Karşılaşılan Sorunlar ve Çözümler
Py tarafında en çok karşılaşılan sorunlardan birisi envanter slotlarının yanlış gösterilmesi veya bazı itemlerin görünmemesidir. Bu durum genellikle UI Script dosyalarındaki hatalardan kaynaklanır. Örneğin 'uiscript' dosyasında tanımlanan slot sayısı gerçek envanter boyutundan farklıysa, bu eksik veya fazla slot görüntülenmesine neden olur.

Çözüm: Uygun slot sayısının ayarlanması, 'root' dizinindeki 'inventorywnd.py' dosyasında yapılacak değişikliklerle sağlanabilir. Ayrıca, slotların doğru itemleri göstermesi için 'refresh' fonksiyonunun düzgün çalıştığından emin olunmalıdır.

C++ Tarafında Ortaya Çıkan Hatalar ve Onarımı
C++ tarafında en çok görülen sorunlardan biri, envanter verilerinin eş zamanlı olarak güncellenememesidir. Özellikle PvP sistemlerinde, hızlı item kullanımında veya envanter değişikliklerinde sunucu ile istemci arasında senkronizasyon problemi yaşanabilir. Bu da itemlerin kaybolması, çoğalması veya yanlış konuma düşmesine yol açabilir.

Çözüm: Bu tür sorunlar genellikle 'game/src' klasöründe bulunan envanter işlemlerini yöneten sınıflarda meydana gelir. Örneğin 'char_item.cpp', 'packet.h', 'item_manager.cpp' gibi dosyalarda yapılan güncellemelerle veri senkronizasyonu sağlanabilir. Paket gönderme ve alma süreçlerinin güvenli olduğundan emin olmak gerekir.

Slot Sayısı ve Sınırlamaları
Metin2 özel sunucularda slot sayısı, hem oyuncu dengesi hem de performans açısından önemlidir. Varsayılan envanter 45 slotlukken, bazı sunucular bu sayıyı artırarak daha geniş bir envanter sunabilir. Ancak bu işlem sırasında hem C++ hem de Python tarafında değişiklik yapılması gerekir. Aksi takdirde, sunucu crash yapabilir veya oyuncu envanteri doğru görüntülenmeyebilir.

Python Tarafı Ayarı: 'inventorywnd.py' dosyasında 'slotCount' değişkeni değiştirilmelidir. Ayrıca 'uiscript' dosyasında tanımlanan slotların da buna göre yeniden boyutlandırılması gerekir.

C++ Tarafı Ayarı: 'char.h' dosyasında tanımlı envanter slot limiti değiştirilmeli ve 'packet.h' dosyasında bu limite uygun paket yapıları tanımlanmalıdır.

Item Kaybolması ve Çoğalması Sorunları
Bu tür hatalar genellikle hatalı veri işleme, eksik kontrol veya paket yetersizliği nedeniyle ortaya çıkar. Özellikle item taşıma, envanterden envantere geçişler sırasında bu sorunlar artar. Bunun önüne geçmek için hem sunucu tarafında hem de istemci tarafında gerekli kontrollerin sağlanması gerekir.

Önlemler:[/COORD] Item taşıma fonksiyonlarında double-click engelleyici mekanizmalar, item kontrolü yapan fonksiyonlar ve veri tabanına yazma sırasında hata kontrolü yapılmalıdır. Ayrıca, envanter işlemlerinde mutex gibi senkronizasyon tekniklerinin kullanımı önerilir.

Sonuç
Metin2 özel sunucularında envanter ve slot sistemlerinin sağlıklı çalışması, hem oyun deneyimini artırır hem de sunucu güvenliğini güçlendirir. C++ ve Python tabanlı çözümlerle bu sistemlerde yaşanan sorunlar adım adım giderilebilir. Oyuncuların verimli bir şekilde envanterlerini kullanabilmesi için, her iki tarafın da dikkatlice test edilmesi ve optimize edilmesi gerekir.


Solving All Inventory and Slot Issues with C++/Python in Metin2 Private Servers

Introduction
In the process of developing Metin2 private servers, the inventory and slot system that players use constantly is of critical importance. Any malfunction in this system directly affects the gaming experience. In this article, we will detail how to resolve all inventory and slot issues using C++ and Python-based solutions.

What Is the Inventory System?
The inventory is the structure that holds items and equipment for the player to use. In Metin2 private servers, this system typically operates on two layers: client-side (Python) and server-side (C++). Python files handle UI and user interaction, while the C++ side handles data processing, validation, and database operations.

Issues and Solutions on the Python Side
One of the most common issues on the Python side is incorrect display of inventory slots or missing items. This usually stems from errors in UI Script files. For instance, if the slot count defined in the 'uiscript' file differs from the actual inventory size, it may result in missing or extra slots being displayed.

Solution: Adjusting the correct slot count can be done by modifying the 'inventorywnd.py' file located in the 'root' directory. Also, ensure the 'refresh' function works properly so that slots display the correct items.

Issues and Fixes on the C++ Side
On the C++ side, one of the most common issues is the failure of inventory data to update simultaneously. Especially in PvP systems, fast item usage or inventory changes can cause synchronization problems between the server and client. This may lead to items disappearing, duplicating, or dropping into incorrect slots.

Solution: Such issues often occur in classes managing inventory operations located in folders like 'game/src'. Updates in files such as 'char_item.cpp', 'packet.h', and 'item_manager.cpp' can ensure proper data synchronization. It's important to ensure the sending and receiving of packets are handled safely.

Slot Count and Limitations
In Metin2 private servers, slot count is important both for player balance and performance. While the default inventory has 45 slots, some servers expand this number to offer a larger inventory space. However, this requires modifications on both C++ and Python sides. Otherwise, the server may crash or fail to display the inventory correctly.

Python Side Configuration: The 'slotCount' variable in 'inventorywnd.py' must be adjusted. Additionally, the slots defined in the 'uiscript' file must be resized accordingly.

C++ Side Configuration: The inventory slot limit defined in 'char.h' must be changed, and appropriate packet structures should be defined in 'packet.h' according to this limit.

Item Disappearance and Duplication Issues
Such errors typically arise due to faulty data handling, insufficient checks, or packet shortages. These issues especially increase during item transfers or movements from one inventory to another. To prevent these, proper validations must be implemented on both the server and client sides.

Precautions: Double-click prevention mechanisms in item-moving functions, validation functions, and error-checking during database writes should be added. Moreover, the use of synchronization techniques like mutex in inventory operations is recommended.

Conclusion
Proper functioning of the inventory and slot systems in Metin2 private servers enhances the gaming experience and strengthens server security. By using C++ and Python-based solutions, issues within these systems can be resolved step by step. To allow players to efficiently use their inventories, both sides must be thoroughly tested and optimized.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt