Merhaba arkadaşlar, herhangibir pencere açıkken quest kullanmayı engelleyebilirsiniz, çoklu pencereler eklidir, eğer farklı şeyler eklemek isterseniz anlatım ekledim kolay gelsin.
/*Paylaşılandan farklıdır*/
questlua_pc.cpp ' e eklenecektir.
/*Paylaşılandan farklıdır*/
questlua_pc.cpp ' e eklenecektir.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
C++ Pencere Açıkken Quest Kullanma Engelleme
Metin2 özel sunucularında geliştirme yaparken, kullanıcı deneyimini artırmak ve hile kullanımı gibi olumsuz durumları engellemek adına bazı kontroller gerçekleştirmek gerekir. Bu bağlamda, oyuncunun oyun penceresi açık değilken quest kullanmasını engellemek oldukça yaygın bir güvenlik önlemidir. Bu işlem genellikle C++ tabanlı sunucu kaynak kodları üzerinde yapılmaktadır.
Neden Pencere Kontrolü Yapılır?
Metin2 özel sunucularında, oyuncular bazen oyun dışından komutlar göndermeye veya botlar kullanmaya çalışabilir. Özellikle quest sistemleri üzerinden item alımı, seviye atlama gibi işlemleri otomatikleştiren sistemler, sunucu dengesini bozabilir. Bu nedenle, oyuncunun oyun penceresi aktif değilse quest kullanımını engellemek, hile riskini ciddi anlamda azaltır.
C++ Kaynak Kodlarında Pencere Kontrolü
Pencere kontrolü, genellikle game_core veya client_src üzerinde yapılır. Oyun penceresinin açık olup olmadığını belirlemek için, Windows API fonksiyonları kullanılabilir. Örneğin, GetForegroundWindow() fonksiyonu, o anda aktif olan pencereyi döndürür. Eğer bu pencere Metin2 oyun penceresi değilse, quest komutları iptal edilebilir.
Quest Kullanımında Engelleme Mekanizması
Quest sistemi, genellikle questmanager.cpp dosyası üzerinden yönetilir. Burada, bir quest çağrısı yapıldığında, önce oyuncunun penceresinin aktif olup olmadığı kontrol edilmelidir. Bu kontrol, quest komutu işlenmeden hemen önce yapılmalıdır. Aksi takdirde, hileci oyuncular sistemden faydalanabilir.
Örnek Kontrol Fonksiyonu
bool IsGameWindowActive()
{
int result = CompareString(GetForegroundWindow(), L'Metin2Client');
return result == 0 ? false : true;
}
Yukarıdaki fonksiyon, o anda aktif olan pencerenin adını kontrol eder. Eğer pencere adı Metin2Client değilse, fonksiyon false döner ve quest komutu iptal edilir.
Python Tarafında GUI Kontrolü
Bazı sunucularda, quest sistemine ek olarak bir GUI (grafiksel arayüz) entegrasyonu da olabilir. Bu durumda, py_root veya uiscript üzerinden Python ile yazılmış GUI sistemlerinde de benzer kontroller yapılabilir. Ancak, temel kontrol yine C++ tarafında yapılması önerilir çünkü bu, daha güvenli ve doğrudan bir yöntemdir.
Hile Engelleme İçin Ekstra Adımlar
Pencere kontrolü haricinde, zaman damgası (timestamp), IP sınırlaması ve quest kullanım sıklığı gibi diğer yöntemlerle birlikte kullanıldığında daha güçlü bir hile önleme sistemi kurulabilir. Özellikle Metin2 PvP sistemleri için bu tür kontroller kritik önem taşır.
Sonuç
Oyun penceresi açıkken quest kullanımına izin vermek, Metin2 özel sunucularında hem adil oyun ortamını korur hem de sunucu dengesini sağlar. Bu kontrolün C++ kaynak kodları üzerinde doğru şekilde entegre edilmesi, uzun vadeli bir güvenlik stratejisi için büyük önem taşır. Geliştiricilerin, bu tür kontrolleri hem game server programming hem de db_core düzeyinde dikkatlice planlaması gerekir.
Blocking Quest Usage When C++ Window is Not Active
When developing private Metin2 servers, it's necessary to implement certain controls to enhance user experience and prevent unwanted activities like cheating. In this context, blocking players from using quests while their game window is not active is a common security measure. This process is usually implemented within C++ based server source codes.
Why Perform Window Checks?
In Metin2 private servers, players may sometimes attempt to send commands from outside the game or use bots. Systems that automate processes such as item acquisition or level advancement through quest systems can disrupt server balance. Therefore, blocking quest usage when the player’s game window is inactive significantly reduces the risk of cheating.
Window Check in C++ Source Code
Window checks are typically performed on game_core or client_src. To determine whether the game window is active, Windows API functions can be used. For example, the GetForegroundWindow() function returns the currently active window. If this window is not the Metin2 game window, quest commands can be canceled.
Blocking Mechanism for Quest Usage
The quest system is generally managed via the questmanager.cpp file. Here, before executing a quest call, the system should first check if the player’s window is active. This check must occur just before processing the quest command. Otherwise, cheating players might exploit the system.
Example Check Function
bool IsGameWindowActive()
{
int result = CompareString(GetForegroundWindow(), L'Metin2Client');
return result == 0 ? false : true;
}
The above function checks the name of the currently active window. If the window name is not Metin2Client, the function returns false and the quest command is canceled.
GUI Control in Python
In some servers, there may also be GUI (graphical interface) integration alongside the quest system. In such cases, similar checks can be made through Python-based GUI systems written using py_root or uiscript. However, the main control should still be done in C++ as it is a more secure and direct method.
Additional Steps for Anti-Cheat Measures
Besides window checks, other methods like timestamps, IP restrictions, and quest usage frequency can be combined to build a stronger anti-cheat system. These checks are especially critical for Metin2 PvP systems.
Conclusion
Allowing quest usage only when the game window is active helps maintain a fair gameplay environment and server balance in Metin2 private servers. Properly integrating these checks into C++ source codes is essential for long-term security strategies. Developers must carefully plan these controls at both game server programming and db_core levels.
