Oyun içinde Ep Satın alma sistemi (Basit Temel MANTIK)

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

Admin

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

Kod:
import ui import net import app class EPPurchaseWindow(ui.ScriptWindow):     def __init__(self):         ui.ScriptWindow.__init__(self)         self.__LoadWindow()     def __LoadWindow(self):         self.board = ui.BoardWithTitleBar()         self.board.SetSize(200, 150)         self.board.SetCenterPosition()         self.board.AddFlag('movable')         self.board.SetTitleName("EP Satın Al")         self.board.Show()         self.inputBox = ui.EditLine()         self.inputBox.SetParent(self.board)         self.inputBox.SetSize(180, 20)         self.inputBox.SetPosition(10, 40)         self.inputBox.SetMax(5)         self.inputBox.SetNumberMode()         self.inputBox.Show()         self.buyButton = ui.Button()         self.buyButton.SetParent(self.board)         self.buyButton.SetPosition(50, 80)         self.buyButton.SetText("Satın Al")         self.buyButton.SetEvent(self.__OnBuy)         self.buyButton.Show()     def __OnBuy(self):         amount = self.inputBox.GetText()         if amount.isdigit():             net.SendChatPacket(f"/buy_ep {amount}")         else:             chat.AppendChat(chat.CHAT_TYPE_INFO, "Lütfen geçerli bir sayı girin.")     def OnPressEscapeKey(self):         self.Close()         return TRUE     def Close(self):         self.board.Hide()


(C++)

Kod:
ACMD(do_buy_ep) {     if (ch->IsPC())     {         char arg1[256];         one_argument(argument, arg1);         int amount = atoi(arg1);         if (amount <= 0)         {             ch->ChatPacket(CHAT_TYPE_INFO, "Geçersiz miktar.");             return;         }         // Gerçek ödeme bağlantısı yoksa sadece loglama         ch->ChatPacket(CHAT_TYPE_INFO, "Ödeme bağlantısı başlatılıyor...");         // API ile entegrasyon yapılacak fonksiyon         SendPaymentRequest(ch, amount);     } }


C++ ile API İsteği Gönderme

Kod:
#include <curl/curl.h> #include "desc.h" #inc#includear.h" voi#includeymentRequest(LPCHARACTER ch, int amount) {     CURL* curl = curl_easy_init();     if (!curl)         return;     std::string api_url = "https://yourpaymentapi.com/pay";     std::string postData = "user=" + std::to_string(ch->GetPlayerID()) + "&amount=" + std::to_string(amount);     curl_easy_setopt(curl, CURLOPT_URL, api_url.c_str());     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postData.c_str());     CURLcode res = curl_easy_perform(curl);     if (res != CURLE_OK)     {         sys_err("curl_easy_perform() failed: %s\n", curl_easy_strerror(res));         ch->ChatPacket(CHAT_TYPE_INFO, "Ödeme isteği gönderilemedi.");     }     else     {         ch->ChatPacket(CHAT_TYPE_INFO, "Ödeme isteği başarıyla gönderildi.");     }     curl_easy_cleanup(curl); }

EP Yükleme

Kod:
<?php $user_id = $_POST['user']; $amount = $_POST['amount']; // Veritabanı bağlantısı $db = new PDO("mysql:host=localhost;dbname=player", "user", "pass"); // Kullanıcının EP'sini güncelle $stmt = $db->prepare("UPDATE account SET coins = coins + ? WHERE id = ?"); $stmt->execute([$amount, $user_id]);

Ödeme sağlayıcısından bir webhook veya callback API kullanarak başarılı ödeme sonrası veritabanına EP yüklenir


Tüm bu sistem HTTPS üzerinden çalışmalı. ve API istekleri mutlaka hash/signature kontrolü içermeli. (örneğin: PayTR, Stripe, Papara vs.) sistemlere eklemek yazmak size kalmış havale eft vs. bölümleri pyython tasarımlarna ekleyebilirsiniz.
Oyun İçinde EP Satın Alma Sistemi Nedir?

Metin2 özel sunucularında oyun içi ekonomi ve kullanıcı deneyimini artırmak amacıyla geliştirilen sistemlerden birisi de 'EP Satın Alma Sistemi'dir. Bu sistem sayesinde oyuncular, belirli miktarda gerçek para karşılığı oyun içi özel puan olan 'EP (Event Point)' satın alabilirler. Bu puanlar, oyun içinde özel ödüller, güçlendirmeler veya bonus içerikler için kullanılabilir. Bu yazıda, basit temel mantık çerçevesinde EP satın alma sisteminin nasıl çalıştığını detaylıca inceleyeceğiz.

EP Sisteminin Amacı ve Kullanımı

EP (Event Point), genellikle turnuvalar, özel etkinlikler veya oyuncu seviyesiyle ilgili ödüller için kullanılan bir puandır. Sunucu sahipleri, bu sistemi oyuncuların daha fazla katkısıyla elde ettikleri puanları değil, doğrudan satın aldıkları özel puanlar olarak tanımlayabilirler. Bu sayede hem ek gelir kaynağı oluşturulmuş olur hem de oyunculara ekstra avantajlar sunulur. Bu sistem, Metin2 özel sunucularında PVP odaklı sistemlerin yanı sıra ekonomi ve kullanıcı sadakati için de oldukça önemlidir.

EP Satın Alma Sisteminin Teknik Altyapısı

Bu sistemin teknik olarak çalışabilmesi için genellikle auth-server, game-server ve bir ödeme altyapısı gereklidir. Auth-server üzerinden kullanıcı girişi yapılırken, ödeme yapıldığında EP miktarı doğrudan kullanıcıya tanıtılır. Game-server üzerinde bu puanlar özel NPC'ler aracılığıyla harcanabilir. Bu işlem sırasında C++ tabanlı sistemler, Python GUI arayüzleri veya özel UIScript dosyaları ile EP miktarı ve satın alma işlemleri kontrol edilir. Bu sayede hem güvenli hem de esnek bir altyapı oluşturulmuş olur.

Sistemde Dikkat Edilmesi Gerekenler

EP satın alma sistemi, doğru şekilde entegre edilmezse hata riski taşır. Özellikle veritabanı (DB) bağlantısı ve ödeme onayı süreçleri titizlikle yönetilmelidir. Yanlışlıkla EP'nin iadesi veya çoğaltılması gibi güvenlik açıkları oluşabilir. Bu nedenle, C++ kaynak kodlar üzerinde gerekli kontrollerin yapılması ve Python scriptlerinde gerekli güvenlik önlemlerinin alınması büyük önem taşır. Ayrıca, sistemde kullanılan EP puanları için bir sınırlama getirilmesi, sunucu ekonomisinin dengelenmesi açısından da faydalıdır.

Sonuç

Oyun içi EP satın alma sistemi, Metin2 özel sunucularında kullanıcı memnuniyetini ve sunucu gelirini artıran etkili bir yöntemdir. Basit temel mantığıyla, oyunculara ekstra avantajlar sunarken, geliştiricilere de ek gelir kazandırır. Ancak, doğru teknik altyapıyla desteklenmediğinde güvenlik riskleri doğurabilir. Bu nedenle, sistem tasarımı sırasında C++, Python, DB ve UIScript gibi teknolojilerin dikkatli kullanılması gerekir. Metin2Lobby olarak, bu konuda size yardımcı olabilecek kaynaklara ulaşabilirsiniz.


What is the In-Game EP Purchase System?

In Metin2 private servers, one of the systems developed to enhance in-game economy and user experience is the 'EP Purchase System'. With this system, players can purchase 'EP (Event Points)' with real money. These points can be used for special rewards, enhancements, or bonus content within the game. In this article, we will examine how the basic logic of the EP purchase system works in detail.

Purpose and Usage of the EP System

EP (Event Point) is generally a point used for tournaments, special events, or level-related rewards. Server owners may define these as special points purchased directly by players instead of points earned through contributions. This creates both an additional revenue stream and offers extra benefits to players. This system is highly important for user loyalty and economy in Metin2 private servers, especially in PvP-oriented environments.

Technical Infrastructure of the EP Purchase System

For this system to function technically, an auth-server, game-server, and payment infrastructure are typically required. During login via the auth-server, purchased EP amounts are assigned directly to the user. Within the game, these points can be spent via special NPCs. During this process, C++ based systems, Python GUI interfaces, or custom UIScript files control EP balances and purchases. This way, a secure and flexible infrastructure is established.

Important Considerations in the System

If not properly integrated, the EP purchase system can pose risks of errors. Particularly, database (DB) connections and payment confirmation processes must be managed carefully. Incorrect refunding or duplication of EPs might cause security vulnerabilities. Therefore, it's crucial to perform necessary checks in C++ source codes and implement security measures in Python scripts. Additionally, setting limits on EP usage contributes to balancing the server economy.

Conclusion

The in-game EP purchase system is an effective method that increases user satisfaction and server revenue in Metin2 private servers. With its simple basic logic, it provides players with extra advantages while generating additional income for developers. However, if not supported by proper technical infrastructure, it can lead to security issues. Therefore, careful use of technologies such as C++, Python, DB, and UIScript during system design is essential. Visit Metin2Lobby for resources to assist you in this area.
 

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

Geri
Üst Alt