Jump to content

Global Chat


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Hello,

 

To make the shout chat work for all kingdoms you need to open the file:

 

input_p2p.cpp

and search for this:

struct FuncShout

then replace this:

if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))

with this:

if (!d->GetCharacter() /*|| (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)*/)

After that open the file input_main.cpp

and find this:

        TPacketGGShout p;
 
        p.bHeader = HEADER_GG_SHOUT;
        p.bEmpire = ch->GetEmpire();
        strlcpy(p.szText, chatbuf, sizeof(p.szText));
 
        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
 
        SendShout(chatbuf, ch->GetEmpire());

and make it look like this:

	const char* kingdoms[3] = {"|cFFff000|h|h[Shinsoo]|cFFA7FFD4|H|h","|CFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
        char chatbuf_global[CHAT_MAX_LEN + 1];
        int len_global_ = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);
 
        TPacketGGShout p;
 
        p.bHeader = HEADER_GG_SHOUT;
        p.bEmpire = ch->GetEmpire();
        strlcpy(p.szText, chatbuf_global, sizeof(p.szText));
 
        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
 
        SendShout(chatbuf_global, ch->GetEmpire());

 

  • Metin2 Dev 38
  • kekw 2
  • Eyes 2
  • Sad 1
  • Smile Tear 1
  • Think 1
  • Good 15
  • Love 2
  • Love 45
Link to comment
Share on other sites

 

erro 

 

input_main.cpp:746: warning: unused variable 'len_global'
gmake: *** [OBJDIR/input_main.o] Error 1
 
 
My imput_main 
 

 

 

On the line of the array "kingdoms", you are initializing the array using regular brackets "(" and ")", instead of curly ones "{" and "}". That's what's giving that error, just fix it and it should compile fine.

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

  erro.jpg

const char* kingdoms[3] = {"|cFFff0000|H|h[shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
char chatbuf_global[CHAT_MAX_LEN + 1];
int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);
 
TPacketGGShout p;
 
p.bHeader = HEADER_GG_SHOUT;
p.bEmpire = ch->GetEmpire();
strlcpy(p.szText, chatbuf, sizeof(p.szText));
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
 
 
SendShout(chatbuf, ch->GetEmpire());

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 1 month later...
const char* kingdoms[3] = {"|cFFff000|h|h[Shinsoo]|cFFA7FFD4|H|h","|CFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
		char chatbuf_global[CHAT_MAX_LEN + 1];
		int len_global_ snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);

		TPacketGGShout p;

		p.bHeader = HEADER_GG_SHOUT;
		p.bEmpire = ch->GetEmpire();
		strlcpy(p.szText, chatbuf_global, sizeof(p.szText));

		P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));

		SendShout(chatbuf_global, ch->GetEmpire());

I think all is right. ^_^

  • Love 2
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.