- Katılım
- 6 Mayıs 2022
- Konular
- 48,263
- Mesajlar
- 48,573
- Tepkime puanı
- 74
- M2 Yaşı
- 3 yıl 11 ay 10 gün
- Trophy Puan
- 48
- M2 Yang
- 488,599
Reboot atmadan drop ayarlama sistemini paylaşıyorum. Forumda araştırdım ancak göremedim. Aktif oyunda core verdirebilir dikkatli olmak lazım.
xx forumdan alınmıştır.
mob_drop_item.txt ve special_item_group.txt için geçerlidir.
İyi kullanımlar.
Metin2 özel sunucularında geliştirme yaparken bazı sistemleri dinamik olarak değiştirmek isteyebilirsiniz. Bu durumda sunucuyu yeniden başlatmadan bazı ayarlamaları gerçekleştirmek büyük kolaylık sağlar. Özellikle drop sistemleri gibi kritik yapılar üzerinde çalışırken reboot olmadan ayar yapabilmek hem zaman kazandırır hem de oyuncu deneyimini olumsuz etkilemez.
Drop Sistemi Nedir?
Drop sistemi, oyuncuların belirli NPC'leri yendikten sonra elde ettikleri ödüllerdir. Bu sistem, sunucu yöneticileri tarafından ayarlanabilir ve değişiklik yapılabilir. Standart olarak item düşme oranları, drop listeleri gibi ayarlar sunucunun config dosyasında bulunur. Ancak bu dosyayı değiştirdiğinizde sunucuyu yeniden başlatmanız gerekir.
Reboot Atmadan Değişiklik Yapmak
Sunucu aktifken drop ayarlarını değiştirebilmek için özel bir sistem geliştirmek gereklidir. Bu sistem genellikle C++ ile yazılır ve oyun sırasında sunucuya runtime komutları göndererek ayarların yeniden yüklenmesini sağlar. Bu sayede config dosyası üzerinde değişiklik yapıldığında sunucuyu yeniden başlatmaya gerek kalmaz.
C++ ile Uygulama
Öncelikle drop ayarlarını barındıran yapıyı bir fonksiyonla tekrar okutmak gerekir. Örneğin, drop_rate, item_vnum gibi değerler bir yapıda tutuluyorsa bu yapıya erişip değerleri güncellemek için bir komut sistemi yazmalısınız. Bu komutu admin panel üzerinden veya oyun içi bir komutla tetikleyebilirsiniz.
Örnek olarak: /reload_drops komutunu yazdığınızda, sistem drop ayarlarını tekrar okur ve hemen etkinleştirir. Bu işlem sırasında sunucuda herhangi bir kesinti olmaz.
Dikkat Edilmesi Gerekenler
Bu tip sistemler yazarken hata kontrolü çok önemlidir. Yanlış bir config dosyası yüklendiğinde sunucu çökmesin diye gerekli kontroller yapılmalıdır. Ayrıca, yapılan değişikliklerin loglanması da güvenlik açısından faydalıdır.
Avantajları
- Sunucu kesintisi olmadan ayar değişikliği yapılabilir.
- Oyuncuların oyun deneyimi bozulmaz.
- Geliştirici açısından esneklik sağlar.
- Hızlı test ve geri bildirim alınabilir.
Sonuç
Reboot atmadan drop ayarları gibi sistemleri değiştirebilmek, Metin2 özel sunucu geliştiricileri için oldukça faydalı bir özelliktir. Bu tarz sistemler C++ bilgisiyle kolayca entegre edilebilir ve sunucu yönetimi daha verimli hale getirilebilir.
When developing Metin2 private servers, you may want to dynamically change certain systems. In such cases, adjusting settings without restarting the server can be very convenient. Especially when working on critical structures like drop systems, being able to configure them without rebooting saves time and avoids negatively impacting player experience.
What Is a Drop System?
The drop system refers to rewards players receive after defeating specific NPCs. This system can be configured by server administrators and adjusted as needed. By default, item drop rates and drop lists are located in the server's config file. However, changing this file requires restarting the server.
Making Changes Without Rebooting
To modify drop settings while the server is active, you need to develop a custom system. This system is typically written in C++ and reloads settings via runtime commands sent to the server. This way, there is no need to restart the server when changes are made to the configuration file.
Implementation with C++
Firstly, you must create a function that reloads the structure holding the drop settings. For example, if values such as drop_rate and item_vnum are stored within a structure, you need to access and update that structure via a command system. You can trigger this command either through an admin panel or an in-game command.
As an example: typing the command /reload_drops will cause the system to reload the drop settings and activate them immediately. During this process, there will be no interruption on the server.
Important Considerations
Error handling is crucial when implementing such systems. Necessary checks should be performed so that the server does not crash due to an incorrect config file. Additionally, logging the changes made is beneficial for security purposes.
Advantages
- Settings can be changed without server downtime.
- Player gaming experience remains uninterrupted.
- Offers flexibility for developers.
- Enables quick testing and feedback.
Conclusion
Being able to adjust drop settings and similar systems without rebooting is highly beneficial for Metin2 private server developers. Such systems can easily be integrated with C++ knowledge, making server management more efficient.
xx forumdan alınmıştır.
mob_drop_item.txt ve special_item_group.txt için geçerlidir.
Kod:
ACMD(do_reload) { char arg1[256]; one_argument(argument, arg1, sizeof(arg1)); #if def#ifd(E#ifLE_EXTENDED_RELOAD) const int FILE_NAME_LEN = 256; char szMOBDropItemFileName[FILE_NAME_LEN]; char szSpecialItemGroupFileName[FILE_NAME_LEN]; #endif [HASH=3]#endif[/HASH]f ([HASH=3]#endif[/HASH] switch (LOWER(*arg1)) { case 'u': ch->ChatPacket(CHAT_TYPE_INFO, "Reloading state_user_count"); LoadStateUserCount(); break; case 'a': ch->ChatPacket(CHAT_TYPE_INFO, "Reloading admin infomation"); db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0); sys_log(0, "Reloading admin infomation"); break; #if def#ifd(E#ifLE_EXTENDED_RELOAD) case 't': snprintf(szSpecialItemGroupFileName, sizeof(szSpecialItemGroupFileName), "%s/special_item_group.txt", LocaleService_GetBasePath().c_str()); ITEM_MANAGER::Instance().DestroyChestDropItem(); if (!ITEM_MANAGER::Instance().ReadSpecialDropItemFile(szSpecialItemGroupFileName)) { ch->ChatPacket(CHAT_TYPE_INFO, "Nu pot relua special_item_group.txt.."); return; } else { ch->ChatPacket(CHAT_TYPE_INFO, "special_item_group.txt reluat cu succes..."); } break; case 'm': snprintf(szMOBDropItemFileName, sizeof(szMOBDropItemFileName), "%s/mob_drop_item.txt", LocaleService_GetBasePath().c_str()); ITEM_MANAGER::Instance().DestroyMobDropItem(); if (!ITEM_MANAGER::Instance().ReadMonsterDropItemGroup(szMOBDropItemFileName)) { ch->ChatPacket(CHAT_TYPE_INFO, "Nu pot relua mob_drop_item.txt."); return; } else { ch->ChatPacket(CHAT_TYPE_INFO, "mob_drop_item.txt reluat cu succes..."); } break; #endif [HASH=3]#endif[/HASH] [HASH=3]#endif[/HASH] // cube // ·ÎÄà ÇÁ·Î¼¼½º¸¸ °»»êÇÑ´Ù. Cube_init (); break; } } else { ch->ChatPacket(CHAT_TYPE_INFO, "Reloading state_user_count"); LoadStateUserCount(); ch->ChatPacket(CHAT_TYPE_INFO, "Reloading prototype tables"); db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0); ch->ChatPacket(CHAT_TYPE_INFO, "Reloading notice string"); DBManager::instance().LoadDBString(); } }
Kod:
#if defined (ENABLE_EXTENDED_RELOAD) void ITEM_MANAGER::DestroyMobDropItem() { if (!m_map_pkMobItemGroup.empty()) m_map_pkMobItemGroup.clear(); if (!m_map_pkDropItemGroup.empty()) m_map_pkDropItemGroup.clear(); if (!m_map_pkLevelItemGroup.empty()) m_map_pkLevelItemGroup.clear(); if (!m_map_pkGloveItemGroup.empty()) m_map_pkGloveItemGroup.clear(); } void ITEM_MANAGER::DestroyChestDropItem() { if (!m_map_pkSpecialItemGroup.empty()) m_map_pkSpecialItemGroup.clear(); } #endif
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Kod:
#if defined(ENABLE_EXTENDED_RELOAD) void DestroyMobDropItem(); void DestroyChestDropItem(); #endif
İyi kullanımlar.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Reboot Atmadan Drop Ayarlama Sistemi (C++)
Metin2 özel sunucularında geliştirme yaparken bazı sistemleri dinamik olarak değiştirmek isteyebilirsiniz. Bu durumda sunucuyu yeniden başlatmadan bazı ayarlamaları gerçekleştirmek büyük kolaylık sağlar. Özellikle drop sistemleri gibi kritik yapılar üzerinde çalışırken reboot olmadan ayar yapabilmek hem zaman kazandırır hem de oyuncu deneyimini olumsuz etkilemez.
Drop Sistemi Nedir?
Drop sistemi, oyuncuların belirli NPC'leri yendikten sonra elde ettikleri ödüllerdir. Bu sistem, sunucu yöneticileri tarafından ayarlanabilir ve değişiklik yapılabilir. Standart olarak item düşme oranları, drop listeleri gibi ayarlar sunucunun config dosyasında bulunur. Ancak bu dosyayı değiştirdiğinizde sunucuyu yeniden başlatmanız gerekir.
Reboot Atmadan Değişiklik Yapmak
Sunucu aktifken drop ayarlarını değiştirebilmek için özel bir sistem geliştirmek gereklidir. Bu sistem genellikle C++ ile yazılır ve oyun sırasında sunucuya runtime komutları göndererek ayarların yeniden yüklenmesini sağlar. Bu sayede config dosyası üzerinde değişiklik yapıldığında sunucuyu yeniden başlatmaya gerek kalmaz.
C++ ile Uygulama
Öncelikle drop ayarlarını barındıran yapıyı bir fonksiyonla tekrar okutmak gerekir. Örneğin, drop_rate, item_vnum gibi değerler bir yapıda tutuluyorsa bu yapıya erişip değerleri güncellemek için bir komut sistemi yazmalısınız. Bu komutu admin panel üzerinden veya oyun içi bir komutla tetikleyebilirsiniz.
Örnek olarak: /reload_drops komutunu yazdığınızda, sistem drop ayarlarını tekrar okur ve hemen etkinleştirir. Bu işlem sırasında sunucuda herhangi bir kesinti olmaz.
Dikkat Edilmesi Gerekenler
Bu tip sistemler yazarken hata kontrolü çok önemlidir. Yanlış bir config dosyası yüklendiğinde sunucu çökmesin diye gerekli kontroller yapılmalıdır. Ayrıca, yapılan değişikliklerin loglanması da güvenlik açısından faydalıdır.
Avantajları
- Sunucu kesintisi olmadan ayar değişikliği yapılabilir.
- Oyuncuların oyun deneyimi bozulmaz.
- Geliştirici açısından esneklik sağlar.
- Hızlı test ve geri bildirim alınabilir.
Sonuç
Reboot atmadan drop ayarları gibi sistemleri değiştirebilmek, Metin2 özel sunucu geliştiricileri için oldukça faydalı bir özelliktir. Bu tarz sistemler C++ bilgisiyle kolayca entegre edilebilir ve sunucu yönetimi daha verimli hale getirilebilir.
Drop Adjustment System Without Reboot (C++)
When developing Metin2 private servers, you may want to dynamically change certain systems. In such cases, adjusting settings without restarting the server can be very convenient. Especially when working on critical structures like drop systems, being able to configure them without rebooting saves time and avoids negatively impacting player experience.
What Is a Drop System?
The drop system refers to rewards players receive after defeating specific NPCs. This system can be configured by server administrators and adjusted as needed. By default, item drop rates and drop lists are located in the server's config file. However, changing this file requires restarting the server.
Making Changes Without Rebooting
To modify drop settings while the server is active, you need to develop a custom system. This system is typically written in C++ and reloads settings via runtime commands sent to the server. This way, there is no need to restart the server when changes are made to the configuration file.
Implementation with C++
Firstly, you must create a function that reloads the structure holding the drop settings. For example, if values such as drop_rate and item_vnum are stored within a structure, you need to access and update that structure via a command system. You can trigger this command either through an admin panel or an in-game command.
As an example: typing the command /reload_drops will cause the system to reload the drop settings and activate them immediately. During this process, there will be no interruption on the server.
Important Considerations
Error handling is crucial when implementing such systems. Necessary checks should be performed so that the server does not crash due to an incorrect config file. Additionally, logging the changes made is beneficial for security purposes.
Advantages
- Settings can be changed without server downtime.
- Player gaming experience remains uninterrupted.
- Offers flexibility for developers.
- Enables quick testing and feedback.
Conclusion
Being able to adjust drop settings and similar systems without rebooting is highly beneficial for Metin2 private server developers. Such systems can easily be integrated with C++ knowledge, making server management more efficient.
