Envanterdeki itemshop butonu üzerinde yaptım değişiklikleri ekstra bir buton eklemedim bunu belirtiyim. İsteyen game.py ye ekleyerek herhangi bi tuşa atayabilir bunu size kalmış. Yada taskbara buton olarak ekleyin.
Bu paylaştığım son konudur.
Game Src Kısmı:
Öncelikle char.cpp açılır ve alttaki kısım silinir yada etkisiz hale getirilir.
Açılır: cmd.cpp
Aratılır:
Altına Eklenir:
Tekrar Aratılır:
Altına Eklenir:
______________________________
Açılır: cmd_general.cpp
Aratılır:
Kod Bloğunun Altına Eklenir:
_____________________________
Pack Kısmı.
Açılır: uiinventory.py
Aratılır:
Kod Bloğu Full Değiştirilir:
Açılır: interfacemodule.py
Aratılır:
Altına Eklenir:
Metin2 Özel Sunucularında ItemShop / Depoyu Aç / Şehire Dön Butonu Sistemi
Metin2 özel sunucuları geliştirmek isteyen geliştiriciler için önemli konulardan birisi kullanıcı deneyimini artıran sistemlerdir. Bu sistemlerden biri de ItemShop / Depoyu Aç / Şehire Dön butonudur. Bu yazıda, hem C++ hem de Python tarafında nasıl bu sistemin entegre edileceğini adım adım inceleyeceğiz.
ItemShop / Depoyu Aç / Şehire Dön Nedir?
Bu sistem, oyuncuların hızlıca markete gitmeden eşya satın alabilmesi, depolarını açıp kapanabilmesi ve şehre kolayca dönebilmesi için geliştirilmiş bir GUI arayüzüdür. Özellikle PvP sunucularında bu tür kolaylıklar büyük avantaj sağlar.
Python Tarafında UI Script Geliştirme
Python tarafında bu butonları oluşturmak için uiscript dosyalarını kullanmalısınız. Öncelikle bir root dosyası oluşturup, butonların konumlarını, boyutlarını ve işlevlerini tanımlamalısınız. PyGUI kütüphanesi sayesinde butonlara tıklama olayları ekleyebilirsiniz. Örneğin;
Depo Aç Butonu: Oyuncunun depo arayüzünü açar. Bu işlem için game sunucusuna bir paket gönderilir ve sunucu bu isteği karşılayarak depo arayüzünü açar.
ItemShop Aç Butonu: Oyuncuya özel bir market arayüzü sunar. Burada özel itemler satılır veya satılık özel efektler verilir. Bu da game sunucusu ile koordineli çalışır.
Şehre Dön Butonu: Oyuncuyu bulunduğu lokasyondan belirli bir şehre ışınlar. Bu işlem genellikle bir zaman bekleme süresiyle yapılır.
C++ Tarafında Game Sunucu Entegrasyonu
Oyuncudan gelen buton tıklamaları, game server tarafından karşılanmalıdır. Bu işlemler için src dosyalarında özel fonksiyonlar yazmanız gerekir. Örneğin, ItemShop için bir paket tanımlaması yapabilirsiniz:
UYARI: Paket tanımlamaları sırasında hatalar oluşabilir. Doğru tanımlamalar yapılmazsa sistem çalışmaz. Paket boyutu, türü ve_checksum kontrolleri yapılmalıdır.
Sistem Güvenliği ve Hile Önleme
Bu tür sistemlerde en çok dikkat edilmesi gereken konulardan biri güvenlik ve hile önlemedir. Örneğin, bir oyuncu butona çok hızlı basarak istismar yapmaya çalışabilir. Bu durumu engellemek için butonlara bekleme süresi (cooldown) eklenmelidir.
Cooldown Mekanizması:
Her buton tıklamasından sonra belirli bir süre boyunca tekrar tıklanmasını engelleyen bir mekanizma kurulmalıdır. Bu, Python tarafında zaman kontrolü ile yapılabilir.
Sistem Kurulumu ve Test
Bu sistemi kurduktan sonra test aşaması oldukça önemlidir. Her butonun çalıştığını, hata alınmadığını ve sistemsel sorun yaşamadığınızdan emin olmalısınız. Auth ve Game sunucuları arasında bağlantı kontrolü yapılmalıdır.
Sonuç:
ItemShop / Depoyu Aç / Şehire Dön buton sistemi, Metin2 özel sunucularında kullanıcı memnuniyetini artırır. Hem C++ hem de Python tarafında doğru entegrasyon ile sisteminizi daha profesyonel hale getirebilirsiniz.
ItemShop / Open Depot / Return to City Button System in Metin2 Private Servers
One of the important topics for developers who want to improve Metin2 private servers is the systems that enhance user experience. One such system is the ItemShop / Open Depot / Return to City button. In this article, we will examine step-by-step how this system can be integrated on both the C++ and Python sides.
What Is ItemShop / Open Depot / Return to City?
This system provides players with a GUI interface allowing them to purchase items without going to the marketplace, open and close their depot, and return to the city easily. Such conveniences provide great advantages especially on PvP servers.
Developing UI Scripts in Python
To create these buttons in Python, you need to use uiscript files. First, create a root file defining the positions, sizes, and functions of the buttons. With the PyGUI library, you can add click events to the buttons. For example;
Open Depot Button: Opens the player's depot interface. A packet is sent to the game server, which responds by opening the depot interface.
Open ItemShop Button: Provides a custom market interface for the player. Special items can be sold here, or special effects provided. This works in coordination with the game server.
Return to City Button: Teleports the player from their current location to a specific city. Usually, this process includes a waiting period.
Integration with the Game Server in C++
Button clicks from the player must be handled by the game server. For these operations, you need to write custom functions in your src files. For example, for ItemShop, you can define a packet:
WARNING: Errors may occur during packet definitions. If proper definitions are not made, the system will not work. Packet size, type, and checksum checks must be performed.
System Security and Anti-Cheat
Security and anti-cheat measures are critical in such systems. For example, a player might rapidly click a button to exploit the system. To prevent this, cooldown periods should be added to the buttons.
Cooldown Mechanism:
After each button click, a mechanism should prevent clicking again for a certain duration. This can be implemented in Python using time controls.
Installation and Testing
After installing this system, the testing phase is crucial. Ensure all buttons function correctly, no errors occur, and there are no system issues. Connections between Auth and Game servers must be checked.
Conclusion:
The ItemShop / Open Depot / Return to City button system enhances user satisfaction in Metin2 private servers. With correct integration on both C++ and Python sides, you can make your system more professional.
Bu paylaştığım son konudur.
Game Src Kısmı:
Öncelikle char.cpp açılır ve alttaki kısım silinir yada etkisiz hale getirilir.
Kod:
else if (GetDistanceFromSafeboxOpen() > 1000) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<â°í> °Å¸®°¡ ¸Ö¾î¼* â°í¸¦ ¿* ¼ö ¾ø½À´Ï´Ù.")); return; }
Açılır: cmd.cpp
Aratılır:
Kod:
ACMD(do_click_mall);
Kod:
ACMD(do_click_safebox); ACMD(do_click_town);
Tekrar Aratılır:
Kod:
{ "click_mall", do_click_mall, 0, POS_DEAD, GM_PLAYER },
Kod:
{ "click_safebox", do_click_safebox, 0, POS_DEAD, GM_PLAYER }, { "click_town", do_click_town, 0, POS_DEAD, GM_PLAYER },
______________________________
Açılır: cmd_general.cpp
Aratılır:
Kod:
ACMD(do_click_mall)
Kod Bloğunun Altına Eklenir:
Kod:
ACMD(do_click_town) { ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); } ACMD(do_click_safebox) { ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeSafeboxPassword"); }
Pack Kısmı.
Açılır: uiinventory.py
Aratılır:
Kod:
def ClickMallButton(self):
Kod Bloğu Full Değiştirilir:
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Açılır: interfacemodule.py
Aratılır:
Kod:
IsQBHide = 0
Kod:
statutahta1 = 0
Metin2 Özel Sunucularında ItemShop / Depoyu Aç / Şehire Dön Butonu Sistemi
Metin2 özel sunucuları geliştirmek isteyen geliştiriciler için önemli konulardan birisi kullanıcı deneyimini artıran sistemlerdir. Bu sistemlerden biri de ItemShop / Depoyu Aç / Şehire Dön butonudur. Bu yazıda, hem C++ hem de Python tarafında nasıl bu sistemin entegre edileceğini adım adım inceleyeceğiz.
ItemShop / Depoyu Aç / Şehire Dön Nedir?
Bu sistem, oyuncuların hızlıca markete gitmeden eşya satın alabilmesi, depolarını açıp kapanabilmesi ve şehre kolayca dönebilmesi için geliştirilmiş bir GUI arayüzüdür. Özellikle PvP sunucularında bu tür kolaylıklar büyük avantaj sağlar.
Python Tarafında UI Script Geliştirme
Python tarafında bu butonları oluşturmak için uiscript dosyalarını kullanmalısınız. Öncelikle bir root dosyası oluşturup, butonların konumlarını, boyutlarını ve işlevlerini tanımlamalısınız. PyGUI kütüphanesi sayesinde butonlara tıklama olayları ekleyebilirsiniz. Örneğin;
Depo Aç Butonu: Oyuncunun depo arayüzünü açar. Bu işlem için game sunucusuna bir paket gönderilir ve sunucu bu isteği karşılayarak depo arayüzünü açar.
ItemShop Aç Butonu: Oyuncuya özel bir market arayüzü sunar. Burada özel itemler satılır veya satılık özel efektler verilir. Bu da game sunucusu ile koordineli çalışır.
Şehre Dön Butonu: Oyuncuyu bulunduğu lokasyondan belirli bir şehre ışınlar. Bu işlem genellikle bir zaman bekleme süresiyle yapılır.
C++ Tarafında Game Sunucu Entegrasyonu
Oyuncudan gelen buton tıklamaları, game server tarafından karşılanmalıdır. Bu işlemler için src dosyalarında özel fonksiyonlar yazmanız gerekir. Örneğin, ItemShop için bir paket tanımlaması yapabilirsiniz:
Kod:
[B]HEADER_DEFINE_ITEMSHOP_PACKET[/B][BR][/BR][B]void PacketHandler::HandleItemShopRequest(LPCHARACTER ch, TPacketGCHandler packet)[/B][BR][/BR][B]{[/B][BR][/BR][B] // Handle shop open request[/B][BR][/BR][B] ch->OpenItemShop();[/B][BR][/BR][B]}[/B]
UYARI: Paket tanımlamaları sırasında hatalar oluşabilir. Doğru tanımlamalar yapılmazsa sistem çalışmaz. Paket boyutu, türü ve_checksum kontrolleri yapılmalıdır.
Sistem Güvenliği ve Hile Önleme
Bu tür sistemlerde en çok dikkat edilmesi gereken konulardan biri güvenlik ve hile önlemedir. Örneğin, bir oyuncu butona çok hızlı basarak istismar yapmaya çalışabilir. Bu durumu engellemek için butonlara bekleme süresi (cooldown) eklenmelidir.
Cooldown Mekanizması:
Her buton tıklamasından sonra belirli bir süre boyunca tekrar tıklanmasını engelleyen bir mekanizma kurulmalıdır. Bu, Python tarafında zaman kontrolü ile yapılabilir.
Sistem Kurulumu ve Test
Bu sistemi kurduktan sonra test aşaması oldukça önemlidir. Her butonun çalıştığını, hata alınmadığını ve sistemsel sorun yaşamadığınızdan emin olmalısınız. Auth ve Game sunucuları arasında bağlantı kontrolü yapılmalıdır.
Sonuç:
ItemShop / Depoyu Aç / Şehire Dön buton sistemi, Metin2 özel sunucularında kullanıcı memnuniyetini artırır. Hem C++ hem de Python tarafında doğru entegrasyon ile sisteminizi daha profesyonel hale getirebilirsiniz.
ItemShop / Open Depot / Return to City Button System in Metin2 Private Servers
One of the important topics for developers who want to improve Metin2 private servers is the systems that enhance user experience. One such system is the ItemShop / Open Depot / Return to City button. In this article, we will examine step-by-step how this system can be integrated on both the C++ and Python sides.
What Is ItemShop / Open Depot / Return to City?
This system provides players with a GUI interface allowing them to purchase items without going to the marketplace, open and close their depot, and return to the city easily. Such conveniences provide great advantages especially on PvP servers.
Developing UI Scripts in Python
To create these buttons in Python, you need to use uiscript files. First, create a root file defining the positions, sizes, and functions of the buttons. With the PyGUI library, you can add click events to the buttons. For example;
Open Depot Button: Opens the player's depot interface. A packet is sent to the game server, which responds by opening the depot interface.
Open ItemShop Button: Provides a custom market interface for the player. Special items can be sold here, or special effects provided. This works in coordination with the game server.
Return to City Button: Teleports the player from their current location to a specific city. Usually, this process includes a waiting period.
Integration with the Game Server in C++
Button clicks from the player must be handled by the game server. For these operations, you need to write custom functions in your src files. For example, for ItemShop, you can define a packet:
Kod:
[B]HEADER_DEFINE_ITEMSHOP_PACKET[/B][BR][/BR][B]void PacketHandler::HandleItemShopRequest(LPCHARACTER ch, TPacketGCHandler packet)[/B][BR][/BR][B]{[/B][BR][/BR][B] // Handle shop open request[/B][BR][/BR][B] ch->OpenItemShop();[/B][BR][/BR][B]}[/B]
WARNING: Errors may occur during packet definitions. If proper definitions are not made, the system will not work. Packet size, type, and checksum checks must be performed.
System Security and Anti-Cheat
Security and anti-cheat measures are critical in such systems. For example, a player might rapidly click a button to exploit the system. To prevent this, cooldown periods should be added to the buttons.
Cooldown Mechanism:
After each button click, a mechanism should prevent clicking again for a certain duration. This can be implemented in Python using time controls.
Installation and Testing
After installing this system, the testing phase is crucial. Ensure all buttons function correctly, no errors occur, and there are no system issues. Connections between Auth and Game servers must be checked.
Conclusion:
The ItemShop / Open Depot / Return to City button system enhances user satisfaction in Metin2 private servers. With correct integration on both C++ and Python sides, you can make your system more professional.
