Official %d Kadar yang, won, gaya harcandı mesajı ufak bir güncelleme isteyene

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
char.cpp

arat

Kod:
case POINT_GOLD:             {                 const long long nTotalMoney = static_cast<long long>(GetGold()) + static_cast<long long>(amount);                 if (GOLD_MAX <= nTotalMoney)                 {                     sys_err("[OVERFLOW_GOLD] OriGold %lld AddedGold %lld id %u Name %s ", GetGold(), amount, GetPlayerID(), GetName());                     LogManager::instance().CharLog(this, GetGold() + amount, "OVERFLOW_GOLD", "");                     return;                 }                 if (g_bChinaIntoxicationCheck && amount > 0)                 {                     if (IsOverTime(OT_NONE))                     {                         sys_log(1, "<GOLD_LOG> %s = NONE", GetName());                     }                     else if (IsOverTime(OT_3HOUR))                     {                         amount = (amount / 2);                         sys_log(1, "<GOLD_LOG> %s = 3HOUR", GetName());                     }                     else if (IsOverTime(OT_5HOUR))                     {                         amount = 0;                         sys_log(1, "<GOLD_LOG> %s = 5HOUR", GetName());                     }                 }                 if (amount < 0)                     ChatPacket(CHAT_TYPE_COMMAND, "SpendGold %lld", std::abs(amount));                 SetGold(GetGold() + amount);                 val = GetGold();             }             break;

vurgulanan kısmı ekleyin

Won için
Kod:
#if defined(__CHEQUE_SYSTEM__)         case POINT_CHEQUE:         {             const int64_t nTotalCheque = static_cast<int64_t>(GetCheque()) + static_cast<int64_t>(amount);             if (CHEQUE_MAX <= nTotalCheque)             {                 sys_err("[OVERFLOW_CHEQUE] OriCheque %d AddedCheque %lld id %u Name %s ", GetCheque(), amount, GetPlayerID(), GetName());                 LogManager::instance().CharLog(this, GetCheque() + amount, "OVERFLOW_CHEQUE", "");                 return;             }             if (amount < 0)                 ChatPacket(CHAT_TYPE_COMMAND, "SpendWon %d", std::abs(amount));             SetCheque(GetCheque() + amount);             val = GetCheque();         }         break; #en[HASH=3]#endif[/HASH]ODE] vurgulanan kısmı ekleyin Gaya için [CODE lang="cpp" title="POINT_GEM" highlight="12,13"]#if defined(__GEM_SYSTEM__)         case POINT_GEM:         {             const int64_t nTotalGem = static_cast<int64_t>(GetGem()) + static_cast<int64_t>(amount);             if (GEM_MAX <= nTotalGem)             {                 sys_err("[OVERFLOW_GEM] OriGem %d AddedGem %lld id %u Name %s ", GetGem(), amount, GetPlayerID(), GetName());                 LogManager::instance().CharLog(this, GetGem() + amount, "OVERFLOW_GEM", "");                 return;             }             if (amount < 0)                 ChatPacket(CHAT_TYPE_COMMAND, "SpendGem %d", std::abs(amount));             SetGem(GetGem() + amount);             val = GetGem();         }         break; #endif[HASH=3]#endif[/HASH]] game.py arat [CODE lang="python" title="game.py"]            # PRIVATE_SHOP_PRICE_LIST             "MyShopPriceList"        : self.__PrivateShop_PriceList,             # END_OF_PRIVATE_SHOP_PRICE_LIST

altına ekle
Kod:
"SpendGold"        : self.__SpendGold,             "SpendWon"        : self.__SpendWon,             "SpendGem"        : self.__SpendGem,

tekrar arat
Kod:
# PRIVATE_SHOP_PRICE_LIST     def __PrivateShop_PriceList(self, itemVNum, itemPrice):         if app.ENABLE_CHEQUE_SYSTEM:             return         else:             uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)     # END_OF_PRIVATE_SHOP_PRICE_LIST

altına ekle

Kod:
def __SpendGold(self, amount):         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_USE_MONEY % localeInfo.DottedNumber(long(amount)))     def __SpendWon(self, amount):         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHEQUE_USE_WON % localeInfo.DottedNumber(int(amount)))     def __SpendGem(self, amount):         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GEM_USE_GEM % localeInfo.DottedNumber(int(amount)))

localInfo.py ekle

Kod:
def DottedNumber(n) :     return "%s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]))

locale/tr/local_game.txt ekle

Kod:
GAME_USE_MONEY    %s Yang harcandı. CHEQUE_USE_WON    %s Won harcandı. GEM_USE_GEM    %s Gaya harcandı.


teşekkürler
Metin2 Sunucularında Oyuncuların Harcadığı Yang, Won ve Gaya Miktarlarını Takip Eden Sistem: Küçük Bir Güncelleme Talebiyle Daha Güçlü Hale Geliyor

Metin2 özel sunucu geliştirme dünyasında, oyuncuların oyun içi ekonomisine dair verileri takip etmek, hem sunucu yöneticileri hem de geliştiriciler için büyük önem taşımaktadır. Özellikle PVP sistemlerin yoğun olduğu sunucularda, oyuncuların yang, won ve gaya gibi para birimlerini nasıl harcadıkları, sunucu deneyiminin dengesini doğrudan etkiler. Bu nedenle, 'Official %d Kadar yang, won, gaya harcandı' mesajını içeren sistem, küçük bir güncellemeyle bile sunucu yönetimini daha verimli hale getirebilir.

Metin2 Ekonomisi ve Para Birimleri Hakkında Genel Bilgi

Metin2 oyununda üç ana para birimi vardır: Yang, Won ve Gaya. Yang, genellikle oyun içi alım-satım işlemlerinde kullanılan standart para birimidir. Won ise genellikle premium işlemlerde kullanılır ve oyuncular tarafından satın alınabilir. Gaya ise genellikle PvP kazançları veya özel görevlerle elde edilir. Bu para birimlerinin akışı, sunucu ekonomisinin dengelenmesi açısından çok önemlidir.

Sunucu geliştiricileri, bu para birimlerinin oyuncular tarafından nasıl harcandığını takip ederek, ekonomik manipülasyonları engelleyebilir, giderilecek boşlukları görebilir ve sunucu içi aktiviteleri daha iyi yönlendirebilirler. Bu bağlamda, 'Harcama logları' oldukça kritik bir rol oynar.

Geliştirilen Sistem: Harcanan Miktarların Loglanması

C++ tabanlı Metin2 sunucu kaynak kodlarında, oyuncuların harcadığı yang, won ve gaya miktarlarının loglandığı bir sistem geliştirilebilir. Bu sistem sayesinde, örneğin bir oyuncu bir eşya satın aldığında, harcanan miktar DB (veritabanı) üzerinden kaydedilir. Bu veriler, daha sonra analiz edilmek üzere sunucu sahipleri tarafından incelenebilir.

Bu sistemde, 'Official %d Kadar yang, won, gaya harcandı' mesajı, sunucu tarafında bir event olarak tanımlanabilir. Örneğin, belirli bir işlem yapıldığında, sistem bu mesajı otomatik olarak loglar. Bu sayede, sunucu yöneticileri, ne kadar miktarın hangi para biriminden harcandığını anlayabilir ve bu verileri sunucu ekonomisinin analizi için kullanabilirler.

Python GUI ve Uiscript ile Kullanıcı Dostu Arayüz

Sunucu geliştiricileri, bu verileri daha kullanıcı dostu bir şekilde görüntülemek istiyorsa, Python GUI veya Uiscript kullanarak özel bir arayüz tasarlayabilirler. Bu arayüz, harcamaların grafiksel olarak gösterilmesini sağlayabilir. Py Root klasörlerine entegre edilen bu sistem, hem geliştiriciler hem de sunucu yöneticileri için oldukça faydalı olabilir.

Python GUI ile geliştirilen bu arayüz sayesinde, harcamalar zaman bazlı olarak listelenebilir, filtre uygulanabilir ve raporlanabilir. Bu sayede, sunucu ekonomisinin kontrolü kolaylaşır.

Neden Küçük Bir Güncelleme Yetiyor?

Bu sistem, sadece mevcut C++ sunucu kaynak koduna küçük değişikliklerle entegre edilebilir. Örneğin, bir item satın alma fonksiyonuna birkaç satırlık ekleme yapılarak, harcanan miktar loglanabilir. Bu küçük değişiklik, büyük bir işlevsellik kazandırır. Bu nedenle, 'ufak bir güncelleme' ifadesi tam anlamıyla yerindedir.

Ayrıca, bu tür sistemlerin geliştirilmesi, Martysama gibi Metin2 geliştirme platformlarında da aktif olarak desteklenmekte ve örnek kodlarla birlikte sunulmaktadır. Bu sayede, yeni başlayan geliştiriciler bile bu sistemleri kolayca entegre edebilirler.

DB Core ve Game Core Entegrasyonu

Sunucu tarafında bu verilerin güvenli ve hızlı bir şekilde işlenebilmesi için, DB Core ve Game Core arasında doğru entegrasyon yapılması gerekir. Harcama logları, auth-server ile değil, game-server üzerinden DB’ye yazılmalıdır. Bu sayede, sunucu performansı etkilenmeden, veriler eksiksiz şekilde saklanabilir.

Sonuç

Metin2 özel sunucularında ekonomik dengeyi korumak, uzun vadeli başarı için kritik öneme sahiptir. Harcanan yang, won ve gaya miktarlarının takip edildiği bu sistem, sunucu geliştiricilerine büyük kolaylık sağlar. Küçük bir güncelleme ile büyük verim alınabilen bu yaklaşım, Metin2 sunucu geliştirme dünyasında önemli bir yere sahiptir.


Tracking Yang, Won, and Gaya Spent by Players on Metin2 Servers: Enhanced with a Minor Update Request

In the world of Metin2 private server development, tracking in-game economic data related to players is highly important for both server administrators and developers. Especially in servers with intense PVP systems, how players spend currency types such as yang, won, and gaya directly impacts the balance of the server experience. Therefore, the system including the message 'Official %d amount of yang, won, gaya spent' can make server management more efficient even with just a small update.

General Information about Metin2 Economy and Currency Types

In the Metin2 game, there are three main currencies: Yang, Won, and Gaya. Yang is typically used in in-game buy/sell transactions. Won is generally used in premium transactions and can be purchased by players. Gaya is usually obtained through PVP rewards or special quests. The flow of these currencies is critical for balancing the server economy.

Server developers can prevent economic manipulation, identify gaps to fix, and better direct in-game activities by tracking how these currencies are spent by players. In this context, 'spending logs' play a crucial role.

Developed System: Logging Amounts Spent

In C++ based Metin2 server source codes, a system can be developed that logs amounts of yang, won, and gaya spent by players. With this system, for example, when a player purchases an item, the spent amount can be saved via the database (DB). These data can later be analyzed by server owners.

In this system, the message 'Official %d amount of yang, won, gaya spent' can be defined as an event on the server side. For instance, when a certain action occurs, the system automatically logs this message. This allows server admins to see how much was spent from each currency type and use this data for analyzing server economy.

User-Friendly Interface with Python GUI and Uiscript

If server developers want to view this data in a more user-friendly way, they can design a custom interface using Python GUI or Uiscript. This interface can visually display spending data. Integrated into Py Root folders, this system can be very useful for both developers and server administrators.

With the Python GUI interface, expenditures can be listed by time, filtered, and reported. This makes controlling server economy easier.

Why Is a Small Update Enough?

This system can be integrated into existing C++ server source code with minor changes only. For example, a few lines added to an item purchase function can log the spent amount. Such a small change provides significant functionality. Hence, the phrase 'minor update' is quite accurate.

Moreover, such systems are actively supported on Metin2 development platforms like Martysama, where sample codes are provided. Thus, even beginner developers can integrate these systems easily.

Integration between DB Core and Game Core

To process these data securely and quickly on the server side, proper integration between DB Core and Game Core must be ensured. Spending logs should be written to the DB through the game-server, not the auth-server. This ensures data is stored completely without affecting server performance.

Conclusion

Maintaining economic balance in Metin2 private servers is crucial for long-term success. A system tracking yang, won, and gaya spent provides great convenience for server developers. This approach, offering high efficiency with just a minor update, holds an important place in the world of Metin2 server development.
 

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

Geri
Üst Alt