Whisper Panelinde Yazı Rengi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Az önce inceleme yaparken gözüme çarpan ufak, ince ve önemsiz bir detay isteyen düzeltebilir;

ClientManager.cpp
Arat:
Kod:
CDBManager::instance().SetLocale(g_stLocale.c_str());

Değiş:
Kod:
CDBManager::instance().SetLocale(g_stLocale);

DBManager.h
Arat:
Kod:
void SetLocale(const char * szLocale );

Değiş:
Kod:
void SetLocale(const std::string& stLocale);

DBManager.cpp
Arat:
Kod:
void CDBManager::SetLocale(const char * szLocale)

Fonksiyonu komple değiştir:​
Kod:
void CDBManager::SetLocale(const std::string& stLocale) {     sys_log(0, "SetLocale start %s", stLocale.c_str());     for (int n = 0; n < SQL_MAX_NUM; ++n)     {         m_mainSQL[n]->SetLocale(stLocale);         m_directSQL[n]->SetLocale(stLocale);         m_asyncSQL[n]->SetLocale(stLocale);     }     sys_log(0, "End setlocale %s", stLocale.c_str()); }
Build edip denemedim bir sorun varsa yazarsanız düzeltirim, iyi forumlar ...
Metin2 Lobby


Whisper Panelinde Yazı Rengi Nasıl Değiştirilir?

Metin2 özel sunucularında kullanıcı deneyimini artırmak için birçok görsel ve işlevsel özellik geliştirilmektedir. Bunlardan birisi de whisper (özel mesaj) panelidir. Whisper sistemi sayesinde oyuncular birbirleriyle özel olarak iletişim kurabilir. Ancak standart sistemde bu mesajlar genellikle siyah ya da gri gibi sade renklerde görünür. Bu yazıların daha dikkat çekici hale getirilmesi için yazı rengi özelleştirme işlemleri yapılabilir.

Whisper Paneli Nedir?

Whisper paneli, oyuncuların kendi aralarında özel olarak mesajlaştığı bir iletişim kanalıdır. Genellikle oyun içinde /w komutuyla açılır. Bu panel sayesinde diğer oyuncuların göremediği özel mesajlar gönderilebilir. Özellikle guild liderleri, event organizasyoncuları veya arkadaşlar arasında hızlı iletişim kurulması açısından oldukça kullanışlıdır.

Neden Yazı Rengi Değiştirilmeli?

Standart whisper mesajları genellikle sade bir formatta gelir. Bu durum, bazı sunucularda kullanıcıların dikkatini çekmekte yetersiz kalabilir. Oyuncuların daha aktif ve ilgili olması için whisper mesajlarının renkli ve dikkat çekici olması önemlidir. Ayrıca farklı rollerdeki kullanıcılar (admin, moderator, VIP vs.) için farklı renkler ayarlanarak mesaj sahibi daha hızlı tanınabilir.

Yazı Rengi Ayarı İçin Gerekli Dosyalar

Whisper panelinde yazı rengi değiştirmek için öncelikle client-side üzerinde değişiklik yapılması gerekir. Bu işlem genellikle uiscript dosyaları üzerinden yapılır. Whisper penceresi genellikle ChatWindow.py veya benzeri bir dosya ile yönetilir. Burada bulunan text control nesnesine özel renk atamaları yapılabilir. Ayrıca, mesajın hangi kullanıcıdan geldiğine göre rengin değişmesi için Python GUI tarafında özel kontrol mekanizmaları yazılmalıdır.

Python ve C++ Entegrasyonu

Whisper sisteminin tam olarak çalışabilmesi için hem game server hem de client tarafında uyumlu yapılar gereklidir. Sunucu tarafında gönderilen mesajların, istemci tarafında doğru şekilde alınarak ekrana basılması için C++ source düzenlemeleri yapılmalıdır. Bu işlemler sırasında game core ve db core yapıları da dikkate alınmalıdır. Eğer mesaj gönderen kullanıcı özel bir roldeyse (örneğin admin), bu bilgi sunucudan istemciye özel bir tag ile birlikte gönderilir ve bu tag'a göre renk ayarı yapılır.

Whisper Panelinde Renk Atama Kod Örneği

Aşağıda örnek bir Python kod parçası verilmiştir. Bu kod, whisper mesajının rengini kullanıcı tipine göre değiştirir:

Kod:
def AppendChatLine(self, text, playerID, type):[BR][/BR]    if type == CHAT_TYPE_WHISPER:[BR][/BR]        if playerID in self.adminList:[BR][/BR]            textColor = RGB(255, 0, 0)  # Kırmızı[BR][/BR]        elif playerID in self.vipList:[BR][/BR]            textColor = RGB(0, 255, 0)  # Yeşil[BR][/BR]        else:[BR][/BR]            textColor = RGB(255, 255, 255)  # Beyaz[BR][/BR]        self.whisperText.SetPackedColor(textColor)[BR][/BR]        self.whisperText.SetText(text)


Sunucu Tarafında Yetkilendirme Kontrolü

Sunucu tarafında kullanıcı yetkileri kontrol edilerek, mesaj gönderirken kullanıcıya özel tag’ler atanabilir. Bu tag'ler auth server veya game server tarafından yönetilir. Bu sayede kullanıcı kimliği doğrulanır ve mesajın rengi buna göre belirlenir. Bu işlem sırasında db bağlantısı ve kullanıcı veritabanı sorguları da önem taşır.

Sonuç

Whisper panelinde yazı rengi özelleştirmesi, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırabilir. Bu işlem için hem client-side hem de server-side üzerinde uyumlu çalışmak gerekir. Python GUI ve C++ source düzenlemeleriyle birlikte kullanıcı rollerine göre özel renk atamaları yapılabilir. Bu sayede hem güvenilirlik hem de kullanıcı dostu bir arayüz elde edilir. Metin2 Lobby olarak bu konuda size destek olmaya devam edeceğiz.


Metin2 Lobby


How to Change Text Color in Whisper Panel?

In Metin2 private servers, many visual and functional features are developed to enhance user experience. One of these features is the whisper (private message) panel. The whisper system allows players to communicate privately with each other. However, by default, these messages usually appear in plain colors like black or gray. To make these texts more eye-catching, text color customization can be applied.

What is the Whisper Panel?

The whisper panel is a communication channel where players can privately message each other. Usually accessed via the /w command within the game, this panel allows sending private messages that others cannot see. It's particularly useful for guild leaders, event organizers, or friends who need quick communication.

Why Should You Change the Text Color?

Standard whisper messages typically come in a plain format. This may not be enough to capture attention on some servers. For players to become more active and engaged, having colorful and eye-catching whisper messages is important. Additionally, assigning different colors based on user roles (admin, moderator, VIP, etc.) helps identify the sender more quickly.

Required Files for Changing Text Color

To change the text color in the whisper panel, modifications must first be made on the client-side. This process is usually done through uiscript files. The whisper window is generally managed by files like ChatWindow.py. Within these files, color assignments can be applied to the text control object. Moreover, special control mechanisms written in Python GUI can change the color depending on who sent the message.

Python and C++ Integration

For the whisper system to work fully, compatible structures are needed on both the game server and the client side. C++ source modifications must be made so that messages sent from the server are properly received and displayed on the client. During these operations, game core and db core structures must also be taken into account. If the message sender has a special role (such as admin), this information is sent to the client along with a special tag, and the color is adjusted accordingly.

Sample Code for Setting Colors in Whisper Panel

Below is an example Python code snippet that changes the color of a whisper message based on the user type:

Kod:
def AppendChatLine(self, text, playerID, type):[BR][/BR]    if type == CHAT_TYPE_WHISPER:[BR][/BR]        if playerID in self.adminList:[BR][/BR]            textColor = RGB(255, 0, 0)  # Red[BR][/BR]        elif playerID in self.vipList:[BR][/BR]            textColor = RGB(0, 255, 0)  # Green[BR][/BR]        else:[BR][/BR]            textColor = RGB(255, 255, 255)  # White[BR][/BR]        self.whisperText.SetPackedColor(textColor)[BR][/BR]        self.whisperText.SetText(text)


Authorization Control on Server Side

On the server side, user permissions can be checked and special tags assigned to users when they send messages. These tags are managed by either the auth server or game server. In this way, the identity of the user is verified, and the message color is determined accordingly. Database queries and connections may also be important during this process.

Conclusion

Customizing text colors in the whisper panel can significantly enhance the user experience in Metin2 private servers. This requires compatible work on both the client-side and server-side. With Python GUI and C++ source modifications, custom color assignments can be made based on user roles. This ensures both reliability and a user-friendly interface. As Metin2 Lobby, we will continue to support you in this area.​
 

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

Benzer konular

Geri
Üst Alt