Oncelikle merhaba iyi forumlar,yabancı forumda gördügüm Hızlı Kanal Degistirme Sistemini Paylasacagim.Sistem game'nize göre calıstıgı ıcın sorunsuzdur.
Not:[/FONT] Önceden paylasıldıysa söyleyin editliyeyim.Bu aralar yogunum paylaşılan konulara bakmaya fırsatım olmuyor.
game/src > cmd.cpp acilir aratilir :
altina eklenir:
tekrar aratılır:
altina eklenir :
game/src > cmd_general.cpp acilir ve aratilir :
Not:[/FONT] Önceden paylasıldıysa söyleyin editliyeyim.Bu aralar yogunum paylaşılan konulara bakmaya fırsatım olmuyor.
game/src > cmd.cpp acilir aratilir :
Kod:
ACMD(do_warp);
altina eklenir:
Kod:
ACMD(do_channel_switch);
tekrar aratılır:
Kod:
{ "mall_close", do_mall_close, 0, POS_DEAD, GM_PLAYER },
altina eklenir :
Kod:
{ "channel", do_channel_switch, 0, POS_DEAD, GM_PLAYER },
game/src > cmd_general.cpp acilir ve aratilir :
Kod:
ACMD(do_set_run_mode)
Kod:
{ ch->SetNowWalking(false); ch->SetWalking(false); [CENTER] }[/CENTER]
altina eklenir
Kod:
ACMD(do_channel_switch)
Kod:
{ char arg1[256]; one_argument(argument, arg1, sizeof(arg1)); if (!*arg1) return; int new_ch; str_to_number(new_ch, arg1); if( new_ch <1 || new_ch >4) // REPLACE 2 WITH YOUR MAX_CHANNEL return; if (!ch->IsPC()) return; ch->ChannelSwitch(new_ch); [CENTER] }[/CENTER]
game/src > char.h acilir ve aratilir :
Kod:
void StartWarpNPCEvent();
altina eklenir :
Kod:
void ChannelSwitch(int new_ch);
game/src > char.cpp acilir ve aratilir:
Kod:
EVENTFUNC(warp_npc_event)
Kod:
{ char_event_info* info = dynamic_cast<char_event_info*>( event->info ); if ( info == NULL ) { sys_err( "warp_npc_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { // <Factor> return 0; } if (!ch->GetSectree()) { ch->m_pkWarpNPCEvent = NULL; return 0; } FuncCheckWarp f(ch); if (f.Valid()) ch->GetSectree()->ForEachAround(f); return passes_per_sec / 2; [CENTER] }[/CENTER]
altina eklenir :
Kod:
void CHARACTER::ChannelSwitch(int new_ch){
Kod:
long lAddr; long lMapIndex; WORD wPort; long x = this->GetX(); long y = this->GetY(); if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort)) { sys_err("cannot find map location index %d x %d y %d name %s", lMapIndex, x, y, GetName()); return; } if(lMapIndex >= 10000){ return; } std::map<WORD, int>micha; for(int i = 0; i < 4; i++){ //replace with maximum channels -1 actual 1300x - 1330x for(int i2 = 2; i2 < 9; i2++){ //replace with your core values actual 13x02 - 13x08 micha[13*1000 + i*100 + i2] = i+1; } } //micha[13002] = 1; int chan; if(micha.find(wPort) != micha.end()){ chan = micha[wPort]; }else{return;} Stop(); Save(); if(GetSectree()){ GetSectree()->RemoveEntity(this); ViewCleanup(); EncodeRemovePacket(this); } TPacketGCWarp p; p.bHeader = HEADER_GC_WARP; p.lX = x; p.lY = y; p.lAddr = lAddr; p.wPort = (wPort - 100*(chan-1) + 100*(new_ch-1)); sys_err("x : %d y: %d, addr: %d, port: %d , newPort: %d", x, y, lAddr, wPort, (wPort - 100*chan + 100*new_ch)); GetDesc()->Packet(&p, sizeof(TPacketGCWarp)); [CENTER] }[/CENTER]
source ile işimiz bitti simdi gecelim client'e.
root > game.py acilir ve aratilir :
Kod:
onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
altina eklenir :
Kod:
onPressKeyDict[app.DIK_F7] = lambda : self.__switch_channel()
game.py'nin en altına gelip eklenir :
Kod:
def __switch_channel(self):[/CENTER] import uiChannel a = uiChannel.ChannelChanger() [CENTER] a.Show()
ve uiChannel.py root'un icine atilir bu kadar.
Teşekkürler.
İndir :
Kod:
http://dosya.co/qdvbhrintrq1/H%C4%B1zl%C4%B1_Kanal_rMelih.rar.html
Kod:
https://www.virustotal.com/tr/url/50770556cf40f2cf11a22aae991476cbfb48c83470d7f4f143e9f18aa2e7bef4/analysis/1458584484/
[C++ - Python]Ingame Channel Game Uzerinden | rMelih
Metin2 özel sunucuları üzerinde geliştirme yaparken C++ ve Python dilleri büyük önem taşır. Bu iki dil, hem sunucu tarafında (Game Server) hem de istemci tarafında (Client Side) birçok sistemin çalışmasını sağlar. Bu yazıda özellikle Ingame Channel Game üzerinden nasıl entegrasyon yapılabileceğini, rMelih adlı geliştirici örneğiyle ele alacağız.
Ingame Channel Game Nedir?
Ingame Channel Game, oyuncuların belirli kanallarda özel etkinlikler, turnuvalar ya da özel sistemlerle etkileşim kurduğu dinamik yapılardır. Bu yapılar sayesinde sunucu yöneticileri, oyuncuların aktif kalmasını sağlayabilir ve PvP sistemlerini daha da zenginleştirebilirler. Bu kanallar genellikle Python ile yazılmış arayüzler (UI Script) ile kontrol edilir ve C++ tarafında sunucu mantığıyla entegre çalışır.
C++ Tarafında Kanal Sistemi Entegrasyonu
Metin2 sunucu kaynak kodlarında (Game Server SRC), kanal sistemi genellikle C++ ile yazılmıştır. Bu sistem, oyuncuların belirli bir kanala girip özel oyun modlarına erişmesini sağlar. ChannelManager gibi sınıflar yardımıyla farklı kanallar oluşturulabilir ve oyuncular bu kanallara yönlendirilebilir. rMelih tarzı geliştiriciler, bu yapıları kendi özel PvP sistemlerine entegre ederek benzersiz deneyimler yaratır.
Python Tarafında UI Entegrasyonu
Python tarafında, UIScript ve Py Root dosyaları ile oyuncuya görsel arayüzler sunulur. Ingame kanal sistemine özel bir menü, buton veya sayaç tasarımı yapılabilir. PyGUI kullanılarak kullanıcı dostu arayüzler geliştirilir ve bu arayüzler Game Server'dan gelen verilerle beslenir. Örneğin, bir kanalda kaç oyuncu olduğu, hangi aktivitenin aktif olduğu gibi bilgiler gerçek zamanlı olarak güncellenebilir.
Database (DB) Entegrasyonu
Kanal oyunları için özel verilerin tutulması gerekebilir. Bu veriler genellikle Auth veya Game DB içinde saklanır. Oyuncu istatistikleri, skorlar, kanal aktiviteleri gibi veriler için özel tablolar tasarlanabilir. MySQL veya PostgreSQL gibi veritabanları ile bu süreç yönetilebilir. rMelih gibi deneyimli geliştiriciler, bu yapıları optimize ederek sunucu performansını artırabilir.
Martysama ve Diğer Geliştirici Kaynakları
Metin2 özel sunucu geliştirme konusunda Martysama gibi isimler, topluluk için önemli referanslardır. Onların sunduğu SRC dosyaları, C++ ve Python örnekleri, geliştiricilerin projelerini hızlandırır. rMelih'in geliştirdiği sistemler de bu tarz kaynaklardan esinlenebilir veya doğrudan entegre edilebilir. Metin2Dev ve benzeri platformlar bu altyapıyı paylaşan topluluklardır.
PvP Sistemleri ve Kanal Oyunları
PvP sistemleri, Metin2 özel sunucularının can damarıdır. Ingame kanallar üzerinden turnuva, arena, capture the flag gibi özel etkinlikler organize edilebilir. Bu sistemler, hem C++ hem de Python tarafında detaylı kodlamayı gerektirir. rMelih gibi geliştiriciler, bu sistemleri özel algoritmalarla güçlendirerek PvP deneyimini daha rekabetçi hale getirir.
Sonuç
Metin2 özel sunucularında Ingame Channel Game sistemleri, hem teknik hem de kullanıcı deneyimi açısından oldukça değerlidir. C++ ve Python dillerinin uyumlu kullanımı, bu sistemlerin güçlü ve stabil çalışmasını sağlar. rMelih tarzı geliştiricilerin katkılarıyla, bu sistemler daha da gelişecek ve Metin2 topluluğu için yenilikçi çözümler sunacaktır.
[C++ - Python]Ingame Channel Game Over | rMelih
When developing custom Metin2 servers, the C++ and Python languages are of great importance. These two languages enable many systems to operate both on the server side (Game Server) and the client side (Client Side). In this article, we will particularly examine how integration can be done through Ingame Channel Game, using the example of the developer rMelih.
What Is Ingame Channel Game?
Ingame Channel Game refers to dynamic structures where players interact with special events, tournaments, or custom systems within specific channels. These structures allow server administrators to keep players active and enrich PvP systems. These channels are usually controlled via interfaces written in Python (UI Script) and integrated with server logic on the C++ side.
Integration of Channel System on C++ Side
In the Metin2 server source codes (Game Server SRC), the channel system is typically coded in C++. This system allows players to enter certain channels and access special game modes. Classes like ChannelManager allow different channels to be created and players to be directed to these channels. Developers like rMelih integrate these structures into their own custom PvP systems to create unique experiences.
UI Integration on Python Side
On the Python side, visual interfaces are provided to players via UIScript and Py Root files. Special menus, buttons, or counters can be designed for the Ingame channel system. User-friendly interfaces can be developed using PyGUI, and these interfaces can be updated with data received from the Game Server. For example, real-time updates such as how many players are in a channel or which activity is active can be displayed.
Database (DB) Integration
Special data may need to be stored for channel games. This data is generally stored in Auth or Game DB. Custom tables can be designed for player statistics, scores, and channel activities. These processes can be managed using databases like MySQL or PostgreSQL. Experienced developers like rMelih can optimize these structures to enhance server performance.
Martysama and Other Developer Resources
Within the realm of custom Metin2 server development, names like Martysama are important references for the community. Their provided SRC files, C++ and Python examples accelerate other developers' projects. Systems developed by rMelih might draw inspiration from or directly integrate such resources. Platforms like Metin2Dev serve as communities sharing such infrastructure.
PvP Systems and Channel Games
PvP systems are the heartbeat of custom Metin2 servers. Special events like tournaments, arenas, and capture the flag can be organized through Ingame channels. These systems require detailed coding on both C++ and Python sides. Developers like rMelih strengthen these systems with custom algorithms, making the PvP experience more competitive.
Conclusion
Ingame Channel Game systems in custom Metin2 servers are highly valuable both technically and in terms of user experience. The harmonious use of C++ and Python ensures that these systems run robustly and stably. With contributions from developers like rMelih, these systems will continue to evolve and offer innovative solutions for the Metin2 community.
