To make the Global Chat work for all kingdoms you need to open the file:
and search for this:
and search for this:
with this:
Screen:
and add this:
Screen:
and add this
Screen:
You can change Jinno, Shinsoo and Chunjo over locale_sting.txt
Yabancı Forum Alıntı
Metin2 Lobby üzerinden [C++] Üzerinden Global Chat Yapımı
Metin2 özel sunucularında geliştirme yapan geliştiriciler için global sohbet sistemleri büyük önem taşır. Bu sistem sayesinde farklı kanallarda oynayan oyuncular birbiriyle etkileşim kurabilir ve oyun içi sosyal yapı güçlenir. Bu yazıda, Metin2 özel sunucularında [C++] dili kullanarak nasıl bir global sohbet sistemi kurulacağını adım adım inceleyeceğiz.
Global Chat Nedir?
Global chat, oyuncuların kanallar arası mesajlaşabilmesini sağlayan bir özelliktir. Oyuncu hangi kanalda olursa olsun, global sohbete yazdığı mesajlar diğer tüm kanallarda görülebilir. Bu, özellikle Metin2 PvP sunucularında oyuncuların daha aktif iletişim kurmasını sağlar.
Sistem Gereksinimleri
Bu sistemi kurabilmek için öncelikle Metin2 server source üzerinde değişiklik yapabiliyor olmanız gerekir. Ayrıca DB core ile ilgili bilgi sahibi olmanız faydalı olacaktır. Sistem genellikle game server tarafında çalışır ve client tarafına özel bir entegrasyon gerektirmez.
Adım Adım Kurulum
Öncelikle game/src/char.cpp dosyası üzerinde çalışacağız. Burada mesaj gönderme fonksiyonunu genişletmemiz gerekir. ChatPacket fonksiyonuna global sohbet komutunu ekleyeceğiz.
Ardından, SendToAllChannels adında bir fonksiyon tanımlamalıyız. Bu fonksiyon, mesajı tüm kanallara yayar. game/src/char_manager.cpp dosyasına bu fonksiyonu eklememiz gerekebilir. Channel tabanlı sunucularda bu işlem daha karmaşık olabilir, ancak temel mantık aynıdır.
Database Entegrasyonu
Global sohbet mesajları loglanmak istenirse, db core üzerinde bir tablo oluşturulabilir. Mesajların zaman damgası, gönderen karakter adı gibi veriler bu tabloya yazılabilir. Örnek tablo yapısı:
Client Tarafı Ayarları
Client tarafında herhangi bir değişiklik yapmanıza gerek yoktur. Ancak bazı geliştiriciler, global mesajları farklı bir renkte veya efektli göstermek isteyebilir. Bu durumda uiscript veya py root üzerinde küçük değişiklikler yapılabilir. Örneğin, Python GUI kullanarak global mesajları farklı bir alanda gösterebilirsiniz.
Test ve Hata Ayıklama
Sistemi kurduktan sonra test aşamasında farklı kanallarda bulunan iki karakter arasında global sohbetin düzgün çalışıp çalışmadığını kontrol edin. Eğer mesaj gönderilmiyorsa, core üzerindeki logları inceleyin. En sık karşılaşılan sorunlar genelde fonksiyonların doğru şekilde çağrılmasıyla ilgilidir.
Sonuç
Metin2 özel sunucularında global sohbet sistemi, oyuncu deneyimini ciddi anlamda artırır. [C++] üzerinde geliştirilen bu sistem, güvenilir ve esnek bir yapı sunar. Metin2Lobby.com olarak, bu tür gelişmiş sistemlerin kaynak kodlarını ve desteklerini sürekli olarak paylaşmaya devam ediyoruz.
Metin2 Lobby How to Create Global Chat Over [C++]
Global chat systems are important for developers working on Metin2 private servers. This system allows players playing in different channels to interact with each other and strengthens the in-game social structure. In this article, we will examine step by step how to create a global chat system using [C++] language in Metin2 private servers.
What Is Global Chat?
Global chat enables players to communicate across channels. Regardless of which channel they are in, messages sent to the global chat can be seen in all other channels. This encourages more active communication among players, especially on Metin2 PvP servers.
System Requirements
To implement this system, you must be able to make modifications to your Metin2 server source. Additionally, having knowledge about DB core would be beneficial. The system typically runs on the game server side and does not require special integration on the client side.
Step-by-Step Installation
Firstly, we'll work on the game/src/char.cpp file. We'll extend the message sending function here. Add the global chat command to the ChatPacket function.
Next, define a function named SendToAllChannels. This function broadcasts the message to all channels. You might need to add this function to the game/src/char_manager.cpp file. On Channel-based servers, this process can be more complex, but the basic logic remains the same.
Database Integration
If you wish to log global chat messages, you can create a table in the db core. Timestamps, sender character names, etc., can be stored in this table. Example table structure:
Client-Side Configuration
You don't need to make any changes on the client-side. However, some developers may want to display global messages in a different color or with effects. In such cases, minor modifications can be made to uiscript or py root. For example, you can use Python GUI to display global messages in a separate area.
Testing and Debugging
After installing the system, during testing, check whether the global chat works properly between two characters located in different channels. If the message is not being sent, review the logs on the core. Most common issues are related to functions not being called correctly.
Conclusion
The global chat system on Metin2 private servers significantly enhances player experience. The system developed over [C++] offers a reliable and flexible structure. As Metin2Lobby.com, we continuously share the source codes and support for such advanced systems.
Kod:
extern bool global_chat;
and search for this:
Kod:
struct FuncShout
and search for this:
Kod:
if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return;
with this:
Kod:
if(global_chat) { if (!d->GetCharacter()) return; }else { if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return; }
Screen:
Kod:
ch->SetLastShoutPulse(thecore_heart->pulse);
and add this:
Kod:
if(global_chat) { char buf[256]; char chatbuf_global[CHAT_MAX_LEN + 1]; const BYTE char_empire = ch->GetEmpire(); if(char_empire == 1) { strlcpy(buf, LC_TEXT("Shinsoo"), sizeof(buf)); std::string kingdom_red = "|cFFff0000|H|h["; kingdom_red += buf; kingdom_red += "]|cFFA7FFD4|H|h"; sprintf(chatbuf_global, "%s %s", kingdom_red.c_str(), chatbuf); } else if (char_empire == 2) { strlcpy(buf, LC_TEXT("Chunjo"), sizeof(buf)); std::string kingdom_yel = "|cFFFFFF00|H|h["; kingdom_yel += buf; kingdom_yel += "]|cFFA7FFD4|H|h"; sprintf(chatbuf_global, "%s %s", kingdom_yel.c_str(), chatbuf); } else if (char_empire == 3) { strlcpy(buf, LC_TEXT("Jinno"), sizeof(buf)); std::string kingdom_blue = "|cFF0080FF|H|h["; kingdom_blue += buf; kingdom_blue += "]|cFFA7FFD4|H|h"; sprintf(chatbuf_global, "%s %s", kingdom_blue.c_str(), chatbuf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = char_empire; strlcpy(p.szText, chatbuf_global, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf_global, ch->GetEmpire()); return (iExtraLen); }
Screen:
Kod:
TOKEN("max_level") { str_to_number(gPlayerMaxLevel, value_string); gPlayerMaxLevel = MINMAX(1, gPlayerMaxLevel, PLAYER_MAX_LEVEL_CONST); fprintf(stderr, "PLAYER_MAX_LEVEL: %dn", gPlayerMaxLevel); }
and add this
Kod:
TOKEN("global_chat") { int flag = 0; str_to_number(flag, value_string); if (1 == flag) { global_chat = true; fprintf(stderr, "GLOBAL_CHAT: %in", flag); } }
Screen:
Kod:
"Jinno"; "Jinno"; "Chunjo"; "Chunjo"; "Shinsoo"; "Shinsoo";
You can change Jinno, Shinsoo and Chunjo over locale_sting.txt
Kod:
"Jinno"; "Blue Empire"; "Chunjo"; "Yellow Empire"; "Shinsoo"; "Red Empire";
Yabancı Forum Alıntı
Metin2 Lobby üzerinden [C++] Üzerinden Global Chat Yapımı
Metin2 özel sunucularında geliştirme yapan geliştiriciler için global sohbet sistemleri büyük önem taşır. Bu sistem sayesinde farklı kanallarda oynayan oyuncular birbiriyle etkileşim kurabilir ve oyun içi sosyal yapı güçlenir. Bu yazıda, Metin2 özel sunucularında [C++] dili kullanarak nasıl bir global sohbet sistemi kurulacağını adım adım inceleyeceğiz.
Global Chat Nedir?
Global chat, oyuncuların kanallar arası mesajlaşabilmesini sağlayan bir özelliktir. Oyuncu hangi kanalda olursa olsun, global sohbete yazdığı mesajlar diğer tüm kanallarda görülebilir. Bu, özellikle Metin2 PvP sunucularında oyuncuların daha aktif iletişim kurmasını sağlar.
Sistem Gereksinimleri
Bu sistemi kurabilmek için öncelikle Metin2 server source üzerinde değişiklik yapabiliyor olmanız gerekir. Ayrıca DB core ile ilgili bilgi sahibi olmanız faydalı olacaktır. Sistem genellikle game server tarafında çalışır ve client tarafına özel bir entegrasyon gerektirmez.
Adım Adım Kurulum
Öncelikle game/src/char.cpp dosyası üzerinde çalışacağız. Burada mesaj gönderme fonksiyonunu genişletmemiz gerekir. ChatPacket fonksiyonuna global sohbet komutunu ekleyeceğiz.
Kod:
[COLOR=green]if (strchr(text, '!')) { // ! işareti global chat için kullanılır[BR][/BR] SendToAllChannels(text);[BR][/BR]}[/COLOR]
Ardından, SendToAllChannels adında bir fonksiyon tanımlamalıyız. Bu fonksiyon, mesajı tüm kanallara yayar. game/src/char_manager.cpp dosyasına bu fonksiyonu eklememiz gerekebilir. Channel tabanlı sunucularda bu işlem daha karmaşık olabilir, ancak temel mantık aynıdır.
Database Entegrasyonu
Global sohbet mesajları loglanmak istenirse, db core üzerinde bir tablo oluşturulabilir. Mesajların zaman damgası, gönderen karakter adı gibi veriler bu tabloya yazılabilir. Örnek tablo yapısı:
Kod:
[COLOR=green]CREATE TABLE global_chat_log ([BR][/BR] id INT AUTO_INCREMENT PRIMARY KEY,[BR][/BR] sender_name VARCHAR(255),[BR][/BR] message TEXT,[BR][/BR] send_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP[BR][/BR]);[/COLOR]
Client Tarafı Ayarları
Client tarafında herhangi bir değişiklik yapmanıza gerek yoktur. Ancak bazı geliştiriciler, global mesajları farklı bir renkte veya efektli göstermek isteyebilir. Bu durumda uiscript veya py root üzerinde küçük değişiklikler yapılabilir. Örneğin, Python GUI kullanarak global mesajları farklı bir alanda gösterebilirsiniz.
Test ve Hata Ayıklama
Sistemi kurduktan sonra test aşamasında farklı kanallarda bulunan iki karakter arasında global sohbetin düzgün çalışıp çalışmadığını kontrol edin. Eğer mesaj gönderilmiyorsa, core üzerindeki logları inceleyin. En sık karşılaşılan sorunlar genelde fonksiyonların doğru şekilde çağrılmasıyla ilgilidir.
Sonuç
Metin2 özel sunucularında global sohbet sistemi, oyuncu deneyimini ciddi anlamda artırır. [C++] üzerinde geliştirilen bu sistem, güvenilir ve esnek bir yapı sunar. Metin2Lobby.com olarak, bu tür gelişmiş sistemlerin kaynak kodlarını ve desteklerini sürekli olarak paylaşmaya devam ediyoruz.
Metin2 Lobby How to Create Global Chat Over [C++]
Global chat systems are important for developers working on Metin2 private servers. This system allows players playing in different channels to interact with each other and strengthens the in-game social structure. In this article, we will examine step by step how to create a global chat system using [C++] language in Metin2 private servers.
What Is Global Chat?
Global chat enables players to communicate across channels. Regardless of which channel they are in, messages sent to the global chat can be seen in all other channels. This encourages more active communication among players, especially on Metin2 PvP servers.
System Requirements
To implement this system, you must be able to make modifications to your Metin2 server source. Additionally, having knowledge about DB core would be beneficial. The system typically runs on the game server side and does not require special integration on the client side.
Step-by-Step Installation
Firstly, we'll work on the game/src/char.cpp file. We'll extend the message sending function here. Add the global chat command to the ChatPacket function.
Kod:
[COLOR=green]if (strchr(text, '!')) { // ! character is used for global chat[BR][/BR] SendToAllChannels(text);[BR][/BR]}[/COLOR]
Next, define a function named SendToAllChannels. This function broadcasts the message to all channels. You might need to add this function to the game/src/char_manager.cpp file. On Channel-based servers, this process can be more complex, but the basic logic remains the same.
Database Integration
If you wish to log global chat messages, you can create a table in the db core. Timestamps, sender character names, etc., can be stored in this table. Example table structure:
Kod:
[COLOR=green]CREATE TABLE global_chat_log ([BR][/BR] id INT AUTO_INCREMENT PRIMARY KEY,[BR][/BR] sender_name VARCHAR(255),[BR][/BR] message TEXT,[BR][/BR] send_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP[BR][/BR]);[/COLOR]
Client-Side Configuration
You don't need to make any changes on the client-side. However, some developers may want to display global messages in a different color or with effects. In such cases, minor modifications can be made to uiscript or py root. For example, you can use Python GUI to display global messages in a separate area.
Testing and Debugging
After installing the system, during testing, check whether the global chat works properly between two characters located in different channels. If the message is not being sent, review the logs on the core. Most common issues are related to functions not being called correctly.
Conclusion
The global chat system on Metin2 private servers significantly enhances player experience. The system developed over [C++] offers a reliable and flexible structure. As Metin2Lobby.com, we continuously share the source codes and support for such advanced systems.
