Page 1 of 1

Shout on console instead of GM

Posted: 11 May 2010, 02:49
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

Re: Shout on console instead of GM

Posted: 11 May 2010, 08:05
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).

Re: Shout on console instead of GM

Posted: 11 May 2010, 10:23
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.

Re: Shout on console instead of GM

Posted: 11 May 2010, 10:37
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, ...)