[C++] Increase safebox/warehouse

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Herkese Hayırlı Kullanımlar

Alıntıdır ...




Kod:
Lets do ex: 16x9. I dont know if i something forgot, but its little tutorial how do it, im tired af so sorry for errors THANKS ❤️ // tables.h #define SAFEBOX_MAX_NUM    135 to #define SAFEBOX_MAX_NUM    432 // Packet.h typedef struct command_safebox_checkout {     BYTE    bHeader;     BYTE    bSafePos;     TItemPos    ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin {     BYTE    bHeader;     BYTE    bSafePos;     TItemPos    ItemPos; } TPacketCGSafeboxCheckin; // Like that typedef struct command_safebox_checkout {     BYTE    bHeader;     UINT    bSafePos;     TItemPos    ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin {     BYTE    bHeader;     UINT    bSafePos;     TItemPos    ItemPos; } TPacketCGSafeboxCheckin; // Safebox.cpp     if (m_iSize)         m_pkGrid = M2_NEW CGrid(5, m_iSize);     else         m_pkGrid = NULL; //     if (m_iSize)         m_pkGrid = M2_NEW CGrid(16, m_iSize);     else         m_pkGrid = NULL; // ------------------------------     if (pkOldGrid)         m_pkGrid = M2_NEW CGrid(pkOldGrid, 5, m_iSize);     else         m_pkGrid = M2_NEW CGrid(5, m_iSize); //     if (pkOldGrid)         m_pkGrid = M2_NEW CGrid(pkOldGrid, 16, m_iSize);     else         m_pkGrid = M2_NEW CGrid(16, m_iSize); // ---------------------------------- if (bCell >= 5 * m_iSize) // if (bCell >= 16 * m_iSize) // ---------------------------- int max_position = 5 * m_iSize; // int max_position = 16 * m_iSize; //Search for: LPITEM CSafebox::GetItem(BYTE bCell) //Replace with: LPITEM CSafebox::GetItem(UINT bCell) //Search for: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count) //Replace with bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count) // Safebox.h //Search for: LPITEM CSafebox::GetItem(BYTE bCell) //Replace with: LPITEM CSafebox::GetItem(UINT bCell) //Search for: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count) //Replace with bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count) Client/ // Packet.h typedef struct command_safebox_checkout {     uint8_t bHeader;     BYTE bSafePos;     TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin {     uint8_t bHeader;     BYTE bSafePos;     TItemPos ItemPos; } TPacketCGSafeboxCheckin; // -------------- typedef struct command_safebox_checkout {     uint8_t bHeader;     UINT bSafePos;     TItemPos ItemPos; } TPacketCGSafeboxCheckout; typedef struct command_safebox_checkin {     uint8_t bHeader;     UINT bSafePos;     TItemPos ItemPos; } TPacketCGSafeboxCheckin; // PythonNetworkStream.h //Search for: bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos); //edit: bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos); //Search for: bool SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos); //edit: bool SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos); // search for: bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount); //edit: bool SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount); // Python****PhaseGameItem.cpp //Search for: bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos) //edit bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos) //Search for: bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos) //edit bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos) //    bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount) // edit bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount)   // PythonSafebox.h     enum     {         SAFEBOX_SLOT_X_COUNT = 5,         SAFEBOX_SLOT_Y_COUNT = 9,         SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT     }; // edit     enum     {         SAFEBOX_SLOT_X_COUNT = 16,         SAFEBOX_SLOT_Y_COUNT = 9,         SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT     };


Metin2'de C++ Kullanarak Güvenli Kutu / Depo Kapasitesini Arttırmak

Metin2 özel sunucularında oyun deneyimini geliştirmek için geliştiriciler sürekli olarak sistemleri optimize eder. Bu süreçte güvenli kutu yani warehouse kapasitesini artırmak, oyuncuların daha fazla eşya saklamasını sağlar ve oyun içi konforu artırır. Bu yazıda, C++ dilinde yazılmış Metin2 server src üzerinde güvenli kutu kapasitesinin nasıl arttırılacağını detaylıca inceleyeceğiz.

Güvenli Kutu Sistemi Nedir?
Metin2 oyununda oyuncular eşyalarını güvenli bir şekilde saklayabilmek için warehouse sistemini kullanırlar. Varsayılan olarak bu sistem sınırlı sayıda slot sunar. Ancak özel sunucularda bu limitler değiştirilebilir. C++ tabanlı game core[/BR] üzerinde yapılan değişikliklerle bu sınır genişletilebilir.

C++ Kaynak Kodlarında Değişiklik
Güvenli kutu kapasitesini artırmak için game server programming seviyesinde değişiklik yapılması gerekir. İlk adım olarak server src dosyasında bulunan ilgili yapıları incelemek gerekir. Özellikle char.cpp veya benzeri dosyalarda tanımlanan sabit değerler değiştirilmelidir.

Örneğin:
#define WAREHOUSE_MAX_ITEMS 45
Bu satır, depoda tutulabilecek maksimum eşya sayısını belirtir. Bu değeri 90 yaparak kapasiteyi ikiye katlamak mümkündür.

Veritabanı Ayarlarını Güncelleme
Sunucuda yapılan değişikliklerin kalıcı olması için db core tarafında da bazı güncellemeler gerekebilir. Özellikle player tablosunda yer alan safebox_size gibi alanlar doğrulanmalı ve gerekirse güncellenmelidir. Bu işlem, oyuncuların yeni kapasiteye göre doğru şekilde erişim sağlayabilmesi için önemlidir.

Client Tarafında Gerekli Değişiklikler
Sunucu tarafındaki değişikliklerin ardından, istemci tarafında da buna uyumlu olacak şekilde ayarlamalar yapılması gerekir. client src üzerinde uiscript dosyalarında bulunan GUI sınırlarının güncellenmesi gerekebilir. Bu sayede oyuncular yeni kapasiteyi görebilir ve kullanabilirler.

Test ve Derleme İşlemi
Değişiklikler yapıldıktan sonra Metin2 compile işlemi yapılmalıdır. Sunucu yeniden başlatıldığında yeni kapasite aktif olacaktır. Test aşamasında, hem auth hem de game sunucularında sorunsuz çalıştığından emin olunmalıdır.

Sonuç
Metin2 özel sunucularında C++ seviyesinde yapılan küçük değişiklikler, kullanıcı deneyimini büyük ölçüde artırabilir. Güvenli kutu kapasitesini artırmak, oyuncuların daha fazla eşya saklamasına olanak tanır ve oyun içi verimliliği artırır. Bu işlem, source edit becerisi gerektirir ancak doğru adımlarla kolayca uygulanabilir.


Increasing Safebox/Warehouse Capacity in Metin2 with C++

To enhance the gaming experience on Metin2 private servers, developers constantly optimize systems. In this process, increasing the capacity of the safebox, also known as warehouse, allows players to store more items and improves in-game comfort. In this article, we will examine in detail how to increase warehouse capacity using C++ within the Metin2 server src.

What Is the Warehouse System?
In Metin2, players use the warehouse system to securely store their items. By default, this system offers a limited number of slots. However, on private servers, these limits can be modified. Expanding the limit is possible by making adjustments at the game core level, which is based on C++.

Modifying C++ Source Code
To increase warehouse capacity, modifications must be made at the game server programming level. The first step is to examine the relevant structures in the server src. Particularly, constant values defined in files like char.cpp should be adjusted.

For example:
#define WAREHOUSE_MAX_ITEMS 45
This line specifies the maximum number of items that can be stored in the warehouse. Changing this value to 90 doubles the capacity.

Updating Database Settings
For changes made on the server side to be persistent, certain updates may be required in the db core. Specifically, fields such as safebox_size in the player table must be verified and updated if necessary. This ensures that players can correctly access the new capacity.

Client-Side Adjustments
After server-side modifications, adjustments compatible with the new settings must be made on the client side as well. Within the client src, GUI limitations in uiscript files may need to be updated so that players can view and utilize the increased capacity.

Testing and Compilation Process
After modifications are completed, a Metin2 compile operation must be performed. Once the server is restarted, the new capacity will be active. During testing, ensure both the auth and game servers operate without issues.

Conclusion
Small modifications made at the C++ level in Metin2 private servers can significantly improve user experience. Increasing warehouse capacity allows players to store more items and boosts in-game efficiency. This process requires source edit skills but can be easily implemented with correct steps.​
 

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

Benzer konular

Geri
Üst Alt