Dükkan Açıkken düzenleme yapabilmeden dolayı Yapılan Bir item kopyalama bugu var.(Biz 1 tanesini Gördük Daha Fazlada olabilir)bununla Dükkan açıkken eşya ekleyip çıkarmayı kapatıyoruz.
python ve engelin geçilmesi durumuna karşı sunucudan da engelledim istemci taraflı gerek duymadım.
Dali Offlineshop Item Kopyalama Fixi: Metin2 Sunucularında Güvenlik ve Performans
Metin2 özel sunucu geliştirme dünyasında, kullanıcılar tarafından sunuculara yüklenen sistemlerden biri olan Dali Offlineshop, oyuncuların offline状态下 esya satabilmesine olanak tanır. Ancak bu sistemde bazı güvenlik açıkları oluşabilmektedir. Bunlardan birisi de item kopyalama sorunudur. Bu yazıda, Dali Offlineshop sisteminde meydana gelen item kopyalama açığının neden kaynaklandığını ve nasıl düzeltileceğini detaylıca ele alacağız.
Dali Offlineshop Nedir?
Dali Offlineshop, Metin2 özel sunucularında popüler olarak kullanılan bir sistemdir. Oyuncuların offline状态下 dahi esya satabilmesine izin vererek sunucu ekonomisine katkı sağlar. Bu sistem sayesinde oyuncular, sunucuya bağlı olmadan dükkan kurabilir, ürünlerini sergileyebilir ve satış yapabilirler.
Item Kopyalama Açığının Kaynağı
Bazı sunucularda, Dali Offlineshop sistemi eksik veya hatalı şekilde entegre edildiğinde, kullanıcılar aynı itemleri birden fazla kez satabilir veya kopyalayabilir. Bu durum, genellikle item veritabanı kontrolü yapılmadan satış işlemi başlatıldığında ortaya çıkar. Özellikle C++ tarafında eksik doğrulama kontrolleri bu tür açıklara sebep olabilir.
Fix Uygulaması: C++ Tarafında Kontroller
Açığı kapatmak için öncelikle game_src dosyalarında bulunan offlineshop modülünde değişiklik yapılmalıdır. Satış yapılan itemlerin, envanterten silinmeden önce gerçekten sahip olup olmadığı kontrol edilmelidir. Ayrıca, item satışı tamamlandığında, database üzerinde de bu işlemin bir kayıt altına alınması gerekmektedir. Bu işlemler doğru şekilde yapılmadığında, item tekrar tekrar satılabiliyor olabilir.
Python Tarafında Güvenlik Kontrolü
Sunucu tarafında Python tabanlı UI sistemlerinde de benzer kontroller yapılmalıdır. Py Root dosyalarında bulunan offlineshop komutları üzerinden, item kontrolü yapılmadan satış isteği gönderilirse, bu da kopyalama riskini artırır. UIScript üzerinden gönderilen her işlem, game server tarafından teyit edilmelidir.
Veritabanı Seviyesinde Çözüm[/BR]Daha güvenli bir çözüm için, item transferi sırasında transaction işlemleri kullanılmalıdır. Yani itemin hem satıcının envanterinden silinmesi hem de alıcının envanterine eklenmesi, atomic bir işlem olarak gerçekleştirilmelidir. Bu, veritabanı seviyesinde işlem yapılırken bir hata oluşursa tüm işlemin geri alınmasını sağlar.
Sunucu Geliştiricileri İçin Öneriler[/BR]Metin2 özel sunucu geliştiricileri, offlineshop gibi sistemleri entegre ederken mutlaka güvenlik testleri yapmalı ve her işlemi loglamalıdır. Martysama gibi deneyimli geliştiricilerin önerdiği yöntemler, bu tür açıkların önüne geçmede oldukça faydalıdır. Ayrıca, server source üzerinde yapılan değişikliklerin derlenip test sunucusunda denenmesi, canlı sunucuda yaşanabilecek sorunları engeller.
Sonuç
Dali Offlineshop sistemi, doğru şekilde kurulduğunda Metin2 sunucularında güçlü bir ekonomik yapı sunar. Ancak, item kopyalama gibi güvenlik açıkları, sunucunun dengesini bozabilir. Bu nedenle, hem C++ hem de Python tarafında gerekli kontrolleri yapmak ve database işlemleri sırasında dikkatli olmak büyük önem taşır.
Dali Offlineshop Item Duplication Fix: Security and Performance on Metin2 Servers
Metin2 private server development world, one of the systems loaded by users onto servers is Dali Offlineshop, which allows players to sell items while offline. However, some security vulnerabilities can occur in this system. One of these issues is the item duplication bug. In this article, we will examine in detail what causes the item duplication vulnerability in the Dali Offlineshop system and how to fix it.
What is Dali Offlineshop?
Dali Offlineshop is a popular system used in Metin2 private servers. It enables players to sell items even while offline, contributing to the server economy. With this system, players can open shops, display their items, and make sales without being connected to the server.
Source of the Item Duplication Bug
In some servers, if the Dali Offlineshop system is integrated incompletely or incorrectly, users may be able to sell or duplicate the same items multiple times. This issue usually arises when the sale process starts without checking whether the item exists in the database. Particularly missing validation checks on the C++ side can lead to such vulnerabilities.
Applying the Fix: Checks on the C++ Side
To close the vulnerability, modifications must first be made in the offlineshop module found in game_src files. Before an item is removed from inventory, it should be verified that the player actually owns the item. Additionally, once the item sale is completed, the transaction should be recorded in the database. If these operations are not performed correctly, the same item could potentially be sold repeatedly.
Security Checks on the Python Side
Similar checks must also be applied in UI systems based on Python. If item checks are skipped before sending a sale request through commands found in Py Root files, this increases the risk of duplication. Every action sent via UIScript should be confirmed by the game server.
Database-Level Solution
For a more secure solution, transaction operations should be used during item transfers. The removal of the item from the seller's inventory and its addition to the buyer's inventory should be executed as an atomic operation. This ensures that if an error occurs during the database operation, the entire transaction is rolled back.
Recommendations for Server Developers
Metin2 private server developers should always perform security tests and log every action when integrating systems like offlineshop. Methods suggested by experienced developers like Martysama can be very helpful in preventing such vulnerabilities. Furthermore, compiling and testing any changes made to the server source on a test server helps avoid potential issues on the live server.
Conclusion
When properly set up, the Dali Offlineshop system offers a robust economic structure for Metin2 servers. However, security vulnerabilities like item duplication can disrupt the balance of the server. Therefore, performing necessary checks on both the C++ and Python sides, and being cautious during database operations, is highly important.
python ve engelin geçilmesi durumuna karşı sunucudan da engelledim istemci taraflı gerek duymadım.
Kod:
arat: if app.ENABLE_OFFLINE_SHOP: if shop.IsOwner(): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() mouseModule.mouseController.DeattachObject() if player.SLOT_TYPE_INVENTORY != attachedSlotType and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType: return altına ekle: if False == shop.IsLocked(): chat.AppendChat(chat.CHAT_TYPE_INFO,"Dükkan Kilitliyken Eşya Eklenemez.") return arat: net.SendShopWithdrawItemPacket(self.__GetRealIndex(selectedSlotPos)) üstüne ekle: if False == shop.IsLocked(): chat.AppendChat(chat.CHAT_TYPE_INFO,"Dükkan Kilitliyken Eşya Geri Alınamaz.") return
Kod:
arat: bool IsEmpty(); altına ekle: bool LockStatus() { return m_bIsLocked; }
Kod:
arat: void CShopManager::AddItem(DWORD dwPID, TPlayerItem *item, bool broadcast) üstüne ekle: bool CShopManager::LockStatus(DWORD dwPID) { LPSHOP shop = FindOfflineShop(dwPID); if (shop->LockStatus()) return false; return true; }
Kod:
arat: void AddItem(DWORD dwPID, TPlayerItem* item, bool broadcast = true); altına ekle: bool LockStatus(DWORD dwPID);
Kod:
arat: BYTE pos = *(BYTE*)c_pData; if (!ch->CanEditOfflineShop(4, &pos)) return sizeof(BYTE); üstüne ekle: if(CShopManager::instance().LockStatus(ch->GetPlayerID())) return sizeof(BYTE); arat: TShopItemTable *pTable = (TShopItemTable*)c_pData; if (!ch->CanEditOfflineShop(5, pTable)) return sizeof(TShopItemTable); üstüne ekle: if(CShopManager::instance().LockStatus(ch->GetPlayerID())) return sizeof(TShopItemTable);
Dali Offlineshop Item Kopyalama Fixi: Metin2 Sunucularında Güvenlik ve Performans
Metin2 özel sunucu geliştirme dünyasında, kullanıcılar tarafından sunuculara yüklenen sistemlerden biri olan Dali Offlineshop, oyuncuların offline状态下 esya satabilmesine olanak tanır. Ancak bu sistemde bazı güvenlik açıkları oluşabilmektedir. Bunlardan birisi de item kopyalama sorunudur. Bu yazıda, Dali Offlineshop sisteminde meydana gelen item kopyalama açığının neden kaynaklandığını ve nasıl düzeltileceğini detaylıca ele alacağız.
Dali Offlineshop Nedir?
Dali Offlineshop, Metin2 özel sunucularında popüler olarak kullanılan bir sistemdir. Oyuncuların offline状态下 dahi esya satabilmesine izin vererek sunucu ekonomisine katkı sağlar. Bu sistem sayesinde oyuncular, sunucuya bağlı olmadan dükkan kurabilir, ürünlerini sergileyebilir ve satış yapabilirler.
Item Kopyalama Açığının Kaynağı
Bazı sunucularda, Dali Offlineshop sistemi eksik veya hatalı şekilde entegre edildiğinde, kullanıcılar aynı itemleri birden fazla kez satabilir veya kopyalayabilir. Bu durum, genellikle item veritabanı kontrolü yapılmadan satış işlemi başlatıldığında ortaya çıkar. Özellikle C++ tarafında eksik doğrulama kontrolleri bu tür açıklara sebep olabilir.
Fix Uygulaması: C++ Tarafında Kontroller
Açığı kapatmak için öncelikle game_src dosyalarında bulunan offlineshop modülünde değişiklik yapılmalıdır. Satış yapılan itemlerin, envanterten silinmeden önce gerçekten sahip olup olmadığı kontrol edilmelidir. Ayrıca, item satışı tamamlandığında, database üzerinde de bu işlemin bir kayıt altına alınması gerekmektedir. Bu işlemler doğru şekilde yapılmadığında, item tekrar tekrar satılabiliyor olabilir.
Python Tarafında Güvenlik Kontrolü
Sunucu tarafında Python tabanlı UI sistemlerinde de benzer kontroller yapılmalıdır. Py Root dosyalarında bulunan offlineshop komutları üzerinden, item kontrolü yapılmadan satış isteği gönderilirse, bu da kopyalama riskini artırır. UIScript üzerinden gönderilen her işlem, game server tarafından teyit edilmelidir.
Veritabanı Seviyesinde Çözüm[/BR]Daha güvenli bir çözüm için, item transferi sırasında transaction işlemleri kullanılmalıdır. Yani itemin hem satıcının envanterinden silinmesi hem de alıcının envanterine eklenmesi, atomic bir işlem olarak gerçekleştirilmelidir. Bu, veritabanı seviyesinde işlem yapılırken bir hata oluşursa tüm işlemin geri alınmasını sağlar.
Sunucu Geliştiricileri İçin Öneriler[/BR]Metin2 özel sunucu geliştiricileri, offlineshop gibi sistemleri entegre ederken mutlaka güvenlik testleri yapmalı ve her işlemi loglamalıdır. Martysama gibi deneyimli geliştiricilerin önerdiği yöntemler, bu tür açıkların önüne geçmede oldukça faydalıdır. Ayrıca, server source üzerinde yapılan değişikliklerin derlenip test sunucusunda denenmesi, canlı sunucuda yaşanabilecek sorunları engeller.
Sonuç
Dali Offlineshop sistemi, doğru şekilde kurulduğunda Metin2 sunucularında güçlü bir ekonomik yapı sunar. Ancak, item kopyalama gibi güvenlik açıkları, sunucunun dengesini bozabilir. Bu nedenle, hem C++ hem de Python tarafında gerekli kontrolleri yapmak ve database işlemleri sırasında dikkatli olmak büyük önem taşır.
Dali Offlineshop Item Duplication Fix: Security and Performance on Metin2 Servers
Metin2 private server development world, one of the systems loaded by users onto servers is Dali Offlineshop, which allows players to sell items while offline. However, some security vulnerabilities can occur in this system. One of these issues is the item duplication bug. In this article, we will examine in detail what causes the item duplication vulnerability in the Dali Offlineshop system and how to fix it.
What is Dali Offlineshop?
Dali Offlineshop is a popular system used in Metin2 private servers. It enables players to sell items even while offline, contributing to the server economy. With this system, players can open shops, display their items, and make sales without being connected to the server.
Source of the Item Duplication Bug
In some servers, if the Dali Offlineshop system is integrated incompletely or incorrectly, users may be able to sell or duplicate the same items multiple times. This issue usually arises when the sale process starts without checking whether the item exists in the database. Particularly missing validation checks on the C++ side can lead to such vulnerabilities.
Applying the Fix: Checks on the C++ Side
To close the vulnerability, modifications must first be made in the offlineshop module found in game_src files. Before an item is removed from inventory, it should be verified that the player actually owns the item. Additionally, once the item sale is completed, the transaction should be recorded in the database. If these operations are not performed correctly, the same item could potentially be sold repeatedly.
Security Checks on the Python Side
Similar checks must also be applied in UI systems based on Python. If item checks are skipped before sending a sale request through commands found in Py Root files, this increases the risk of duplication. Every action sent via UIScript should be confirmed by the game server.
Database-Level Solution
For a more secure solution, transaction operations should be used during item transfers. The removal of the item from the seller's inventory and its addition to the buyer's inventory should be executed as an atomic operation. This ensures that if an error occurs during the database operation, the entire transaction is rolled back.
Recommendations for Server Developers
Metin2 private server developers should always perform security tests and log every action when integrating systems like offlineshop. Methods suggested by experienced developers like Martysama can be very helpful in preventing such vulnerabilities. Furthermore, compiling and testing any changes made to the server source on a test server helps avoid potential issues on the live server.
Conclusion
When properly set up, the Dali Offlineshop system offers a robust economic structure for Metin2 servers. However, security vulnerabilities like item duplication can disrupt the balance of the server. Therefore, performing necessary checks on both the C++ and Python sides, and being cautious during database operations, is highly important.
