Sistemin işleyişi videoda gayet açık bellidir uzatmaya gerek yok LoL gibi oyunlarda mesaj gelince sistem penceresinin uyarı verir gibi yanıp sönmesidir.
Fazla uzatmaya gerek yok video ve anlatıma geçelim
Fazla uzatmaya gerek yok video ve anlatıma geçelim
Client/root/InterfaceModule.py aç Arat : 2x
Kod:
btn.Flash() #in function def RecvWhisper(self, name):
Kod:
app.FlashApplication()
Source/src/Client/UserInterface/PythonApplication.cpp aç Arat :
Kod:
void CPythonApplication::Clear() { m_pySystem.Clear(); }
Kod:
#include <Windows.h> void CPythonApplication::FlashApplication() { HWND hWnd = GetWindowHandle(); FLASHWINFO fi; fi.cbSize = sizeof(FLASHWINFO); fi.hwnd = hWnd; fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; fi.uCount = 0; fi.dwTimeout = 0; FlashWindowEx(&fi); }
Source/src/Client/UserInterface/PythonApplication.h aç Arat :
Kod:
void SetForceSightRange(int iRange);
Kod:
void FlashApplication();
Source/src/Client/UserInterface/PythonApplicationModule.cpp aç Arat :
Kod:
PyObject* appLogoClose(PyObject* poSelf, PyObject* poArgs) { //CPythonApplication::Instance().OnLogoClose(); return Py_BuildNone(); }
Kod:
PyObject* appFlashApplication(PyObject* poSelf, PyObject* poArgs) { CPythonApplication::Instance().FlashApplication(); return Py_BuildNone(); }
Arat :
Kod:
{ "OnLogoClose", appLogoClose, METH_VARARGS },
Kod:
{ "FlashApplication", appFlashApplication, METH_VARARGS },
Metin2'de Mesaj Geldiğinde Windows Penceresinde Uyarı Gösterimi
Giriş:
Metin2 özel sunucularında kullanıcı deneyimini artırmak için birçok geliştirici, oyun içi olaylarda dışarıdan bildirim göndermeyi tercih eder. Özellikle turnuvalar, PvP aktiviteleri veya sunucuya özel duyurular gibi durumlarda oyuncuların dikkatini çekmek oldukça önemlidir. Bu yazıda, C++ tabanlı bir sistem üzerinden, Metin2 oyununda mesaj geldiğinde Windows penceresi üzerinde uyarı göstermeyi ele alacağız. Bu yöntem, game server tarafında geliştirilebilecek bir notification sistemidir ve server src ile entegre çalışabilir.
Neden Windows Bildirimi Gereklidir?
Metin2 özel sunucularında oyuncular, oyun içinde dikkatini çekebilecek pek çok olayla karşılaşabilir. Ancak bazı önemli durumlarda, oyuncu oyun ekranına bakmıyor olabilir. Örneğin, bir PvP etkinliği başladığında veya bir sistem mesajı geldiğinde, oyuncunun dikkatini çekmek için ekstra bir uyarı mekanizması gerekebilir. Windows seviyesinde bir bildirim, bu tür olaylarda oldukça etkili bir yöntemdir. Böylece oyuncu, oyun dışında bile önemli olaylardan haberdar edilebilir.
Sistem Mimarisi
Bu sistemi uygulamak için, öncelikle game server tarafında bir mesaj geldiğinde, bu mesajın Windows bildirimini tetikleyecek bir fonksiyon çağrılması gerekir. Bu işlem genellikle C++ ile yazılmış bir alt modül üzerinden gerçekleştirilir. Modül, client src ile entegre çalışarak, belirlenen koşullarda bir Windows bildirimi gösterir. Bu modül, UIScript veya Python GUI arayüzleriyle de desteklenebilir.
Kurulum Adımları
1. Oyun içinde bir mesaj geldiğinde, bu mesajı yakalayan bir event tanımlanmalıdır.
2. Event, C++ tabanlı bir fonksiyona yönlendirilmeli.
3. Fonksiyon, Windows API kullanarak bir messagebox veya notification penceresi oluşturur.
4. Oluşturulan pencere, oyuncunun dikkatini çekecek şekilde tasarlanır.
Örnek Kod Yapısı (C++)
Kod:
MessageBox(NULL, L'Mesaj Geldi!', L'Bildirim', MB_OK | MB_ICONINFORMATION);
Bu kod, basit bir MessageBox oluşturur. Daha gelişmiş sistemlerde, Toast Notification gibi modern Windows bildirimleri de kullanılabilir. Bunun için WinRT API kullanılır.
Entegrasyon ve Test
Sistemin doğru çalışabilmesi için, server src ile client src arasında uyum sağlanmalıdır. Özellikle auth ve game sunucuları arasında mesaj geçişi sırasında bu bildirim sisteminin aktif olması gerekir. Test aşamasında, farklı mesaj türleri (turnuva, duyuru, sistem) için farklı renk ve stillerde bildirimler gönderilmesi önerilir.
Avantajlar
- Oyuncu dikkatini daha etkili çeker.
- Oyun dışındayken bile bildirim alınabilir.
- Turnuva ve PvP aktivitelerinde avantaj sağlar.
- Sunucu yönetimini kolaylaştırır.
Sonuç
Metin2 özel sunucularında, oyuncu deneyimini artırmak için geliştirilen her sistem, oyuncuların katılımını ve memnuniyetini artırır. Windows seviyesinde bildirim göndermek, bu sistemlerden yalnızca biridir. C++ ile yazılmış bu tür sistemler, hem teknik açıdan hem de kullanıcı deneyimi açısından oldukça değerlidir. Geliştiriciler, bu yöntemi kullanarak kendi source edit projelerine benzersiz özellikler ekleyebilirler. Metin2Lobby.com olarak, bu gibi gelişmeleri desteklemeye devam ediyoruz.
Displaying Windows Notifications When Messages Arrive in Metin2
Introduction:
To enhance the user experience on Metin2 private servers, many developers prefer sending external notifications during in-game events. Especially during tournaments, PvP activities, or server-specific announcements, grabbing the attention of players becomes crucial. In this article, we will examine how to display a warning on the Windows window when a message arrives in Metin2, using a C++ based system. This method can serve as a notification system that can be integrated with the server src.
Why Windows Notification Is Needed?
On Metin2 private servers, players may encounter numerous events within the game. However, there are important situations where the player might not be looking at the game screen. For example, during the start of a PvP event or when a system message arrives, an additional alert mechanism might be necessary to grab the player's attention. A notification at the Windows level can be very effective in such cases. Thus, the player can be informed about critical events even when outside the game.
System Architecture
To implement this system, first, when a message arrives in the game, a function triggering a Windows notification must be called. This process is typically done via a sub-module written in C++. The module integrates with client src and displays a Windows notification upon predefined conditions. This module can also be supported by UIScript or Python GUI interfaces.
Installation Steps
1. An event should be defined to capture incoming messages within the game.
2. The event should redirect to a C++ based function.
3. The function creates a messagebox or notification window using the Windows API.
4. The created window is designed to attract the player's attention.
Sample Code Structure (C++)
Kod:
MessageBox(NULL, L'Message Received!', L'Notification', MB_OK | MB_ICONINFORMATION);
This code creates a simple MessageBox. In more advanced systems, modern Windows notifications like Toast Notification can be used, utilizing the WinRT API.
Integration and Testing
For the system to work correctly, compatibility between server src and client src must be ensured. Particularly, during message transfers between auth and game servers, this notification system must remain active. During testing, it is recommended to send different styled notifications for various message types (tournament, announcement, system).
Advantages
- More effectively captures player attention.
- Notifications can be received even when outside the game.
- Provides advantages during tournaments and PvP activities.
- Simplifies server management.
Conclusion
On Metin2 private servers, each system developed to enhance player experience increases participation and satisfaction. Sending notifications at the Windows level is one such system. Systems written in C++ are highly valuable both technically and from a user experience perspective. Developers can add unique features to their source edit projects using this method. At Metin2Lobby.com, we continue to support such developments.
