Offline Shop Efsun Değişme bugu çö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 94

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
AÇILIR
Kod:
char szColumns[QUERY_MAX_LEN], szValues[QUERY_MAX_LEN];           int iLen = snprintf(szColumns, sizeof(szColumns), "id,owner_id,pos,count,price,vnum");             int iUpdateLen = snprintf(szValues, sizeof(szValues), "%u,%u,%d,%u,%u,%u", pkItem->GetID(), GetPlayerID(), (pTable + i)->display_pos, pkItem->GetCount(), (pTable + i)->price, pkItem->GetVnum());             iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ",socket0,socket1,socket2");             iUpdateLen += snprintf(szValues + iUpdateLen, sizeof(szValues) - iUpdateLen, ",%ld,%ld,%ld", pkItem->GetSocket(0), pkItem->GetSocket(1), pkItem->GetSocket(2));             iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ",attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6");             iUpdateLen += snprintf(szValues + iUpdateLen, sizeof(szValues) - iUpdateLen, ",%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",                 pkItem->GetAttributeType(0), pkItem->GetAttributeValue(0),                 pkItem->GetAttributeType(1), pkItem->GetAttributeValue(1),                 pkItem->GetAttributeType(2), pkItem->GetAttributeValue(2),                 pkItem->GetAttributeType(3), pkItem->GetAttributeValue(3),                 pkItem->GetAttributeType(4), pkItem->GetAttributeValue(4),                 pkItem->GetAttributeType(5), pkItem->GetAttributeValue(5),                 pkItem->GetAttributeType(6), pkItem->GetAttributeValue(6));             char szInsertQuery[QUERY_MAX_LEN];             snprintf(szInsertQuery, sizeof(szInsertQuery), "INSERT INTO %soffline_shop_item (%s) VALUES (%s)", get_table_postfix(), szColumns, szValues);             std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szInsertQuery));             pkItem->RemoveFromCharacter();

not : 3 taş sistemli filesler içindir
not2 : konu daha önce açıldımı bilimiyorum eğer açıldı ise kapatılsın
Offline Shop Efsun Değişme Bug'u Nedir ve Nasıl Çözülür?

Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın sorunlardan birisi 'Offline Shop Efsun Değişme Bug'udur.

Bu hata, oyuncuların offline shop sistemini kullanırken efsun değiştirebilmesine olanak sağlar ve oyun dengelerini ciddi şekilde etkileyebilir. Özellikle Metin2 PvP sunucularında bu tür hatalar büyük avantajlar sağlayabilir ve dolayısıyla sunucu yöneticileri tarafından derhal düzeltilmelidir.

Bug'un Oluşum Nedeni

Offline shop sistemi genellikle C++ tabanlı bir yapıya sahiptir ve auth-server ile game-server arasında belirli senkronizasyonlarla çalışır. Bu sistemde, oyuncu bir eşya satın aldığında, bu eşyanın özelliklerinde değişiklik yapılması (örneğin efsun değiştirme) sunucu tarafında kontrol edilmelidir. Ancak bazı sunucularda, bu kontrol eksik bırakılmışsa, oyuncular doğrudan offline shop üzerinden efsun değiştirme işlemi yapabilmektedir.

Etkilenen Sistemler

Bu hata genellikle martysama veya diğer C++ source editlerinde bulunabilir. Game server source kodlarında, offline shop modülü ile efsun değiştirme modülü arasındaki senkronizasyon eksikliği bu hataya neden olur.

Çözüm Adımları

1. Auth-Server ve Game-Server Senkronizasyonu
Offline shop sisteminin doğru çalışması için auth-server ve game-server arasında güvenli bir veri aktarımı sağlanmalıdır. Özellikle eşya özellikleri değiştirilecekse, bu işlemin auth-server üzerinden onaylanması gerekir.

2. C++ Kaynak Kodlarında Kontroller

Game server kaynak kodunda, offline shop üzerinden gelen eşyaların üzerinde yapılan işlemler için kontrol mekanizmaları eklenmelidir. Örneğin, bir eşya offline shop üzerinden alındığında, bu eşyanın efsun değiştirme gibi işlemleri engellenmelidir.

3. Python GUI ve Py Root Düzenlemeleri

Python GUI tabanlı arayüzlerde, offline shop işlemi yapılırken efsun değiştirme fonksiyonunun devre dışı bırakılması gerekir. Bu, py root dosyalarında belirli fonksiyonların engellenmesiyle sağlanabilir.

4. Database (DB) Seviyesinde Kontrol

Database seviyesinde de, offline shop üzerinden alınan eşyaların üzerinde yapılabilecek işlemler sınırlanabilir. Bu, SQL seviyesinde trigger veya stored procedure ile sağlanabilir.

Güvenlik Açığı ve Sunucu Performansı

Bu tür güvenlik açıkları, hem oyun dengesini hem de sunucu performansını etkileyebilir. Oyuncuların bu açığı istismar etmesi, sunucuda anomali yaratır. Bu yüzden, sunucu sahipleri düzenli olarak source kodlarını gözden geçirmeli ve test etmelidir.

Kaynak Kod Düzenlemesi

Metin2 server src üzerinde yapılan düzenlemeler, özellikle game core ve db core dosyalarında dikkatli yapılmalıdır. Yanlışlıkla başka bir sistemi etkilememek için, tüm değişiklikler lokal test ortamında denenebilir.

Sonuç

Offline Shop Efsun Değişme bug'u, Metin2 özel sunucularında karşılaşılan kritik bir güvenlik açığıdır. Bu hatanın düzeltilmesi için C++ server kaynak kodları, Python GUI yapıları ve database kontrolleri birlikte ele alınmalıdır. Sunucu yöneticileri, bu tür açıkların farkında olmalı ve gerekli önlemleri almalıdır. Daha fazla Metin2 geliştirme rehberi için Metin2Lobby'i takip edin.


What is the Offline Shop Enchant Change Bug and How to Fix It?

One of the common issues encountered while developing Metin2 private servers is the 'Offline Shop Enchant Change Bug.'

This error allows players to change enchantments through the offline shop system, which can seriously affect the game balance. Particularly in Metin2 PvP servers, such bugs can provide significant advantages and must therefore be corrected immediately by server administrators.

Cause of the Bug

The offline shop system typically operates with a C++ base and works with certain synchronizations between the auth-server and game-server. In this system, when a player purchases an item, changes to its properties (e.g., enchantment change) should be checked on the server side. However, if this check is missing in some servers, players can directly change enchantments via the offline shop.

Affected Systems

This error usually occurs in martySama or other C++ source edits. The lack of synchronization between the offline shop module and the enchantment change module in the game server source codes causes this issue.

Solution Steps

1. Auth-Server and Game-Server Synchronization
To ensure the offline shop system functions correctly, secure data transfer between the auth-server and game-server must be established. Especially when modifying item properties, this process should be approved via the auth-server.

2. Controls in C++ Source Code

In the game server source code, mechanisms should be added to control actions performed on items received through the offline shop. For instance, enchantment changes on items purchased through the offline shop should be blocked.

3. Python GUI and Py Root Modifications

In Python GUI-based interfaces, the enchantment change function should be disabled during offline shop transactions. This can be achieved by blocking specific functions in py root files.

4. Database (DB) Level Control

At the database level, actions that can be performed on items obtained through the offline shop can also be restricted. This can be implemented using triggers or stored procedures at the SQL level.

Security Vulnerability and Server Performance

Such security vulnerabilities can affect both game balance and server performance. Exploitation of these loopholes by players can cause anomalies on the server. Therefore, server owners should regularly review and test their source codes.

Source Code Editing

Modifications made on the Metin2 server src, especially in game core and db core files, should be done carefully. To avoid affecting other systems by mistake, all changes should first be tested in a local environment.

Conclusion

The Offline Shop Enchant Change Bug is a critical security vulnerability in Metin2 private servers. Correcting this error requires attention to C++ server source codes, Python GUI structures, and database controls. Server administrators should be aware of such vulnerabilities and take necessary precautions. For more Metin2 development guides, follow Metin2Lobby.
 

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

Benzer konular

Geri
Üst Alt