Metin2 Kaynak Kodları - değer alabilen count İçin Düzenleme

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Öncelikle yaptığımız işlemin ne olduğunu yazayım.
Eğer count 'a - değer aldırabilecek veri tipi kullanıyorsanız yapabilirsiniz.
İşlevini aşağıya belirtiyorum.
[TABLE=full][TR][TD]abs()[/TD][TD]Bu fonksiyon verilen tam sayının mutlak değerini döndürür. Çıktı her zaman pozitiftir.[/TD][/TR][/TABLE] Char_item.cpp girin.


bool CHARACTER:: DropItem (TItemPos Cell,

Aratın ve { altına şunu ekleyin.

bCount = abs(bCount);

Sonra

bool CHARACTER::MoveItem (TItemPos Cell, TItemPos DestCell

Aratın ve { altına şunu ekleyin.

count = abs(count);
Metin2 Kaynak Kodları - Değer Alabilen Count İçin Düzenleme


Giriş:
Metin2 özel sunucu geliştirme sürecinde, birçok geliştirici count parametresi üzerinden çeşitli değer atamaları yapar. Bu değerler genellikle oyuncuların envanterindeki eşya sayısını, bir sisteme ait miktarı veya bir işlemin kaç kez tekrar edebileceğini belirtmek için kullanılır. Ancak bazen mevcut count yapısı yeterli gelmeyebilir veya daha esnek bir yapıya ihtiyaç duyulabilir. Bu makalede, count değeri alabilen sistemlerde nasıl değişiklikler yapılacağını, hangi dosyalarda düzenlemeler gerektiğini ve bu düzenlemelerin Metin2 özel sunucularında nasıl çalıştığını detaylı olarak inceleyeceğiz.

Count Sistemi Nedir?
Metin2 sistemlerinde count, genellikle bir işlemde kullanılacak sayısal değeri ifade eder. Örneğin, bir eşyanın kaç adet kullanılacağı, bir görevde istenen miktar ya da bir item drop sisteminde ne kadar item verileceği gibi durumlarda kullanılır. Varsayılan olarak bu değer genellikle 1 ile 99 arasında sınırlıdır. Ancak bazı gelişmiş sistemlerde bu değerin daha yüksek olması gerekebilir. Bu nedenle count parametresi üzerinde değişiklik yapabilmek, sunucu geliştiricileri için oldukça önemlidir.

Değer Alabilen Count Sistemleri Nerede Kullanılır?
Count değerleri aşağıdaki gibi sistemlerde karşımıza çıkar:
- Eşya kullanımlarında
- Görev (quest) sistemlerinde
- Drop sistemlerinde
- Market ve satın alma işlemlerinde
- PvP ve PVE ödüllerinde
Bu sistemlerde, count değeri doğrudan sunucu tarafında kontrol edilir ve genellikle game server kaynak kodlarında tanımlanır. Örneğin, bir oyuncu 5 adet bomba kullanmak istediğinde, sunucu bu count değerini kontrol eder ve işlemi ona göre gerçekleştirir.

Düzenlenecek Dosyalar
Count sisteminde değişiklik yapabilmek için aşağıdaki dosyalar üzerinde çalışmak gerekir:
1. Game Server Kaynak Kodları (src/game):
- char_item.cpp
- item_manager.cpp
- packet.h
- input_main.cpp
2. Client Kaynak Kodları (client):
- uiinventory.py
- uiscript.py
3. Auth ve DB Bağlantıları:
- db.sql
- auth_server
Bu dosyalar üzerinde yapılacak düzenlemeler, hem sunucu hem de istemci tarafında doğru şekilde count değerlerinin işlenmesini sağlar.

Count Değerinin Arttırılması veya Dinamik Hale Getirilmesi
Varsayılan olarak count değeri genellikle 1 byte (0-255) olarak tanımlıdır. Bu değer, büyük sistemlerde yetersiz kalabilir. Bu durumda, count değişkeninin 2 veya 4 byte olarak yeniden tanımlanması gerekir. Bu işlem sırasında dikkat edilmesi gereken en önemli konu, hem client hem de server tarafında bu değişikliğin aynı şekilde uygulanmasıdır. Aksi takdirde paket uyumsuzlukları oluşabilir.

Örnek olarak, bir item kullanıldığında count değeri 1000 olacaksa, bu değer hem client hem de server tarafından tanınabilmelidir. Paket boyutları ve veri tipleri buna göre güncellenmelidir.

Python ve Py GUI Üzerinden Count Kontrolü
Metin2 özel sunucularında, bazı geliştiriciler Python tabanlı GUI sistemleri kullanarak count değerlerini dinamik olarak yönetebilirler. Bu sayede, sunucu yöneticisi onlineyken belirli işlemler için farklı count değerleri tanımlanabilir. Bu tür sistemlerde, py root klasörleri üzerinden GUI arayüzler hazırlanabilir ve bu arayüz üzerinden count değerleri kolayca değiştirilebilir.

Sonuç
Metin2 özel sunucu geliştirme sürecinde, count sistemleri büyük önem taşır. Oyun içi işlemlerde doğru ve esnek bir count yapısı oluşturmak, kullanıcı deneyimini artırır ve sunucu performansını optimize eder. Bu makalede anlatılan adımlar sayesinde, geliştiriciler count değerlerini özelleştirebilir, daha yüksek değerlere çıkartabilir ve bu işlemleri güvenli bir şekilde uygulayabilirler. Metin2 Lobby olarak, bu tür teknik bilgileri siz geliştiricilerle paylaşmaya devam edeceğiz.


Metin2 Source Codes - Editing for Count Values That Accept Input


Introduction:
During Metin2 private server development, many developers use the count parameter to assign various values. These values typically indicate the number of items in a player's inventory, the amount related to a system, or how many times an operation can be repeated. However, sometimes the existing count structure may not be sufficient, or more flexible structures might be needed. In this article, we will examine in detail how to make modifications to systems that accept count values, which files require adjustments, and how these modifications work in Metin2 private servers.

What Is the Count System?
In Metin2 systems, count usually refers to the numerical value used in an operation. For example, it indicates how many items will be used, the required quantity in a quest, or how many items will be dropped in an item drop system. By default, this value is generally limited between 1 and 99. However, in some advanced systems, higher values may be required. Therefore, modifying the count parameter is crucial for server developers.

Where Are Count Systems Used?
Count values appear in the following systems:
- Item usage
- Quest systems
- Drop systems
- Market and purchase operations
- PvP and PVE rewards
In these systems, the count value is checked directly on the server side and typically defined in the game server source codes. For instance, when a player wants to use 5 bombs, the server checks this count value and executes the operation accordingly.

Files to Be Modified
To modify the count system, you need to work with the following files:
1. Game Server Source Codes (src/game):
- char_item.cpp
- item_manager.cpp
- packet.h
- input_main.cpp
2. Client Source Codes (client):
- uiinventory.py
- uiscript.py
3. Auth and DB Connections:
- db.sql
- auth_server
Modifications made to these files ensure that count values are processed correctly on both the server and client sides.

Increasing or Making Count Values Dynamic
By default, the count value is often defined as 1 byte (0-255). This value may be insufficient for large-scale systems. In such cases, the count variable needs to be redefined as 2 or 4 bytes. The most important thing to consider during this process is ensuring that these changes are applied identically on both the client and server sides. Otherwise, packet mismatches may occur.

As an example, if the count value is set to 1000 when an item is used, this value must be recognized by both the client and server. Packet sizes and data types should be updated accordingly.

Controlling Count via Python and Py GUI
In Metin2 private servers, some developers manage count values dynamically using Python-based GUI systems. This allows server administrators to define different count values for specific operations while online. In such systems, GUI interfaces can be prepared through py root folders, allowing easy modification of count values via these interfaces.

Conclusion
In the process of developing Metin2 private servers, count systems hold great importance. Creating a correct and flexible count structure in-game operations enhances user experience and optimizes server performance. Thanks to the steps outlined in this article, developers can customize count values, increase them to higher amounts, and apply these changes securely. As Metin2 Lobby, we will continue sharing such technical information with you developers.
 

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

Benzer konular

Geri
Üst Alt