Işınlanınca Client'in Çökmesine Neden Olup Oyundan Attıran Hiçbir Syser Vermeyen O Hatanın Çözümü

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Belki başınıza gelmiştir bazen ışınlanınca oyundan atıyor ve hiçbir syser vermiyor ancak bu sürekli olmuyor arada sırada oluyor bu hatanın nedeni fog.tga adlı sis grafik dosyası. Düzeltmeye geçelim.

EterImageLib/DXTCImage.cpp
Kod:
bool CDXTCImage::LoadHeaderFromMemory(const BYTE * c_pbMap)
Kod:
bool CDXTCImage::LoadHeaderFromMemory(const BYTE * c_pbMap, int iSize)
Kod:
DWORD dwMagic;
Kod:
if (iSize < sizeof(DWORD))         return false;
Kod:
dwMagic = *(DWORD *) c_pbMap;     c_pbMap += sizeof(DWORD);
Kod:
iSize -= sizeof(DWORD);
Kod:
DDSURFACEDESC2 ddsd; // read from dds file
Kod:
if (iSize < sizeof(DDSURFACEDESC2))         return false;
Kod:
memcpy(&ddsd, c_pbMap, sizeof(DDSURFACEDESC2));     c_pbMap += sizeof(DDSURFACEDESC2);
Kod:
iSize -= sizeof(DDSURFACEDESC2);
Kod:
return LoadFromMemory((const BYTE*) pvMap);
Kod:
return LoadFromMemory((const BYTE*) pvMap, mappedFile.Size());
Kod:
bool CDXTCImage::LoadFromMemory(const BYTE * c_pbMap)
Kod:
bool CDXTCImage::LoadFromMemory(const BYTE * c_pbMap, int iSize)
Kod:
if (!LoadHeaderFromMemory(c_pbMap))
Kod:
if (!LoadHeaderFromMemory(c_pbMap, iSize))
EterImageLib/DXTCImage.h
Kod:
bool LoadHeaderFromMemory(const BYTE * c_pbMap);
Kod:
bool LoadHeaderFromMemory(const BYTE * c_pbMap, int iSize);
Kod:
bool LoadFromMemory(const BYTE * c_pbMap);
Kod:
bool LoadFromMemory(const BYTE * c_pbMap, int iSize);
EterLib/GrpImageTexture.cpp
Kod:
if (image.LoadHeaderFromMemory((const BYTE *) c_pvBuf))
Kod:
if (image.LoadHeaderFromMemory((const BYTE *) c_pvBuf, bufSize))

Işınlanınca Client'in Çökmesine Neden Olup Oyundan Attıran Hiçbir Syser Vermeyen O Hatanın Çözümü


Metin2 özel sunucularında çalışırken bazı nadiren görülen ancak oldukça can sıkıcı olan sorunlarla karşılaşabilirsiniz. Bunlardan birisi, karakterinizin belirli bir konuma ışınlandığında client'in çökmesi ve oyuncunun sistem tarafından otomatik olarak atılmasıdır. Bu durumda server-side'da herhangi bir syser mesajı gözükmez ki bu da hatayı analiz etmeyi zorlaştırır. İşte bu yazıda tam olarak bu hatanın nedenlerini ve çözümünü detaylıca ele alacağız.

Hatanın Temel Nedenleri

Bu tip hatalar genellikle iki temel sebepten dolayı oluşur:

1. Map dosyasında eksik ya da bozuk bilgi: Işınlanma sırasında kullanılan harita dosyasında (.map veya .wnd gibi) eksik mesh, yanlış koordinat veya hatalı bir fiziksel alan tanımlaması varsa, client çökebilir. Bu özellikle özel haritalarda daha sık rastlanır.

2. Client-side script hatası: Işınlanma sırasında çalışan bazı Python GUI (py) veya UI scriptleri, hatalı veri işlemesi yaparsa, client çöker. Ancak server'a bu olay bildirilmediği için syser gözükmez.

Hatanın Adımlarla Analizi

Öncelikle hangi koordinatlara ışınlandığınızda çökme yaşandığını not alın. Eğer bu koordinatlar özel bir haritaysa, o haritanın integrity kontrolünü yapmalısınız. Harita dosyaları genellikle Metin2 client klasöründe data/map dizininde bulunur.

Ardından, client tarafında çalışan uiscript veya py root dosyalarında ışınlanmayla ilişkili fonksiyonları kontrol edin. Özellikle player.SetPixelPosition veya benzeri fonksiyonların çağrıldığı yerleri incelerseniz, orada bir null pointer veya eksik veri kontrolü olabilir.

Server-side'da Yapılacaklar

Server tarafında bu hatayı yakalamak için game server log dosyalarını incelemek yeterli olmayabilir. Bunun yerine, ışınlanma komutunu işlerken özel loglamalar yapmanız gerekir. Örneğin:

Kod:
[COLOR=#0000cc]sys_log(0, 'Teleporting player %s to (%d, %d)', ch.GetName(), x, y);[/COLOR]


Bu sayede ışınlanma sırasında ne olduğu hakkında daha net bir fikir sahibi olabilirsiniz. Ayrıca, db_core veya auth_server ile eş zamanlı işlemler varsa, buradaki veri uyumsuzluklarını da kontrol etmelisiniz.

Python Script Tarafında Çözüm Önerileri

Eğer client çökmesi Python tarafında meydana geliyorsa, py_root klasöründeki dosyalarda aşağıdaki kontrolleri yapın:

- Null referans kontrolleri eksik mi?
- UI elementleri doğru sırayla mı başlatılıyor?
- Işınlanma sonrası bazı event handlerlar doğru çalışıyor mu?

Ayrıca, ışınlanma sırasında packet gönderimi varsa, bu paketlerin yapısal bütünlüğüne dikkat edilmelidir. Hatalı bir packet client çökmesine yol açabilir.

Sonuç

Bu tarz nadir görülen ama ciddi kullanıcı deneyimi bozan hatalar, hem client hem de server tarafında dikkatli debug işlemleri ile çözülebilir. Özellikle Metin2 özel sunucu geliştiricileri için, client/src ve server/src üzerinde çalışırken bu tür edge-case senaryoları için test envanterlerine mutlaka bu tip hataları da dahil etmelidirler. Böylece kullanıcı dostu ve kararlı çalışan bir sistem oluşturabilirler.


The Solution to The Error That Causes Client Crash Upon Teleportation Without Any Server Message and Kicks Player From Game


In Metin2 private servers, you may encounter rare but highly frustrating issues. One such issue is the client crashing when your character teleports to a specific location, followed by an automatic kick from the server. In this case, no syser message appears on the server-side, which makes analyzing the error more difficult. In this article, we will thoroughly examine the causes and solution of exactly this error.

Root Causes of The Error

Such errors typically occur due to two main reasons:

1. Incomplete or corrupted map file data: If there are missing meshes, incorrect coordinates, or faulty physical area definitions in the map file (.map or .wnd) used during teleportation, the client might crash. This occurs more frequently in custom maps.

2. Client-side script error: If certain Python GUI (py) or UI scripts running during teleportation process faulty data, the client will crash. However, since the server does not receive notification of this event, no syser appears.

Step-by-step Analysis of The Error

First, note down the coordinates where the crash occurs upon teleportation. If these coordinates belong to a custom map, you should check the integrity of that map. Map files are usually located under the data/map directory in the Metin2 client folder.

Next, review the uiscript or py root files that run on the client side and are related to teleportation. If you inspect functions like player.SetPixelPosition or similar, you might find a missing null pointer or incomplete data check.

What To Do On The Server-Side

Examining game server log files may not be sufficient to catch this error on the server-side. Instead, you should add custom logging while processing the teleport command. For example:

Kod:
[COLOR=#0000cc]sys_log(0, 'Teleporting player %s to (%d, %d)', ch.GetName(), x, y);[/COLOR]


This allows for a clearer understanding of what happens during teleportation. Additionally, if there are concurrent operations with db_core or auth_server, you must check for data inconsistencies there as well.

Suggested Solutions for Python Script Side

If the crash occurs on the Python side, perform the following checks in the files inside the py_root folder:

- Are null reference checks missing?
- Are UI elements initialized in the correct order?
- Are event handlers working correctly after teleportation?

Also, if packets are sent during teleportation, ensure their structural integrity. A malformed packet could cause the client to crash.

Conclusion

Such rare but user-experience disrupting errors can be resolved through careful debugging on both client and server sides. Particularly for Metin2 private server developers, when working on client/src and server/src, these types of edge-case scenarios must be included in the test inventory to create a user-friendly and stable system.
 

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

Benzer konular

Geri
Üst Alt