char.cpp arat
Kod:
sys_log(0, "CHANGE_SEX: %s (%d -> %d)", GetName(), src_race, m_points.job); return true;
üstüne ekle
Cinsiyet Değiştirirken Çıkış Yapılması Fix
Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın sorunlardan birisi de karakter cinsiyetini değiştirmeye çalışırken oyuncunun oyun dışına atılmasıdır. Bu durum, hem kullanıcı deneyimini olumsuz etkiler hem de sunucu tarafında istenmeyen duruşlar yaratır. Bu yazıda, cinsiyet değiştirme işlemi sırasında çıkış yapılan hatayı nasıl düzelteceğimizi detaylıca ele alacağız.
Sorunun Temeli Nedir?
Metin2 özel sunucularda genellikle game core üzerinde değişiklikler yapılmaktadır. Cinsiyet değiştirme işlemi sırasında sunucu, oyuncunun karakter verilerini yeniden yüklemek veya geçici olarak bağlantısını kesmek gibi işlemler gerçekleştirebilir. Bu, özellikle auth server ile game server[/COORD] senkronizasyonu eksikse hata oluşturabilir.
Olası Hata Durumu:
Bazı sunucularda, cinsiyet değiştirme işlemi başlatıldığında oyuncu karakteri oyun dışına atılır. Bu durum genellikle client-src ile server-src arasında tutarsızlık olduğunda meydana gelir. Özellikle uiscript veya py-root kısmında tanımlanan cinsiyet değiştirme fonksiyonları, doğru şekilde yapılandırılmazsa bağlantı kopması tetiklenebilir.
Fix Nasıl Uygulanır?
Bu hatayı çözmek için birkaç adım izlenmelidir:
1. Game Server Kaynak Kodlarında Gerekli Kontroller
Öncelikle server-src/game/src klasöründe bulunan cinsiyet değiştirme fonksiyonları incelenmelidir. Bu fonksiyonun, karakter verilerini doğru şekilde kaydettiğinden emin olunmalıdır. Ayrıca, cinsiyet değiştirme sırasında player_disconnect çağrısı yapılmaması gerekir.
2. Auth Server ile Senkronizasyon
Cinsiyet değişikliği yapıldığında db üzerinden karakter bilgileri güncellenmelidir. Eğer bu güncelleme auth server ile senkronize değilse, oyuncu tekrar bağlandığında eski cinsiyetiyle geri dönebilir veya bağlantı kopabilir. Bu yüzden db_core üzerinden doğru SQL güncellemeleri yapılmalıdır.
3. Client Tarafında Py Dosyalarının Kontrolü
client-src/root altında bulunan py-root dosyalarında cinsiyet değiştirme penceresi ile ilgili işlemler gözden geçirilmelidir. Özellikle python gui üzerinden gönderilen paketlerin doğruluğu önemlidir. Paketlerin doğru formatta gönderilmesi ve sunucunun bu paketleri doğru şekilde işlemesi sağlanmalıdır.
Python GUI ve PyUIScript Kullanımı
Eğer arayüz tarafında PyUIScript kullanıyorsanız, cinsiyet değiştirme butonuna basıldığında doğru fonksiyonların çağrıldığından emin olun. Martysama gibi sistemlerde, UI üzerinden yapılan işlemler sunucuyla uyumlu olmalıdır. Yanlış bir veri formatı, sunucuda hata tetikleyebilir.
Sunucu Compile ve Paketleme
Değişiklikler yapıldıktan sonra sunucu kaynak kodlarının doğru şekilde compile edildiğinden emin olun. Eksik derleme işlemleri, cinsiyet değiştirme gibi küçük işlemlerde büyük sorunlara yol açabilir. Ayrıca, tüm pack dosyaları güncellenmeli ve doğru şekilde dağıtılmalıdır.
Sonuç
Cinsiyet değiştirme sırasında çıkış yapılan sorunu, hem sunucu hem de istemci tarafında yapılacak kontrollerle çözülebilir. Özellikle Metin2 development sürecinde bu gibi hataların erken fark edilip düzeltilmesi, kullanıcı memnuniyetini artırır. Bu fix sayesinde oyuncular, cinsiyetlerini güvenle değiştirebilir ve oyun içi deneyim daha stabil hale gelir.
Fix for Logging Out During Gender Change
One of the common issues encountered while developing on Metin2 private servers is players being disconnected from the game when attempting to change their character's gender. This situation negatively impacts user experience and can cause unwanted behaviors on the server side. In this article, we will explain in detail how to fix the error where the player gets logged out during the gender change process.
What Is the Root Cause of the Problem?
On Metin2 private servers, modifications are typically made on the game core. During the gender change process, the server might attempt to reload the player’s character data or temporarily disconnect them. This can lead to errors, especially if synchronization between the auth server and game server is not properly handled.
Possible Error Scenario:
In some servers, initiating a gender change causes the player to be kicked from the game. This usually happens due to inconsistencies between the client-src and server-src. Particularly, if the functions defined in uiscript or py-root related to gender change are not configured correctly, disconnection may be triggered.
How to Apply the Fix?
To resolve this issue, follow these steps:
1. Required Checks in the Game Server Source Code
Firstly, review the gender change function found under server-src/game/src. Ensure that the function correctly saves character data. Additionally, make sure that player_disconnect is not called during the gender change process.
2. Synchronization with Auth Server
When a gender change occurs, the character's information must be updated in the db. If this update is not synchronized with the auth server, the player might revert to their old gender upon reconnecting, or the connection might drop. Therefore, correct SQL updates must be performed via db_core.
3. Check Py Files on the Client Side
Examine the files located under client-src/root in the py-root folder related to the gender change window. Especially ensure that packets sent through python gui are formatted correctly and processed accurately by the server.
Using Python GUI and PyUIScript
If you are using PyUIScript for the interface, ensure that the appropriate functions are called when the gender change button is pressed. In systems like Martysama, operations performed via the UI must be compatible with the server. Incorrect data formats can trigger errors on the server side.
Server Compilation and Packaging
After applying changes, ensure the server source code is correctly compiled. Incomplete compilation processes can lead to major issues even in small operations like gender change. Moreover, all pack files should be updated and distributed correctly.
Conclusion
The issue of logging out during gender change can be resolved with checks on both the server and client sides. Early detection and correction of such errors during Metin2 development increases user satisfaction. With this fix, players can safely change their character's gender, leading to a more stable gaming experience.
Kod:
UpdatePacket(); SET_BIT(m_bAddChrState, ADD_CHARACTER_STATE_SPAWN); m_afAffectFlag.Set(AFF_SPAWN); ViewReencode(); REMOVE_BIT(m_bAddChrState, ADD_CHARACTER_STATE_SPAWN); m_afAffectFlag.Reset(AFF_SPAWN);
Cinsiyet Değiştirirken Çıkış Yapılması Fix
Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın sorunlardan birisi de karakter cinsiyetini değiştirmeye çalışırken oyuncunun oyun dışına atılmasıdır. Bu durum, hem kullanıcı deneyimini olumsuz etkiler hem de sunucu tarafında istenmeyen duruşlar yaratır. Bu yazıda, cinsiyet değiştirme işlemi sırasında çıkış yapılan hatayı nasıl düzelteceğimizi detaylıca ele alacağız.
Sorunun Temeli Nedir?
Metin2 özel sunucularda genellikle game core üzerinde değişiklikler yapılmaktadır. Cinsiyet değiştirme işlemi sırasında sunucu, oyuncunun karakter verilerini yeniden yüklemek veya geçici olarak bağlantısını kesmek gibi işlemler gerçekleştirebilir. Bu, özellikle auth server ile game server[/COORD] senkronizasyonu eksikse hata oluşturabilir.
Olası Hata Durumu:
Bazı sunucularda, cinsiyet değiştirme işlemi başlatıldığında oyuncu karakteri oyun dışına atılır. Bu durum genellikle client-src ile server-src arasında tutarsızlık olduğunda meydana gelir. Özellikle uiscript veya py-root kısmında tanımlanan cinsiyet değiştirme fonksiyonları, doğru şekilde yapılandırılmazsa bağlantı kopması tetiklenebilir.
Fix Nasıl Uygulanır?
Bu hatayı çözmek için birkaç adım izlenmelidir:
1. Game Server Kaynak Kodlarında Gerekli Kontroller
Öncelikle server-src/game/src klasöründe bulunan cinsiyet değiştirme fonksiyonları incelenmelidir. Bu fonksiyonun, karakter verilerini doğru şekilde kaydettiğinden emin olunmalıdır. Ayrıca, cinsiyet değiştirme sırasında player_disconnect çağrısı yapılmaması gerekir.
2. Auth Server ile Senkronizasyon
Cinsiyet değişikliği yapıldığında db üzerinden karakter bilgileri güncellenmelidir. Eğer bu güncelleme auth server ile senkronize değilse, oyuncu tekrar bağlandığında eski cinsiyetiyle geri dönebilir veya bağlantı kopabilir. Bu yüzden db_core üzerinden doğru SQL güncellemeleri yapılmalıdır.
3. Client Tarafında Py Dosyalarının Kontrolü
client-src/root altında bulunan py-root dosyalarında cinsiyet değiştirme penceresi ile ilgili işlemler gözden geçirilmelidir. Özellikle python gui üzerinden gönderilen paketlerin doğruluğu önemlidir. Paketlerin doğru formatta gönderilmesi ve sunucunun bu paketleri doğru şekilde işlemesi sağlanmalıdır.
Python GUI ve PyUIScript Kullanımı
Eğer arayüz tarafında PyUIScript kullanıyorsanız, cinsiyet değiştirme butonuna basıldığında doğru fonksiyonların çağrıldığından emin olun. Martysama gibi sistemlerde, UI üzerinden yapılan işlemler sunucuyla uyumlu olmalıdır. Yanlış bir veri formatı, sunucuda hata tetikleyebilir.
Sunucu Compile ve Paketleme
Değişiklikler yapıldıktan sonra sunucu kaynak kodlarının doğru şekilde compile edildiğinden emin olun. Eksik derleme işlemleri, cinsiyet değiştirme gibi küçük işlemlerde büyük sorunlara yol açabilir. Ayrıca, tüm pack dosyaları güncellenmeli ve doğru şekilde dağıtılmalıdır.
Sonuç
Cinsiyet değiştirme sırasında çıkış yapılan sorunu, hem sunucu hem de istemci tarafında yapılacak kontrollerle çözülebilir. Özellikle Metin2 development sürecinde bu gibi hataların erken fark edilip düzeltilmesi, kullanıcı memnuniyetini artırır. Bu fix sayesinde oyuncular, cinsiyetlerini güvenle değiştirebilir ve oyun içi deneyim daha stabil hale gelir.
Fix for Logging Out During Gender Change
One of the common issues encountered while developing on Metin2 private servers is players being disconnected from the game when attempting to change their character's gender. This situation negatively impacts user experience and can cause unwanted behaviors on the server side. In this article, we will explain in detail how to fix the error where the player gets logged out during the gender change process.
What Is the Root Cause of the Problem?
On Metin2 private servers, modifications are typically made on the game core. During the gender change process, the server might attempt to reload the player’s character data or temporarily disconnect them. This can lead to errors, especially if synchronization between the auth server and game server is not properly handled.
Possible Error Scenario:
In some servers, initiating a gender change causes the player to be kicked from the game. This usually happens due to inconsistencies between the client-src and server-src. Particularly, if the functions defined in uiscript or py-root related to gender change are not configured correctly, disconnection may be triggered.
How to Apply the Fix?
To resolve this issue, follow these steps:
1. Required Checks in the Game Server Source Code
Firstly, review the gender change function found under server-src/game/src. Ensure that the function correctly saves character data. Additionally, make sure that player_disconnect is not called during the gender change process.
2. Synchronization with Auth Server
When a gender change occurs, the character's information must be updated in the db. If this update is not synchronized with the auth server, the player might revert to their old gender upon reconnecting, or the connection might drop. Therefore, correct SQL updates must be performed via db_core.
3. Check Py Files on the Client Side
Examine the files located under client-src/root in the py-root folder related to the gender change window. Especially ensure that packets sent through python gui are formatted correctly and processed accurately by the server.
Using Python GUI and PyUIScript
If you are using PyUIScript for the interface, ensure that the appropriate functions are called when the gender change button is pressed. In systems like Martysama, operations performed via the UI must be compatible with the server. Incorrect data formats can trigger errors on the server side.
Server Compilation and Packaging
After applying changes, ensure the server source code is correctly compiled. Incomplete compilation processes can lead to major issues even in small operations like gender change. Moreover, all pack files should be updated and distributed correctly.
Conclusion
The issue of logging out during gender change can be resolved with checks on both the server and client sides. Early detection and correction of such errors during Metin2 development increases user satisfaction. With this fix, players can safely change their character's gender, leading to a more stable gaming experience.
