Clinet Build Etmeden Debug Bilgilerini Görme

  • 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
Merhabalar bugün python taraflı dosyalara göz atarken ufak bir detay farkettim bileniniz vardır elbette bu işle içli dışlı olanız bilmeyenler için yardımcı olma amacıyla paylaşımda bulunmak istedim.

İlk önce Root>Game.py açıyoruz;

isShowDebugInfo kodunu TRUE olarak değiştiriyoruz.
Clinet Build Etmeden Debug Bilgilerini Görme


Metin2 özel sunucu geliştirme sürecinde, özellikle istemci tarafında (client-side) debug işlemleri oldukça kritik bir rol oynar.
Ancak birçok geliştirici, client build işlemini gerçekleştirmeden debug çıktılarını nasıl görüntüleyebileceğini merak eder.
Bu yazıda, client build etmeden nasıl debug bilgilerini görebileceğinizi detaylıca anlatacağız.

Client Tarafında Debug Nedir?
Client tarafında debug, oyun istemcisinin çalışması sırasında oluşan hataları, veri akışlarını ve sistem durumlarını takip etmeyi sağlar.
Genellikle C++ tabanlı client kaynak kodları üzerinde çalışırken, geliştiriciler loglama sistemleri veya debug mesajları ile hata ayıklama yapar.
Ancak bazı durumlarda client'i yeniden derlemek istenmez ya da mümkün olmayabilir.

Python ve Uiscript Üzerinden Debug
Metin2 client tarafında UI'lar genellikle Python dilinde yazılmıştır.
Bu yapı sayesinde, uiscript.py, root dizinindeki Python dosyaları ve diğer GUI bileşenleri üzerinden debug işlemleri yapılabilir.
Python tarafında debug yaparken, print() fonksiyonu yerine logging modülünü kullanmak daha profesyonel ve esnek bir çözüm sunar.

Debug Çıktılarını Konsolda Gösterme
Python tarafında debug bilgilerini doğrudan konsol ekranında görmek mümkündür.
Bunun için, Python kodunuzda log seviyesini DEBUG olarak ayarlayıp, gerekli mesajları yazdırabilirsiniz.
Örneğin:
Kod:
import logging[BR][/BR]logging.basicConfig(level=logging.DEBUG)[BR][/BR]logging.debug('Bu bir debug mesajıdır')


C++ Tarafında Debug
Client C++ tarafında debug yapmak için, Visual Studio gibi IDE'ler üzerinden Output penceresini kullanabilirsiniz.
Debug modda çalışan client, Output penceresine debug mesajlarını yazdırabilir.
Bu mesajlar, OutputWindow'a OutputDebugString() fonksiyonu ile gönderilir.
Bu yöntemle, client build etmeden debug çıktılarını takip edebilirsiniz.

Python Root ve Py Root Dosyalarında Debug
Py root klasörü, client tarafında Python kodlarının bulunduğu temel dizindir.
Bu klasördeki dosyalarda debug işlemleri yaparken, debug mesajlarını konsola yazdırmak veya log dosyasına kaydetmek mümkündür.
Ayrıca, Martysama gibi popüler frameworkler üzerinden debug sistemleri entegre edilebilir.

Client Side Loglama Sistemleri
Geliştiriciler, client tarafında debug bilgilerini daha kolay takip edebilmek için loglama sistemleri kullanabilir.
Bu sistemler sayesinde, oyun çalışırken oluşan hatalar, veri değişimleri veya sistem durumları log dosyalarına yazılır.
Bu log dosyaları, client build işlemine gerek kalmadan incelenebilir.

Py GUI ve UI Script Üzerinden Debug
Py GUI, Python ile yazılmış arayüz sistemidir.
UI script dosyalarında debug işlemleri yaparken, Python GUI ile debug mesajlarını ekranda göstermek mümkündür.
Bu sayede, kullanıcı arayüzü üzerinde debug bilgilerini anlık olarak takip edebilirsiniz.

Server ile Client Arasındaki Veri Akışı
Client tarafında debug yaparken, server ile client arasında geçen verileri takip etmek de önemlidir.
Bu veriler, auth, game veya db core katmanlarından alınarak client tarafında analiz edilebilir.
Debug mesajları ile bu veri akışı kolayca izlenebilir.

Sonuç
Client build etmeden debug bilgilerini görmek, Metin2 özel sunucu geliştirme sürecinde büyük kolaylık sağlar.
Python, C++, loglama sistemleri ve GUI üzerinden debug işlemleri yapılabileceği gibi, server-client veri akışı da izlenebilir.
Bu yöntemler sayesinde, client tarafında oluşabilecek hatalar hızlıca tespit edilebilir.


Viewing Debug Information Without Building Client


In the process of developing Metin2 private servers, debugging on the client side plays a critical role.
However, many developers wonder how they can view debug outputs without rebuilding the client.
In this article, we will explain in detail how to view debug information without building the client.

What is Debugging on the Client Side?
Client-side debugging allows tracking errors, data flows, and system states during the game client's operation.
When working with C++ based client source codes, developers usually perform debugging through logging systems or debug messages.
However, there are times when rebuilding the client is not desired or feasible.

Debugging via Python and Uiscript
In Metin2 clients, UIs are generally written in Python.
Thanks to this structure, debugging can be performed through uiscript.py, Python files in the root directory, and other GUI components.
When debugging in Python, using the logging module instead of the print() function provides a more professional and flexible solution.

Displaying Debug Outputs in Console
It is possible to directly view debug messages in the console when debugging in Python.
For this purpose, you can set the log level to DEBUG and print necessary messages in your Python code.
For example:
Kod:
import logging[BR][/BR]logging.basicConfig(level=logging.DEBUG)[BR][/BR]logging.debug('This is a debug message')


Debugging in C++
To debug on the client C++ side, you can use the Output window in IDEs such as Visual Studio.
The client running in debug mode can print debug messages to the Output window.
These messages are sent to the OutputWindow via the OutputDebugString() function.
With this method, you can track debug outputs without building the client.

Debugging in Python Root and Py Root Files
The py root folder is the main directory where Python codes are located on the client side.
In these files, debug messages can be printed to the console or saved to a log file.
Additionally, debug systems can be integrated through popular frameworks like Martysama.

Client-Side Logging Systems
Developers can use logging systems to more easily monitor debug information on the client side.
With these systems, errors occurring during gameplay, data changes, or system statuses are written to log files.
These log files can be reviewed without needing to rebuild the client.

Debugging Through Py GUI and UI Scripts
Py GUI is a Python-based interface system.
When debugging in UI script files, it is possible to display debug messages on the screen through Python GUI.
Thus, you can instantly monitor debug information on the user interface.

Data Flow Between Server and Client
When debugging on the client side, monitoring the data exchanged between the server and client is also important.
These data can be taken from the auth, game, or db core layers and analyzed on the client side.
Debug messages allow easy tracking of this data flow.

Conclusion
Viewing debug information without building the client greatly facilitates the Metin2 private server development process.
Debug operations can be performed via Python, C++, logging systems, and GUI, and the server-client data flow can also be monitored.
With these methods, potential client-side errors can be quickly detected.
 

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

Geri
Üst Alt