Shout on console instead of GM

This section is created for developers and non-developers who think that he/she has a good (and realistic) idea that might contribute to the OpenKore community.

Moderator: Moderators

Message
Author
gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Shout on console instead of GM

#1 Post by gamenikko »

Openkore identifies shouts as GM messages.

example:
[GM] Cool Idiot113 shouts: S>+9 idiotic pants [2] pm me
i guess it should be
[Shout] Cool Idiot113 shouts: S>+9 idiotic pants [2] pm me
Just like old times.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Shout on console instead of GM

#2 Post by EternalHarvest »

Official server's Megaphone shouts are GM messages.
Form of messages can be different on each server and can be changed anytime, so configure this yourself (for example, with chatDomains plugin, if you need to filter there messages).

gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: Shout on console instead of GM

#3 Post by gamenikko »

EternalHarvest wrote:Official server's Megaphone shouts are GM messages.
Form of messages can be different on each server and can be changed anytime, so configure this yourself (for example, with chatDomains plugin, if you need to filter there messages).
but the difference is clear when you are playing, shouts are white and gm messages are yellow.
Just like old times.

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: Shout on console instead of GM

#4 Post by Technology »

If you play on kRO based servers, i suggest you play with, test and tweak this piece of code in Openkore-SVN/src/Network/Receive/Sakexe_0.pm:

Code: Select all

# TODO: known prefixes (chat domains): micc | ssss | blue | tool
sub system_chat {
	my ($self, $args) = @_;

	my $domain = bytesToString($args->{domain});
	my ($name, $message, $color);

	if ($domain eq 'micc') {
		($name, $color, $message) = unpack('Z24 a6 a*', $args->{message});
		$name = bytesToString($name);
		$color = bytesToString($color);
		$message = bytesToString($message);
	} elsif ($domain eq 'ssss') { # forces color yellow?
		$message = bytesToString($args->{message});
	} elsif ($domain eq 'blue') { # forces color blue?
		$message = bytesToString($args->{message});
	} elsif ($domain eq 'tool') { # not seen before?
		$message = bytesToString($args->{message});
	} else { # possible?
		$message = $domain . bytesToString($args->{message});
	}

	# TODO: hande different types of messages
	stripLanguageCode(\$message);
	chatLog("s", "$message\n") if ($config{logSystemChat});
	# Translation Comment: System/GM chat
	message TF("[GM] %s\n", $message), "schat";
	ChatQueue::add('gm', undef, undef, $message);

	Plugins::callHook('packet_sysMsg', {
		Msg => $message
	});

}
I wrote it to differentiate between the messages but never really implemented different message prefixes (GM, MIC, ...)
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!

Post Reply