&printNotice("Created clan \"$clanName\" <C:$clanId> with tag "
&printNotice("Created clan \"$clanName\" <C:$clanId> with tag "
. "\"$clanTag\" for player \"$name\"");
. "\"$clanTag\" for player \"$name\"");
return $clanId;
return $clanId;
}
}
}
}
#
#
# object getServer (string address, int port)
# object getServer (string address, int port)
#
#
# Looks up a server's ID number in the Servers table, by searching for a
# Looks up a server's ID number in the Servers table, by searching for a
# matching IP address and port. NOTE you must specify IP addresses in the
# matching IP address and port. NOTE you must specify IP addresses in the
# Servers table, NOT hostnames.
# Servers table, NOT hostnames.
#
#
# Returns a new "Server object".
# Returns a new "Server object".
#
#
sub getServer
sub getServer
{
{
my ($address, $port) = @_;
my ($address, $port) = @_;
my $query = "
my $query = "
SELECT
SELECT
a.serverId,
a.serverId,
a.game,
a.game,
a.name,
a.name,
a.rcon_password,
a.rcon_password,
a.publicaddress,
a.publicaddress,
IFNULL(b.`value`,3) AS game_engine,
IFNULL(b.`value`,3) AS game_engine,
IFNULL(c.`realgame`, 'hl2mp') AS realgame,
IFNULL(c.`realgame`, 'hl2mp') AS realgame,
IFNULL(a.max_players, 0) AS maxplayers
IFNULL(a.max_players, 0) AS maxplayers
FROM
FROM
hlstats_Servers a LEFT JOIN hlstats_Servers_Config b on a.serverId = b.serverId AND b.`parameter` = 'GameEngine' LEFT JOIN `hlstats_Games` c ON a.game = c.code
hlstats_Servers a LEFT JOIN hlstats_Servers_Config b on a.serverId = b.serverId AND b.`parameter` = 'GameEngine' LEFT JOIN `hlstats_Games` c ON a.game = c.code
WHERE
WHERE
address=? AND
address=? AND
port=? LIMIT 1
port=? LIMIT 1
";
";
my @vals = (
my @vals = (
$address,
$address,
$port
$port
);
);
my $result = &execCached("get_server_information", $query, @vals);
my $result = &execCached("get_server_information", $query, @vals);
# trying first using l4d as "realgame" code for l4d2 in db. if default server config settings won't work, will leave as own "realgame" code in db but uncomment line.
# trying first using l4d as "realgame" code for l4d2 in db. if default server config settings won't work, will leave as own "realgame" code in db but uncomment line.