Merhaba Arkadaşlar,
Offline PM Sistemi daha önce biliyorum paylaşıldı fakat o py taraflıydı bu ise c++ taraflıdır.
Resimleri de o konudan alıyorum,
Offline PM Sistemi daha önce biliyorum paylaşıldı fakat o py taraflıydı bu ise c++ taraflıdır.
Resimleri de o konudan alıyorum,
İNDİR:
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
VT:
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
C++ ile Metin2'de Offline PM Sistemi Geliştirme
Metin2 özel sunucularında kullanıcılar arasında iletişim kurmak, özellikle PvP ve oyun içi sosyal etkileşim açısından oldukça önemlidir. Ancak bazı durumlarda, oyuncular çevrimdışıyken bile mesaj alabilmeleri veya gönderilen mesajları daha sonra okuyabilmeleri istenebilir. Bu noktada devreye Offline PM Sistemi girer. Bu sistem, oyuncuların çevrimdışıyken dahi mesaj alabilmesini sağlayarak kullanıcı deneyimini artırır.
Sistem Nedir?
Offline PM (Özel Mesaj) sistemi, oyuncuların birbirlerine oyun içinden mesaj göndermelerini sağlar. Eğer alıcı oyuncu çevrimdışıysa, mesaj veritabanında tutulur ve oyuncu giriş yaptığında gösterilir. Bu sistem genellikle C++ tabanlı sunucu kaynak kodlarına entegre edilir. Metin2 sunucularında game core kısmında geliştirilir ve veri tabanı ile entegre çalışır.
Nasıl Çalışır?
Sistem, oyuncu tarafından gönderilen mesajı doğrudan karşı tarafa göndermez. Eğer alıcı aktif değilse, mesaj db_core ile veritabanına yazılır. Oyuncu tekrar giriş yaptığında, sistem onun adıyla eşleşen tüm offline mesajları kontrol eder ve ekranda gösterir. Bu süreçte hem auth server hem de game server dikkatlice senkronize çalışmalıdır.
Geliştirme Adımları
1. Veritabanı Tablosu Oluşturma: Öncelikle veritabanına mesajların tutulacağı bir tablo eklenmelidir. Bu tablo genellikle 'player_offline_messages' gibi bir isimle oluşturulur. İçerisinde gönderici, alıcı, mesaj içeriği ve tarih bilgileri yer alır.
2. Sunucu Tarafında Fonksiyon Yazımı: C++ ile yazılmış server src dosyalarında, mesaj gönderme ve alma fonksiyonları tanımlanır. Gönderilen mesaj, alıcının aktif olup olmadığına göre doğrudan gönderilir ya da veritabanına yazılır.
3. Client Tarafında UI Entegrasyonu: Oyuncu giriş yaptığında alınmamış mesaj varsa, bunlar uiscript ile oluşturulmuş bir pencere üzerinde gösterilir. Bu arayüz genellikle Python tabanlıdır ve py_root altında yer alır.
Avantajlar
- Oyuncuların çevrimdışıyken bile mesaj alması sağlanır.
- PvP sistemlerinde stratejik planlama için faydalıdır.
- Oyun içi sosyal etkileşimi artırır.
- Oyuncu sadakati artar.
Sonuç
C++ ile geliştirilen offline PM sistemi, Metin2 özel sunucularında kullanıcı memnuniyetini artıran temel özelliklerden biridir. Doğru yapılandırıldığında, oyuncuların oyun içinde daha aktif ve etkileşimli olmasına yardımcı olur. Bu sistem, hem source edit hem de client src üzerinde çalışmayı gerektirir. Geliştirme sürecinde martysama gibi kaynaklar da destek olabilir.
Developing an Offline PM System with C++ for Metin2
Communication between players in Metin2 private servers is crucial, especially for PvP and social interactions within the game. However, there are cases where you may want players to receive messages even while they are offline, or read sent messages later. This is where the Offline PM System comes into play. This system allows players to receive messages even when they are offline, enhancing user experience.
What Is The System?
The Offline PM (Private Message) system allows players to send messages to each other within the game. If the recipient is offline, the message is stored in the database and displayed when the player logs in again. This system is usually integrated into C++ based server source codes and works in integration with the database. It is developed within the game core section of Metin2 servers and must be synchronized carefully between the auth server and game server.
How Does It Work?
Instead of sending the message directly to the recipient, the system checks if the receiver is online. If not, the message is written to the database via db_core. When the player logs in again, the system checks for any offline messages associated with their account and displays them. Both auth server and game server must work in sync during this process.
Development Steps
1. Create Database Table: First, a table must be added to the database to store messages. This table is usually named something like 'player_offline_messages', containing fields such as sender, receiver, message content, and timestamp.
2. Server-Side Function Implementation: Functions for sending and receiving messages are defined in the C++ based server src files. Depending on whether the recipient is active, the message is either sent directly or stored in the database.
3. Client-Side UI Integration: When a player logs in, any unread messages are displayed through a window created with uiscript. This interface is typically Python-based and located under py_root.
Benefits
- Players can receive messages even while offline.
- Useful for strategic planning in PvP systems.
- Increases in-game social interaction.
- Enhances player retention.
Conclusion
An offline PM system developed with C++ is one of the essential features that enhance user satisfaction in Metin2 private servers. When configured correctly, it helps players stay more active and engaged in the game. This system requires work on both source edit and client src. Resources like martysama can also provide support during development.
