[Sourceden]Global Chat + Renk Ekleme

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhaba Arkadaşlar Bugün Sourceden Global Chat + Renk eklemeyi göstericem Bu Farklı Sourceden Ekleyeceğiz Dilerseniz Başlayalım

Not= Keşke Sabitlense :)

1) Global Chat Ekleme

input_p2p.cpp Açılır.

Ve Aşağıdaki Aranır.

Kod:
[COLOR=#9F9F9F][FONT=tahoma]if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))[/FONT][/COLOR]


Eğer Novaline Kullanıyorsanız

Şunu Arayın

Kod:
[COLOR=#9F9F9F][FONT=tahoma]if (!d->GetCharacter())[/FONT][/COLOR]


Ve Alttaki İle Değiştirilir.

Kod:
[COLOR=#9F9F9F][FONT=tahoma]    // ADDED GLOBAL SHOUT OPTION[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (!d->GetCharacter())[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            return;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if(!g_bGlobalShoutEnable && (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            return;[/FONT][/COLOR]
2) Chat Fonksiyon Ekleme

ınput_main.cpp Açılır

Ve Şunu Arayın

Kod:
[COLOR=#9F9F9F][FONT=tahoma]if (pinfo->type == CHAT_TYPE_SHOUT)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        const int SHOUT_LIMIT_LEVEL = 15;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (ch->GetLevel() < SHOUT_LIMIT_LEVEL)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ì¸ì¹ê¸°ë ë*벨 %d ì´ìë§ ì¬ì© ê°ë¥ í©ëë¤."), SHOUT_LIMIT_LEVEL);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        ch->SetLastShoutPulse(thecore_heart->pulse);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TPacketGGShout p;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        p.bHeader = HEADER_GG_SHOUT;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        p.bEmpire = ch->GetEmpire();[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        strlcpy(p.szText, chatbuf, sizeof(p.szText));[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        SendShout(chatbuf, ch->GetEmpire());[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]    }[/FONT][/COLOR]


Bununla Değiştirin


Kod:
[COLOR=#9F9F9F][FONT=tahoma]if (pinfo->type == CHAT_TYPE_SHOUT)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        const int SHOUT_LIMIT_LEVEL = 15;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (ch->GetLevel() < SHOUT_LIMIT_LEVEL)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ì¸ì¹ê¸°ë ë*벨 %d ì´ìë§ ì¬ì© ê°ë¥ í©ëë¤."), SHOUT_LIMIT_LEVEL);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        ch->SetLastShoutPulse(thecore_heart->pulse);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[Shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        char chatbuf_global[CHAT_MAX_LEN + 1];[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        int my_level = ch->GetLevel();[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        if (gSpecialShout == 1)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            if (ch->GetGMLevel() != GM_PLAYER)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                if (MasterGhostChat == 1)[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",kingdoms[0], buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                else[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    if ((MasterColorEmpire == 1) and (MasterLevelChat == 0))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                        int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    else if ((MasterColorEmpire == 1) and (MasterLevelChat == 1))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                        int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    else if ((MasterColorEmpire == 0) and (MasterLevelChat == 1))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                        int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    else[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                        int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            else[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 0))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                else if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 1))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                else if ((PlayerColorEmpire == 0) and (PlayerLevelChat == 1))[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                else[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                    int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]                }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        else[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TPacketGGShout p;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        p.bHeader = HEADER_GG_SHOUT;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        p.bEmpire = ch->GetEmpire();[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        strlcpy(p.szText, chatbuf_global, sizeof(p.szText));[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        SendShout(chatbuf_global, ch->GetEmpire());[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        return (iExtraLen);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]    }[/FONT][/COLOR]
3) Config fonksiyon Ekleme

config.cpp Açılır

Şunu Arayın

Kod:
[COLOR=#9F9F9F][FONT=tahoma]int gShutdownEnable = 0;[/FONT][/COLOR]


Altına Şunları Ekleyin

Kod:
[COLOR=#9F9F9F][FONT=tahoma]int gSpecialShout = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]int MasterGhostChat = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]int MasterColorEmpire = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]int MasterLevelChat = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]int PlayerColorEmpire = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]int PlayerLevelChat = 0;[/FONT][/COLOR]


Ve Tekrar Şunu Arayın.

Kod:
[COLOR=#9F9F9F][FONT=tahoma]TOKEN("empire_whisper")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            bool b_value = 0;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(b_value, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            g_bEmpireWhisper = !!b_value;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR]


Altına Ekleyin

Kod:
[COLOR=#9F9F9F][FONT=tahoma]TOKEN("special_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(gSpecialShout, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TOKEN("gm_ghost_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(MasterGhostChat, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TOKEN("gm_empire_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(MasterColorEmpire, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TOKEN("gm_level_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(MasterLevelChat, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TOKEN("player_empire_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(PlayerColorEmpire, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        TOKEN("player_level_shout")[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        {[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            str_to_number(PlayerLevelChat, value_string);[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]            continue;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]        }[/FONT][/COLOR]
config.h Açılır

Ve Şunu Arayın

Kod:
[COLOR=#9F9F9F][FONT=tahoma]extern int gPlayerMaxLevel;[/FONT][/COLOR]


Altına Şunları Ekleyin

Kod:
[COLOR=#9F9F9F][FONT=tahoma]extern int gSpecialShout;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]extern int MasterGhostChat;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]extern int MasterColorEmpire;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]extern int MasterLevelChat;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]extern int PlayerColorEmpire;[/FONT][/COLOR] [COLOR=#9F9F9F][FONT=tahoma]extern int PlayerLevelChat;[/FONT][/COLOR]
4) Game Config fonksiyonları
Kod:
[INDENT]special_shout: 1 gm_ghost_shout: 1 gm_empire_shout: 1 gm_level_shout: 1 player_empire_shout: 1 player_level_shout: 1[/INDENT]


Teşekkürler.




Metin2 Global Chat ve Renk Ekleme Sistemi Hakkında Detaylı Bilgi

Metin2 özel sunucularında kullanıcı deneyimini artırmak için global chat (genel sohbet) sistemi oldukça önemli bir özelliktir. Bu sistem sayesinde farklı haritalarda bulunan oyuncular birbiriyle doğrudan mesajlaşabilir. Ancak sadece yazı göndermek yetmiyor; görsellik ve kullanıcı dostu bir yapı için renk eklentileri de oldukça değerlidir. Bu yazıda sourceden entegre edilmiş bir global chat ve renk ekleme sistemi nasıl yapılır onu detaylıca inceleyeceğiz.

Global Chat Nedir ve Ne İşe Yarar?

Global chat, tüm oyuncuların aynı kanalda mesajlaşabilmesini sağlayan bir sohbet sistemidir. Oyun içinde farklı bölgelerde ya da kanallarda olsalar bile, tüm oyuncular bu kanal üzerinden mesaj alabilir ve gönderebilir. Bu özellikle büyük sunucularda topluluk hissi yaratmak ve oyuncular arası iletişimi artırmak için oldukça faydalıdır.

Genelde bu sistem game server tarafında geliştirilir. C++ tabanlı Metin2 sunucularında bu işlem için source edit yapısı gerekebilir. Ayrıca uiscript ve py root dosyalarında da bazı değişiklikler yapılması gerekir.

Renk Ekleme Sisteminin Avantajları

Renkli mesajlar, kullanıcıların dikkatini çeker ve daha etkileyici bir sohbet deneyimi sunar. Özellikle yetkililerin veya önemli duyuruların mesajları farklı renklerle belirtilebilir. Bu sayede kullanıcılar hızlıca hangi mesajın ne olduğunu ayırt edebilir.

Örneğin, bir admin mesajı kırmızı, bir olay duyurusu turuncu, genel sohbet ise mavi olabilir. Bu tür bir yapı, kullanıcıya kolaylık sağlar ve sunucu yönetimi açısından da avantajlıdır.

C++ Kaynak Kod ile Global Chat Geliştirme

Global chat sistemini source kod seviyesinde geliştirmek istiyorsanız, Metin2 server src üzerinde çalışmanız gerekir. Bu işlemde hem auth hem de game server üzerinde değişiklikler yapılmalıdır. Oyuncu mesajı gönderdiğinde, bu mesaj diğer tüm oyunculara_broadcast_ edilmelidir. Bu broadcast işlemi genellikle TCP bağlantısı üzerinden yapılır.

Renk ekleme özelliği içinse, mesaj parse edilmeden önce renk kodları kontrol edilmeli ve ilgili renk bilgisi client tarafına aktarılmaldır. Bu işlem için uiscript içinde özel bir parser geliştirilmesi önerilir.

Python GUI ile Yönetim Paneli Entegrasyonu

Global chat sistemine ek olarak, yetkililerin mesaj gönderip yönetebilmesi için bir yönetim paneli de geliştirilebilir. Bu panel için Python GUI veya PyQt gibi kütüphaneler kullanılabilir. Böylece adminler, oyun dışından da global sohbete mesaj gönderebilir veya spam filtreleri kurabilir.

Güvenlik ve Spam Önleme

Global chat sistemi açık bir yapı olduğu için spam ve küfür gibi istenmeyen durumlarla karşılaşılabilir. Bu nedenle sistemde bir filtreleme mekanizması kurulmalıdır. Örneğin, belirli kelimeler engellenir veya kullanıcıların belirli süre içinde sadece belli sayıda mesaj göndermesine izin verilir.

Sonuç

Global chat ve renk ekleme sistemi, Metin2 özel sunucularında kullanıcı etkileşimini ciddi anlamda artırabilir. Bu sistemi doğru bir şekilde implement etmek için hem client hem de server tarafında değişiklikler yapılması gerekir. C++ bilgisi olan geliştiriciler için bu sistem oldukça esnek ve özelleştirilebilir bir yapı sunar. Bu sayede hem güvenli hem de kullanıcı dostu bir sohbet ortamı oluşturulabilir.


Detailed Information About Metin2 Global Chat and Color Addition System

In order to enhance the user experience in Metin2 private servers, the global chat system is a very important feature. Thanks to this system, players located in different maps can directly communicate with each other. However, just sending text is not enough; adding color elements are also very valuable for a visual and user-friendly structure. In this article, we will examine in detail how to implement a global chat and color addition system integrated from source.

What is Global Chat and What Does It Do?

Global chat allows all players to chat within the same channel. Even if they are in different regions or channels in the game, all players can receive and send messages through this channel. This is especially useful for large servers to create a sense of community and increase communication between players.

Usually, this system is developed on the game server. In C++ based Metin2 servers, source edit structures may be required for this process. Also, some modifications in uiscript and py root files may be necessary.

Advantages of Color Addition System

Colorful messages attract users attention and provide a more impressive chat experience. Especially messages from staff members or important announcements can be marked with different colors. Thus, users can quickly distinguish what type of message it is.

For example, an admin message could be red, an event announcement orange, and general chat blue. Such a structure provides convenience to the user and offers advantages in server management as well.

Developing Global Chat with C++ Source Code

If you want to develop the global chat system at the source code level, you need to work on Metin2 server src. In this process, modifications must be made on both the auth and game server. When a player sends a message, that message should be broadcasted to all other players. This broadcast operation is usually done via TCP connection.

For color addition functionality, before parsing the message, color codes must be checked and the relevant color information must be transmitted to the client side. It is recommended to develop a custom parser inside uiscript for this purpose.

Integration of Administration Panel with Python GUI

As an additional feature to the global chat system, an administration panel can also be developed for staff to send and manage messages. For this panel, libraries such as Python GUI or PyQt can be used. This way, admins can send messages to the global chat or set spam filters without entering the game.

Security and Spam Prevention

Since the global chat system is an open structure, unwanted situations such as spam and profanity may occur. Therefore, a filtering mechanism must be established in the system. For example, certain words can be blocked or users may be allowed to send only a limited number of messages within a specific time frame.

Conclusion

The global chat and color addition system can significantly increase user interaction in Metin2 private servers. To properly implement this system, modifications on both client and server sides are required. For developers with C++ knowledge, this system offers a flexible and customizable structure. This way, a secure and user-friendly chat environment can be created.
 

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

Benzer konular

Geri
Üst Alt