Reload Komutu 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 40

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhaba arkadaşlar,
Yönettiğim bir serverda "Ölüm adası" adında bir map bulunuyor ve burada sabit bir boss var boss savaşları döndüğü için hep loncalar kapıyor bossları bireyseller de bu durumdan hoşnut kalmıyor :)

Bu şekilde belirdiğiniz maplerde oyuncuların birbirlerine vurmalarını engelleyebilirsiniz.

Farklı bir isimde paylaşıldımı bilmiyorum ben forumlarda aradım fakat bulamadım.

Resim:


Client SRC / UserInterface / InstanceBase.cpp dosyası açılır.

Aratılır:
Kod:
bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)

Fonksiyonun içerisine eklenir:
Kod:
static std::string BulundugumMap = CPythonBackground::Instance().GetWarpMapName();     static std::string EngelliMap = "metin2_map_t1";     int Result = std::strcmp(EngelliMap.c_str(), BulundugumMap.c_str());     if (Result == 0 && rkInstVictim.IsPC())         return false;

Son hali bu şekilde olacaktır :


Kod içerisindeki "metin2_map_t1" engellenecek map'in atlasinfo da ki adıdır.
Metin2'de Reload Komutu Düzenleme

Metin2 özel sunucularında geliştirme yaparken, sunucu üzerinde çalışan sistemlerin dinamik olarak yeniden yüklenmesi oldukça önemlidir. Bu sayede sunucuyu tekrar başlatmadan bazı ayarları, komutları ya da modülleri güncelleyebilirsiniz. Bu yazıda, Reload komutu nasıl düzenlenir ve Metin2 özel sunucu geliştirme sürecinde nasıl kullanılır, detaylıca ele alınacaktır.

Reload Komutunun Amacı

Genellikle game server programming süreçlerinde geliştiriciler, sunucu çökmeden veya oyuncuların oyundan atılmaması için belirli modüllerin yeniden yüklenmesini sağlar. Bu özellikle C++ system ve Python system tabanlı sistemlerde yaygın bir yöntemdir. Reload komutu, genellikle yetkililerin belirli dosyaları veya sistemleri sunucuda değişiklik yaptıktan sonra yeniden başlatmasına olanak tanır.

Metin2 Sunucusunda Reload Komutu Nasıl Çalışır?

Metin2 özel sunucularında reload komutları genellikle Python tarafında tanımlanır. Oyun sunucusu çalışırken belirli fonksiyonlar ya da modüller yeniden import edilerek güncellenir. Bu işlem sırasında dikkat edilmesi gereken bazı önemli konular vardır:

1. Modül Güncellemesi: Python tabanlı sistemlerde reload fonksiyonu, importlib.reload() gibi fonksiyonlarla yapılır. Bu sayede mevcut modülün son halini sunucuya entegre edebilirsiniz.
2. Oyun Veritabanı Yenileme: DB tarafında yapılan değişikliklerin de reload ile aktif hale gelmesi gerekir. Bu durumda db core sistemlerinde reload komutuna özel işlevler eklenmelidir.
3. Yetkilendirme Sistemleri: Auth ve game sunucuları arasında reload komutunun çalışması için yetkilendirme sistemlerinin buna uygun yapılandırılması gerekir.

Reload Komutunu Özelleştirme

Metin2 özel sunucularında reload komutunun özelleştirilmesi, geliştiricinin ihtiyaçlarına göre değişir. Örneğin bir PvP sistemine ait komutları reload etmek isterseniz, bu komutların tanımlandığı dosyaları yeniden yükleyecek şekilde ayarlamalısınız. Bunun için py root klasörlerinde yer alan komut dosyalarına reload fonksiyonlarını entegre etmeniz gerekir.

Örnek Kod Yapısı (Python):

Kod:
import importlib[BR][/BR][BR][/BR]def reload_module(module_name):[BR][/BR]    module = __import__(module_name)[BR][/BR]    importlib.reload(module)[BR][/BR]    return f'{module_name} modülü başarıyla yeniden yüklendi.'


Reload Komutunun Kullanımı

Sunucu içinde yetkili karakterlerin kullanabilmesi için reload komutunun bir sistem komutu olarak tanımlanması gerekir. Bu komut genellikle !reload veya /reload şeklinde tanımlanabilir. Bu komutun çalışması için gerekli yetki seviyesi de ayarlanmalıdır.

Güvenlik Uyarısı

Reload komutunun yetkisiz kişiler tarafından kullanılması güvenlik açıklarına neden olabilir. Bu nedenle reload komutunun yalnızca belirli yetkilere açık olması gerekir. Özellikle C++ kaynak kod tabanlı sistemlerde bu komutun kullanımı daha dikkatli yapılmalıdır.

Metin2 Özel Sunucu Geliştirme Sürecinde Reload Komutunun Önemi

Reload komutu, Metin2 development sürecinde büyük kolaylık sağlar. Geliştiriciler, test aşamasında sürekli sunucuyu yeniden başlatmak zorunda kalmadan hızlıca değişiklikler yapabilir ve test edebilirler. Bu özellikle PvP sistem geliştirme sürecinde çok değerlidir.

Sonuç

Metin2 özel sunucularında reload komutu düzenlemek, geliştirme sürecini hızlandırır ve daha verimli test etme imkanı sunar. Ancak dikkatli bir yapılandırma gerektirir. Güvenlik önlemleri alınarak ve doğru sistem entegrasyonu ile reload komutu güçlü bir geliştirici aracı haline gelebilir.


Editing the Reload Command in Metin2

While developing on Metin2 private servers, dynamically reloading systems running on the server is highly important. This allows you to update certain configurations, commands, or modules without restarting the server. In this article, we will examine in detail how the Reload command can be configured and used within the context of Metin2 private server development.

Purpose of the Reload Command

In general, during game server programming, developers use the reload functionality to restart specific modules without crashing the server or disconnecting players. This approach is common especially in C++ system and Python system based implementations. The Reload command allows administrators to reload certain files or modules after making changes without fully restarting the server.

How Does the Reload Command Work in Metin2 Servers?

In Metin2 private servers, reload commands are typically defined on the Python side. While the game server is running, specific functions or modules can be reloaded by re-importing them. There are some critical points to consider during this process:

1. Module Updates: In Python-based systems, the reload function is often implemented using functions like importlib.reload(). This ensures that the latest version of the module is loaded into the server.
2. Database Refreshing: Changes made on the DB side must also be reactivated via the reload command. For this reason, reload commands should have special functions integrated into db core systems.
3. Authorization Systems: To ensure the reload command works between the auth and game servers, authorization systems must be configured accordingly.

Customizing the Reload Command

Customization of the reload command in Metin2 private servers varies according to developer needs. For example, if you want to reload commands related to a PvP system, you need to configure the reload function to reload the relevant command files. You must integrate reload functions into the command files located in the py root folders for this purpose.

Sample Code Structure (Python):

Kod:
import importlib[BR][/BR][BR][/BR]def reload_module(module_name):[BR][/BR]    module = __import__(module_name)[BR][/BR]    importlib.reload(module)[BR][/BR]    return f'{module_name} module successfully reloaded.'


Using the Reload Command

To allow admin characters to use the reload command in-game, it must be defined as a system command. This command is usually defined as !reload or /reload. The required permission level for this command must also be set.

Security Warning

Unauthorized use of the reload command may lead to security vulnerabilities. Therefore, the reload command should only be accessible to certain authorized users. Especially in C++ source code based systems, extra care must be taken when using this command.

Importance of the Reload Command in Metin2 Private Server Development

The reload command significantly speeds up the Metin2 development process. Developers can make and test changes quickly without having to restart the server repeatedly during testing phases. This is particularly valuable during PvP system development.

Conclusion

Editing the reload command in Metin2 private servers accelerates the development process and provides more efficient testing opportunities. However, it requires careful configuration. With proper security measures and correct system integration, the reload command can become a powerful tool for developers.
 

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

Benzer konular

Geri
Üst Alt