File: joinmessage.pl

package info (click to toggle)
nexuiz-data 2.5.2-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,294,288 kB
  • sloc: ansic: 10,523; perl: 6,845; sh: 2,188; java: 1,417; xml: 969; lisp: 519; ruby: 136; makefile: 125
file content (33 lines) | stat: -rw-r--r-- 847 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Nexuiz rcon2irc plugin by Merlijn Hofstra licensed under GPL - joinmessage.pl
# Place this file inside the same directory as rcon2irc.pl and add the full filename to the plugins.

# Do not use more than 5 lines here, as they will be cut off by the client.
my @jmtext = (
	"Welcome to this Nexuiz server",
	"Have fun but please behave.",
);

$store{plugin_joinmessage} = \@jmtext;

sub out($$@);

[ dp => q{:join:(\d+):(\d+):([^:]*):(.*)} => sub {
	my ($id, $slot, $ip, $nick) = @_;
	my $text = $store{plugin_joinmessage};

	return 0 if ( $ip =~ m/^bot$/i );
	return 0 if defined $store{"playerid_byslot_$slot"};

	foreach ( @{ $text } ) {
		out dp => 0, "tell #$slot " . $_;
	}
	return 0;
} ],

[ dp => q{:part:(\d+)} => sub {
	my ($id) = @_;
	my $slot = $store{"playerslot_byid_$id"};

	$store{"playerid_byslot_$slot"} = undef;
	return 0;
} ],