[C++,PHYTON] İTEMİ YERE AT SİL SİSTEMİ

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
SİSTEM RESİMDE GÖRÜLDÜĞÜ GİBİDİR. İTEMİ YERE ATTIĞINIZDA SADECE SİLİYORSUNUZ YERE DÜŞÜRME GİBİ BİR SEÇENEK OLMAMASI SERVERİNİZİN GİDİŞATI AÇISINDAN AVANTAJ SAĞLAYACAKTIR.
ANLATIM İÇERİSİNDE MEVCUTTUR.

Z9EqoG.png

LİNK:
VT:

NOT:

Locale_string'e bunu eklemeyi unutmayın

"%s has succesfully deleted";
"%s başarıyla silindi.";

Metin2 Oyun Sunucusu İçin C++ ve Python ile Örnek Item Silme Sistemi

Metin2 özel sunucularında, oyuncuların sahip oldukları eşyaları silmek veya yere atmak gibi işlemleri yönetebilmek oldukça önemli bir sistemdir. Bu yazıda, C++ ve Python dilleri kullanılarak geliştirilmiş bir 'Item Silme / Yere Atma' sistemi ele alınacaktır. Bu sistem, hem oyun içi deneyimi artırmak hem de sunucu tarafında kontrolü kolaylaştırmak için tasarlanmıştır.

C++ Tarafında Item Silme Sistemi

C++ tarafında item silme işlemi genellikle gamecore dosyasında tanımlanan fonksiyonlar aracılığıyla gerçekleştirilir. Örneğin, oyuncu bir itemi silmek istediğinde, CItemManager::RemoveItem fonksiyonu çağrılır. Bu fonksiyon, itemin veritabanından silinmesini sağlar. Ayrıca, bu işlem sırasında log tutulması da önemlidir. Güvenlik açısından, item silme işleminin izinsiz tekrarları engellenmelidir.

Özel sunucularda, martysama gibi geliştiricilerin hazırladığı modülasyonlar sayesinde, item silme işlemleri daha esnek hale getirilebilir. Bu modülasyonlar genellikle uiscript dosyaları üzerinden kullanıcı arayüzüne entegre edilir.

Python Tarafında Item Silme ve Yere Atma Sistemi

Python tarafında, genellikle pyroot dizininde bulunan uiinventory.py dosyasında item silme fonksiyonları tanımlanır. Oyuncu bir iteme sağ tıkladığında çıkan menüden 'Sil' veya 'Yere At' seçeneği seçilir. Bu işlem, net.SendChatPacket ile sunucuya gönderilir ve ardından C++ tarafında işlenir.

Python GUI (PyGUI) sistemleri sayesinde, bu menü özelleştirilebilir ve farklı stillerde sunulabilir. Bu tür sistemler, hem oyun deneyimini artırır hem de kullanıcı dostu bir arayüz sağlar.

Yere Atma İşlemi Nasıl Çalışır?

Yere atma işlemi, genellikle DropItem adlı bir fonksiyonla sağlanır. Bu fonksiyon, itemin o anki koordinatlarına göre haritada görünmesini sağlar. Bu işlem sırasında, itemin kimliği ve konumu veritabanına yazılır. Yere atılan itemler, belirli bir süre sonra otomatik olarak silinebilir veya başka bir oyuncu tarafından alınabilir.

Güvenlik ve Performans Açısından Dikkat Edilmesi Gerekenler

Bu tür sistemlerde güvenlik çok önemlidir. Örneğin, herhangi bir itemin silinip silinmeyeceği server-side kontrollerle doğrulanmalıdır. Aksi takdirde, hatalı silmeler veya dolandırıcılık yapılabileceği unutulmamalıdır. Ayrıca, item silme işlemlerinde performans kaybı yaşamamak adına, sorgular optimize edilmelidir.

Sonuç

Metin2 özel sunucularında item silme/yere atma sistemi, oyuncu deneyimini artıran temel sistemlerden biridir. C++ ve Python tabanlı geliştirilen bu sistemler, doğru uygulandığında hem güvenli hem de esnek bir yapı sunar. Geliştiriciler, bu sistemleri özelleştirerek kendi sunucularına göre uyarlayabilirler.


Sample Item Delete/Drop System with C++ and Python for Metin2 Server

In Metin2 private servers, managing the deletion or dropping of items owned by players is an important system. In this article, we will examine an 'Item Delete / Drop on Ground' system developed using C++ and Python. This system is designed to enhance the in-game experience while simplifying control on the server side.

Item Deletion System in C++

In C++, item deletion is usually handled via functions defined in the gamecore files. For example, when a player wants to delete an item, the CItemManager::RemoveItem function is called. This function ensures that the item is removed from the database. Additionally, logging these operations is also important for security purposes. Unauthorized repetitive deletions must be prevented.

With modulations prepared by developers like martysama, item deletion processes can become more flexible. These modulations are typically integrated into the user interface through uiscript files.

Item Deletion and Drop System in Python

In Python, item deletion functions are generally defined within files such as uiinventory.py located in the pyroot directory. When a player right-clicks an item and selects 'Delete' or 'Drop', this action is sent to the server via net.SendChatPacket and processed on the C++ side.

Thanks to Python GUI (PyGUI) systems, these menus can be customized and presented in different styles, enhancing both the gaming experience and user-friendliness.

How Does the Drop System Work?

The drop operation is typically handled by a function named DropItem. This function makes the item appear on the map based on its current coordinates. During this process, the item's ID and location are recorded in the database. Items dropped on the ground may be automatically removed after a certain time or picked up by another player.

Security and Performance Considerations

Security is critical in such systems. For instance, whether any item can be deleted must be verified through server-side checks. Otherwise, unauthorized deletions or fraud could occur. Furthermore, queries should be optimized to avoid performance losses during item deletion operations.

Conclusion

An item deletion/drop system in Metin2 private servers is one of the fundamental features enhancing the player experience. When properly implemented, C++ and Python-based systems provide both secure and flexible structures. Developers can customize and adapt these systems according to their own server needs.
 

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

Geri
Üst Alt