World Chat?

Any discussion not related to the other forum topics
nikkinrob
Posts: 6
Joined: Sun Nov 04, 2012 9:50 am

World Chat?

Post by nikkinrob » Tue Nov 06, 2012 9:21 am

I know on some servers they make /shout into a world chat. how is this done? or is there a way to add a new command /world to talk in a chat thats all across every zone on the server? Thanks so much for the input

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: World Chat?

Post by whasf » Tue Nov 06, 2012 6:01 pm

sure! modify packet_system.cpp, find the handler for chat packets (0x0B5 I believe; a search will get you right to it on "chat") and put in some code to parse out the command you want and you can handle it yourself (i.e. If you see that command then take the text and iterate through all the zones and send the message to the players) :)
-- Whasf

nikkinrob
Posts: 6
Joined: Sun Nov 04, 2012 9:50 am

Re: World Chat?

Post by nikkinrob » Tue Nov 06, 2012 7:50 pm

can i get a little more info not good with coding myself

nikkinrob
Posts: 6
Joined: Sun Nov 04, 2012 9:50 am

Re: World Chat?

Post by nikkinrob » Tue Nov 06, 2012 8:10 pm

im presuming this line needs to be altered?
case MESSAGE_SHOUT: PChar->loc.zone->PushPacket(PChar, CHAR_INSHOUT, new CChatMessagePacket(PChar, MESSAGE_SHOUT, data+6)); break;
and to something like PChar->????->PushPacket and so on.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: World Chat?

Post by bluekirby0 » Tue Nov 06, 2012 10:09 pm

I would suggest hijacking the "yell" command since we don't actually use it. Should be easy to turn it into a global chat with a bit of ingenuity.

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: World Chat?

Post by diatanato » Wed Nov 07, 2012 2:27 am

for /yell

packet_system.cpp line 2708

Code: Select all

case MESSAGE_YELL: 
{
    for (uint16 zone = 0; zone < 256; ++zone)
    {
        zoneutils::GetZone(zone)->PushPacket(
            PChar, 
            CHAR_INZONE, 
            new CChatMessagePacket(PChar, MESSAGE_SHOUT, data+6));
    }
}
break;

nasomi
Posts: 141
Joined: Wed Feb 13, 2013 8:51 am

Re: World Chat?

Post by nasomi » Wed Sep 18, 2013 6:28 pm

I know I'm resurrecting an old thread, but I'm really wanting this to work. I tried replacing hte yell command with what's above, but it didn't work. Can anyone shine some light on this?

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: World Chat?

Post by whasf » Mon Sep 23, 2013 8:54 pm

nasomi wrote:I know I'm resurrecting an old thread, but I'm really wanting this to work. I tried replacing hte yell command with what's above, but it didn't work. Can anyone shine some light on this?
What didn't work about it? Other than the number of zones has increased, that should be about it I would think (without testing it myself)
-- Whasf

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: World Chat?

Post by kjLotus » Mon Sep 23, 2013 8:58 pm

whasf wrote:
nasomi wrote:I know I'm resurrecting an old thread, but I'm really wanting this to work. I tried replacing hte yell command with what's above, but it didn't work. Can anyone shine some light on this?
What didn't work about it? Other than the number of zones has increased, that should be about it I would think (without testing it myself)
/yell might be client restricted to certain zones (jeuno, whitegate, adoulin)

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: World Chat?

Post by tagban » Fri Oct 04, 2013 7:48 am

Could always create a command like @wc (worldchat) Whats up everypony? Considering the above for Yell would probably just need a little modification to make the custom command work, AND the command could be committed but default turned off, so that admins have options to enable/disable.

This would negate the need to adding everyone that joins the world into one giant LS.

Post Reply