C++ Duello Sistemi (Game.core)

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Üzerinde çalışırken tesadüfen bulduğum ve duello atarken karşı tarafa ticaret yollayınca yüksek onlinelerde core veren bir açık bulduk. Uzun uğraşlarım sonucunda çözümünü buldum. Vegas duello sistemini kodlarken tahminimce bir hata yapmış çünkü orjinal dosyalarındada bu şekilde. Herneyse, oyunda normal bir şekilde duello atarken core vermez ancak yüksek onlinelerde her 30 dakikada bir core yemeniz mümkün bir durumdur. Tanımlamadaki son sayıyı vermediğinden dolayı 9 sayısını bulamıyor. Bu arada unutmadan söyleyeyim Bunu yaptıktan sonra sorunun oyunumda çözüldüğünüde belirtmek isterim. Herneyse çözüm için tek yapmanız gereken şu şekilde;

vP6WVA.png


Burada 9 değeri pkChr->GetQuestFlag olarak atanmamış gördüğünüz gibi sayı 8 fakat 9.sayıyı aşağıda vermemiş 639.satıra gidip (pkChr->GetQuestFlag(szTableStaticPvP[8])) yanına şunu ekleyin.

Kod:
,(pkChr->GetQuestFlag(szTableStaticPvP[9]))

Game.core şu şekilde (yukarda çözümü mevcut)
Sorunun char.cpp'de olduğunu söylüyor çünkü
pvp.cpp'de yapılan tanımlama 8 değer görüyor ama
char.cpp 9 değer gördüğü için game.core'de onu suçluyor işte;
Kod:
#1  0x08221c21 in quest::PC::GetFlag (this=0x0, name=@0xffff9d1c) at stl_map.h:542 No locals. #2  0x0807e3ac in CHARACTER::GetDuel (this=0x42cdd800, type=0x846dbc9 "BlockExchange")     at char.cpp:6923 No locals. #3  0x08144dd0 in CHARACTER::ExchangeStart (this=0x30792800, victim=0x42cdd800) at exchange.cpp:74 No locals. #4  0x0817f3e2 in CInputMain::Analyze (this=0x563c289c, d=0x563c2800,     bHeader=<value optimized out>, c_pData=0x54dde380 "\033") at input_main.cpp:3683         ch = 0x30792800         iExtraLen = <value optimized out>         __FUNCTION__ = "Analyze" #5  0x08162f8b in CInputProcessor::Process (this=0x563c289c, lpDesc=0x563c2800,     c_pvOrig=0x54dde380, iBytes=30, r_iBytesProceed=@0xffffa274) at input.cpp:108         iExtraPacketSize = <value optimized out>         bHeader = 27 '\033'         c_pszName = 0x33d4906c "Exchange"         c_pData = 0x54dde380 "\033"         bLastHeader = <value optimized out>         iLastPacketLen = 0         iPacketLen = 15         __FUNCTION__ = "Process" #6  0x0812a3f3 in DESC::ProcessInput (this=0x563c2800) at desc.cpp:303         iBytesProceed = 0         bytes_read = 30         __FUNCTION__ = "ProcessInput" #7  0x082bead4 in io_loop (fdw=0x29161b80) at main.cpp:1072 ---Type <return> to continue, or q <return> to quit---Quit

C++ Duello Sistemi (Game.core)


Metin2 özel sunucularında PvP odaklı sistemlerden biri olan C++ Duello Sistemi, oyuncuların istek üzerine birbirleriyle adil dövüşmesini sağlayan güçlü bir yapıdır. Bu sistem, game.core üzerinden entegre edilerek sunucu tarafında çalışır ve yüksek performans sunar. Metin2lobby.com olarak bu sistem üzerindeki deneyimimizi paylaşarak, geliştiricilere ve sunucu sahiplerine rehberlik etmeyi amaçlıyoruz.

C++ Duello Sisteminin Temelleri
C++ dilinde yazılmış bu sistem, Metin2 server src üzerinde çalışır. Sunucu tarafında tanımlanan komutlar sayesinde iki oyuncu arasında özel bir arena ortamı oluşturulur. Bu sistem, PvP odaklı sunucularda PvP sistem olarak öne çıkar. Oyuncular /duello gibi bir komutla diğer oyuncuya meydan okuyabilir. Eğer karşı taraf kabul ederse, belirlenen arena haritasına yönlendirilirler. Bu esnada, PvP kuralları aktif hale gelir ve iki oyuncu arasında adil bir mücadele başlar.

Sistem Mimarisi ve Kodlama
Sistem, game server programming kapsamında tasarlanmıştır. C++ kaynak kod yapısı sayesinde performans kaybı yaşanmaz. Core yapıya entegre edilirken, db core ile veri takibi sağlanır. Örneğin, duel skorları, kazanma/mağlubiyet oranları gibi veriler veritabanında tutulur. Bu sayede sistem, uzun vadeli oyuncu istatistiklerini de yönetebilir. Ayrıca, source edit işlemleri ile sistem isteğe göre özelleştirilebilir. C++ script dosyaları üzerinden, özel efektler, ödül sistemleri ve zamanlayıcılar eklenebilir.

Duello Arena Özellikleri
Arena ortamı, PvP sistemlerinde kritik öneme sahiptir. C++ Duello Sistemi, özel bir harita üzerinde duel oynamayı sağlar. Bu harita, client src tarafında özel efektlerle desteklenir. Oyuncular arena içine girdiğinde, dış dünyadan izole edilir ve sadece duel kuralları geçerli olur. Arena içinde HP/MP yenilenmesi, özel güçlendirici item'ler veya zaman sınırlaması gibi özellikler ayarlanabilir. Bu sayede her duel, farklı stratejilerle şekillenir.

Ödül ve Skor Sistemi
Her duel sonunda kazanan oyuncu, py root üzerinden belirlenen ödül sistemine göre ödüllendirilir. Bu ödüller, pack içinde özel item'ler, EXP, gold veya özel efektler olabilir. Aynı zamanda db üzerinde tutulan skorlar sayesinde, oyuncuların duel istatistikleri görüntülenebilir. Bu, sunucuda bir sıralama sistemi olarak da kullanılabilir. Sistem aynı zamanda Python system ile entegre çalışarak, GUI tabanlı yönetim panelleri ile yönetilebilir. Py GUI arayüzü sayesinde, sunucu sahipleri kolayca ayarlamalar yapabilir.

Geliştirme ve Test Süreci
Bu tür sistemlerin geliştirilmesi sırasında, Metin2 compile süreci önemlidir. Kodların doğru derlenmesi ve test ortamında kontrol edilmesi gerekir. Geliştirme sırasında Martysama gibi tanınmış kaynaklardan yararlanmak, hata ayıklamayı kolaylaştırır. Metin2 development sürecinde, hem auth hem de game sunucularında senkronizasyon sağlanmalıdır. Metin2dev toplulukları, bu konularda destek sağlar. Game core üzerinde yapılan değişiklikler, tüm sunucuyu etkileyebileceğinden dikkatle yapılmalıdır. DB ve game verileri uyumlu olmalıdır. UIScript ile istemci tarafında da görsel destek verilmelidir.


C++ Duel System (Game.core)


The C++ Duel System is one of the PvP-focused systems used in Metin2 private servers that allows players to engage in fair combat upon request. This system operates on game.core and provides high performance. At Metin2lobby.com, we aim to guide developers and server owners by sharing our experience with this system.

Fundamentals of the C++ Duel System
Written in C++, this system works on Metin2 server src. Through commands defined on the server side, a special arena environment is created between two players. In PvP-oriented servers, this system stands out as a PvP system. Players can challenge another player with a command like /duel. If the opponent accepts, they are transferred to the designated arena map. During this process, PvP rules become active and a fair fight begins between the two players.

System Architecture and Coding
Designed within the scope of game server programming, the system runs without performance loss thanks to its C++ source code structure. When integrated into the core architecture, data tracking is achieved via db core. For example, duel scores, win/loss ratios, etc. are stored in the database. This enables the system to manage long-term player statistics as well. Additionally, through source edit operations, the system can be customized according to needs. Special effects, reward systems, and timers can be added via C++ script files.

Duel Arena Features
The arena environment is critically important in PvP systems. The C++ Duel System allows dueling on a custom map. This map is supported by special effects on the client src side. Once players enter the arena, they are isolated from the outside world and only duel rules apply. Inside the arena, features such as HP/MP regeneration, special buff items, or time limits can be configured. This allows each duel to unfold with different strategies.

Reward and Score System
After every duel, the winning player is rewarded according to the reward system defined in py root. These rewards can include special items inside a pack, EXP, gold, or special effects. Meanwhile, score tracking maintained in the db allows players' duel statistics to be viewed. This can also be used as a ranking system on the server. The system can also operate integrated with Python system and be managed through GUI-based control panels. With the Py GUI interface, server owners can easily make adjustments.

Development and Testing Process
During the development of such systems, the Metin2 compile process is crucial. Correct compilation of codes and testing them in a test environment are required. During development, using resources like Martysama can ease debugging. In the Metin2 development process, synchronization must be ensured in both auth and game servers. Communities like Metin2dev provide support for these topics. Changes made on game core should be done carefully since they may affect the entire server. DB and game data must be compatible. Visual support should also be provided on the client side through UIScript.
 

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

Benzer konular

Geri
Üst Alt