Jump to content

Recommended Posts

Hello !

I have a problem with the global chat in C++, special character are not functionnal.

042254grdgd.jpg

I check my codes but there is nothing wrong.

Spoiler

        if(global_chat)
        {
            char buf[256];
            char chatbuf_global[CHAT_MAX_LEN + 1];
            const BYTE char_empire = ch->GetEmpire();
            if (ch->GetGMLevel() != GM_PLAYER)
            {
                strlcpy(buf, LC_TEXT("Staff"), sizeof(buf));
                std::string staff_color = "|cFFEDA11D|H|h[";
                staff_color += buf;
                staff_color += "]|cFFA7FFD4|H|h";
                sprintf(chatbuf_global, "%s %s", staff_color.c_str(), chatbuf);
            }
            else 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);
        }

Spoiler

extern bool global_chat;

Spoiler


        if(global_chat)
        {
            if (!d->GetCharacter())
                return;
        }else {
            if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))
                return;
        }

        d->GetCharacter()->ChatPacket(CHAT_TYPE_SHOUT, "%s", m_str);
    }
 

 

Thank you for your help and sorry for my bad english ! 
 

Link to comment
https://metin2.dev/topic/12938-special-character-in-global-chat/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.