Oyun İçi Nesne Marketi Site Oturumuna Bağlama

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Konunun temeli Cappuccino'a aittir. Bu eğitim, metin2'de oyunu, web sitenizdeki eşya mağazasına nasıl bağlayacağınızı açıklamak içindir.

Oyun istemcisindeki jetona tıkladığınızda, web tarayıcısı açılacak ve web sitenize bağlanacaktır. Öncelikle cmd_general.cpp'yi açın ve do_in_game_mall'ı arayın ve tüm işlevi bununla değiştirin;

Kod:
ACMD(do_in_game_mall) {         char buf[512+1];         char sas[33];         MD5_CTX ctx;         const char secretKey[*] = "my secret key"; // <<--- DÜZENLE!!!         const char websiteUrl[*] = "http://mywebsite/shop"; // <<--- DÜZENLE!!!         snprintf(buf, sizeof(buf), "%u%s", ch->GetAID(), secretKey);         MD5Init(&ctx);         MD5Update(&ctx, (const unsigned char *) buf, strlen(buf)); #ifdef __FreeBSD__         MD5End(&ctx, sas); #else         static const char hex[*] = "0123456789abcdef";         unsigned char digest[16];         MD5Final(digest, &ctx);         int i;         for (i = 0; i < 16; ++i) {             sas[i+i] = hex[digest[i] >> 4];             sas[i+i+1] = hex[digest[i] & 0x0f];         }         sas[i+i] = '\0'; #endif         snprintf(buf, sizeof(buf), "mall %s?aid=%u&secret=%s", websiteUrl, ch->GetAID(), sas);         ch->ChatPacket(CHAT_TYPE_COMMAND, buf); }

SecretKey ve websiteUrl'yi bilgilerinize göre düzenleyin.

Şu şekilde;
  • <li data-xf-list-type="ul">aid = hesap kimliği <li data-xf-list-type="ul">secret = md5 (hesap kimliği + gizli anahtarınız)
Bu şekilde yapabilirsiniz;

Kod:
&lt;?php $secretKey = $_GET['secret']; $accountId = $_GET['aid']; $generatedSecret = md5($accountId . $secretKey); if ($generatedSecret == $secretKey) {     // ok, proceed with login } else {     // invalid secret }

Umarım açıklayıcı bir rehber olmuştur. Bir sorununuz veya sorunuz varsa, mesaj göndermekten çekinmeyin. İyi forumlar!
Oyun İçi Nesne Marketi Site Oturumuna Bağlama
Metin2 özel sunucularında kullanıcı deneyimini artırmak ve oyun içi ekonomiyi desteklemek için oyun içi nesne marketi entegrasyonu giderek daha popüler hale geliyor. Bu sistem sayesinde oyuncular, oyun içi para ile satın aldıkları veya özel ödüllerle kazandıkları eşyaları doğrudan oyun içinden alabiliyor. Ancak bu sistemin güvenli ve sorunsuz çalışması için site oturumu ile oyun içi kimliğin birleştirilmesi büyük önem taşıyor. Bu yazıda, Metin2 özel sunucularında oyun içi nesne marketi sisteminin site oturumuna nasıl bağlanacağını detaylıca ele alacağız.

Neden Oyun İçi Market?
Metin2 özel sunucularında, oyuncuların oyun içi varlıklarını yönetebilmesi ve satın alma işlemlerini kolayca gerçekleştirmesi için güvenilir ve kullanıcı dostu bir sistem oluşturulmalıdır. Oyun içi nesne marketi, bu ihtiyacı karşılamakta oldukça etkili bir yöntemdir. Bu sistem sayesinde oyuncular, ekstra hesap açmadan ya da siteye tekrar giriş yapmadan eşya satın alabilirler. Bu bağlamda, site oturumu ile oyun içi karakter arasında bir köprü kurulması gerekir.

Site Oturumu Nedir ve Nasıl Çalışır?
Web tabanlı sistemlerde kullanıcı kimliği, genellikle oturum (session) adı verilen bir yapıyla korunur. Metin2 özel sunucularında, bu oturum bilgisi genellikle PHP tarafında saklanır. Bu sayede kullanıcılar siteye giriş yaptığında, sistem onların hangi karaktere sahip olduğunu tespit edebilir. Bu işlem, oturum kimliği ile karakter veritabanı eşleşmesi üzerinden yapılır.

Oyun İçi Market Entegrasyonu
Oyun içi market sistemi genellikle Python GUI arayüzü üzerinden sunulur. Bu sistemde, oyuncu bir eşya satın aldığında, sistem önce kullanıcı oturumunu kontrol eder. Eğer kullanıcı giriş yapmışsa, oyun içi karakterine ait bilgileri çeker. Bu bilgi sayesinde, eşya doğrudan oyun içi envanterine eklenir veya posta kutusuna gönderilir. Bu işlem sırasında veritabanı güvenliği çok önemlidir. Yanlış bir kontrol, hile yapılmasına veya veri kaybına yol açabilir.

C++ ve Python Arasında Veri Akışı
Metin2 özel sunucularında, oyun içi arayüz genellikle Python ile yazılırken, temel sunucu işlemleri C++ tabanlıdır. Bu nedenle, oyun içi marketten gelen isteklerin C++ tarafında güvenli şekilde işlenebilmesi gerekir. Bunun için genellikle auth-server ve game-server arasında özel bir protokol tanımlanır. Bu protokol, kullanıcı oturum bilgisini oyun sunucusuna iletir ve eşya verilimi sırasında kimlik doğrulaması sağlar.

Veritabanı ve Kimlik Doğrulama
Market sisteminde veri güvenliği için DB (database) tarafında kullanıcıların oturum kimliği, karakter adı ve hesap bilgileri eşleştirilmelidir. Bu sayede, bir oyuncu marketten eşya satın aldığında, doğru karaktere eşya verilmesi sağlanır. Ayrıca, bu veriler şifrelenmiş olarak saklanmalı ve sadece yetkili sistemler tarafından erişilebilir olmalıdır. Martysama gibi sistemlerde bu yapı zaten standartlara dahildir.

Sonuç
Metin2 özel sunucularında oyun içi nesne marketi sisteminin etkili bir şekilde kullanılabilmesi için site oturumu ile oyun içi kimliğin güvenli şekilde bağlanması şarttır. Bu bağlama sayesinde kullanıcılar daha hızlı, güvenli ve konforlu bir alışveriş deneyimi yaşar. Aynı zamanda sunucu yöneticileri için de veri takibi ve güvenlik daha kolay hale gelir.


Linking In-Game Item Market to Website Session
To enhance user experience in Metin2 private servers and support in-game economy, integrating an in-game item market is becoming increasingly popular. This system allows players to receive items purchased with in-game currency or earned through special rewards directly within the game. However, for this system to operate securely and smoothly, linking the website session with the in-game character identity is crucial. In this article, we will explain in detail how to connect the in-game item market system to the website session in Metin2 private servers.

Why an In-Game Market?
In Metin2 private servers, creating a reliable and user-friendly system allows players to manage their in-game assets and make purchases easily. An in-game item market is highly effective in meeting this need. With this system, players can purchase items without creating additional accounts or logging into the website again. In this context, building a bridge between the website session and the in-game character becomes necessary.

What Is a Website Session and How Does It Work?
User identity in web-based systems is generally protected using a structure called session. In Metin2 private servers, this session information is usually stored on the PHP side. Thus, when users log in to the site, the system can detect which character they own. This process is done by matching session ID with the character database.

In-Game Market Integration
The in-game market system is usually presented via a Python GUI interface. In this system, when a player purchases an item, the system first checks the user session. If the user is logged in, the system retrieves the relevant character information. Thanks to this information, the item is added directly to the in-game inventory or sent to the mailbox. During this process, database security is very important. Incorrect checks may lead to exploits or data loss.

Data Flow Between C++ and Python
In Metin2 private servers, the in-game interface is typically written in Python, while core server operations are based on C++. Therefore, requests from the in-game market must be processed securely on the C++ side. For this purpose, a custom protocol is often defined between the auth-server and game-server. This protocol transmits the user session information to the game server and ensures identity verification during item delivery.

Database and Identity Verification
For security in the market system, user session IDs, character names, and account information should be matched in the DB (database). This ensures that when a player purchases an item from the market, it is delivered to the correct character. Additionally, this data must be stored encrypted and accessible only by authorized systems. Systems like Martysama already include this structure as standard.

Conclusion
For effective use of the in-game item market system in Metin2 private servers, securely linking the website session with the in-game identity is essential. This linkage allows users to enjoy a faster, safer, and more comfortable shopping experience. At the same time, it makes data tracking and security easier for server administrators.
 

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

Benzer konular

Geri
Üst Alt