Skip to content

Commit

Permalink
Replaced depecated ereg_replace function.
Browse files Browse the repository at this point in the history
Fixed suicide info for player specific match stats.
Added tables for handling special kill and weapon events.
  • Loading branch information
panther committed Oct 19, 2010
1 parent a4e2ca8 commit 8b74b0d
Show file tree
Hide file tree
Showing 15 changed files with 133 additions and 109 deletions.
18 changes: 13 additions & 5 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
UTStatsDB
Copyright (C) 2002-2009 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier
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
Expand Down Expand Up @@ -390,13 +390,15 @@ function menu_top() {
else
$versioncheck = "";

header('Content-Type:text/html; charset=utf-8');

echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>UTStatsDB Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="resource/admin.css" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
Expand Down Expand Up @@ -636,13 +638,15 @@ function logparse() {
//========== Login Screen =====================================================
//=============================================================================
function login() {
header('Content-Type:text/html; charset=utf-8');

echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>UTStatsDB Admin Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="resource/uicon.png" type="image/png" />
<style type="text/css">
.sidebox {border: 1px #000000 solid}
Expand Down Expand Up @@ -688,13 +692,15 @@ function setFocus() {
}

function invalid_login() {
header('Content-Type:text/html; charset=utf-8');

echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Invalid Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="resource/uicon.png" type="image/png" />
</head>
<body text="#ff0000">
Expand All @@ -710,13 +716,15 @@ function invalid_login() {
}

function auth_required() {
header('Content-Type:text/html; charset=utf-8');

echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Authorization Required</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="resource/uicon.png" type="image/png" />
</head>
<body text="#ff0000">
Expand Down
5 changes: 4 additions & 1 deletion docs/RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
UTStatsDB
Copyright (C) 2002-2009 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier

Release Notes:

Expand All @@ -15,6 +15,9 @@ Unreleased
Fixed various issues in server query.
Rewrote documentation.
Added compatibility with non-standard game speeds.
Replaced depecated ereg_replace function.
Fixed suicide info for player specific match stats.
Added tables for handling special kill and weapon events.

Version 3.06
Added Tactical Ops support.
Expand Down
9 changes: 6 additions & 3 deletions includes/admininit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
UTStatsDB
Copyright (C) 2002-2008 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier
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
Expand All @@ -25,13 +25,15 @@
function initcheck($reinit) {
global $dbtype;

header('Content-Type:text/html; charset=utf-8');

echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>UTStatsDB Initialization</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="resource/uicon.png" type="image/png" />
<style type="text/css">
.sidebox {border: 1px #000000 solid}
Expand Down Expand Up @@ -100,7 +102,8 @@ function initconfig($reinit) {
"matches","players","playersgt","aliases","maps","weapons",
"servers","totals","gplayers","gkills","gscores","tkills",
"gevents","pwkills","type","items","pitems","gitems","gchat",
"objectives","mwkills","gwaccuracy","gbots","connections","eventdesc");
"objectives","mwkills","gwaccuracy","gbots","connections",
"eventdesc","special","specialtypes");

if ($IPass != $InitPass) {
echo <<<EOF
Expand Down
2 changes: 1 addition & 1 deletion includes/logclasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
UTStatsDB
Copyright (C) 2002-2009 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier
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
Expand Down
16 changes: 11 additions & 5 deletions includes/logkillevents.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
UTStatsDB
Copyright (C) 2002-2009 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier
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
Expand Down Expand Up @@ -110,7 +110,7 @@ function tag_k ($i, $data)

// Check for special event
for ($i = 0; $i < $numspectypes; $i++) {
if ($specialtypes[$i][2] == 0 && $specialtypes[$i][3] > 0 && stristr($killweapon, $specialtypes[$i][1])) {
if (stristr($killweapon, $specialtypes[$i][1]) && $special[$specialtypes[$i][0]][2] == 0 && $special[$specialtypes[$i][0]][3] > 0) {
$player[$killer]->specialcount[$specialtypes[$i][0]]++;
if ($player[$killer]->specialcount[$specialtypes[$i][0]] == $specialtypes[$i][3]) {
$player[$killer]->specialevents[$specialtypes[$i][0]]++;
Expand All @@ -123,16 +123,22 @@ function tag_k ($i, $data)

// Check for road kill
if ($killweapsec == 4) {
$i = array_search(specialtypes[
$player[$killer]->specialcount[$specialtypes[$i][0]]++; // roadkills++;
for ($i = 0, $roadkill = -1; $i < $numspectypes; $i++) {
if (stristr("Road Kill", $specialtypes[$i][1]) && $specialtypes[$i][3] == 2) {
$roadkill = $i;
break;
}
}

if ($roadkill >= 0)
$player[$killer]->specialcount[$specialtypes[$roadkill][0]]++; // roadkills++;

// Check for road rampage
if ($player[$killer]->roadkills >= 15 && !$player[$killer]->roadrampage) {
$player[$killer]->roadrampage = 1;
weaponspecial($killtime, $killer, 5, 0);
}
}
*/

// Track Killing Sprees for Killer
if (!$spree[$killer][1]) {
Expand Down
8 changes: 4 additions & 4 deletions includes/logparse.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
UTStatsDB
Copyright (C) 2002-2008 Patrick Contreras / Paul Gallier
Copyright (C) 2002-2010 Patrick Contreras / Paul Gallier
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
Expand Down Expand Up @@ -90,10 +90,10 @@ function parselog($file,$chatfile)
exit;
}
$numspectypes = 0;
$specialtypes = array(array ());
$specialtypes = array(array());
while ($row = sql_fetch_row($result)) {
$specialtypes[$numspec][0] = $row[0];
$specialtypes[$numspec++][1] = intval($row[1]);
$specialtypes[$numspectypes][0] = $row[0];
$specialtypes[$numspectypes++][1] = intval($row[1]);
}
sql_free_result($result);

Expand Down
Loading

0 comments on commit 8b74b0d

Please sign in to comment.