Neler yeni

Foruma hoş geldin, Ziyaretçi

Metin2Lobby.com Metin2 Private Server Tanıtım Advertising Ve Geliştirme Forumudur.Metin2 pvp serverler,1-99,1-105,1-120,55-120 global serverları paylaş yada ara.
Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

[C++] İteme 4. Taş Slotunu Eklemek .

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Konular
48,291
Mesajlar
48,601
Tepkime puanı
75
M2 Yaşı
3 yıl 11 ay 10 gün
Trophy Puan
48
Konum
Web sitesi
M2 Yang
488,879
Ticaret : 1 / 0 / 0
Ticaret Oranı : 100%
# Edit

[C++] İteme 4. Taş Slotunu Eklemek

Metin2 özel sunucularında geliştirme yaparken, oyuncuların ekipmanlarına takabilecekleri taşları artırmak önemli bir özelliktir. Bu yazıda, C++ tabanlı Metin2 sunucu kaynak koduna 4. taş slotunun nasıl ekleneceğini adım adım anlatacağız. Bu işlem, hem game hem de client tarafında değişiklik gerektirir.

Taş Sistemi Nedir?

Metin2'de taşlar, ekipmanlara takılan ve karakterin özelliklerini artıran küçük bonus unsurlarıdır. Varsayılan olarak bir ekipmana maksimum 3 adet taş takılabilir. Ancak bazı özel sunucularda bu sayının artırılması istenir. Bu durumda 4. taş slotunun eklenmesi gerekir.

Sunucu Tarafında Değişiklikler

1. Item Struct'ı Düzenleme:

Öncelikle game sunucusunda, item verilerini tutan yapıya 4. taş slotunu tanımlamalıyız. char_item.cpp veya item.h dosyasında bulunan item sınıfında m_alSockets dizisinin boyutunu artırmalıyız. Örneğin:

int m_alSockets[ITEM_SOCKET_SLOT_MAX]; // Eski: 3, Yeni: 4

2. ITEM_SOCKET_SLOT_MAX Değerini Güncelle:

Bu sabiti tanımladığınız yerde (constants.h gibi), değerini 4 yapmalısınız.

3. DB ve Auth Sunucu Güncellemesi:

DB sunucusunda item verilerini saklayan tabloya 4. slot için bir sütun daha eklenmelidir. Örneğin item_attr tablosuna socket4 gibi bir alan eklenir.

Client Tarafında Değişiklikler

1. Uiscript Dosyası Ayarları:

equipmentwindow.py gibi ekipman penceresini yöneten dosyalarda, 4. slotun görsel konumu tanımlanmalıdır. UIScript kullanıyorsanız, yeni bir slot nesnesi eklenir.

2. Taş Takma/Sökme Fonksiyonlarını Güncelle:

item.py veya benzeri dosyalarda taş takma/sökme işlemleri yapan fonksiyonlar, 4. slotu da kontrol edecek şekilde yeniden düzenlenmelidir.

Python GUI ve Py Root Entegrasyonu

Eğer arayüzde PyGUI veya PyRoot kullanıyorsanız, 4. slotun görünmesi ve işlem yapılabilmesi için ilgili .py dosyalarında uygun buton ve slot tanımları yapılmalıdır.

Test ve Derleme

Değişiklikler tamamlandıktan sonra hem game hem de client tarafı derlenmelidir. Test aşamasında 4. taş slotunun doğru çalışıp çalışmadığı kontrol edilmelidir.

Not: Bu işlem sırasında dikkat edilmesi gereken en önemli nokta, hem sunucu hem de istemci tarafında eş zamanlı çalışmaktır. Aksi takdirde taşlar gözükmeyebilir ya da doğru aktarılmayabilir.

Daha fazla Metin2 geliştirme rehberi için Metin2Lobby'yi takip etmeyi unutmayın.


Adding 4th Socket Slot to Items in [C++]

When developing Metin2 private servers, increasing the number of sockets available for players to insert stones into their equipment is an important feature. In this article, we will explain step-by-step how to add a 4th socket slot to Metin2 server source code based on C++. This process requires changes on both game and client sides.

What is the Socket System?

In Metin2, sockets are small items that can be inserted into equipment to enhance character stats. By default, up to 3 sockets are allowed per item. However, in some custom servers, there may be a need to increase this number. In such cases, adding a 4th socket slot becomes necessary.

Server-Side Changes

1. Modify the Item Structure:

Firstly, in the game server, you must define a 4th socket slot within the structure that holds item data. In files like char_item.cpp or item.h, expand the size of the m_alSockets array. For example:

int m_alSockets[ITEM_SOCKET_SLOT_MAX]; // Old: 3, New: 4

2. Update ITEM_SOCKET_SLOT_MAX Value:

Update the constant value where ITEM_SOCKET_SLOT_MAX is defined (such as in constants.h) to 4.

3. Update DB and Auth Servers:

In the DB server, a new column should be added to the table storing item data (like item_attr) to store the 4th socket's value, e.g., socket4.

Client-Side Changes

1. UIScript File Adjustments:

In files managing the equipment window, such as equipmentwindow.py, define the visual location for the 4th socket slot. If using UIScript, a new slot object needs to be added.

2. Update Socket Insertion/Removal Functions:

Functions in files like item.py responsible for inserting/removing sockets must be updated to also handle the 4th slot.

PyGUI and Py Root Integration

If using PyGUI or PyRoot for the interface, appropriate button and slot definitions must be added in the relevant .py files so the 4th socket appears and can be used.

Testing and Compilation

After all changes are completed, both the game and client sides must be compiled. During testing, verify that the 4th socket functions correctly.

Note: The most critical point during this process is ensuring synchronized work between the server and client sides. Otherwise, sockets may not appear or transfer properly.

For more Metin2 development guides, follow Metin2Lobby.
 

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kaydol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Üye ol
Giriş Yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş Yap

Tema düzenleyici

Tema özelletirmeleri