<?PHP
/**
*
* $Id: css_defines.inc.php 121 2006-11-24 12:59:43Z khaless $
* $Revision: 121 $
* $Author: khaless $
* $Date: 2006-11-24 23:59:43 +1100 (Fri, 24 Nov 2006) $
*
* Copyright (c) 2005 Mathew Rodley <hide@address.com>
*
* Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
DEFINE('LOG_PREFIX', 'RL ([0-9]{2})\/([0-9]{2})\/([0-9]{4}) - ([0-9]{2}):([0-9]{2}):([0-9]{2}): ');
DEFINE('CVARS_START', 'Servercvarsstart');
DEFINE('CVARS', 'Servercvar"([a-zA-Z0-9_]{1,20})"="([a-zA-Z0-9_\.]{1,20})"');
DEFINE('CVARS_END', 'Servercvarsend');
DEFINE('LOGFILE_STARTED', 'Logfilestarted\(file"([a-zA-Z0-9_\.\]*)"\)\(game"([a-zA-Z0-9_]{1,20})"\)\(version"([0-9]+)/([0-9\.]+)/([0-9]+)"\)');
DEFINE('LOGFILE_END', 'Logfileclosed');
DEFINE('LOAD_MAP', 'Loadingmap"([a-zA-Z0-9_]{1,20})"');
DEFINE('STARTED_MAP', 'Startedmap"([a-zA-Z0-9_]{1,20})"\(CRC"([0-9\-]{9})"\)');
DEFINE('GOOD_RCON', 'Rcon: "rcon challenge "(.*)" (.*)" from "([0-9\.]{7,15}):([0-9]{1,6})"');
DEFINE('BAD_RCON', 'Bad Rcon: "rcon challenge "(.*)" (.*)" from "([0-9\.]{7,15}):([0-9]{1,6})"');
DEFINE('SERVER_NAME', 'Server name is "(.*)"');
DEFINE('SERVER_SAY', 'Server say "(.*)"');
DEFINE('CONECTION', '"(.*)<([0-9]+)><(.*)><>" connected, address "([0-9\.]{7,15}):([0-9]{1,6})"');
DEFINE('ENTER_GAME', '"(.*)<([0-9]+)><(.*)><>" entered the game');
DEFINE('DISCONNECTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" disconnected');
DEFINE('SUICIDES', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" committed suicide with "(.*)"');
DEFINE('TEAM_SELECTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" joined team "([A-Za-z]{0,20})"');
DEFINE('ROLE_SELECTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" changed role to "([a-zA-Z0-9]*)"');
DEFINE('CHANGE_NAME', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" changed name to "(.*)"');
DEFINE('KILLS', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" killed "(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" with "(.*)"( \(headshot\)|)');
DEFINE('INJURING', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" attacked "(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" with "(.*)" \(damage "([0-9]+)"\)');
DEFINE('PLAYER_PLAYER_ACTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" triggered "(.*)" against "(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>"');
DEFINE('PLAYER_ACTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" triggered "(.*)"');
DEFINE('TEAM_ACTION', 'Team "([A-Za-z]{0,20})" triggered "(.*)"');
DEFINE('TEAM_WIN', 'Team "([A-Za-z]{0,20})" triggered "(.*)" \(CT "([0-9]+)"\) \(T "([0-9]+)"\)');
DEFINE('WORLD_ACTION', 'World triggered "(.*)"');
DEFINE('WORLD_WIN', 'World triggered "(.*)" \(CT "([0-9]+)"\) \(T "([0-9]+)"\)');
DEFINE('SAY', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" say "(.*)"');
DEFINE('TEAM_SAY', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" say_team "(.*)"');
DEFINE('TEAM_ALLIANCE', 'Team "([A-Za-z]{0,20})" formed alliance with team "([A-Za-z]{0,20})"');
DEFINE('PRIVATE_CHAT', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" tell "(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" message "(.*)"');
DEFINE('WEAPON_SELECTION', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" selected weapon "(.*)"');
DEFINE('WEAPON_PICKUP', '"(.*)<([0-9]+)><(.*)><([A-Za-z]{0,20})>" acquired weapon "(.*)"');
// Kbot auth stuff.
DEFINE('KBOT_AUTH_VALID_AUTH_STEAMID', 'KBOT_AUTH VALID_AUTH_STEAMID "([^"]*)" "([^"]*)"');
DEFINE('KBOT_AUTH_VALID_AUTH_CODE', 'KBOT_AUTH VALID_AUTH_CODE "([^"]*)" "([^"]*)" "([^"]*)"');
// these are the game Server Watch (SW) formats
define('SW_PREFIX', chr(3).'05* ');
define('SW_CONNECTED', SW_PREFIX.'{args[0]} has connected');
define('SW_DISCONNECTION', SW_PREFIX.'{args[0]} has disconnected');
define('SW_PUGENDING_PLAYERS', SW_PREFIX.'PUG Ending due to insufficient active players in server. [{args[0]} Active, {args[1]} Needed]');
define('SW_PLAYERLEFT', SW_PREFIX . chr(31).'Player Left. Need {args[0]} more. Password is {args[1]}');
define('SW_PLAYERLEFT_AUTH', SW_PREFIX . chr(31).'Player Left. Need {args[0]} more. Type !join to play!');
define('SW_PLAYERNEEDED_AUTH', SW_PREFIX . chr(31).'Player(s) Needed. Need {args[0]} more. Type !join to play!');
define('SW_PLAYERJOINTEAM', SW_PREFIX.'{args[0]} has joined the {args[1]}{args[2]}');
define('SW_KILL_KNIFED', SW_PREFIX . chr(31).'HaHa!!! {args[0]} KNIFED {args[1]}');
define('SW_KILL_HEADSHOT', SW_PREFIX.'{args[0]} {args[2]}(headshot) {args[1]}');
define('SW_KILL', SW_PREFIX.'{args[0]} {args[2]} {args[1]}');
define('SW_TEAMKILL', SW_PREFIX.'{args[0]} team killed {args[1]}{args[2]}');
define('SW_BOMB_DROP', SW_PREFIX.'{args[0]} dropped the bomb');
define('SW_BOMB_GOT', SW_PREFIX.'{args[0]} got the bomb');
define('SW_BOMB_SPAWNEDWITH', SW_PREFIX.'{args[0]} spawned with the bomb');
define('SW_BOMB_PLANTED', SW_PREFIX.'{args[0]} planted the bomb');
define('SW_BOMB_DEFUSE', SW_PREFIX.'{args[0]} is defusing the bomb without a defuse kit');
define('SW_BOMB_DEFUSEWKIT', SW_PREFIX.'{args[0]} is defusing the bomb with a defuse kit');
define('SW_BOMB_DEFUSED', SW_PREFIX.'{args[0]} defused the bomb');
define('SW_FIRSTHALF_START', SW_PREFIX.'Starting the first round');
define('SW_SECONDHALF_START', SW_PREFIX.'Starting the second round');
define('SW_FIRSTHALF_RESTART', SW_PREFIX.'The first round is being restarted');
define('SW_SECONDHALF_RESTART', SW_PREFIX.'The second round is being restarted');
define('SW_IRCMESSAGE', SW_PREFIX.chr(31).'Message From Ingame: {args[0]}');
define('SW_END_ADMINCOMMAND', SW_PREFIX.'PUG Ending due to admin command');
define('SW_REQUESTPLAYERS', SW_PREFIX.chr(31).'Request from ingame for {args[0]} more players, password is {args[1]}');
define('SW_REQUESTPLAYERS_AUTH',SW_PREFIX.chr(31).'Request from ingame for {args[0]} more players. Type !join to play!');
define('SW_ROUND_END', SW_PREFIX.'Round {args[0]} out of {args[1]} completed: {args[2]} '.chr(3).'12CTs {args[3]} '.chr(3).'04Ts {args[4]}');
define('SW_HALFCOMPLETED', SW_PREFIX.'{args[0]}');
define('SW_PLAYERREPORT', SW_PREFIX.'{args[0]}'.chr(3).'05 * {args[1]} * {args[2]}');
// stick it!
function buildSWSwting($format, $args = array()) {
if(!is_array($args)) return $format;
$string = $format;
for($i = 0; $i < count($args); $i++) {
$string = str_replace('{args['.$i.']}', $args[$i], $string);
}
return $string;
}
?>