Merhaba arkadaşlar,
Yaptığım bir sistemi sizler ile paylaşmak istedim.
Sistem kesinlikle alıntı değildir.
Hayırlı olsun...
Saygılarımla,
Hasan SERCAN
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Metin2'de Duello Bloklama Sistemi: C++ ve Python Entegrasyonu
Metin2 özel sunucularında PvP sistemlerini daha da ileri taşımak isteyen geliştiriciler için Duello Bloklama Sistemi, kullanıcı deneyimini artıran önemli bir özelliktir. Bu sistem sayesinde oyuncular belirli oyuncularla düello yapamaz hale getirilebilir veya istenmeyen kişilerin düello istekleri engellenebilir.
Duello Bloklama Sistemine Genel Bakış
Metin2 özel sunucularında PvP odaklı yapılar kurulduğunda, oyuncuların aralarındaki etkileşimlerin kontrol edilebilir olması gerekir. Özellikle bazı oyuncuların sürekli olarak düello isteği göndermesi ya da istemeden düello başlatılması gibi durumlar, diğer oyuncuların oyun keyfini kaçırmaktadır. Bu nedenle, bir 'duello bloklama' sistemi tasarlamak, hem güvenlik hem de kullanıcı memnuniyeti açısından önemlidir.
Sistem Mimarisine Giriş
Duello bloklama sistemi genellikle iki ana bileşenden oluşur:
- C++ tarafında sunucu içi işlemler
- Python tarafında GUI ve kullanıcı etkileşimi
C++ Tarafında Gerçekleştirilen İşlemler
Sunucu tarafında, yani C++ kodları ile yazılmış olan Game Server kısmında, oyuncuların birbirleriyle olan düello etkileşimleri yönetilir. Bu süreçte, bir oyuncu başka bir oyuncuya düello isteği gönderdiğinde, önce karşı tarafın bu isteği alıp alamayacağı kontrol edilir. Eğer karşı taraf bloke edilmişse, istek gönderilmeyeceği gibi, istek gönderen oyuncuya da bilgi mesajı gönderilir.
Bu işlem için aşağıdaki adımlar takip edilir:
- Oyuncunun blok listesi veritabanından alınır
- Düello isteği gönderilen oyuncu listede varsa, işlem iptal edilir
- Gerekirse, özel mesajla kullanıcıya bilgi verilir
Python Tarafında Kullanıcı Arayüzü
Metin2 özel sunucularında genellikle Python dili ile yazılmış UI Script dosyaları kullanılır. Bu dosyalar, oyuncuların düello bloklama listesini görüntülemesine, ekleme ve silme işlemlerini yapmasına olanak tanır. Python GUI (örneğin uiscript), oyunculara kolay ve kullanıcı dostu bir arayüz sunar.
Py Root klasöründe bulunan bu dosyalar, bloklama sistemi için gerekli arayüzleri sağlar. Örneğin, bir oyuncu blok ekranına girdiğinde, sunucudan blok ettiği oyuncuların listesi çekilir ve ekranda gösterilir. Yeni bir oyuncu eklemek veya çıkarmak için gerekli fonksiyonlar bu arayüz üzerinden çalıştırılır.
Veritabanı Entegrasyonu
Duello bloklama sistemi, blok listesinin kalıcı olarak saklanması için bir veritabanı bağlantısı gerektirir. Bu veri genellikle account veya character tablosuna eklenen özel bir tablo ile yönetilir. DB Core sistemleri bu verilerin güvenli ve hızlı şekilde işlenmesini sağlar.
Örnek bir tablo yapısı şu şekildedir:
- block_id (int, primary key)
- player_id (int)
- blocked_player_id (int)
- date_added (datetime)
Güvenlik ve Performans
Sistemde güvenlik çok önemlidir. Yanlışlıkla ya da kötü niyetli bir şekilde blok listelerine erişim sağlanmaması için yetkilendirme kontrolleri yapılmalıdır. Ayrıca, bu tür sistemlerin sunucu performansını olumsuz etkilememesi için optimize edilmiş sorgular kullanılmalıdır.
MartySama ve benzeri geliştiriciler tarafından paylaşılan kaynak kodlar, bu sistemlerin daha hızlı entegre edilmesini sağlar. Ancak, bu sistemlerin kendi özel sunucunuza göre uyarlanması önemlidir.
Sonuç
Metin2 özel sunucularında duellobloklama sistemi, PvP sistemlerini daha keyifli ve kontrol edilebilir hale getiren güçlü bir özelliktir. C++ ve Python arasındaki entegrasyon sayesinde hem sunucu tarafında hem de istemci tarafında sorunsuz bir deneyim sağlanabilir. Bu sistem, doğru uygulandığında oyuncuların daha fazla ilgisini çekecek ve sunucu sadakatini artıracaktır.
Duel Blocking System in Metin2: C++ and Python Integration
For developers aiming to enhance PvP systems on Metin2 private servers, the Duel Blocking System is a crucial feature that improves user experience. With this system, players can be prevented from dueling specific individuals or blocking unwanted duel requests.
Overview of the Duel Blocking System
In PvP-oriented Metin2 private servers, it's essential to maintain control over player interactions. For instance, continuous duel requests from certain players or unintended duels can ruin other players’ gaming experience. Therefore, implementing a 'duel blocking' system is important for both security and user satisfaction.
Introduction to System Architecture
The duel blocking system generally consists of two main components:
- Server-side operations implemented in C++
- GUI and user interaction handled in Python
Operations Performed in C++
On the server side, within the C++ code of the Game Server, interactions such as duel requests between players are managed. When a player attempts to send a duel request, the system first checks whether the receiving player has blocked them. If so, the request will not be sent and the sender will receive a notification message.
The following steps are taken during this process:
- The target player’s block list is retrieved from the database
- If the requesting player is on the list, the action is canceled
- Optionally, a custom message is sent to the user
User Interface with Python
In Metin2 private servers, UI Script files written in Python are commonly used. These scripts allow players to view their duel block lists, add or remove players. The Python GUI (e.g., uiscript) provides a simple and user-friendly interface.
These files located in the Py Root folder provide the necessary UI for the blocking system. For example, when a player opens the block screen, the list of blocked users is fetched from the server and displayed. Functions for adding or removing players are executed through this interface.
Database Integration
The duel blocking system requires a database connection to store block lists permanently. This data is usually managed via a special table added to the account or character tables. DB Core systems ensure these data are processed securely and quickly.
An example table structure looks like this:
- block_id (int, primary key)
- player_id (int)
- blocked_player_id (int)
- date_added (datetime)
Security and Performance
Security is paramount in the system. Authorization checks must be performed to prevent unauthorized access to block lists. Additionally, optimized queries should be used to avoid negatively impacting server performance.
Source codes shared by developers like MartySama can help integrate such systems more quickly. However, it's important to adapt these systems to your own private server.
Conclusion
The duel blocking system in Metin2 private servers is a powerful feature that makes PvP systems more enjoyable and manageable. Thanks to the integration between C++ and Python, seamless experiences can be provided on both the server and client sides. When properly implemented, this system will attract more attention from players and increase server loyalty.
