[C++] GF Kısayol sistemi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
oyundaki varsayılan anahtarları başkalarıyla değiştirebileceğiniz bu sistemi de buraya bırakıyorum.

Örneğin:

Sen açmak için değiştirebilirsiniz envanteri üzerinde P tuşu veya açmak için Big Harita üzerinde ben tuşunun vb

Ayrıca sisteme yeni fonksiyonlar ekleyebilirsiniz... Günlük Sistem ve Pet penceresini değiştirilecek şekilde koyuyorum.

<a href=" " class="link link--external" target="_blank" rel="nofollow ugc noopener" data-proxy-href="/proxy.php?link=https%3A%2F%2Fi.gyazo.com%2Fee8c7da4fa5eeb26ea91dc3e34286f69.mp4&amp;hash=c8dafa62f387fffe39d495c09b949526"> </a> <a href=" " class="link link--external" target="_blank" rel="nofollow ugc noopener" data-proxy-href="/proxy.php?link=https%3A%2F%2Fi.gyazo.com%2Fd57387e9e2abb0edab739da6c912926c.mp4&amp;hash=1e0874f503399b94252ccd2d7b8423ae"> </a>

C++ ile Metin2 GF Kısayol Sistemi Geliştirme

Metin2 özel sunucularında oyuncuların daha hızlı ve verimli hareket etmesini sağlamak adına GF (Game Function) kısayol sistemi oldukça yaygın bir şekilde kullanılmaktadır. Bu sistem sayesinde oyuncular, belirli tuş kombinasyonları ile belirli eylemleri otomatikleştirebilir veya hızlıca erişebilir. Bu yazıda C++ tabanlı bir GF kısayol sistemi nasıl geliştirilir, hangi yapılarla entegre edilir ve nasıl optimize edilir konusunu detaylıca ele alacağız.

GF Sisteminin Temel Yapısı

GF kısayol sistemi, genellikle Metin2 client tarafında bir UI script ve Python GUI ile başlatılır. Ancak bu sistemin arka planda çalışması için C++ tabanlı server-side işlemler gereklidir. Client tarafında bir tuşa basıldığında, ilgili komut game server'a gönderilir ve sunucu bu komutu yorumlayarak gerekli eylemi başlatır.

C++ tarafında bu sistem genellikle pack dosyaları içinde tanımlanan mesaj tipleri ile çalışır. Örneğin, bir GF komutu packet olarak gönderilir ve game server tarafından işlenir. Bu işlem sırasında db core ve auth server ile senkronizasyon sağlanarak, komutun geçerli olup olmadığı kontrol edilir.

GF Komutlarını Tanımlamak

GF kısayolları, genellikle oyuncunun bir komutu hızlıca kullanabilmesi için tasarlanır. Örneğin, !heal gibi bir komutla otomatik olarak bir can iksiri kullanılabilir. Bu komutlar C++ içinde enum olarak tanımlanabilir:

Kod:
enum GFCOMMANDS {[BR][/BR]    GF_HEAL = 1,[BR][/BR]    GF_TP = 2,[BR][/BR]    GF_SUMMON = 3[BR][/BR]};


Bu şekilde tanımlanan komutlar, client tarafından gönderildiğinde game server içinde bu enum ile karşılaştırılır ve ilgili fonksiyon çağrılır. Bu yapı sayesinde sistem hem güvenli hem de esnek bir şekilde genişletilebilir.

Olası Güvenlik Riskleri ve Önlemler

Her GF komutu, sunucu üzerinde doğrudan bir eylem tetikleyeceği için güvenlik açısından dikkatli bir şekilde tasarlanmalıdır. Özellikle root seviyesinde işlem yapabilen komutlar, sadece yetkilendirilmiş kullanıcılar için açık olmalıdır. Bu bağlamda auth server ile entegrasyon kritik öneme sahiptir.

Metin2 Lobby olarak bu tür sistemleri geliştirmeye odaklıyız. C++ server src üzerinde yapılan değişiklikler, compile işleminden sonra doğrudan game server içinde aktif hale gelir. Bu süreçte source edit işlemleri, doğru bir şekilde yapılmadığı takdirde sunucuda hata oluşabilir. Bu nedenle her değişiklikten sonra debug modunda test yapılması önerilir.

Python GUI Entegrasyonu

Bazı gelişmiş GF sistemlerinde, oyuncuların kendi kısayollarını ayarlayabilmesi için bir Python GUI arayüzü de entegre edilebilir. Bu arayüz, uiscript ile oluşturulur ve py root dosyaları ile server ile haberleşir. Oyuncu, bu arayüzden kısayollarını tanımlar ve bu bilgi server'a gönderilir.

Sonuç

GF kısayol sistemi, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artıran bir özelliktir. Doğru uygulandığında hem PvP savaşlarında hem de günlük oyun içinde büyük kolaylıklar sağlar. C++ tabanlı sistemlerle entegre edildiğinde ise performans ve güvenlik açısından güçlü bir yapı ortaya çıkar. Metin2 Lobby olarak bu tür gelişmiş sistemleri sizlere sunmaya devam edeceğiz.


Developing a GF Shortcut System with C++

In Metin2 private servers, the GF (Game Function) shortcut system is widely used to allow players to move faster and more efficiently. This system enables players to automate certain actions or access them quickly through specific key combinations. In this article, we will discuss how to develop a GF shortcut system based on C++, how it integrates with existing structures, and how to optimize it.

The Basic Structure of the GF System

The GF shortcut system is typically initiated via a UI script and Python GUI on the Metin2 client. However, for this system to function properly, server-side operations built with C++ are required. When a key is pressed on the client side, the corresponding command is sent to the game server, which interprets the command and executes the necessary action.

On the C++ side, this system often works with message types defined within pack files. For instance, a GF command is sent as a packet and processed by the game server. During this process, synchronization with the db core and auth server ensures the command is valid.

Defining GF Commands

GF shortcuts are usually designed so that players can quickly execute commands. For example, a command like !heal might automatically use a health potion. These commands can be defined in C++ using an enum:

Kod:
enum GFCOMMANDS {[BR][/BR]    GF_HEAL = 1,[BR][/BR]    GF_TP = 2,[BR][/BR]    GF_SUMMON = 3[BR][/BR]};


When such commands are sent from the client, they are compared against this enum on the game server and the corresponding function is invoked. This structure allows the system to be both secure and easily expandable.

Potential Security Risks and Precautions

Since every GF command triggers direct actions on the server, careful design is crucial for security. Commands capable of performing root-level operations should only be accessible to authorized users. Integration with the auth server is therefore critical.

At Metin2 Lobby, we focus on developing such systems. Modifications made to the C++ server src become active in the game server after compilation. If source edit procedures are not performed correctly, errors may occur on the server. Therefore, testing in debug mode after each modification is recommended.

Python GUI Integration

In some advanced GF systems, a Python GUI interface can also be integrated, allowing players to configure their own shortcuts. This interface is created with uiscript and communicates with the server via py root files. Players define their shortcuts through this interface, and the information is sent to the server.

Conclusion

The GF shortcut system significantly enhances the user experience in Metin2 private servers. When properly implemented, it offers great convenience both in PvP battles and in daily gameplay. When integrated with C++-based systems, it provides a powerful framework in terms of performance and security. As Metin2 Lobby, we will continue to provide you with such advanced systems.
 

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

Benzer konular

Geri
Üst Alt