Reupload after bitbucket wipe

This commit is contained in:
Chris Lynch 2013-12-25 18:43:29 -05:00
commit 965453909e
5942 changed files with 99045 additions and 0 deletions

1764
CHANGELOG Normal file

File diff suppressed because it is too large Load Diff

34
CREATORS Normal file
View File

@ -0,0 +1,34 @@
HLstatsX Community Edition - Real-time player and clan rankings and statistics
http://www.hlxcommunity.com
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
HLstatsX is an enhanced version of ELstatsNEO
ELstatsNEO - Real-time player and clan rankings and statistics
http://ovrsized.neo-soft.org/
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://ovrsized.neo-soft.org!

101
IMAGES Normal file
View File

@ -0,0 +1,101 @@
HLStatsX Community Edition
IMAGES Credits
NOTE: The developers have made a good-faith effort to give credit where credit is due for images provided to the project.
All images remain the property of their respective owners.
HLStatsX Community Edition
Classic Game Icons: vaksa (http://www.myspace.com/vaksa)
Logo: Viper
Nav-icons: Viper
Signature Images: R3M
Hitbox Flash Animation by sandman {sandman@borgcluster.de)
Updated with new logo by BusteR
Age of Chivalry
Game icon: pirate555
Counter-Strike
Maps: (jumpin) banana from HLStats Project
Ribbons: Unity
Weapons: (jumpin) banana from HLStats Project
Counter-Strike: Source
Awards: Hellraiser from ELstatsNEO (http://forum.elstatsneo.de), HS Fighter
Heatmaps: stachi,
Ribbons: Hellraiser from ELstatsNEO (http://forum.elstatsneo.de), HS Fighter
Weapons: HO!NO!
Day of Defeat
Heatmaps: Zuko
Maps: (jumpin) banana from HLStats Project
Weapons: (jumpin) banana from HLStats Project
Day of Defeat: Source
Awards: Mosalar
Fistful of Frags
Awards: Mosalar
Goldeneye Source
Awards: Dr.NO
Maps: Dr.NO
Roles: Dr.NO
Weapons: Dr.No
HL2DM
Awards: Osiris_TSGK
Ribbons: Osiris_TSGK
Insurgency
Awards: Trawa
Ribbons: Trawa
Other: Zuko, _KaszpiR_
Left4Dead
Awards: U#O, MrXorMrY
Maps: Honk
Ribbons: U#O, MrXorMrY
Roles: MrXorMrY
Weapons: R3M
Left4Dead 2
Awards: U#0, MrXorMry
Ribbons: U#0, MrXorMry
Roles: ribit
Weapons: R3M
Signature images: gH0sTy (http://www.affenkaefig.com/)
Natural-Selection
Heatmaps: Zuko
Maps: (jumpin) banana from HLStats Project from HLStats Project
Weapons: (jumpin) banana from HLStats Project
NeoTokyo Source
Awards: R3M
Maps: R3M
Ribbons: R3M
Weapons: R3M
Stargate: The Last Stand
Heatmaps: Zuko
Team Fortress Classic
Heatmaps: Zuko
Maps: (jumpin) banana from HLStats Project
Weapons: (jumpin) banana from HLStats Project
Team Fortress 2
Awards: FernFerret, Semikolon, DragonShadow, Fluff-a-Licious, Rakshot, bug
Heatmaps: Patalete, Roman Sobol
Maps: Extrim25
Ribbons: FernFerret, Semikolon, DragonShadow, Rakshot, bug
Sandvich Award Icon: aveneyer (aveneyer@gmail.com)
Weapons: HO!NO!, Semikolon, FernFerret, DragonShadow, Solarpowered, soolshock, bug
Zombie Panic Source
Awards: aveneyer (aveneyer@gmail.com)
Game icon: ~WaywerdWolf (wiff23@msn.com)
Weapons: aveneyer (aveneyer@gmail.com)

340
LICENSE Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

54
README Normal file
View File

@ -0,0 +1,54 @@
===========================================================
HLstatsX Community Edition
http://www.hlxce.com
===========================================================
HLstatsX Community Edition is an open-source project licensed
under GNU General Public License v2 and is a real-time stats
and ranking for Source engine based games. HLstatsX Community
Edition uses a Perl daemon to parse the log streamed from the
game server. The data is stored in a MySQL Database and has
a PHP frontend.
For installation help, please visit our web site:
http://www.hlxce.com
http://wiki.hlxce.com
or our forums:
http://forums.hlxce.com
or join us on IRC:
irc.gamesurge.net, channel #HLXCE
To be notified of upcoming releases, you can join our
FreeLists group:
http://www.freelists.org/list/hlxce
We are also always looking for Beta-Testers. Join our
Google Group at:
http://groups.google.com/group/hlxce-beta-testers
NOTE:
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,872 @@
/**
* 2008 - Modified by Nicholas Hastings (psychonic) for used with HLstatsX Community Edition
* http://www.hlxcommunity.com
*
* HLstatsX - AMX Mod X plugin to display ingame messages
* http://www.hlstatsx.com/
* Copyright (C) 2007-2008 TTS Oetzel & Goerz GmbH
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma dynamic 16000
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <ns>
#include <cellarray>
#include <fakemeta>
#define VERSION "1.6.19 (HL1)"
new g_hlx_block_commands
new g_hlx_message_prefix
new blocked_commands[][] = { "rank", "skill", "points", "place", "session", "session_data",
"kpd", "kdratio", "kdeath", "next", "load", "status", "servers",
"top20", "top10", "top5", "clans", "cheaters", "statsme", "weapons",
"weapon", "action", "actions", "accuracy", "targets", "target", "kills",
"kill", "player_kills", "cmd", "cmds", "command", "hlx_display 0",
"hlx_display 1", "hlx_teams 0", "hlx_teams 1", "hlx_hideranking",
"hlx_chat 0", "hlx_chat 1", "hlx_menu", "servers 1", "servers 2",
"servers 3", "hlx", "hlstatsx", "help" }
new g_msgSayText
new g_HLstatsX_MainMenu
new g_HLstatsX_AutoMenu
new g_HLstatsX_EventsMenu
new logmessage_ignore[512]
new display_menu_keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9
public plugin_init()
{
register_plugin("HLstatsX CE Ingame Plugin", VERSION, "psychonic")
register_srvcmd("hlx_amx_psay", "hlx_amx_psay", 0, "<name or #userid><message> - sends private message")
register_srvcmd("hlx_amx_psay2", "hlx_amx_psay2", 0, "<name or #userid><colored><message> - sends green colored private message")
register_srvcmd("hlx_amx_bulkpsay", "hlx_amx_bulkpsay", 0, "<userid list><message> - sends private message to many")
register_srvcmd("hlx_amx_say", "hlx_amx_say", 0, "<message> - sends message to all players")
register_srvcmd("hlx_amx_csay", "hlx_amx_csay", 0, "<message> - sends center hud message to all players")
register_srvcmd("hlx_amx_hint", "hlx_amx_hint", 0, "<name or #userid><message> - sends hint message")
register_srvcmd("hlx_amx_msay", "hlx_amx_msay", 0, "<delay><userid><message> - displays advanced information")
register_srvcmd("hlx_amx_browse", "hlx_amx_browse", 0, "<userid><url> - displays internal browser")
register_srvcmd("hlx_amx_swap", "hlx_amx_swap", 0, "<userid> - swaps players to the opposite team")
register_cvar("hlxce_plugin_version", VERSION, FCVAR_SPONLY|FCVAR_SERVER)
register_cvar("hlxce_version", "", FCVAR_SPONLY|FCVAR_SERVER)
register_cvar("hlxce_webpage", "http://www.hlxcommunity.com", FCVAR_SPONLY|FCVAR_SERVER)
g_hlx_block_commands = register_cvar("hlx_block_commands", "1")
g_hlx_message_prefix = register_cvar("hlx_message_prefix", "")
// building the menus only once
g_HLstatsX_MainMenu = menu_create("HLstatsX - Main Menu", "mainmenu_handle")
menu_additem(g_HLstatsX_MainMenu, "Display Rank", "1")
menu_additem(g_HLstatsX_MainMenu, "Next Players", "2")
menu_additem(g_HLstatsX_MainMenu, "Top10 Players", "3")
menu_additem(g_HLstatsX_MainMenu, "Auto Ranking", "7")
menu_additem(g_HLstatsX_MainMenu, "Console Events", "8")
menu_setprop(g_HLstatsX_MainMenu, MPROP_PERPAGE, 6)
g_HLstatsX_AutoMenu = menu_create("HLstatsX - Auto-Ranking", "automenu_handle")
menu_additem(g_HLstatsX_AutoMenu, "Enable on round-start", "1")
menu_additem(g_HLstatsX_AutoMenu, "Enable on round-end", "2")
menu_additem(g_HLstatsX_AutoMenu, "Enable on player death", "3")
menu_additem(g_HLstatsX_AutoMenu, "Disable", "4")
menu_setprop(g_HLstatsX_AutoMenu, MPROP_PERPAGE, 0)
g_HLstatsX_EventsMenu = menu_create("HLstatsX - Console Events", "eventsmenu_handle")
menu_additem(g_HLstatsX_EventsMenu, "Enable Events", "1")
menu_additem(g_HLstatsX_EventsMenu, "Disable Events", "2")
menu_additem(g_HLstatsX_EventsMenu, "Enable Global Chat", "3")
menu_additem(g_HLstatsX_EventsMenu, "Disable Global Chat", "4")
menu_setprop(g_HLstatsX_EventsMenu, MPROP_PERPAGE, 0)
register_menucmd(register_menuid("Display Menu"), display_menu_keys, "handle_internal_menu")
register_clcmd("say", "hlx_block_commands")
register_clcmd("say_team", "hlx_block_commands")
g_msgSayText = get_user_msgid("SayText")
}
public log_player_event(client, verb[32], player_event[192], display_location)
{
if ((client > 0) && (is_user_connected(client))) {
new player_userid = get_user_userid(client)
static player_authid[32]
get_user_authid(client, player_authid, 31)
static player_name[32]
get_user_name(client, player_name, 31)
static player_team[16]
get_user_team(client, player_team, 15)
if (display_location > 0) {
new player_origin[3]
get_user_origin (client, player_origin)
format(logmessage_ignore, 511, "^"%s<%d><%s><%s>^" %s ^"%s^"", player_name, player_userid, player_authid, player_team, verb, player_event)
log_message("^"%s<%d><%s><%s>^" %s ^"%s^" (position ^"%d %d %d^")", player_name, player_userid, player_authid, player_team, verb, player_event, player_origin[0], player_origin[1], player_origin[2])
} else {
log_message("^"%s<%d><%s><%s>^" %s ^"%s^"", player_name, player_userid, player_authid, player_team, verb, player_event)
}
}
}
public game_log_hook(AlertType: type, message[])
{
if (type != at_logged ) {
return FMRES_IGNORED
}
if ((strcmp("", logmessage_ignore) != 0) && (contain(message, logmessage_ignore) != -1)) {
if (contain(message, "position") == -1) {
logmessage_ignore = ""
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
stock ExplodeString( Output[][], Max, Size, Input[], Delimiter )
{
new Idx, l = strlen(Input), Len;
do Len += (1 + copyc( Output[Idx], Size, Input[Len], Delimiter ));
while( (Len < l) && (++Idx < Max) )
return Idx;
}
psay (client_id[], client_message[192])
{
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
static display_message[192]
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
format(display_message, 192, "%s", client_message)
} else {
format(display_message, 192, "%s %s", message_prefix, client_message)
}
message_begin(MSG_ONE, g_msgSayText, {0,0,0}, player_index)
write_byte(player_index)
write_string(display_message)
message_end()
}
}
}
public hlx_amx_bulkpsay(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
new client_id_list[48]
read_argv(1, client_id_list, 47)
new client_ids[8][6];
ExplodeString(client_ids, 7, 5, client_id_list, ',');
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
for (new i = 0; i < 8; i++)
{
psay(client_ids[i], client_message);
}
return PLUGIN_HANDLED
}
public hlx_amx_psay(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
psay(client_id, client_message)
return PLUGIN_HANDLED
}
public hlx_amx_psay2(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
new color_index = player_index
static display_message[192]
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
format(display_message, 192, "%s", client_message)
} else {
format(display_message, 192, "%s %s", message_prefix, client_message)
}
message_begin(MSG_ONE, g_msgSayText, {0,0,0}, player_index)
write_byte(color_index)
write_string(display_message)
message_end()
}
}
return PLUGIN_HANDLED
}
public hlx_amx_say(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static message[192]
read_args(message, 191)
remove_quotes(message)
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
client_print(0, print_chat, "%s", message)
} else {
client_print(0, print_chat, "%s %s", message_prefix, message)
}
return PLUGIN_HANDLED
}
public hlx_amx_csay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static message[192]
read_args(message, 191)
remove_quotes(message)
new color3[0][] = {255, 255, 255}
new Float:verpos = 0.3
set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
show_hudmessage(0, "%s", message)
return PLUGIN_HANDLED
}
public hlx_amx_hint(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new argument_count = read_argc()
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
new client_message[192]
for(new i = 1; i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > 1) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
new color3[0][] = {255, 128, 0}
new Float:verpos = 0.80
set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
show_hudmessage(player_index, "%s", client_message)
}
}
return PLUGIN_HANDLED
}
public hlx_amx_msay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
static delay[8]
read_argv(1, delay, 7)
remove_quotes(delay)
static name[32]
read_argv(2, name, 31)
copy(name, 30, name[1])
new raw_user_id = str_to_num(name)
static handler_param[32]
read_argv(3, handler_param, 31)
new ignore_param = 0
new need_handler = 0
if (strcmp(handler_param, "1") == 0) {
need_handler = 1
ignore_param = 1
}
if (strcmp(handler_param, "0") == 0) {
need_handler = 0
ignore_param = 1
}
static message[1024]
new userid
new Players[32]
new player_count, player_index
get_players(Players, player_count, "ch")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == raw_user_id) {
userid = player
break
}
}
read_args(message, 1023)
new find_pattern[] = "#"
new find_pos = strfind(message, find_pattern)
new text_pos = find_pos + strlen(name) + 2
if (ignore_param == 1) {
text_pos += 3
}
static menu_text[1024]
copy(menu_text, 1023, message[text_pos])
remove_quotes(menu_text)
new menu_display[1024]
new i, start = 0
new nLen = 0
new buffer[1024]
for(i = 0; i < strlen(menu_text); i++) {
if (i > 0) {
if ((menu_text[i-1] == '\') && (menu_text[i] == 'n')) {
buffer = ""
copy(buffer, (i - start)-1 , menu_text[start])
nLen += format(menu_display[nLen], (1023 - nLen), "%s^n", buffer)
i += 1
start = i
}
}
}
if ((userid > 0) && (!is_user_bot(userid)) && (is_user_connected(userid))) {
if (need_handler == 0) {
show_menu(userid, display_menu_keys, menu_display, 15)
} else {
show_menu(userid, display_menu_keys, menu_display, 15, "Display Menu")
}
}
return PLUGIN_HANDLED
}
public handle_internal_menu(id, key)
{
new client = id
if (is_user_connected(client)) {
if (key < 9) {
static player_event[192]
new slot = key
slot++
num_to_str(slot, player_event, 192)
log_player_event(client, "selected", player_event, 0)
} else {
new player_event[192] = "cancel"
log_player_event(client, "selected", player_event, 0)
}
}
}
public hlx_amx_browse(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static name[32]
read_argv(1, name, 31)
copy(name, 30, name[1])
new raw_user_id = str_to_num(name)
static message[160]
new userid
new Players[32]
new player_count, player_index
get_players(Players, player_count, "ch")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == raw_user_id) {
userid = player
break
}
}
read_args(message, 159)
new find_pattern[] = "#"
new find_pos = strfind(message, find_pattern)
static url[160]
copy(url, 159, message[find_pos + strlen(name) + 2])
remove_quotes(url)
if ((userid > 0) && (!is_user_bot(userid)) && (is_user_connected(userid))) {
show_motd(userid, url, "HLstatsX CE")
}
return PLUGIN_HANDLED
}
public hlx_amx_swap(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
new client = str_to_num(client_id)
if (client > 0) {
new userid = 0
new Players[32]
new player_count, player_index
get_players(Players, player_count, "h")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
userid = player
break
}
}
static player_team[32]
get_user_team(userid, player_team, 31)
if ((userid > 0) && (is_user_connected(userid))) {
}
}
return PLUGIN_HANDLED
}
stock make_player_command(client, player_command[192])
{
if (client > 0) {
log_player_event(client, "say", player_command, 0)
}
}
public display_menu(menu, id)
{
menu_display(id, menu, 0)
}
public display_mainmenu(id)
{
display_menu(g_HLstatsX_MainMenu, id)
return PLUGIN_HANDLED
}
public display_automenu(id)
{
display_menu(g_HLstatsX_AutoMenu, id)
return PLUGIN_HANDLED
}
public display_eventsmenu(id)
{
display_menu(g_HLstatsX_EventsMenu, id)
return PLUGIN_HANDLED
}
public mainmenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/rank")
case 2 :
make_player_command(id, "/next")
case 3 :
make_player_command(id, "/top10")
case 4 :
make_player_command(id, "/clans")
case 5 :
make_player_command(id, "/status")
case 6 :
make_player_command(id, "/statsme")
case 7 :
display_automenu(id)
case 8 :
display_eventsmenu(id)
case 9 :
make_player_command(id, "/weapons")
case 10 :
make_player_command(id, "/accuracy")
case 11 :
make_player_command(id, "/targets")
case 12 :
make_player_command(id, "/kills")
case 13 :
make_player_command(id, "/hlx_hideranking")
case 14 :
make_player_command(id, "/cheaters")
case 15 :
make_player_command(id, "/help")
}
return PLUGIN_HANDLED
}
public automenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/hlx_auto start rank")
case 2 :
make_player_command(id, "/hlx_auto end rank")
case 3 :
make_player_command(id, "/hlx_auto kill rank")
case 4 :
make_player_command(id, "/hlx_auto clear")
}
return PLUGIN_HANDLED
}
public eventsmenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/hlx_display 1")
case 2 :
make_player_command(id, "/hlx_display 0")
case 3 :
make_player_command(id, "/hlx_chat 1")
case 4 :
make_player_command(id, "/hlx_chat 0")
}
return PLUGIN_HANDLED
}
stock is_command_blocked(command[192])
{
new command_blocked = 0
new command_index = 0
while ((command_blocked == 0) && (command_index < sizeof(blocked_commands))) {
if (strcmp(command, blocked_commands[command_index]) == 0) {
command_blocked++
}
command_index++
}
if (command_blocked > 0) {
return 1
}
return 0
}
public hlx_block_commands(client)
{
if (client) {
if (client == 0) {
return PLUGIN_CONTINUE
}
new block_chat_commands = get_pcvar_num(g_hlx_block_commands)
static user_command[192]
read_args(user_command, 192)
static origin_command[192]
new start_index = 0
new command_length = strlen(user_command)
if (command_length > 0) {
if (user_command[start_index] == 34) {
start_index = start_index + 1
if (user_command[command_length - 1] == 34) {
user_command[command_length - 1] = 0
}
}
if (user_command[start_index] == 47) {
start_index++
}
copy(origin_command, 192, user_command[start_index])
}
if (command_length > 0) {
if (block_chat_commands > 0) {
new command_type[32] = "say"
new command_blocked = is_command_blocked(origin_command)
if (command_blocked > 0) {
if (is_user_connected(client)) {
if ((strcmp("hlx_menu", user_command[start_index]) == 0) ||
(strcmp("hlx", user_command[start_index]) == 0) ||
(strcmp("hlstatsx", user_command[start_index]) == 0)) {
display_mainmenu(client)
}
log_player_event(client, command_type, origin_command, 0)
}
return PLUGIN_HANDLED
}
} else {
if (is_user_connected(client)) {
if ((strcmp("hlx_menu", user_command[start_index]) == 0) ||
(strcmp("hlx", user_command[start_index]) == 0) ||
(strcmp("hlstatsx", user_command[start_index]) == 0)) {
display_mainmenu(client)
}
}
return PLUGIN_CONTINUE
}
}
}
return PLUGIN_CONTINUE
}

View File

@ -0,0 +1,913 @@
/**
* 2008 - Modified by Nicholas Hastings (psychonic) for used with HLstatsX Community Edition
* http://www.hlxcommunity.com
*
* HLstatsX - AMX Mod X plugin to display ingame messages
* http://www.hlstatsx.com/
* Copyright (C) 2007-2008 TTS Oetzel & Goerz GmbH
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma dynamic 16000
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <tfcx>
#include <cellarray>
#include <fakemeta>
#define VERSION "1.6.19 (HL1)"
new g_hlx_block_commands
new g_hlx_message_prefix
new blocked_commands[][] = { "rank", "skill", "points", "place", "session", "session_data",
"kpd", "kdratio", "kdeath", "next", "load", "status", "servers",
"top20", "top10", "top5", "clans", "cheaters", "statsme", "weapons",
"weapon", "action", "actions", "accuracy", "targets", "target", "kills",
"kill", "player_kills", "cmd", "cmds", "command", "hlx_display 0",
"hlx_display 1", "hlx_teams 0", "hlx_teams 1", "hlx_hideranking",
"hlx_chat 0", "hlx_chat 1", "hlx_menu", "servers 1", "servers 2",
"servers 3", "hlx", "hlstatsx", "help" }
new g_msgSayText
new g_HLstatsX_MainMenu
new g_HLstatsX_AutoMenu
new g_HLstatsX_EventsMenu
new logmessage_ignore[512]
new display_menu_keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9
public plugin_init()
{
register_plugin("HLstatsX CE Ingame Plugin", VERSION, "psychonic")
register_srvcmd("hlx_amx_psay", "hlx_amx_psay", 0, "<name or #userid><message> - sends private message")
register_srvcmd("hlx_amx_bulkpsay", "hlx_amx_bulkpsay", 0, "<userid list><message> - sends private message to many")
register_srvcmd("hlx_amx_psay2", "hlx_amx_psay2", 0, "<name or #userid><colored><message> - sends green colored private message")
register_srvcmd("hlx_amx_say", "hlx_amx_say", 0, "<message> - sends message to all players")
register_srvcmd("hlx_amx_csay", "hlx_amx_csay", 0, "<message> - sends center hud message to all players")
register_srvcmd("hlx_amx_hint", "hlx_amx_hint", 0, "<name or #userid><message> - sends hint message")
register_srvcmd("hlx_amx_msay", "hlx_amx_msay", 0, "<delay><userid><message> - displays advanced information")
register_srvcmd("hlx_amx_browse", "hlx_amx_browse", 0, "<userid><url> - displays internal browser")
register_srvcmd("hlx_amx_swap", "hlx_amx_swap", 0, "<userid> - swaps players to the opposite team")
register_cvar("hlxce_plugin_version", VERSION, FCVAR_SPONLY|FCVAR_SERVER)
register_cvar("hlxce_version", "", FCVAR_SPONLY|FCVAR_SERVER)
register_cvar("hlxce_webpage", "http://www.hlxcommunity.com", FCVAR_SPONLY|FCVAR_SERVER)
g_hlx_block_commands = register_cvar("hlx_block_commands", "1")
g_hlx_message_prefix = register_cvar("hlx_message_prefix", "")
// building the menus only once
g_HLstatsX_MainMenu = menu_create("HLstatsX - Main Menu", "mainmenu_handle")
menu_additem(g_HLstatsX_MainMenu, "Display Rank", "1")
menu_additem(g_HLstatsX_MainMenu, "Next Players", "2")
menu_additem(g_HLstatsX_MainMenu, "Top10 Players", "3")
menu_additem(g_HLstatsX_MainMenu, "Clans Ranking", "4")
menu_additem(g_HLstatsX_MainMenu, "Server Status", "5")
menu_additem(g_HLstatsX_MainMenu, "Statsme", "6")
menu_additem(g_HLstatsX_MainMenu, "Auto Ranking", "7")
menu_additem(g_HLstatsX_MainMenu, "Console Events", "8")
menu_additem(g_HLstatsX_MainMenu, "Weapon Usage", "9")
menu_additem(g_HLstatsX_MainMenu, "Weapons Accuracy", "10")
menu_additem(g_HLstatsX_MainMenu, "Weapons Targets", "11")
menu_additem(g_HLstatsX_MainMenu, "Player Kills", "12")
menu_additem(g_HLstatsX_MainMenu, "Toggle Ranking Display", "13")
menu_additem(g_HLstatsX_MainMenu, "VAC Cheaterlist", "14")
menu_additem(g_HLstatsX_MainMenu, "Display Help", "15")
menu_setprop(g_HLstatsX_MainMenu, MPROP_PERPAGE, 6)
g_HLstatsX_AutoMenu = menu_create("HLstatsX - Auto-Ranking", "automenu_handle")
menu_additem(g_HLstatsX_AutoMenu, "Enable on round-start", "1")
menu_additem(g_HLstatsX_AutoMenu, "Enable on round-end", "2")
menu_additem(g_HLstatsX_AutoMenu, "Enable on player death", "3")
menu_additem(g_HLstatsX_AutoMenu, "Disable", "4")
menu_setprop(g_HLstatsX_AutoMenu, MPROP_PERPAGE, 0)
g_HLstatsX_EventsMenu = menu_create("HLstatsX - Console Events", "eventsmenu_handle")
menu_additem(g_HLstatsX_EventsMenu, "Enable Events", "1")
menu_additem(g_HLstatsX_EventsMenu, "Disable Events", "2")
menu_additem(g_HLstatsX_EventsMenu, "Enable Global Chat", "3")
menu_additem(g_HLstatsX_EventsMenu, "Disable Global Chat", "4")
menu_setprop(g_HLstatsX_EventsMenu, MPROP_PERPAGE, 0)
register_menucmd(register_menuid("Display Menu"), display_menu_keys, "handle_internal_menu")
register_clcmd("say", "hlx_block_commands")
register_clcmd("say_team", "hlx_block_commands")
g_msgSayText = get_user_msgid("SayText")
}
public log_player_event(client, verb[32], player_event[192], display_location)
{
if ((client > 0) && (is_user_connected(client))) {
new player_userid = get_user_userid(client)
static player_authid[32]
get_user_authid(client, player_authid, 31)
static player_name[32]
get_user_name(client, player_name, 31)
static player_team[16]
get_user_team(client, player_team, 15)
if (display_location > 0) {
new player_origin[3]
get_user_origin (client, player_origin)
format(logmessage_ignore, 511, "^"%s<%d><%s><%s>^" %s ^"%s^"", player_name, player_userid, player_authid, player_team, verb, player_event)
log_message("^"%s<%d><%s><%s>^" %s ^"%s^" (position ^"%d %d %d^")", player_name, player_userid, player_authid, player_team, verb, player_event, player_origin[0], player_origin[1], player_origin[2])
} else {
log_message("^"%s<%d><%s><%s>^" %s ^"%s^"", player_name, player_userid, player_authid, player_team, verb, player_event)
}
}
}
public game_log_hook(AlertType: type, message[])
{
if (type != at_logged ) {
return FMRES_IGNORED
}
if ((strcmp("", logmessage_ignore) != 0) && (contain(message, logmessage_ignore) != -1)) {
if (contain(message, "position") == -1) {
logmessage_ignore = ""
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
new id = victim
if ((id > 0) && (is_user_connected(id))) {
new iStats[8], iHits[8]
static szTeam[16], szName[32], szAuthid[32], szWeapon[24]
new iUserid = get_user_userid(id)
new _max = TFCMAX_WEAPONS
get_user_team(id, szTeam, 15)
get_user_name(id, szName, 31)
get_user_authid(id, szAuthid, 31)
for (new i = 1; i < _max; ++i) {
if (get_user_wstats(id, i, iStats, iHits)) {
xmod_get_wpnlogname(i, szWeapon, 23)
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^")",
szName, iUserid, szAuthid, szTeam, szWeapon, iStats[4], iStats[5], iStats[0], iStats[2], iStats[3], iStats[6], iStats[1])
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats2^" (weapon ^"%s^") (head ^"%d^") (chest ^"%d^") (stomach ^"%d^") (leftarm ^"%d^") (rightarm ^"%d^") (leftleg ^"%d^") (rightleg ^"%d^")",
szName, iUserid, szAuthid, szTeam, szWeapon, iHits[1], iHits[2], iHits[3], iHits[4], iHits[5], iHits[6], iHits[7])
}
}
reset_user_wstats(id)
}
}
stock ExplodeString( Output[][], Max, Size, Input[], Delimiter )
{
new Idx, l = strlen(Input), Len;
do Len += (1 + copyc( Output[Idx], Size, Input[Len], Delimiter ));
while( (Len < l) && (++Idx < Max) )
return Idx;
}
psay (client_id[], client_message[192])
{
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
static display_message[192]
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
format(display_message, 192, "%s", client_message)
} else {
format(display_message, 192, "%s %s", message_prefix, client_message)
}
message_begin(MSG_ONE, g_msgSayText, {0,0,0}, player_index)
write_byte(player_index)
write_string(display_message)
message_end()
}
}
}
public hlx_amx_bulkpsay(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
new client_id_list[48]
read_argv(1, client_id_list, 47)
new client_ids[8][6];
ExplodeString(client_ids, 7, 5, client_id_list, ',');
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
for (new i = 0; i < 8; i++)
{
psay(client_ids[i], client_message);
}
return PLUGIN_HANDLED
}
public hlx_amx_psay(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
psay(client_id, client_message)
return PLUGIN_HANDLED
}
public hlx_amx_psay2(id, level, cid)
{
new argument_count = read_argc()
if (argument_count < 3) {
return PLUGIN_HANDLED
}
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
static colored_param[32]
read_argv(2, colored_param, 31)
new ignore_param = 0
if (strcmp(colored_param, "1") == 0) {
ignore_param = 1
}
if (strcmp(colored_param, "0") == 0) {
ignore_param = 1
}
new client_message[192]
for(new i = (1 + ignore_param); i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > (1 + ignore_param)) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
new color_index = player_index
static display_message[192]
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
format(display_message, 192, "%s", client_message)
} else {
format(display_message, 192, "%s %s", message_prefix, client_message)
}
message_begin(MSG_ONE, g_msgSayText, {0,0,0}, player_index)
write_byte(color_index)
write_string(display_message)
message_end()
}
}
return PLUGIN_HANDLED
}
public hlx_amx_say(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static message[192]
read_args(message, 191)
remove_quotes(message)
static message_prefix[64]
get_pcvar_string(g_hlx_message_prefix, message_prefix, 64)
if (strcmp(message_prefix, "") == 0) {
client_print(0, print_chat, "%s", message)
} else {
client_print(0, print_chat, "%s %s", message_prefix, message)
}
return PLUGIN_HANDLED
}
public hlx_amx_csay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static message[192]
read_args(message, 191)
remove_quotes(message)
new color3[0][] = {255, 255, 255}
new Float:verpos = 0.3
set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
show_hudmessage(0, "%s", message)
return PLUGIN_HANDLED
}
public hlx_amx_hint(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new argument_count = read_argc()
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
new client_message[192]
for(new i = 1; i < argument_count; i++) {
static temp_argument[192]
read_argv(i + 1, temp_argument, 191)
if (i > 1) {
if ((191 - strlen(client_message)) > strlen(temp_argument)) {
if ((temp_argument[0] == 41) || (temp_argument[0] == 125)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
} else if ((strlen(client_message) > 0) && (client_message[strlen(client_message)-1] != 40) && (client_message[strlen(client_message)-1] != 123) && (client_message[strlen(client_message)-1] != 58) && (client_message[strlen(client_message)-1] != 39) && (client_message[strlen(client_message)-1] != 44)) {
if ((strcmp(temp_argument, ":") != 0) && (strcmp(temp_argument, ",") != 0) && (strcmp(temp_argument, "'") != 0)) {
client_message[strlen(client_message)] = 32
}
copy(client_message[strlen(client_message)], 191, temp_argument)
} else {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
} else {
if ((192 - strlen(client_message)) > strlen(temp_argument)) {
copy(client_message[strlen(client_message)], 191, temp_argument)
}
}
}
new client = str_to_num(client_id)
if (client > 0) {
new Players[32]
new player_count, temp_player_index, player_index
get_players(Players, player_count, "ch")
for (temp_player_index = 0; temp_player_index < player_count; temp_player_index++) {
new player = Players[temp_player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
player_index = player
break
}
}
if ((player_index > 0) && (!is_user_bot(player_index)) && (is_user_connected(player_index))) {
new color3[0][] = {255, 128, 0}
new Float:verpos = 0.80
set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
show_hudmessage(player_index, "%s", client_message)
}
}
return PLUGIN_HANDLED
}
public hlx_amx_msay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
static delay[8]
read_argv(1, delay, 7)
remove_quotes(delay)
static name[32]
read_argv(2, name, 31)
copy(name, 30, name[1])
new raw_user_id = str_to_num(name)
static handler_param[32]
read_argv(3, handler_param, 31)
new ignore_param = 0
new need_handler = 0
if (strcmp(handler_param, "1") == 0) {
need_handler = 1
ignore_param = 1
}
if (strcmp(handler_param, "0") == 0) {
need_handler = 0
ignore_param = 1
}
static message[1024]
new userid
new Players[32]
new player_count, player_index
get_players(Players, player_count, "ch")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == raw_user_id) {
userid = player
break
}
}
read_args(message, 1023)
new find_pattern[] = "#"
new find_pos = strfind(message, find_pattern)
new text_pos = find_pos + strlen(name) + 2
if (ignore_param == 1) {
text_pos += 3
}
static menu_text[1024]
copy(menu_text, 1023, message[text_pos])
remove_quotes(menu_text)
new menu_display[1024]
new i, start = 0
new nLen = 0
new buffer[1024]
for(i = 0; i < strlen(menu_text); i++) {
if (i > 0) {
if ((menu_text[i-1] == '\') && (menu_text[i] == 'n')) {
buffer = ""
copy(buffer, (i - start)-1 , menu_text[start])
nLen += format(menu_display[nLen], (1023 - nLen), "%s^n", buffer)
i += 1
start = i
}
}
}
if ((userid > 0) && (!is_user_bot(userid)) && (is_user_connected(userid))) {
if (need_handler == 0) {
show_menu(userid, display_menu_keys, menu_display, 15)
} else {
show_menu(userid, display_menu_keys, menu_display, 15, "Display Menu")
}
}
return PLUGIN_HANDLED
}
public handle_internal_menu(id, key)
{
new client = id
if (is_user_connected(client)) {
if (key < 9) {
static player_event[192]
new slot = key
slot++
num_to_str(slot, player_event, 192)
log_player_event(client, "selected", player_event, 0)
} else {
new player_event[192] = "cancel"
log_player_event(client, "selected", player_event, 0)
}
}
}
public hlx_amx_browse(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
static name[32]
read_argv(1, name, 31)
copy(name, 30, name[1])
new raw_user_id = str_to_num(name)
static message[1024]
new userid
new Players[32]
new player_count, player_index
get_players(Players, player_count, "ch")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == raw_user_id) {
userid = player
break
}
}
read_args(message, 1023)
new find_pattern[] = "#"
new find_pos = strfind(message, find_pattern)
static url[1024]
copy(url, 1023, message[find_pos + strlen(name) + 2])
remove_quotes(url)
if ((userid > 0) && (!is_user_bot(userid)) && (is_user_connected(userid))) {
show_motd(userid, url, "HLstatsX CE")
}
return PLUGIN_HANDLED
}
public hlx_amx_swap(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
static client_id[32]
read_argv(1, client_id, 31)
copy(client_id, 30, client_id[1])
new client = str_to_num(client_id)
if (client > 0) {
new userid = 0
new Players[32]
new player_count, player_index
get_players(Players, player_count, "h")
for (player_index = 0; player_index < player_count; player_index++) {
new player = Players[player_index]
new temp_user_id = get_user_userid(player)
if (temp_user_id == client) {
userid = player
break
}
}
static player_team[32]
get_user_team(userid, player_team, 31)
if ((userid > 0) && (is_user_connected(userid))) {
}
}
return PLUGIN_HANDLED
}
stock make_player_command(client, player_command[192])
{
if (client > 0) {
log_player_event(client, "say", player_command, 0)
}
}
public display_menu(menu, id)
{
menu_display(id, menu, 0)
}
public display_mainmenu(id)
{
display_menu(g_HLstatsX_MainMenu, id)
return PLUGIN_HANDLED
}
public display_automenu(id)
{
display_menu(g_HLstatsX_AutoMenu, id)
return PLUGIN_HANDLED
}
public display_eventsmenu(id)
{
display_menu(g_HLstatsX_EventsMenu, id)
return PLUGIN_HANDLED
}
public mainmenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/rank")
case 2 :
make_player_command(id, "/next")
case 3 :
make_player_command(id, "/top10")
case 4 :
make_player_command(id, "/clans")
case 5 :
make_player_command(id, "/status")
case 6 :
make_player_command(id, "/statsme")
case 7 :
display_automenu(id)
case 8 :
display_eventsmenu(id)
case 9 :
make_player_command(id, "/weapons")
case 10 :
make_player_command(id, "/accuracy")
case 11 :
make_player_command(id, "/targets")
case 12 :
make_player_command(id, "/kills")
case 13 :
make_player_command(id, "/hlx_hideranking")
case 14 :
make_player_command(id, "/cheaters")
case 15 :
make_player_command(id, "/help")
}
return PLUGIN_HANDLED
}
public automenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/hlx_auto start rank")
case 2 :
make_player_command(id, "/hlx_auto end rank")
case 3 :
make_player_command(id, "/hlx_auto kill rank")
case 4 :
make_player_command(id, "/hlx_auto clear")
}
return PLUGIN_HANDLED
}
public eventsmenu_handle(id, menu, item)
{
if (item < 0) {
return PLUGIN_CONTINUE
}
static command[16], name[64]
new access, callback
menu_item_getinfo(menu, item, access, command, 15, name, 63, callback)
new choice = str_to_num(command)
switch (choice) {
case 1 :
make_player_command(id, "/hlx_display 1")
case 2 :
make_player_command(id, "/hlx_display 0")
case 3 :
make_player_command(id, "/hlx_chat 1")
case 4 :
make_player_command(id, "/hlx_chat 0")
}
return PLUGIN_HANDLED
}
stock is_command_blocked(command[192])
{
new command_blocked = 0
new command_index = 0
while ((command_blocked == 0) && (command_index < sizeof(blocked_commands))) {
if (strcmp(command, blocked_commands[command_index]) == 0) {
command_blocked++
}
command_index++
}
if (command_blocked > 0) {
return 1
}
return 0
}
public hlx_block_commands(client)
{
if (client) {
if (client == 0) {
return PLUGIN_CONTINUE
}
new block_chat_commands = get_pcvar_num(g_hlx_block_commands)
static user_command[192]
read_args(user_command, 192)
static origin_command[192]
new start_index = 0
new command_length = strlen(user_command)
if (command_length > 0) {
if (user_command[start_index] == 34) {
start_index = start_index + 1
if (user_command[command_length - 1] == 34) {
user_command[command_length - 1] = 0
}
}
if (user_command[start_index] == 47) {
start_index++
}
copy(origin_command, 192, user_command[start_index])
}
if (command_length > 0) {
if (block_chat_commands > 0) {
new command_type[32] = "say"
new command_blocked = is_command_blocked(origin_command)
if (command_blocked > 0) {
if (is_user_connected(client)) {
if ((strcmp("hlx_menu", user_command[start_index]) == 0) ||
(strcmp("hlx", user_command[start_index]) == 0) ||
(strcmp("hlstatsx", user_command[start_index]) == 0)) {
display_mainmenu(client)
}
log_player_event(client, command_type, origin_command, 0)
}
return PLUGIN_HANDLED
}
} else {
if (is_user_connected(client)) {
if ((strcmp("hlx_menu", user_command[start_index]) == 0) ||
(strcmp("hlx", user_command[start_index]) == 0) ||
(strcmp("hlstatsx", user_command[start_index]) == 0)) {
display_mainmenu(client)
}
}
return PLUGIN_CONTINUE
}
}
}
return PLUGIN_CONTINUE
}

BIN
heatmaps/DejaVuSans.ttf Normal file

Binary file not shown.

14
heatmaps/README Normal file
View File

@ -0,0 +1,14 @@
HLstatsX Community Edition
Heatmap Generation Installation Instructions
WARNING: Heatmap generation will consume alot of processor time. Please be sure to plan accordingly!
300k kills on one map will take ~10min to generate on one 2.4Ghz core processor.
Install:
- change user, password, database and path to your "web" folder in config.inc.php
- download the appropriate heatmap pack from www.hlxcommunity.com and put into "src"
To generate heatmaps:
- run: php generate.php
report problems to hlx forums or irc

20
heatmaps/config.inc.php Executable file
View File

@ -0,0 +1,20 @@
<?php
error_reporting(E_ALL);
ini_set("memory_limit", "32M");
ini_set("max_execution_time", "0");
define('DB_HOST', 'localhost');
define('DB_USER', '');
define('DB_PASS', '');
define('DB_NAME', '');
define('HLXCE_WEB', '/path/to/where/you/have/your/hlstats/web');
define('HUD_URL', 'http://www.hlxcommunity.com');
define('OUTPUT_SIZE', 'medium');
define('DB_PREFIX', 'hlstats');
define('KILL_LIMIT', 10000);
define('DEBUG', 1);
// No need to change this unless you are on really low disk.
define('CACHE_DIR', dirname(__FILE__) . '/cache');

19
heatmaps/generate.php Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/php
<?php
error_reporting(E_ALL);
ini_set("memory_limit", "32M");
require_once 'config.inc.php';
require_once 'heatmap.class.php';
$heat = new Heatmap;
$heat->init();
foreach (Env::get('mapinfo') as $game => $gameconf) {
foreach ($gameconf as $map => $data) {
$heat->generate($game, $map, "kill");
}
}
show::Event("CREATE", "Heatmap creation done.", 1);
?>

608
heatmaps/heatmap.class.php Normal file
View File

@ -0,0 +1,608 @@
<?php
/**
* This class holds Environmental vars that can be used anywhere in the code
* For example the database object to perform mysql stuff
*/
class Env {
private static $data = array();
/**
* Add the specified key=>value to the environmental data array
*
* @param string $key this is the identifier of the value you are adding
* @param string $value The value to add into the array
*/
public static function set($key, $value) {
self::$data[$key] = $value;
}
/**
* Gets the current value from the data array
*
* @param string $key The key to lookup in the array
* @throws SteambansException if the variable cannot be found
* @return mixed null if the key cannot be found, or the value that was stored in the array
*/
public static function get($key) {
return array_key_exists($key, self::$data) ? self::$data[$key] : null;
}
}
/**
* Heatmap API to generate/add/update/delete content for heatmaps.
*
*/
class Heatmap {
var $version = "0.1";
/**
* Stuff we want to fire when we start.
*
*/
public static function init () {
global $argv;
DB::connect();
self::mapinfo();
self::parseArguments($argv);
}
/**
* Function that builds the maplist from db elements.
*
*/
public static function mapinfo () {
$query = 'SELECT
g.code,
hc.game,
hc.map,
hc.xoffset,
hc.yoffset,
hc.flipx,
hc.flipy,
hc.rotate,
hc.days,
hc.brush,
hc.scale,
hc.font,
hc.thumbw,
hc.thumbh,
hc.cropx1,
hc.cropx2,
hc.cropy1,
hc.cropy2
FROM
' . DB_PREFIX . '_Games AS g
INNER JOIN
' . DB_PREFIX . '_Heatmap_Config AS hc
ON
hc.game = g.realgame
WHERE 1=1
ORDER BY code ASC, game ASC, map ASC';
$result = DB::doQuery($query);
if (DB::numRows($result)) {
while ($row = DB::getAssoc($result)) {
foreach ($row as $key => $val) {
$mapinfo[$row['code']][$row['map']][$key] = $val;
}
}
Env::set('mapinfo', $mapinfo);
}
}
private static function printHeatDot($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){
if(!isset($pct)){
return false;
}
$pct /= 100;
// Get image width and height
$w = imagesx( $src_im );
$h = imagesy( $src_im );
// Turn alpha blending off
imagealphablending( $src_im, false );
// Find the most opaque pixel in the image (the one with the smallest alpha value)
$minalpha = 127;
for( $x = 0; $x < $w; $x++ ) {
for( $y = 0; $y < $h; $y++ ){
$alpha = ( imagecolorat( $src_im, $x, $y ) >> 24 ) & 0xFF;
if( $alpha < $minalpha ){
$minalpha = $alpha;
}
}
}
//loop through image pixels and modify alpha for each
for( $x = 0; $x < $w; $x++ ){
for( $y = 0; $y < $h; $y++ ){
//get current alpha value (represents the TANSPARENCY!)
$colorxy = imagecolorat( $src_im, $x, $y );
$alpha = ( $colorxy >> 24 ) & 0xFF;
//calculate new alpha
if( $minalpha !== 127 ){
$alpha = 127 + 127 * $pct * ( $alpha - 127 ) / ( 127 - $minalpha );
} else {
$alpha += 127 * $pct;
}
//get the color index with new alpha
$alphacolorxy = imagecolorallocatealpha( $src_im, ( $colorxy >> 16 ) & 0xFF, ( $colorxy >> 8 ) & 0xFF, $colorxy & 0xFF, $alpha );
//set pixel with the new color + opacity
if( !imagesetpixel( $src_im, $x, $y, $alphacolorxy ) ){
return false;
}
}
}
// The image copy
imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
}
public static function generate($code, $map, $mode) {
// generatemap($map, $code, "Total Kills", "HlstatsX:CE")
self::buildQuery($code, $map);
$mapinfo = Env::get('mapinfo');
$map_query = Env::get('map_query');
$disable_cache = Env::get('disable_cache');
// See if we need to rotate the map or not.
$rotate = $mapinfo[$code][$map]['rotate'];
$timestamp = time();
// Fix the last part of your path.
$path = HLXCE_WEB . "/hlstatsimg/games/" . $mapinfo[$code][$map]['code'] . "/heatmaps";
show::Event("PATH", $path, 3);
// Does the source image exists? else there is no idea to spend resources on it.
if (!file_exists(dirname(__FILE__) . "/src/" . $mapinfo[$code][$map]['game'] . "/" . $map . ".jpg")) {
show::Event("FILE", dirname(__FILE__) . "/src/" . $mapinfo[$code][$map]['game'] . "/" . $map . ".jpg doesn't exists", 3);
return false;
}
// Check that the dir exists, else try to create it.
if (!is_dir($path)) {
if (!@mkdir($path)) {
show::Event("PREPARE", "Couln't create outputfolder: $path", 1);
}
}
// Check if we have cached info, then we should work from that instead.
if (is_dir(CACHE_DIR . "/$code")) {
if ($handle = opendir(CACHE_DIR. "/$code")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && preg_match(str_replace("\$","\\\$","/${map}_(\d+).png/i"), $file, $matches)) {
$cache_file = CACHE_DIR . "/$code/$file";
$oldtimestamp = $matches[1];
// unless it's over 30 days old cache file, then we delete it and go from 0 again.
if (floor((time() - $oldtimestamp) / 86400 > 30)) {
$obsolite_cache = true;
show::Event("CACHE", "Cache file is obsolite, " . floor((time() - $oldtimestamp) / 86400) . " days old. Generating from scratch", 1);
}
// If we called with --disable-cache we want to clean up and then regen from our start.
if ($disable_cache || isset($obsolite_cache)) {
$disable_cache = true;
if (file_exists($cache_file)) {
unlink($cache_file);
}
} else {
show::Event("CACHE","Found cached file ($file), we will use timestamp $oldtimestamp instead", 1);
$find = '/.*AND hef.eventTime >= FROM_UNIXTIME\([0-9]+\).*/i';
$replace = ' AND hef.eventTime > FROM_UNIXTIME(' . $oldtimestamp . ')';
$map_query = preg_replace($find, $replace, $map_query);
}
}
}
closedir($handle);
}
} else {
if (!@mkdir(CACHE_DIR . "/$code")) {
show::Event("CACHE", "Can't create cache_dir: " . CACHE_DIR . "/$code", 1);
}
}
$result = DB::doQuery($map_query);
$num_kills = DB::numRows($result);
if (!$num_kills) {
show::Event("IGNORE", "Game: $code, Map: $map, Kills: $num_kills, (to few kills)", 1);
return false;
}
$firstdata = time();
$img = imagecreatefromjpeg("./src/" . $mapinfo[$code][$map]['game'] . "/" . $map . ".jpg");
imagealphablending($img, true);
imagesavealpha($img, true);
if (isset($cache_file) && !$disable_cache) {
$overlay = imagecreatefrompng($cache_file);
} else {
$overlay = imagecreatetruecolor(imagesx($img), imagesy($img));
}
imagealphablending($overlay, true);
imagesavealpha($overlay, true);
$brush = imagecreatefrompng("./src/brush_" . $mapinfo[$code][$map]['brush'] . ".png");
$brushsize = ($mapinfo[$code][$map]['brush'] == "large") ? 33 : 17;
$white = imagecolorallocate($overlay, 255, 255, 255);
$black = imagecolorallocate($overlay, 0, 0, 0);
imagefill($overlay, 0, 0, $black);
imagecolortransparent($overlay, $black);
$num_kills = ($num_kills) ? $num_kills : 1;
show::Event("CREATE", "Game: $code, Map: $map, Kills: $num_kills", 1);
$opacity = intval((500 / $num_kills) * 100);
if ($opacity > 40) $opacity = 40;
if ($opacity < 1) $opacity = 2;
$max_red = 0;
$i = 0;
while ($row = DB::getAssoc($result)) {
if ($row['eventTime'] < $firstdata) $firstdata = $row['eventTime'];
if ($mapinfo[$code][$map]['flipx']) $row['pos_x'] = $row['pos_x'] * -1;
if ($mapinfo[$code][$map]['flipy']) $row['pos_y'] = $row['pos_y'] * -1;
$x = ($row['pos_x'] + $mapinfo[$code][$map]['xoffset']) / $mapinfo[$code][$map]['scale'];
$y = ($row['pos_y'] + $mapinfo[$code][$map]['yoffset']) / $mapinfo[$code][$map]['scale'];
$rgb = imagecolorat($overlay, $x, $y);
$colors = imagecolorsforindex($overlay, $rgb);
if ($colors['red'] > $max_red) $max_red = $colors['red'];
if ($colors['red'] <= 200) {
// Rotate the image
if ($rotate) {
self::printHeatDot($overlay, $brush, $y - ($brushsize / 2), $x - ($brushsize / 2), 0, 0, $brushsize, $brushsize, $opacity);
} else {
self::printHeatDot($overlay, $brush, $x - ($brushsize / 2), $y - ($brushsize / 2), 0, 0, $brushsize, $brushsize, $opacity);
}
}
}
imagedestroy($brush);
$colorarr = array();
$colors = array(0, 0, 255);
for ($line = 0; $line < 128; ++$line) {
$colors = array(0, $colors[1] + 2, $colors[2] -2);
$colorarr[$line] = $colors;
}
for ($line = 128; $line < 255; ++$line) {
$colors = array($colors[0] + 2, $colors[1] -2, 0);
$colorarr[$line] = $colors;
}
for ($x = 0; $x < imagesx($overlay); ++$x) {
for ($y = 0; $y < imagesy($overlay); ++$y) {
$index = imagecolorat($overlay, $x, $y);
$rgb = imagecolorsforindex($overlay, $index);
$alpha = ( imagecolorat( $overlay, $x, $y ) >> 24 ) & 0xFF;
$color = imagecolorallocatealpha($img, $colorarr[$rgb['red']][0], $colorarr[$rgb['red']][1], $colorarr[$rgb['red']][2], 127 - ($rgb['red'] / 2));
if (!imagesetpixel($img, $x, $y, $color)) echo ".";
}
}
if ($mapinfo[$code][$map]['cropy2'] > 0 && $mapinfo[$code][$map]['cropy2'] > 0) {
$temp = imagecreatetruecolor($mapinfo[$code][$map]['cropx2'], $mapinfo[$code][$map]['cropy2']);
imagecopy($temp, $img, 0, 0, $mapinfo[$code][$map]['cropx1'], $mapinfo[$code][$map]['cropy1'], $mapinfo[$code][$map]['cropx2'], $mapinfo[$code][$map]['cropy2']);
imagedestroy($img);
$img = imagecreatetruecolor(imagesx($temp), imagesy($temp));
imagecopy($img, $temp, 0, 0, 0, 0, imagesx($temp), imagesy($temp));
imagedestroy($temp);
}
if ($mapinfo[$code][$map]['thumbw'] > 0 && $mapinfo[$code][$map]['thumbh'] > 0) {
$thumb = imagecreatetruecolor(imagesx($img) * $mapinfo[$code][$map]['thumbw'], imagesy($img) * $mapinfo[$code][$map]['thumbh']);
imagecopyresampled($thumb, $img, 0, 0, 0, 0, imagesx($thumb), imagesy($thumb), imagesx($img), imagesy($img));
imagejpeg($thumb, $path . "/" . $map . "-" . $mode . "-thumb.jpg", 100);
imagedestroy($thumb);
}
$img = self::drawHud($img, $map, "HLX:CE", "Total Kills", $num_kills, $firstdata);
if (imagejpeg($img, $path . "/" . $map . "-" . $mode . ".jpg", 100)) $return = true;
if (imagepng($overlay, CACHE_DIR . "/$code/${map}_${timestamp}.png", 9)) $return = true;
imagedestroy($overlay);
// Clean upc cache file
if (isset($cache_file) && file_exists($cache_file)) {
unlink(CACHE_DIR . "/$code/${map}_${oldtimestamp}.png");
}
imagedestroy($img);
return $return;
}
public static function buildQuery ($code, $map) {
$mapinfo = Env::get('mapinfo');
Env::set('code', $code);
$ignore_infected = Env::get('ignore_infected');
$timescope = (time() - 60*60*24*$mapinfo[$code][$map]['days']);
$map_query = 'SELECT
"frag" AS killtype,
hef.id,
hef.map,
hs.game,
hef.eventTime,
hef.pos_x,
hef.pos_y
FROM
hlstats_Events_Frags as hef,
hlstats_Servers as hs
WHERE 1=1
AND hef.map = "' . $map . '"
AND hs.serverId = hef.serverId
AND hs.game = "' . $code. '"
AND hef.pos_x IS NOT NULL
AND hef.pos_y IS NOT NULL
AND hef.eventTime >= FROM_UNIXTIME(' . $timescope . ')
';
if ($ignore_infected) {
$map_query.= ' AND hef.victimRole != "infected"
';
}
$map_query.= ' LIMIT ' . KILL_LIMIT . '
UNION ALL
SELECT
"teamkill" AS killtype,
hef.id,
hef.map,
hs.game,
hef.eventTime,
hef.pos_x,
hef.pos_y
FROM
hlstats_Events_Teamkills as hef,
hlstats_Servers as hs
WHERE 1=1
AND hef.map = "' . $map . '"
AND hs.serverId = hef.serverId
AND hs.game = "' . $code. '"
AND hef.pos_x IS NOT NULL
AND hef.pos_y IS NOT NULL
AND hef.eventTime >= FROM_UNIXTIME(' . $timescope . ')
LIMIT ' . KILL_LIMIT . '
';
Env::set('map_query', $map_query);
show::Event("SQL", $map_query, 3);
}
private static function drawHud ($img, $map, $heatmapname, $method, $num_kills, $firstdata) {
$mapinfo = Env::get('mapinfo');
$code = Env::get('code');
// Resize the image according to your settings
$img = self::resize($img);
$hudText = array(
strtoupper($map) . " - " . strtoupper($heatmapname) . " HEATMAP - " . strtoupper($method),
date("m/d/y", intval(time() - 60*60*24*30)) . " - " . date("m/d/y", time()),
"Generated: " . date("Y-m-d H:i:s"),
HUD_URL
);
show::Event("HUD", "Creating Overlay HUD", 2);
$hudx = imagesx($img);
$hudy = intval(intval($mapinfo[$code][$map]['font'] + 4) * intval(count($hudText) + 1) + 8);
$hud = imagecreatetruecolor(imagesx($img), imagesy($img)) or die('Cannot Initialize new GD image stream');
imagesavealpha($hud, true);
$trans_colour = imagecolorallocatealpha($hud, 0, 0, 0, 127);
$black = imagecolorallocatealpha($hud, 0, 0, 0, 90);
imagefill($hud, 0, 0, $trans_colour);
imagefilledrectangle($hud, 0, 0, imagesx($img) - 1, imagesy($img) - 1, $black);
$font = "./DejaVuSans.ttf";
// Copy the hud to the top of the image.
imagecopy($img, $hud, 0, 0, 0, 0, $hudx, $hudy);
//array imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
$i = 1;
foreach ($hudText as $text) {
imagettftext( $img,
$mapinfo[$code][$map]['font'],
0,
10,
intval(intval($mapinfo[$code][$map]['font'] + 4) * $i + 8),
imagecolorallocate($img, 255, 255, 255),
$font,
$text
);
$i++;
}
imagedestroy($hud);
show::Event("HUD", "Done...", 2);
return $img;
}
private static function resize ($img) {
switch (OUTPUT_SIZE) {
case "small":
$newwidth = 800;
$newheight = 600;
break;
case "medium":
$newwidth = 1024;
$newheight = 768;
break;
case "large":
$newwidth = 1280;
$newheight = 1024;
// As for now we don't do anything since this is default size
return $img;
break;
default:
$newwidth = 1024;
$newheight = 768;
}
show::Event("RESIZE", "Adjusting Heatmap to current setting: " . OUTPUT_SIZE, 2);
$resized = imagecreatetruecolor($newwidth, $newheight);
imagecopyresized($resized, $img, 0, 0, 0, 0, $newwidth, $newheight, imagesx($img), imagesy($img));
imagedestroy($img);
show::Event("RESIZE", "Done...", 2);
return $resized;
}
private static function arguments($argv) {
$_ARG = array();
foreach ($argv as $arg) {
if (preg_match('/\-\-[a-zA-Z0-9]*=.*/', $arg)) {
$str = explode('=', $arg);
$arg = '';
$key = preg_replace('/\-\-/', '', $str[0]);
for ( $i = 1; $i < count($str); $i++ ) {
$arg .= $str[$i];
}
$_ARG[$key] = $arg;
} elseif(preg_match('/\-[a-zA-Z0-9]/', $arg)) {
$arg = preg_replace('/\-/', '', $arg);
$_ARG[$arg] = 'true';
}
}
return $_ARG;
}
public static function parseArguments($argv) {
$mapinfo = Env::get('mapinfo');
$cache = false;
$args = self::arguments($argv);
if (isset($args['game'])) {
if (!isset($mapinfo[$args['game']])) {
show::Event("ERROR", "Game: " . $args['game'] . " doesn't exists, escaping", 1);
exit;
}
if (isset($args['map'])) {
if (!isset($mapinfo[$args['game']][$args['map']])) {
show::Event("ERROR", "Game: " . $args['game'] . " Map: " . $args['map'] . " doesn't exists, escaping", 1);
exit;
}
$tmp[$args['game']][$args['map']] = $mapinfo[$args['game']][$args['map']];
show::Event("ARGS", "--game=" . $args['game'], 2);
show::Event("ARGS", "--map=" . $args['map'], 2);
} else {
$tmp[$args['game']] = $mapinfo[$args['game']];
show::Event("ARGS", "--game=" . $args['game'], 2);
}
} else {
$visible = '';
$query = "SELECT code FROM hlstats_Games WHERE hidden='0'";
$result = DB::doQuery($query);
if (DB::numRows($result)) {
while ($row = DB::getAssoc($result)) {
foreach ($row as $key => $val) {
if (isset($mapinfo[$val])) {
$visible .= "$val, ";
$tmp[$val] = $mapinfo[$val];
}
}
}
}
show::Event("GAMES", substr($visible, 0, -2), 2);
}
if (isset($tmp)) {
$mapinfo = $tmp;
}
if (isset($args['disablecache'])) {
$cache = true;
show::Event("ARGS", "--disable-cache=true", 2);
} else {
$cache = false;
show::Event("ARGS", "--disable-cache=false", 2);
}
if (isset($args['ignoreinfected'])) {
$ignore_infected = true;
show::Event("ARGS", "--ignore-infected=true", 2);
} else {
$ignore_infected = false;
show::Event("ARGS", "--ignore-infected=false", 2);
}
Env::set('mapinfo', $mapinfo);
Env::set('disable_cache', $cache);
Env::set('ignore_infected', $ignore_infected);
}
// End of Heat Class
}
class DB {
public static function connect () {
mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME);
show::Event("DB", "Connected to " . DB_NAME . " as " . DB_USER . "@" . DB_HOST, 1);
}
public static function doQuery ($query) {
return mysql_query($query);
}
public static function getAssoc ($result) {
return mysql_fetch_assoc($result);
}
public static function numRows ($result) {
return mysql_num_rows($result);
}
}
class show {
public static function Event ($type, $text, $runlevel) {
if ($runlevel <= DEBUG) {
print date("Y-m-d H:i:s") . "\t\t$type: $text\n";
}
}
}
?>

5
heatmaps/src/README Normal file
View File

@ -0,0 +1,5 @@
The Heatmap source files are not included with the release packages of HLXCE.
Heatmap Packs can be downloaded from http://www.hlxce.com.
Heatmap Pack source files are stored in the HLX-Extras repository.

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

384
scripts/BASTARDrcon.pm Normal file
View File

@ -0,0 +1,384 @@
package BASTARDrcon;
#
# BASTARDrcon Perl Module - execute commands on a remote Half-Life 1 server using Rcon.
# A merge of the KKrcon library into HLstatsX
# Copyright (C) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# KKrcon Perl Module - execute commands on a remote Half-Life server using Rcon.
# http://kkrcon.sourceforge.net
#
# TRcon Perl Module - execute commands on a remote Half-Life2 server using remote console.
# http://www.hlstatsx.com
#
# Copyright (C) 2000, 2001 Rod May
# Enhanced in 2005 by Tobi (Tobi@gameme.de)
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
use strict;
use sigtrap;
use Socket;
use Sys::Hostname;
use bytes;
##
## Main
##
#
# Constructor
#
sub new
{
my ($class_name, $server_object) = @_;
my ($self) = {};
bless($self, $class_name);
# Initialise properties
$self->{server_object} = $server_object;
$self->{rcon_password} = $server_object->{rcon} or die("BASTARDrcon: a Password is required\n");
$self->{server_host} = $server_object->{address};
$self->{server_port} = int($server_object->{port}) or die("BASTARDrcon: invalid Port \"" . $server_object->{port} . "\"\n");
$self->{socket} = undef;
$self->{error} = "";
# Set up socket parameters
$self->{_ipaddr} = gethostbyname($self->{server_host}) or die("BASTARDrcon: could not resolve Host \"" . $self->{server_host} . "\"\n");
return $self;
}
#
# Execute an Rcon command and return the response
#
sub execute
{
my ($self, $command) = @_;
my $msg;
my $ans;
# version x.1.0.6+ HL1 server
$msg = "\xFF\xFF\xFF\xFFchallenge rcon\n\0";
$ans = $self->_sendrecv($msg);
if ($ans =~ /challenge +rcon +(\d+)/)
{
$msg = "\xFF\xFF\xFF\xFFrcon $1 \"" . $self->{"rcon_password"} . "\" $command\0";
$ans = $self->_sendrecv($msg);
}
elsif (!$self->error())
{
$ans = "";
$self->{"error"} = "No challenge response";
}
if ($ans =~ /bad rcon_password/i)
{
$self->{"error"} = "Bad Password";
}
return $ans;
}
sub _sendrecv
{
my ($self, $msg) = @_;
my $host = $self->{"server_host"};
my $port = $self->{"server_port"};
my $ipaddr = $self->{"_ipaddr"};
my $proto = $self->{"_proto"};
# Open socket
socket($self->{"socket"}, PF_INET, SOCK_DGRAM, $proto) or die("BASTARDrcon(141): socket: $!\n");
my $hispaddr = sockaddr_in($port, $ipaddr);
die("BASTARDrcon: send $ipaddr:$port : $!") unless(defined(send($self->{"socket"}, $msg, 0, $hispaddr)));
my $rin = "";
vec($rin, fileno($self->{"socket"}), 1) = 1;
my $ans = "TIMEOUT";
if (select($rin, undef, undef, 0.5))
{
$ans = "";
$hispaddr = recv($self->{"socket"}, $ans, 8192, 0);
$ans =~ s/\x00+$//; # trailing crap
$ans =~ s/^\xFF\xFF\xFF\xFFl//; # HL response
$ans =~ s/^\xFF\xFF\xFF\xFFn//; # QW response
$ans =~ s/^\xFF\xFF\xFF\xFF//; # Q2/Q3 response
$ans =~ s/^\xFE\xFF\xFF\xFF.....//; # old HL bug/feature
}
# Close socket
close($self->{"socket"});
if ($ans eq "TIMEOUT")
{
$ans = "";
$self->{"error"} = "Rcon timeout";
}
return $ans;
}
#
# Send a package
#
sub send_rcon
{
my ($self, $id, $command, $string1, $string2) = @_;
my $tmp = pack("VVZ*Z*",$id,$command,$string1,$string2);
my $size = length($tmp);
if($size > 4096)
{
$self->{error} = "Command too long to send!";
return 1;
}
$tmp = pack("V", $size) .$tmp;
unless(defined(send($self->{"socket"},$tmp,0)))
{
die("BASTARDrcon: send $!");
}
return 0;
}
#
# Recieve a package
#
sub recieve_rcon
{
my $self = shift;
my ($size, $id, $command, $msg);
my $rin = "";
my $tmp = "";
vec($rin, fileno($self->{"socket"}), 1) = 1;
if(select($rin, undef, undef, 0.5))
{
while(length($size) < 4)
{
$tmp = "";
recv($self->{"socket"}, $tmp, (4-length($size)), 0);
$size .= $tmp;
}
$size = unpack("V", $size);
if($size < 10 || $size > 8192)
{
close($self->{"socket"});
$self->{error} = "illegal size $size ";
return (-1, -1, -1);
}
while(length($id)<4)
{
$tmp = "";
recv($self->{"socket"}, $tmp, (4-length($id)), 0);
$id .= $tmp;
}
$id = unpack("V", $id);
$size = $size - 4;
while(length($command)<4)
{
$tmp ="";
recv($self->{"socket"}, $tmp, (4-length($command)),0);
$command.=$tmp;
}
$command = unpack("V", $command);
$size = $size - 4;
my $msg = "";
while($size >= 1)
{
$tmp = "";
recv($self->{"socket"}, $tmp, $size, 0);
$size -= length($tmp);
$msg .= $tmp;
}
my ($string1,$string2) = unpack("Z*Z*",$msg);
$msg = $string1.$string2;
return ($id, $command, $msg);
}
else
{
return (-1, -1, -1);
}
}
#
# Get error message
#
sub error
{
my ($self) = @_;
return $self->{"error"};
}
#
# Parse "status" command output into player information
#
sub getPlayers
{
my ($self) = @_;
my $status = $self->execute("status");
my @lines = split(/[\r\n]+/, $status);
my %players;
# HL1
# name userid uniqueid frag time ping loss adr
# 1 "psychonic" 1 STEAM_0:1:4153990 0 00:33 13 0 192.168.5.115:27005
foreach my $line (@lines)
{
if ($line =~ /^\#\s*\d+\s+
"(.+)"\s+ # name
(\d+)\s+ # userid
([^\s]+)\s+\d+\s+ # uniqueid
([\d:]+)\s+ # time
(\d+)\s+ # ping
(\d+)\s+ # loss
([^:]+): # addr
(\S+) # port
$/x)
{
my $name = $1;
my $userid = $2;
my $uniqueid = $3;
my $time = $4;
my $ping = $5;
my $loss = $6;
my $state = "";
my $address = $7;
my $port = $8;
$uniqueid =~ s/^STEAM_[0-9]+?\://i;
# &::printEvent("DEBUG", "USERID: '$userid', NAME: '$name', UNIQUEID: '$uniqueid', TIME: '$time', PING: '$ping', LOSS: '$loss', ADDRESS:'$address', CLI_PORT: '$port'", 1);
if ($::g_mode eq "NameTrack") {
$players{$name} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
} elsif ($::g_mode eq "LAN") {
$players{$address} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
} else {
$players{$uniqueid} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
}
}
}
return %players;
}
sub getServerData
{
my ($self) = @_;
my $status = $self->execute("status");
my @lines = split(/[\r\n]+/, $status);
my $servhostname = "";
my $map = "";
my $max_players = 0;
foreach my $line (@lines)
{
if ($line =~ /^\s*hostname\s*:\s*([\S].*)$/x)
{
$servhostname = $1;
}
elsif ($line =~ /^\s*map\s*:\s*([\S]+).*$/x)
{
$map = $1;
}
elsif ($line =~ /^\s*players\s*:\s*\d+.+\((\d+)\smax.*$/)
{
$max_players = $1;
}
}
return ($servhostname, $map, $max_players, 0);
}
sub getVisiblePlayers
{
my ($self) = @_;
my $status = $self->execute("sv_visiblemaxplayers");
my @lines = split(/[\r\n]+/, $status);
my $max_players = -1;
foreach my $line (@lines)
{
# "sv_visiblemaxplayers" = "-1"
# - Overrides the max players reported to prospective clients
if ($line =~ /^\s*"sv_visiblemaxplayers"\s*=\s*"([-0-9]+)".*$/x)
{
$max_players = $1;
}
}
return ($max_players);
}
#
# Get information about a player by userID
#
sub getPlayer
{
my ($self, $uniqueid) = @_;
my %players = $self->getPlayers();
if (defined($players{$uniqueid}))
{
return $players{$uniqueid};
}
else
{
$self->{"error"} = "No such player # $uniqueid";
return 0;
}
}
1;
# end

View File

@ -0,0 +1,247 @@
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
package ConfigReaderSimple;
#
# Simple interface to a configuration file
#
# Originally developed by Ben Oberin.
# Modified for HLstats by Simon Garner.
# Modified for HLstatsX by Tobias Oetzel.
#
# ObLegalStuff:
# Copyright (c) 2000 Bek Oberin. All rights reserved. This program is
# free software; you can redistribute it and/or modify it under the
# same terms as Perl itself.
#
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw();
@EXPORT_OK = qw();
$VERSION = "1.0";
my $DEBUG = 0;
=head1 NAME
ConfigReader::Simple - Simple configuration file parser
=head1 SYNOPSIS
use ConfigReader::Simple;
$config = ConfigReader::Simple->new("configrc", [qw(Foo Bar Baz Quux)]);
$config->parse();
$config->get("Foo");
=head1 DESCRIPTION
C<ConfigReader::Simple> reads and parses simple configuration files. It's
designed to be smaller and simpler than the C<ConfigReader> module
and is more suited to simple configuration files.
=cut
###################################################################
# Functions under here are member functions #
###################################################################
=head1 CONSTRUCTOR
=item new ( FILENAME, DIRECTIVES )
This is the constructor for a new ConfigReader::Simple object.
C<FILENAME> tells the instance where to look for the configuration
file.
C<DIRECTIVES> is an optional argument and is a reference to an array.
Each member of the array should contain one valid directive. A directive
is the name of a key that must occur in the configuration file. If it
is not found, the module will die. The directive list may contain all
the keys in the configuration file, a sub set of keys or no keys at all.
=cut
sub new {
my $prototype = shift;
my $filename = shift;
my $keyref = shift;
my $class = ref($prototype) || $prototype;
my $self = {};
$self->{"filename"} = $filename;
$self->{"validkeys"} = $keyref;
bless($self, $class);
return $self;
}
#
# destructor
#
sub DESTROY {
my $self = shift;
return 1;
}
=pod
=item parse ()
This does the actual work. No parameters needed.
=cut
sub parse {
my $self = shift;
open(CONFIG, $self->{"filename"}) ||
die "Config: Can't open config file " . $self->{"filename"} . ": $!";
my @array_buffer;
my $ext_option = 0;
my $parsed_line = 0;
while (<CONFIG>) {
chomp;
next if /^\s*$/; # blank
next if /^\s*#/; # comment
next if /^\s*.*\[[0-9]+\]\s*=\s*\(/; # old style server config start
next if /^\s*.*\s*=>\s*\.*".*\",/; # old style server config option
$parsed_line = 0;
my $input_text = $_;
if (($ext_option == 0) && ($parsed_line == 0)) {
my ($key, $value) = &parse_line($input_text);
warn "Key: '$key' Value: '$value'\n" if $DEBUG;
$self->{"config_data"}{$key} = $value;
}
}
close(CONFIG);
return 1;
}
=pod
=item get ( DIRECTIVE )
Returns the parsed value for that directive.
=cut
sub get {
my $self = shift;
my $key = shift;
unless (ref $self->{"config_data"}{$key}) {
return $self->{"config_data"}{$key};
} else {
return %{$self->{"config_data"}{$key}};
}
}
# Internal methods
sub parse_line {
my $text = shift;
my ($key, $value);
if ($text =~ /^\s*(\w+)\s+(['"]?)(.*?)\2\s*$/) {
$key = $1;
$value = $3;
} else {
die "Config: Can't parse line: $text\n";
}
return ($key, $value);
}
=pod
=head1 LIMITATIONS/BUGS
Directives are case-sensitive.
If a directive is repeated, the first instance will silently be
ignored.
Always die()s on errors instead of reporting them.
C<get()> doesn't warn if used before C<parse()>.
C<get()> doesn't warn if you try to acces the value of an
unknown directive not know (ie: one that wasn't passed via C<new()>).
All these will be addressed in future releases.
=head1 CREDITS
Kim Ryan <kimaryan@ozemail.com.au> adapted the module to make declaring
keys optional. Thanks Kim.
=head1 AUTHORS
Bek Oberin <gossamer@tertius.net.au>
=head1 COPYRIGHT
Copyright (c) 2000 Bek Oberin. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
#
# End code.
#
1;

View File

@ -0,0 +1,86 @@
#!/bin/sh
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# Configure the variables below
# Set this value to 1 if you are running Gentoo linux, or any other linux distro where the "cal" command outputs not Sunday as the first day in every row!
LINUX_OTHER="0"
# Login information for your MySQL server
DBHOST="localhost"
DBNAME=""
DBUSER=""
DBPASS=""
#
# Nothing to change below here.
#
# database is updated every first tuesday of any month, so download it with that specific date and import it
TODAY_MONTH=$( date +%m )
TODAY_YEAR=$( date +%Y )
if [ $LINUX_OTHER == "1" ]
then CAL_COMMAND="cal -s"
else CAL_COMMAND="cal"
fi
FIRST_TUESDAY_MONTH=$( $CAL_COMMAND $TODAY_MONTH $TODAY_YEAR |
awk '
NR == 1 { next }
NR == 2 { next }
NF <= 4 { next }
NF == 5 { print $1 ; exit }
NF == 6 { print $2 ; exit }
NF == 7 { print $3 ; exit }
' )
DATE=""$TODAY_YEAR""$TODAY_MONTH"0"$FIRST_TUESDAY_MONTH""
DIR="GeoLiteCity_$DATE"
FILE="GeoLiteCity_$DATE.zip"
ls *.csv &>/dev/null && rm *.csv
[ -f $FILE ] || wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/$FILE || exit 1
unzip -o $FILE || exit 1
mv $DIR/GeoLiteCity-Blocks.csv geoLiteCity_Blocks.csv
mv $DIR/GeoLiteCity-Location.csv geoLiteCity_Location.csv.temp
iconv -f ISO-8859-1 -t UTF-8 geoLiteCity_Location.csv.temp > geoLiteCity_Location.csv
mysqlimport -C -d --fields-terminated-by=, --fields-enclosed-by=\" --ignore-lines=2 --default-character-set=utf8 -L -i -h $DBHOST -u $DBUSER --password=$DBPASS $DBNAME geoLiteCity_Blocks.csv
mysqlimport -C -d --fields-terminated-by=, --fields-enclosed-by=\" --ignore-lines=2 --default-character-set=utf8 -L -i -h $DBHOST -u $DBUSER --password=$DBPASS $DBNAME geoLiteCity_Location.csv
# Cleanup
ls *.csv &>/dev/null && rm *.csv
ls *.csv.temp &>/dev/null && rm *.csv.temp
rm $FILE
rmdir $DIR

View File

@ -0,0 +1,17 @@
Included in this folder are two scripts to import data from the MaxMind (http://www.maxmind.com) from the GeoLiteCity database into your HLX db.
For Linux:
Edit the GeoLite_Import.sh file to insert your database settings in the top section and then execute.
For Windows:
Download the HLstatsX CE GeoLiteCity Importer from http://code.google.com/p/hlstatsxcommunity
--------------------------------------------------------------
Alternative method by *XYZ*SaYnt:
--------------------------------------------------------------
* For Windows or Linux.
* Requires python.
* Generates INSERTs in case LOAD DATA command is disabled
Edit the geoip.py file to insert your database settings in the top section and then execute.

View File

@ -0,0 +1,196 @@
#!/usr/bin/env python
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# For support and installation notes visit http://www.hlxcommunity.com
import os,sys
# version 1.0 alpha contributed to hlstatsx community by *XYZ*SaYnt
DBHOST="localhost"
DBNAME="your_hlstats_db"
DBUSER="your_sql_username"
DBPASS="your_sql_password"
def system(cmd):
"""
executes a system call and returns the text as a string. Returns only the first line of output.
"""
print("EXECUTING: %s"%cmd)
f = os.popen(cmd)
output = f.readlines()
f.close()
if len(output) > 0:
return output[0].replace("\n","")
else:
return ""
def fetch_geodata():
"""
Obtains the geoLiteCity raw data, resulting in geoLiteCity_Location.csv and geoLiteCity_Blocks.csv
"""
# database is updated on 1st every month, so download the file from the 1st of current month
DAT = system("date +%Y%m01")
FIL = "GeoLiteCity_%s"%DAT
FILE = FIL + ".zip"
system("rm *.csv > /dev/null")
if not os.path.exists(FILE):
system("wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/" + FILE)
system("unzip -o " + FILE)
system("mv %s/GeoLiteCity-Blocks.csv geoLiteCity_Blocks.csv"%FIL)
system("mv %s/GeoLiteCity-Location.csv geoLiteCity_Location.csv.temp"%FIL)
system("rmdir " + FIL)
system("iconv -f ISO-8859-1 -t UTF-8 geoLiteCity_Location.csv.temp > geoLiteCity_Location.csv")
return
def dump_sql(fname):
"""
Dump the new sql data into our database
"""
system("mysql -u %s -p%s -h %s %s < %s"%(DBUSER,DBPASS,DBHOST,DBNAME,fname))
def write_sql(fname):
"""
Write a file of sql commands so that our data can be imported into our database.
"""
try:
fout = open(fname,"w")
except:
print("ERROR: unable to open "+fname)
return 0
fout.write("""
DROP TABLE IF EXISTS `geoLiteCity_Blocks`;
DROP TABLE IF EXISTS `geolitecity_blocks`;
DROP TABLE IF EXISTS `geolitecity_location`;
DROP TABLE IF EXISTS `geoLiteCity_Location`;
CREATE TABLE `geoLiteCity_Blocks`
(`startIpNum` bigint(11) unsigned NOT NULL default '0',
`endIpNum` bigint(11) unsigned NOT NULL default '0',
`locId` bigint(11) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `geoLiteCity_Location` (
`locId` bigint(11) unsigned NOT NULL default '0',
`country` varchar(2) NOT NULL,
`region` varchar(50) default NULL,
`city` varchar(50) default NULL,
`postalCode` varchar(10) default NULL,
`latitude` decimal(14,4) default NULL,
`longitude` decimal(14,4) default NULL,
PRIMARY KEY (`locId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
# read in the raw data
f = open("geoLiteCity_Blocks.csv")
raw = f.readlines()
f.close()
del raw[0:2]
# chunk up the raw data
chunksize = 1000
gblocks = []
chunks = len(raw)/chunksize + 1
for i in xrange(0,chunks): gblocks.append(raw[i*chunksize:(i+1)*chunksize])
print("SQL: %d data items, %d chunks"%(len(raw),chunks))
del raw
for chunk in gblocks:
if chunk:
s = "insert into `geoLiteCity_Blocks`(`startIpNum`,`endIpNum`,`locId`) values"
for l in chunk:
vals = l.replace('"',"").replace('\n',"").split(',')
s += "(%s,%s,%s),"%(vals[0],vals[1],vals[2])
s = s[0:-1] # chop the last comma
fout.write(s + ";\n");
del gblocks
f = open("geoLiteCity_Location.csv")
raw = f.readlines()
f.close()
del raw[0:2]
# chunk up the raw data
gblocks = []
chunks = len(raw)/chunksize + 1
for i in xrange(0,chunks): gblocks.append(raw[i*chunksize:(i+1)*chunksize])
print("SQL: %d data items, %d chunks"%(len(raw),chunks))
del raw
for chunk in gblocks:
if chunk:
s = "insert into `geoLiteCity_Location`(`locId`,`country`,`region`,`city`,`postalCode`,`latitude`,`longitude`) values"
for l in chunk:
vals = l.replace('"',"").replace('\n',"").split(',')
for i,v in enumerate(vals): vals[i] = v.replace("'","\\'")
s += "(%s,'%s','%s','%s','%s','%s','%s'),"%(vals[0],vals[1],vals[2],vals[3],vals[4],vals[5],vals[6])
s = s[0:-1] # chop the last comma
fout.write(s + ";\n");
del gblocks
return 1
def main():
sqlname = "geodata.sql"
print("DOWNLOADING GEO DATA....")
fetch_geodata()
print("WRITING DATABASE FILE....")
if write_sql(sqlname):
print("IMPORTING DATABASE FILE....")
dump_sql(sqlname)
else:
print("Fatal error; unable to finish.")
# clean up.
system("rm "+sqlname)
print("DONE.")
main()

View File

@ -0,0 +1,54 @@
#!/bin/bash
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# *** You should not need to configure anything in this script. ***
# URL is the location to download the GeoLiteCity.dat.gz file from.
URL=http://geolite.maxmind.com/download/geoip/database/
# File is the file to download from the server above, as well as what to store it as locally.
FILE=GeoLiteCity.dat.gz
# ***** NOTHING TO CONFIGURE BELOW HERE *****
# Change to directory where installer is
cd `dirname $0`
echo Downloading a new copy of GeoLiteCity, if needed.
wget -N -q $URL$FILE
echo Uncompressing database
gzip -dc < $FILE > $(basename $FILE .gz)
chmod 777 *.dat
echo Done

View File

@ -0,0 +1,49 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
$ip = "62.77.230.10";
$ip = explode(".",$ip);
$number = ($ip[0]*16777216) + ($ip[1]*65536) + ($ip[2]*256) + $ip[3];
echo $number;
// example SQL to determine location
// SELECT geoLiteCity_Location.* FROM geoLiteCity_Blocks INNER JOIN geoLiteCity_Location ON (geoLiteCity_Blocks.locId=geoLiteCity_Location.locId) WHERE startIpNum<=$number AND endIpNum>=$number;
?>

31
scripts/HLStatsFTP/README Normal file
View File

@ -0,0 +1,31 @@
hlstats-ftp.pl README
Utility written by Woody.
This utility can be used to grab log files from a remote game server through FTP and then use the HLStatsX Daemon to enter
the data into the database. You must have perl installed to use this utility.
The script "remembers" the modification time (mtime) of the last log file that has been processed, and when run again,
only processes files with a later mtime.
*** NOTE ***
To use this utility you must copy it into the same folder your hlstats.pl (the daemon) is in.
You probably want to configure this as a cronjob as well.
Usage:
hlstats-ftp.pl --help
hlstats-ftp.pl --version
hlstats-ftp.pl --gs-ip=GSIP --gs-port=GSPORT [--ftp-ip=FTPIP] --ftp-usr=FTPUSR --ftp-pwd=FTPPWD --ftp-dir=FTPDIR [--quiet]
Options:
--help display this help and exit
--version output version information and exit
--gs-ip=IP game server IP address
--gs-port=PORT game server port
--ftp-ip=IP ftp log server IP address, if different from
game server IP address (--gs-ip)
--ftp-usr=USERNAME ftp log server user name
--ftp-pwd=PASSWORD ftp log server password
--ftp-dir=DIRECTORY ftp log server directory
--quiet quiet operation, i.e. no output

View File

@ -0,0 +1,235 @@
#!/usr/bin/perl
################################################################################################################
# hlstats-ftp.pl
################################################################################################################
# Feed HLstatsX with log data via FTP
# (w) 2009 by Woody (http://woodystree.net)
################################################################################################################
use strict;
use Getopt::Long;
use Net::FTP;
use constant VERSION => "0.42";
use constant USAGE => <<EOT
Feed HLstatsX with log data via FTP.
Usage:
hlstats-ftp.pl --help
hlstats-ftp.pl --version
hlstats-ftp.pl --gs-ip=<IP> --gs-port=<PORT> [--ftp-ip=<IP>] --ftp-usr=<USR> --ftp-pwd=<PWD> --ftp-dir=<DIR> [--quiet]
Options:
--help display this help and exit
--version output version information and exit
--gs-ip=IP game server IP address
--gs-port=PORT game server port
--ftp-ip=IP ftp log server IP address, if different from
game server IP address (--gs-ip)
--ftp-usr=USR ftp log server user name
--ftp-pwd=PWD ftp log server password
--ftp-dir=DIR ftp log server directory
--quiet quiet operation, i.e. no output
(w)2009 by Woody (http://woodystree.net)
EOT
;
################################################################################################################
# define output subroutine
################################################################################################################
sub output {
if (!(our $opt_quiet)) {
my $text = shift;
print $text;
}
}
################################################################################################################
# get & parse command line options
################################################################################################################
my $opt_help; my $opt_version; my $gs_ip; my $gs_port; my $ftp_ip; my $ftp_usr; my $ftp_pwd; my $ftp_dir; our $opt_quiet;
GetOptions(
"help" => \$opt_help,
"version" => \$opt_version,
"gs-ip=s" => \$gs_ip,
"gs-port=i" => \$gs_port,
"ftp-ip=s" => \$ftp_ip,
"ftp-usr=s" => \$ftp_usr,
"ftp-pwd=s" => \$ftp_pwd,
"ftp-dir=s" => \$ftp_dir,
"quiet" => \$opt_quiet
) or die(USAGE);
if ($opt_help) {
print USAGE;
exit(0);
}
if ($opt_version) {
print "\nhlstats-ftp.pl - Version " . VERSION . "\n";
print "Feed HLstatsX with log data via FTP.\n";
print "(w)2009 by Woody (http://woodystree.net)\n\n";
exit(0);
}
if (!(defined $gs_ip) && !(defined $gs_port) && !(defined $ftp_usr) && !(defined $ftp_pwd) && !(defined $ftp_dir)) {
die(USAGE);
}
if (!(defined $ftp_ip)) {
$ftp_ip = $gs_ip;
}
################################################################################################################
# OK, lets go...
################################################################################################################
output("\nStarting hlstats-ftp.pl for IP $gs_ip, Port $gs_port...\n\n");
################################################################################################################
# create tmp directory
################################################################################################################
output(" - creating tmp directory... ");
my $tmp_dir = "hlstats-ftp-$gs_ip-$gs_port.tmp";
if (-e $tmp_dir) {
if (!(-w $tmp_dir)) {
die "Writing to tmp directory is not possible.";
}
} else {
mkdir($tmp_dir, 0775) || die "Make tmp directory \"$tmp_dir\" failed: $!";
}
output("OK.\n");
################################################################################################################
# get last mtime info, if any
################################################################################################################
output(" - getting last mtime info... ");
my $last_mtime_filename = "hlstats-ftp-$gs_ip-$gs_port.last";
my $last_mtime = 0;
if (-e $last_mtime_filename) {
open(LASTMTIME, "<$last_mtime_filename") || die "Open file \"$last_mtime_filename\" failed: $!";
$last_mtime = <LASTMTIME>;
close(LASTMTIME);
output("OK: last mtime $last_mtime.\n");
} else {
output("none: using default 0.\n");
}
################################################################################################################
# establish ftp connection
################################################################################################################
output(" - establishing FTP connection... ");
my $ftp = Net::FTP->new($ftp_ip) || die "FTP connect to \"$ftp_ip\" failed: $!";
$ftp->login($ftp_usr,$ftp_pwd) || die "FTP login for user \"$ftp_usr\" failed: $!";
$ftp->binary() || die "FTP binary mode failed: $!";
$ftp->cwd($ftp_dir) || die "FTP chdir to \"$ftp_dir\" failed: $!";
output("OK.\n");
################################################################################################################
# get complete list of log files
################################################################################################################
output(" - getting complete list of log files... ");
my @files = $ftp->ls("-t *.log"); # get list of log files sorted by mtime
$#files = $#files - 1; # skip last file, i.e. the latest file, which is possibly still in use by the game server
output("OK.\n");
################################################################################################################
# transfer log files to tmp directory, if todo
################################################################################################################
output(" + transfering log files, if todo:\n");
my @todo_files = ();
my @todo_mtimes = ();
foreach my $file (@files) {
output(" - \"$file\" ");
my $mtime = $ftp->mdtm($file) || die "FTP mtdm failed: $!";
output("(mtime $mtime): ");
if ($mtime > $last_mtime) {
output("transferring... ");
$ftp->get($file, "$tmp_dir/$file") || die "FTP get with \"$file\" failed: $!";
push(@todo_files, $file);
push(@todo_mtimes, $mtime);
output("OK.\n");
} else {
output("skipping.\n");
}
}
################################################################################################################
# close ftp connection
################################################################################################################
output(" - closing FTP connection... ");
$ftp->close() || die "FTP close failed: $!";
output("OK.\n");
################################################################################################################
# process log files in tmp directory
################################################################################################################
output(" + parsing log files:\n");
for (my $i = 0; $i <= $#todo_files; $i++) {
my $progress = "(" . ($i+1) . "/" . ($#todo_files+1) . ")";
output(" - \"" . $todo_files[$i] . "\" " . $progress . ": parsing... ");
system("./hlstats.pl --stdin --server-ip $gs_ip --server-port $gs_port < $tmp_dir/" . $todo_files[$i] . " > /dev/null");
output("updating last mtime...");
open(LASTMTIME, ">$last_mtime_filename") || die "Open file \"$last_mtime_filename\" failed: $!";
print LASTMTIME $todo_mtimes[$i];
close(LASTMTIME);
output("OK.\n");
}
################################################################################################################
# delete tmp log files and directory
################################################################################################################
output(" - delete tmp log files and directory... ");
foreach my $file (<$tmp_dir/*>) {
unlink($file) || die "Delete tmp log files failed: $!";
}
rmdir($tmp_dir) || die "Delete tmp directory failed: $!";
output("OK.\n");
################################################################################################################
# the end
################################################################################################################
output("\nSo Long, and Thanks for all the Fish.\n\n");

455
scripts/HLstats.plib Normal file
View File

@ -0,0 +1,455 @@
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# HLstatsX CE release version number
$g_version = "<Unable to Detect>";
my %db_stmt_cache = ();
%g_eventTables = (
"TeamBonuses",
["playerId", "actionId", "bonus"],
"ChangeRole",
["playerId", "role"],
"ChangeName",
["playerId", "oldName", "newName"],
"ChangeTeam",
["playerId", "team"],
"Connects",
["playerId", "ipAddress", "hostname", "hostgroup"],
"Disconnects",
["playerId"],
"Entries",
["playerId"],
"Frags",
["killerId", "victimId", "weapon", "headshot", "killerRole", "victimRole", "pos_x","pos_y","pos_z", "pos_victim_x","pos_victim_y","pos_victim_z"],
"PlayerActions",
["playerId", "actionId", "bonus", "pos_x","pos_y","pos_z"],
"PlayerPlayerActions",
["playerId", "victimId", "actionId", "bonus", "pos_x","pos_y","pos_z", "pos_victim_x","pos_victim_y","pos_victim_z"],
"Suicides",
["playerId", "weapon", "pos_x","pos_y","pos_z"],
"Teamkills",
["killerId", "victimId", "weapon", "pos_x","pos_y","pos_z", "pos_victim_x","pos_victim_y","pos_victim_z"],
"Rcon",
["type", "remoteIp", "password", "command"],
"Admin",
["type", "message", "playerName"],
"Statsme",
["playerId", "weapon", "shots", "hits", "headshots", "damage", "kills", "deaths"],
"Statsme2",
["playerId", "weapon", "head", "chest", "stomach", "leftarm", "rightarm", "leftleg", "rightleg"],
"StatsmeLatency",
["playerId", "ping"],
"StatsmeTime",
["playerId", "time"],
"Latency",
["playerId", "ping"],
"Chat",
["playerId", "message_mode", "message"]
);
##
## Common Functions
##
sub number_format {
local $_ = shift;
1 while s/^(-?\d+)(\d{3})/$1,$2/;
return $_;
}
sub date_format {
my $timestamp = shift;
return sprintf('%dd %02d:%02d:%02dh',
$timestamp / 86400,
$timestamp / 3600 % 24,
$timestamp / 60 % 60,
$timestamp % 60
);
}
#
# void error (string errormsg)
#
# Dies, and optionally mails error messages to $g_mailto.
#
sub error
{
my $errormsg = $_[0];
if ($g_mailto && $g_mailpath)
{
system("echo \"$errormsg\" | $g_mailpath -s \"HLstatsX:CE crashed `date`\" $g_mailto");
}
die("$errormsg\n");
}
#
# string quoteSQL (string varQuote)
#
# Escapes all quote characters in a variable, making it suitable for use in an
# SQL query. Returns the escaped version.
#
sub quoteSQL
{
my $varQuote = $_[0];
$varQuote =~ s/\\/\\\\/g; # replace \ with \\
$varQuote =~ s/'/\\'/g; # replace ' with \'
return $varQuote;
}
#
# void doConnect
#
# Connects to the HLstatsX database
#
sub doConnect
{
$db_conn = DBI->connect(
"DBI:mysql:$db_name:$db_host",
$db_user, $db_pass, { mysql_enable_utf8 => 1 }
);
while(!$db_conn) {
&printEvent("MYSQL", "\nCan't connect to MySQL database '$db_name' on '$db_host'\n" .
"Server error: $DBI::errstr\n");
sleep(5);
$db_conn = DBI->connect(
"DBI:mysql:$db_name:$db_host",
$db_user, $db_pass, { mysql_enable_utf8 => 1 }
);
}
$db_conn->do("SET NAMES 'utf8'");
&printEvent("MYSQL", "Connecting to MySQL database '$db_name' on '$db_host' as user '$db_user' ... connected ok", 1);
%db_stmt_cache = ();
}
#
# result doQuery (string query)
#
# Executes the SQL query 'query' and returns the result identifier.
#
sub doQuery
{
my ($query, $callref) = @_;
if(!$db_conn->ping()) {
&printEvent("HLSTATSX", "Lost database connection. Trying to reconnect...", 1);
&doConnect();
}
my $result = $db_conn->prepare($query) or die("Unable to prepare query:\n$query\n$DBI::errstr\n$callref");
$result->execute or die("Unable to execute query:\n$query\n$DBI::errstr\n$callref");
return $result;
}
sub execNonQuery
{
my ($query) = @_;
if(!$db_conn->ping()) {
&printEvent("HLSTATSX", "Lost database connection. Trying to reconnect...", 1);
&doConnect();
}
#&printEvent("DEBUG","execNonQuery:\n".$query);
$db_conn->do($query);
}
sub execCached {
my ($query_id,$query, @bind_args) = @_;
if(!$db_conn->ping()) {
&printEvent("HLSTATSX", "Lost database connection. Trying to reconnect...", 1);
&doConnect();
}
if(!$db_stmt_cache{$query_id}) {
$db_stmt_cache{$query_id} = $db_conn->prepare($query) or die("Unable to prepare query ($query_id):\n$query\n$DBI::errstr");
#&printEvent("HLSTATSX", "Prepared a statement ($query_id) for the first time.", 1);
}
$db_stmt_cache{$query_id}->execute(@bind_args) or die ("Unable to execute query ($query_id):\n$query\n$DBI::errstr");
return $db_stmt_cache{$query_id};
}
#
# string resolveIp (string ip, boolean quiet)
#
# Do a DNS reverse-lookup on an IP address and return the hostname, or empty
# string on error.
#
sub resolveIp
{
my ($ip, $quiet) = @_;
my ($host) = "";
unless ($g_dns_resolveip)
{
return "";
}
eval
{
$SIG{ALRM} = sub { die "DNS Timeout\n" };
alarm $g_dns_timeout; # timeout after $g_dns_timeout sec
$host = gethostbyaddr(inet_aton($ip), AF_INET);
alarm 0;
};
if ($@)
{
my $error = $@;
chomp($error);
printEvent("DNS", "Resolving hostname (timeout $g_dns_timeout sec) for IP \"$ip\" - $error ", 1);
$host = ""; # some error occurred
}
elsif (!defined($host))
{
printEvent("DNS", "Resolving hostname (timeout $g_dns_timeout sec) for IP \"$ip\" - No Host ", 1);
$host = ""; # ip did not resolve to any host
} else {
$host = lc($host); # lowercase
printEvent("DNS", "Resolving hostname (timeout $g_dns_timeout sec) for IP \"$ip\" - $host ", 1);
}
chomp($host);
return $host;
}
#
# object queryHostGroups ()
#
# Returns result identifier.
#
sub queryHostGroups
{
return &doQuery("
SELECT
pattern,
name,
LENGTH(pattern) AS patternlength
FROM
hlstats_HostGroups
ORDER BY
patternlength DESC,
pattern ASC
");
}
#
# string getHostGroup (string hostname[, object result])
#
# Return host group name if any match, or last 2 or 3 parts of hostname.
#
sub getHostGroup
{
my ($hostname, $result) = @_;
my $hostgroup = "";
# User can define special named hostgroups in hlstats_HostGroups, i.e.
# '.adsl.someisp.net' => 'SomeISP ADSL'
$result = &queryHostGroups() unless ($result);
$result->execute();
while (my($pattern, $name) = $result->fetchrow_array())
{
$pattern = quotemeta($pattern);
$pattern =~ s/\\\*/[^.]*/g; # allow basic shell-style globbing in pattern
if ($hostname =~ /$pattern$/)
{
$hostgroup = $name;
last;
}
}
$result->finish;
if (!$hostgroup)
{
#
# Group by last 2 or 3 parts of hostname, i.e. 'max1.xyz.someisp.net' as
# 'someisp.net', and 'max1.xyz.someisp.net.nz' as 'someisp.net.nz'.
# Unfortunately some countries do not have categorical SLDs, so this
# becomes more complicated. The dom_nosld array below contains a list of
# known country codes that do not use categorical second level domains.
# If a country uses SLDs and is not listed below, then it will be
# incorrectly grouped, i.e. 'max1.xyz.someisp.yz' will become
# 'xyz.someisp.yz', instead of just 'someisp.yz'.
#
# Please mail sgarner@hlstats.org with any additions.
#
my @dom_nosld = (
"ca", # Canada
"ch", # Switzerland
"be", # Belgium
"de", # Germany
"ee", # Estonia
"es", # Spain
"fi", # Finland
"fr", # France
"ie", # Ireland
"nl", # Netherlands
"no", # Norway
"ru", # Russia
"se", # Sweden
);
my $dom_nosld = join("|", @dom_nosld);
if ($hostname =~ /([\w-]+\.(?:$dom_nosld|\w\w\w))$/)
{
$hostgroup = $1;
}
elsif ($hostname =~ /([\w-]+\.[\w-]+\.\w\w)$/)
{
$hostgroup = $1;
}
else
{
$hostgroup = $hostname;
}
}
return $hostgroup;
}
#
# void doConf (object conf, hash directives)
#
# Walk through configuration directives, setting values of global variables.
#
sub doConf
{
my ($conf, %directives) = @_;
while (($directive, $variable) = each(%directives))
{
if ($directive eq "Servers") {
%$variable = $conf->get($directive);
} else {
$$variable = $conf->get($directive);
}
}
}
#
# void setOptionsConf (hash optionsconf)
#
# Walk through configuration directives, setting values of global variables.
#
sub setOptionsConf
{
my (%optionsconf) = @_;
while (($thekey, $theval) = each(%optionsconf))
{
if($theval)
{
$$thekey = $theval;
}
}
}
#
# string abbreviate (string thestring[, int maxlength)
#
# Returns thestring abbreviated to maxlength-3 characters plus "...", unless
# thestring is shorter than maxlength.
#
sub abbreviate
{
my ($thestring, $maxlength) = @_;
$maxlength = 12 unless ($maxlength);
if (length($thestring) > $maxlength)
{
$thestring = substr($thestring, 0, $maxlength - 3);
return "$thestring...";
}
else
{
return $thestring;
}
}
#
# void printEvent (int code, string description)
#
# Logs event information to stdout.
#
sub printEvent
{
my ($code, $description, $update_timestamp, $force_output) = @_;
if ( (($g_debug > 0) && ($g_stdin == 0))|| (($g_stdin == 1) && ($force_output == 1)) ) {
my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time());
my $timestamp = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
if ($update_timestamp == 0) {
$timestamp = $ev_timestamp;
}
if (is_number($code)) {
printf("%s: %21s - E%03d: %s\n", $timestamp, $s_addr, $code, $description);
} else {
printf("%s: %21s - %s: %s\n", $timestamp, $s_addr, $code, $description);
}
}
}
1;

File diff suppressed because it is too large Load Diff

104
scripts/HLstats_Game.pm Normal file
View File

@ -0,0 +1,104 @@
package HLstats_Game;
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
#
# Constructor
#
sub new
{
my $class_name = shift;
my $game = shift;
my $self = {};
bless($self, $class_name);
# Initialise Properties
$self->{game} = $game;
$self->{weapons} = ();
$self->{actions} = ();
# Set Property Values
die("HLstats_Game->new(): must specify game's game code\n") if ($game eq "");
#&::printEvent("DEBUG","game is $game");
my $weaponlist = &::doQuery("SELECT code, name, modifier FROM hlstats_Weapons WHERE game='".&::quoteSQL($game)."'");
while ( my($code,$name,$modifier) = $weaponlist->fetchrow_array) {
$self->{weapons}{$code}{name} = $name;
$self->{weapons}{$code}{modifier} = $modifier;
#&::printEvent("DEBUG","Weapon: name is \"$name\"; modifier is $modifier");
}
my $actionlist = &::doQuery("SELECT id, code, reward_player, reward_team, team, description, for_PlayerActions, for_PlayerPlayerActions, for_TeamActions, for_WorldActions FROM hlstats_Actions WHERE game='".&::quoteSQL($game)."'");
while ( my($id, $code, $reward_player,$reward_team,$team, $descr, $paction, $ppaction, $taction, $waction) = $actionlist->fetchrow_array) {
$self->{actions}{$code}{id} = $id;
$self->{actions}{$code}{descr} = $descr;
$self->{actions}{$code}{reward_player} = $reward_player;
$self->{actions}{$code}{reward_team} = $reward_team;
$self->{actions}{$code}{team} = $team;
$self->{actions}{$code}{paction} = $paction;
$self->{actions}{$code}{ppaction} = $ppaction;
$self->{actions}{$code}{taction} = $taction;
$self->{actions}{$code}{waction} = $waction;
}
$actionlist->finish;
&::printNotice("Created new game object " . $game);
return $self;
}
sub getTotalPlayers
{
my ($self) = @_;
my $query = "
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
game=?
AND hideranking = 0
AND kills >= 1
";
my $resultTotalPlayers = &::execCached("get_game_total_players", $query, &::quoteSQL($self->{game}));
my ($totalplayers) = $resultTotalPlayers->fetchrow_array;
$resultTotalPlayers->finish;
return $totalplayers;
}
1;

View File

@ -0,0 +1,56 @@
use constant {
UNKNOWN => -1,
CSS => 0,
HL2MP => 1,
TF => 2,
DODS => 3,
INSMOD => 4,
FF => 5,
HIDDEN => 6,
ZPS => 7,
AOC => 8,
CSTRIKE => 9,
TFC => 10,
DOD => 11,
NS => 12,
L4D => 13,
FOF => 14,
GES => 15,
BG2 => 16,
SGTLS => 17,
DYSTOPIA => 18,
NTS => 19,
PVKII => 20,
CSP => 21,
VALVE => 22,
NUCLEARDAWN => 23,
DDD => 24,
};
%gamecode_to_game = (
'css' => CSS(),
'hl2mp' => HL2MP(),
'tf' => TF(),
'dods' => DODS(),
'insmod' => INSMOD(),
'ff' => FF(),
'hidden' => HIDDEN(),
'zps' => ZPS(),
'aoc' => AOC(),
'cstrike' => CSTRIKE(),
'tfc' => TFC(),
'dod' => DOD(),
'ns' => NS(),
'l4d' => L4D(),
'fof' => FOF(),
'ges' => GES(),
'bg2' => BG2(),
'sgtls' => SGTLS(),
'dystopia' => DYSTOPIA(),
'nts' => NTS(),
'pvkii' => PVKII(),
'csp' => CSP(),
'valve' => VALVE(),
'nucleardawn' => NUCLEARDAWN(),
'dinodday' => DDD()
);

1124
scripts/HLstats_Player.pm Normal file

File diff suppressed because it is too large Load Diff

1414
scripts/HLstats_Server.pm Normal file

File diff suppressed because it is too large Load Diff

55
scripts/ImportBans/README Normal file
View File

@ -0,0 +1,55 @@
HLStatsX:CE Import Ban Options
----------------------
Description:
HLStatsX:CE has two different scripts to use to import bans from your banning system:
1) ImportBans
ImportBans.pl is a perl script and is the original importing script.
It only imports bans and does not unban a player if they're unbanned from your ban system.
This script supports SourceBans, AMXBans, BeetleMod, and GlobalBan.
You must have perl installed to use this script.
2) hlstatsxbans
Hlstatsxbans is written by Peace-Maker and is written in PHP.
This script will ban AND UNBAN players as they are banned from your banning system.
Forum URL: http://forums.interwavestudios.com/topic/167-import-mysql-bans-to-hlxce-bancheater-page/
This script suports SourceBans, AMXBans, BeetleMod, and GlobalBan.
You must have PHP installed to use this script.
Configuration:
Select which ban system you want to use, either ImportBans or HLStatsXBans. You must then edit the corresponding file.
*run_importbans
** Open run_importbans in a text editor
** Configure "BANSYSTEM" for which script you would like to use.
*ImportBans
** Open ImportBans.pl in a text editor.
** Fill in the HLX DB INFO section (should be same as that found in hlstats.conf in the Perl directory)
** Fill in at least one of the other databases (Sourcebans, AMXBans, BeetlesMod) that you want to import from.
NOTE: You can use any of these databases simultaneously -- fill in the ones you want
to pull from and those databases will be queried.
*HLStatsXBans
** Open HLStatsXBans.cfg in a text editor.
** Fill in the database info for HLX.
** Fill in at least one of the other databases that you want to import from.
Running:
You should run the script manually one time to make sure everything is working.
To run ImportBans, run:
./importbans.pl
To run HLStatsXBans, run:
php hlstatsxbans.php
If everything works, you can either schedule the exact same command you just executed to run at a configured interval or time,
or use the run_importbans wrapper to get logging (great for console use).
To use run_importbans, make sure you have edited the file for which script you want to use, and then simply execute:
./run_importbans.
Note: you will not get any output from this script. Everything is written into your logs/ directory.

View File

@ -0,0 +1,105 @@
<?php
/***************
** Deactivate HLstatsX ranking for banned players
** and reactivate them if unbanned
** Supports SourceBans, AMXBans, Beetlesmod, Globalban, MySQL Banning*
** by Jannik 'Peace-Maker' Hartung
** http://www.sourcebans.net/, http://www.wcfan.de/
** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
**
** Version 1.3: Added MySQL Banning support
** Version 1.2: Added more error handling
** Version 1.1: Fixed banned players not marked as banned, if a previous ban was unbanned
** Version 1.0: Initial Release
** YOU MUST ADJUST THIS FILE TO MEET YOUR NEEDS!
** Please fill in AT LEAST one bans database AND
** the HLStatsX Database section! Don't forget the names
** of the HLStatsX Databases near the end of this file!
**************/
//** SOURCEBANS MYSQL INFO ----------------------------
// http://www.sourcebans.net/
define('SB_HOST', 'localhost'); // MySQL host
define('SB_PORT', 3306); // MySQL port (Default 3306)
define('SB_USER', ''); // MySQL user
define('SB_PASS', ''); // MySQL password
define('SB_NAME', ''); // MySQL database name
define('SB_PREFIX', 'sb'); // MySQL table prefix
//** END SOURCEBANS MYSQL INFO ------------------------
//** AMXBANS MYSQL INFO -------------------------------
// http://www.amxbans.net/
define('AMX_HOST', 'localhost'); // MySQL host
define('AMX_PORT', 3306); // MySQL port (Default 3306)
define('AMX_USER', ''); // MySQL user
define('AMX_PASS', ''); // MySQL password
define('AMX_NAME', ''); // MySQL database name
define('AMX_PREFIX', 'amx'); // MySQL table prefix
//** END AMXBANS MYSQL INFO ---------------------------
//** BEETLESMOD MYSQL INFO ----------------------------
// http://www.beetlesmod.com/
define('BM_HOST', 'localhost'); // MySQL host
define('BM_PORT', 3306); // MySQL port (Default 3306)
define('BM_USER', ''); // MySQL user
define('BM_PASS', ''); // MySQL password
define('BM_NAME', ''); // MySQL database name
define('BM_PREFIX', 'bm'); // MySQL table prefix
//** END BEETLESMOD MYSQL INFO ------------------------
//** GLOBALBAN MYSQL INFO -----------------------------
// http://addons.eventscripts.com/addons/view/GlobalBan
// http://forums.eventscripts.com/viewtopic.php?t=14384
define('GB_HOST', 'localhost'); // MySQL host
define('GB_PORT', 3306); // MySQL port (Default 3306)
define('GB_USER', ''); // MySQL user
define('GB_PASS', ''); // MySQL password
define('GB_NAME', 'global_ban'); // MySQL database name
define('GB_PREFIX', 'gban'); // MySQL table prefix
//** END GLOBALBAN MYSQL INFO -------------------------
//** MySQL Banning - MYSQL INFO -----------------------
// http://forums.alliedmods.net/showthread.php?t=65822
define('MB_HOST', 'localhost'); // MySQL host
define('MB_PORT', 3306); // MySQL port (Default 3306)
define('MB_USER', ''); // MySQL user
define('MB_PASS', ''); // MySQL password
define('MB_NAME', ''); // MySQL database name
define('MB_PREFIX', 'mysql'); // MySQL table prefix
//** END MySQL Banning - MYSQL INFO -------------------
//** HLSTATSX MYSQL INFO ------------------------------
// http://www.hlxcommunity.com/
define('HLX_HOST', 'localhost'); // MySQL host
define('HLX_PORT', 3306); // MySQL port (Default 3306)
define('HLX_USER', ''); // MySQL user
define('HLX_PASS', ''); // MySQL password
define('HLX_PREFIX', 'hlstats'); // MySQL table prefix
/*************************************************
/* We're using different databases for each of our server to isolate each ranking
/* Type the HLstatsX database name here like
/* $hlxdbs[] = "databasename";
/* It's fine to just type one database.
**************************************************/
$hlxdbs = array();
$hlxdbs[] = "hlstatsx";
//** END HLSTATSX MYSQL INFO --------------------------
?>

View File

@ -0,0 +1,362 @@
<?php
/***************
** Deactivate HLstatsX ranking for banned players
** and reactivate them if unbanned
** Supports SourceBans, AMXBans, Beetlesmod, Globalban, MySQL Banning*
** by Jannik 'Peace-Maker' Hartung
** http://www.sourcebans.net/, http://www.wcfan.de/
** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
**
** Version 1.3: Added MySQL Banning support
** Version 1.2: Added more error handling
** Version 1.1: Fixed banned players not marked as banned, if a previous ban was unbanned
** Version 1.0: Initial Release
***************/
/*****************************
/***MAKE YOUR CONFIGURATION***
/********SETTINGS IN**********
/******hlstatsxban.cfg********
/***** DON'T EDIT BELOW ******
/*****************************/
require("hlstatsxban.cfg");
if (!extension_loaded('mysqli')) {
die("This script requires the MySQLi extension to be enabled. Consult your administrator, or edit your php.ini file, to enable this extension.");
}
$usesb = (SB_HOST == ""||SB_PORT == ""||SB_USER == ""||SB_PASS == ""||SB_NAME == ""||SB_PREFIX == ""?false:true);
$useamx = (AMX_HOST == ""||AMX_PORT == ""||AMX_USER == ""||AMX_PASS == ""||AMX_NAME == ""||AMX_PREFIX == ""?false:true);
$usebm = (BM_HOST == ""||BM_PORT == ""||BM_USER == ""||BM_PASS == ""||BM_NAME == ""||BM_PREFIX == ""?false:true);
$usegb = (GB_HOST == ""||GB_PORT == ""||GB_USER == ""||GB_PASS == ""||GB_NAME == ""||GB_PREFIX == ""?false:true);
$usemb = (MB_HOST == ""||MB_PORT == ""||MB_USER == ""||MB_PASS == ""||MB_NAME == ""||MB_PREFIX == ""?false:true);
$hlxready = (HLX_HOST == ""||HLX_PORT == ""||HLX_USER == ""||HLX_PASS == ""||empty($hlxdbs)||HLX_PREFIX == ""?false:true);
if (!$hlxready || (!$usesb && !$useamx && !$usebm && !$usegb && !$usemb))
die('[-] Please type your database information for HLstatsX and at least for one other ban database.');
$bannedplayers = array();
$unbannedplayers = array();
//------------------------------
// SourceBans Part
//------------------------------
if ($usesb)
{
// Connect to the SourceBans database.
$con = new mysqli(SB_HOST, SB_USER, SB_PASS, SB_NAME, SB_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to SourceBans Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to SourceBans database. Retrieving bans now.\n");
// Get permanent banned players
$bcnt = 0;
if ($bans = $con->query("SELECT `authid` FROM `".SB_PREFIX."_bans` WHERE `RemoveType` IS NULL AND `length` = 0")) {
while ($banned = $bans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($banned["authid"], $bannedplayers)) {
$bannedplayers[] = $banned["authid"];
++$bcnt;
}
}
}
else {
die('[-] Error retrieving banned players: ' . $con->error);
}
// Read unbanned players
$ubcnt = 0;
if ($unbans = $con->query("SELECT `authid` FROM `".SB_PREFIX."_bans` WHERE `RemoveType` IS NOT NULL AND `RemovedOn` IS NOT NULL")) {
while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($unbanned["authid"], $bannedplayers) && !in_array($unbanned["authid"], $unbannedplayers)) {
$unbannedplayers[] = $unbanned["authid"];
++$ubcnt;
}
}
}
else {
die('[-] Error retrieving unbanned players: ' . $con->error);
}
$con->close();
print("[+] Retrieved ".$bcnt." banned and ".$ubcnt." unbanned players from SourceBans.\n");
}
//------------------------------
// AMXBans Part
//------------------------------
if ($useamx)
{
// Connect to the AMXBans database.
$con = new mysqli(AMX_HOST, AMX_USER, AMX_PASS, AMX_NAME, AMX_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to AMXBans Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to AMXBans database. Retrieving bans now.\n");
// Get permanent banned players
$bcnt = 0;
if ($bans = $con->query("SELECT `player_id` FROM `".AMX_PREFIX."_bans` WHERE `ban_length` = 0")) {
while ($banned = $bans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($banned["player_id"], $bannedplayers))
{
$bannedplayers[] = $banned["player_id"];
++$bcnt;
}
}
} else {
die('[-] Error retrieving banned players: ' . $con->error);
}
// Read unbanned players
$ubcnt = 0;
// Handles (apparently) pre-6.0 version DB or lower
if ($unbans = $con->query("SELECT `player_id` FROM `".AMX_PREFIX."_banhistory` WHERE `ban_length` = 0")) {
while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($unbanned["player_id"], $bannedplayers) && !in_array($unbanned["player_id"], $unbannedplayers))
{
$unbannedplayers[] = $unbanned["player_id"];
++$ubcnt;
}
}
}
// Handles (apparently) 6.0 version DB or higher
else if ($unbans = $con->query("SELECT `player_id` FROM `".AMX_PREFIX."_bans` WHERE `expired` = 1")) {
while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($unbanned["player_id"], $bannedplayers) && !in_array($unbanned["player_id"], $unbannedplayers))
{
$unbannedplayers[] = $unbanned["player_id"];
++$ubcnt;
}
}
} else {
die('[-] Error retrieving unbanned players: ' . $con->error);
}
$con->close();
print("[+] Retrieved ".$bcnt." banned and ".$ubcnt." unbanned players from AMXBans.\n");
}
//------------------------------
// Beetlesmod Part
//------------------------------
if ($usebm)
{
// Connect to the Beetlesmod database.
$con = new mysqli(BM_HOST, BM_USER, BM_PASS, BM_NAME, BM_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to Beetlesmod Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to Beetlesmod database. Retrieving bans now.\n");
// Get permanent banned players
$bcnt = 0;
if ($bans = $con->query("SELECT `steamid` FROM `".BM_PREFIX."_bans` WHERE `Until` IS NULL")) {
while ($banned = $bans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($banned["steamid"], $bannedplayers))
{
$bannedplayers[] = $banned["steamid"];
++$bcnt;
}
}
} else {
die('[-] Error retrieving banned players: ' . $con->error);
}
// Read unbanned players
$ubcnt = 0;
if ($unbans = $con->query("SELECT `steamid` FROM `".BM_PREFIX."_bans` WHERE `Until` IS NULL AND `Remove` = 0")) {
while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($unbanned["steamid"], $bannedplayers) && !in_array($unbanned["steamid"], $unbannedplayers))
{
$unbannedplayers[] = $unbanned["steamid"];
++$ubcnt;
}
}
} else {
die('[-] Error retrieving unbanned players: ' . $con->error);
}
$con->close();
print("[+] Retrieved ".$bcnt." banned and ".$ubcnt." unbanned players from Beetlesmod.\n");
}
//------------------------------
// Globalban Part
//------------------------------
if ($usegb)
{
// Connect to the Globalban database.
$con = new mysqli(GB_HOST, GB_USER, GB_PASS, GB_NAME, GB_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to Globalban Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to Globalban database. Retrieving bans now.\n");
// Get permanent banned players
$bcnt = 0;
if ($bans = $con->query("SELECT `steam_id` FROM `".GB_PREFIX."_ban` WHERE `active` = 1 AND `pending` = 0 AND `length` = 0")) {
while ($banned = $bans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($banned["steam_id"], $bannedplayers))
{
$bannedplayers[] = $banned["steam_id"];
++$bcnt;
}
}
} else {
die('[-] Error retrieving banned players: ' . $con->error);
}
// Read unbanned players
$ubcnt = 0;
if ($unbans = $con->query("SELECT `steam_id` FROM `".GB_PREFIX."_ban` WHERE `active` = 0 AND `pending` = 0 AND `length` = 0")) {
while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($unbanned["steam_id"], $bannedplayers) && !in_array($unbanned["steam_id"], $unbannedplayers))
{
$unbannedplayers[] = $unbanned["steam_id"];
++$ubcnt;
}
}
} else {
die('[-] Error retrieving unbanned players: ' . $con->error);
}
$con->close();
print("[+] Retrieved ".$bcnt." banned and ".$ubcnt." unbanned players from Globalban.\n");
}
//------------------------------
// MySQL Banning Part
//------------------------------
if ($usemb)
{
// Connect to the MySQL Banning database.
$con = new mysqli(MB_HOST, MB_USER, MB_PASS, MB_NAME, MB_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to MySQL Banning Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to MySQL Banning database. Retrieving bans now.\n");
// Get permanent banned players
$bcnt = 0;
if ($bans = $con->query("SELECT `steam_id` FROM `".MB_PREFIX."_bans` WHERE `ban_length` = 0")) {
while ($banned = $bans->fetch_array(MYSQL_ASSOC)) {
if(!in_array($banned["steam_id"], $bannedplayers))
{
$bannedplayers[] = $banned["steam_id"];
++$bcnt;
}
}
} else {
die('[-] Error retrieving banned players: ' . $con->error);
}
/****** SM MySQL Banning doesn't provide a ban history AFAIK ******/
// Read unbanned players
// $ubcnt = 0;
// if ($unbans = $con->query("SELECT `steam_id` FROM `".MB_PREFIX."_bans` WHERE `ban_length` = 0")) {
// while ($unbanned = $unbans->fetch_array(MYSQL_ASSOC)) {
// if(!in_array($unbanned["steam_id"], $bannedplayers) && !in_array($unbanned["steam_id"], $unbannedplayers))
// {
// $unbannedplayers[] = $unbanned["steam_id"];
// ++$ubcnt;
// }
// }
// } else {
// die('[-] Error retrieving unbanned players: ' . $con->error);
//}
$con->close();
//print("[+] Retrieved ".$bcnt." banned and ".$ubcnt." unbanned players from MySQL Banning.\n");
print("[+] Retrieved ".$bcnt." banned players from MySQL Banning.\n");
}
//------------------------------
// HLstatsX Part
//------------------------------
if(empty($bannedplayers) && empty($unbannedplayers))
die('[-] Nothing to change. Exiting.');
$bannedsteamids="''";
$unbannedsteamids="''";
if(!empty($bannedplayers))
{
$bannedsteamids = "'";
foreach ($bannedplayers as $steamid)
{
$steamid = preg_replace('/^STEAM_[0-9]+?\:/i','',$steamid);
$bannedsteamids .= $steamid."','";
}
$bannedsteamids .= preg_replace('/\,\'$/','',$steamid);
$bannedsteamids .= "'";
}
if(!empty($unbannedplayers))
{
$unbannedsteamids = "'";
foreach ($unbannedplayers as $steamid)
{
$steamid = preg_replace('/^STEAM_[0-9]+?\:/i','',$steamid);
$unbannedsteamids .= $steamid."','";
}
$unbannedsteamids .= preg_replace('/\,\'$/','',$steamid);
$unbannedsteamids .= "'";
}
// Connection to DB
$hlxcon = new mysqli(HLX_HOST, HLX_USER, HLX_PASS, '', HLX_PORT);
if (mysqli_connect_error()) die('[-] Can\'t connect to HLstatsX Database (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
print("[+] Successfully connected to HLstatsX database server. Updating players...\n");
// Loop through all hlstatsx databases
foreach ($hlxdbs as $hlxdb)
{
$unbancnt = $bancnt = 0;
$hlxcon->select_db($hlxdb);
// Hide all banned players
if ($hlxban = $hlxcon->query("UPDATE `".HLX_PREFIX."_Players` SET `hideranking` = 2 WHERE `hideranking` < 2 AND `playerId` IN (SELECT `playerId` FROM `".HLX_PREFIX."_PlayerUniqueIds` WHERE `uniqueId` IN (".$bannedsteamids."));")) {
$bancnt = ($hlxcon->affected_rows?$hlxcon->affected_rows:0);
}
else {
die('[-] Error hiding banned players: ' . $hlxcon->error);
}
// Show all unbanned players
if ($hlxunban = $hlxcon->query("UPDATE `".HLX_PREFIX."_Players` SET `hideranking` = 0 WHERE `hideranking` = 2 AND `playerId` IN (SELECT `playerId` FROM `".HLX_PREFIX."_PlayerUniqueIds` WHERE `uniqueId` IN (".$unbannedsteamids."));")) {
$unbancnt = ($hlxcon->affected_rows?$hlxcon->affected_rows:0);
if ($bancnt>0||$unbancnt>0) {
print("[+] ".$hlxdb.": ".$bancnt." players were marked as banned, ".$unbancnt." players were reenabled again.\n");
}
else {
print("[-] ".$hlxdb.": No player changed.\n");
}
}
else {
die('[-] Error showing unbanned players: ' . $hlxcon->error);
}
}
$hlxcon->close();
?>

View File

@ -0,0 +1,194 @@
#!/usr/bin/perl
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
####
# Script to mark banned users in HLstatsX Community Edition from a Sourcebans, AMXBans, Beetlesmod, or ES GlobalBan database (or multiple at once!)
# Last Revised: 2009-07-22 13:35 GMT
# BeetlesMod and GlobalBan support added by Bo Tribun (R3M)
#######################################################################################
# You must fill info out for the HLX DB and at least one of the Bans databases
#######################################################################################
# Sourcebans DB Info
$sb_dbhost = "localhost";
$sb_dbport = 3306;
$sb_dbuser = "";
$sb_dbpass = "";
$sb_dbname = "";
$sb_prefix = "sb_"; # be sure to include the underscore (_)
# AMXBans DB Info
$amxb_dbhost = "localhost";
$amxb_dbport = 3306;
$amxb_dbuser = "";
$amxb_dbpass = "";
$amxb_dbname = "";
# BeetlesMod DB Info
$bm_dbhost = "localhost";
$bm_dbport = 3306;
$bm_dbuser = "";
$bm_dbpass = "";
$bm_dbname = "";
# ES GlobalBan DB Info
$gb_dbhost = "localhost";
$gb_dbport = 3306;
$gb_dbuser = "";
$gb_dbpass = "";
$gb_dbname = "";
# HLX DB Info
$hlx_dbhost = "localhost";
$hlx_dbport = 3306;
$hlx_dbuser = "";
$hlx_dbpass = "";
$hlx_dbname = "";
##
##
################################################################################
## No need to edit below this line
##
use DBI;
$havesbinfo = ($sb_dbhost eq "" || $sb_dbuser eq "" || $sb_dbpass eq "" || $sb_dbname eq "")?0:1;
$haveamxbinfo = ($amxb_dbhost eq "" || $amxb_dbuser eq "" || $amxb_dbpass eq "" || $amxb_dbname eq "")?0:1;
$havebminfo = ($bm_dbhost eq "" || $bm_dbuser eq "" || $bm_dbpass eq "" || $bm_dbname eq "")?0:1;
$havegbinfo = ($gb_dbhost eq "" || $gb_dbuser eq "" || $gb_dbpass eq "" || $gb_dbname eq "")?0:1;
$havehlxinfo = ($hlx_dbhost eq "" || $hlx_dbuser eq "" || $hlx_dbpass eq "" || $hlx_dbname eq "")?0:1;
die("DB login info incomplete. Exiting\n") if ($havehlxinfo == 0 || ($havesbinfo == 0 && $haveamxbinfo == 0 && $havebminfo == 0 && $havegbinfo == 0));
@steamids = ();
if ($havesbinfo) {
print "Connecting to Sourcebans database...\n";
my $sb_dbconn = DBI->connect(
"DBI:mysql:database=$sb_dbname;host=$sb_dbhost;port=$sb_dbport",
$sb_dbuser, $sb_dbpass) or die ("\nCan't connect to Sourcebans database '$sb_dbname' on '$sb_dbhost'\n" .
"Server error: $DBI::errstr\n");
print "Successfully connected to Sourcebans database. Retrieving banned Steam IDs now...\n";
my $result = &doQuery($sb_dbconn, "SELECT `authid` FROM ".$sb_prefix."bans WHERE `length` = 0 AND `RemovedBy` IS NULL");
while ( my($steamid) = $result->fetchrow_array) {
push(@steamids, $steamid);
}
my $rows = $result->rows;
if ($rows) {
print $rows." banned users retrieved from Sourcebans.\n";
}
$sb_dbconn->disconnect;
}
if ($haveamxbinfo) {
print "Connecting to AMXBans database...\n";
my $amxb_dbconn = DBI->connect(
"DBI:mysql:database=$amxb_dbname;host=$amxb_dbhost;port=$amxb_dbport",
$amxb_dbuser, $amxb_dbpass) or die ("\nCan't connect to AMXBans database '$amxb_dbname' on '$amxb_dbhost'\n" .
"Server error: $DBI::errstr\n");
print "Successfully connected to AMXBans database. Retrieving banned Steam IDs now...\n";
my $result = &doQuery($amxb_dbconn, "SELECT `player_id` FROM amx_bans WHERE `ban_length` = 0");
while ( my($steamid) = $result->fetchrow_array) {
push(@steamids, $steamid);
}
my $rows = $result->rows;
if ($rows) {
print $rows." banned users retrieved from AMXBans.\n";
}
$amxb_dbconn->disconnect;
}
if ($havebminfo) {
print "Connecting to BeetlesMod database...\n";
my $bm_dbconn = DBI->connect(
"DBI:mysql:database=$bm_dbname;host=$bm_dbhost;port=$bm_dbport",
$bm_dbuser, $bm_dbpass) or die ("\nCan't connect to BeetlesMod database '$bm_dbname' on '$bm_dbhost'\n" .
"Server error: $DBI::errstr\n");
print "Successfully connected to BeetlesMod database. Retrieving banned Steam IDs now...\n";
my $result = &doQuery($bm_dbconn, "SELECT `steamid` FROM `bm_bans` WHERE `Until` IS NULL");
while ( my($steamid) = $result->fetchrow_array) {
push(@steamids, $steamid);
}
my $rows = $result->rows;
if ($rows) {
print $rows." banned users retrieved from BeetlesMod.\n";
}
$bm_dbconn->disconnect;
}
if ($havegbinfo) {
print "Connecting to ES GlobalBan database...\n";
my $gb_dbconn = DBI->connect(
"DBI:mysql:database=$gb_dbname;host=$gb_dbhost;port=$gb_dbport",
$gb_dbuser, $gb_dbpass) or die ("\nCan't connect to ES GlobalBan database '$gb_dbname' on '$gb_dbhost'\n" .
"Server error: $DBI::errstr\n");
print "Successfully connected to ES GlobalBan database. Retrieving banned Steam IDs now...\n";
my $result = &doQuery($gb_dbconn, "SELECT `steam_id` FROM `gban_ban` WHERE `active` = 1 AND `pending` = 0 AND `length` = 0");
while ( my($steamid) = $result->fetchrow_array) {
push(@steamids, $steamid);
}
my $rows = $result->rows;
if ($rows) {
print $rows." banned users retrieved from ES GlobalBan.\n";
}
$gb_dbconn->disconnect;
}
if (@steamids) {
$steamidstring = "'";
foreach $steamid (@steamids)
{
$steamid =~ s/^STEAM_[0-9]+?\://i;
$steamidstring .= $steamid."','";
}
$steamidstring =~ s/\,\'$//;
print "Connecting to HLX:CE database...\n";
$hlx_dbconn = DBI->connect(
"DBI:mysql:database=$hlx_dbname;host=$hlx_dbhost;port=$hlx_dbport",
$hlx_dbuser, $hlx_dbpass) or die ("\nCan't connect to HLX:CE database '$hlx_dbname' on '$hlx_dbhost'\n" .
"Server error: $DBI::errstr\n");
print "Updating HLX:CE banned players...\n";
$result = &doQuery($hlx_dbconn, "UPDATE `hlstats_Players` SET `hideranking` = 2 WHERE `playerId` IN (SELECT `playerId` FROM hlstats_PlayerUniqueIds WHERE `uniqueId` IN ($steamidstring)) AND `hideranking` < 2");
print $result->rows." users newly marked as banned.\n";
$hlx_dbconn->disconnect;
} else {
die("No banned users found in database(s). Exiting\n");
}
sub doQuery
{
my ($dbconn, $query, $callref) = @_;
my $result = $dbconn->prepare($query) or die("Unable to prepare query:\n$query\n$DBI::errstr\n$callref");
$result->execute or die("Unable to execute query:\n$query\n$DBI::errstr\n$callref");
return $result;
}

View File

@ -0,0 +1,79 @@
#!/bin/bash
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# HLStatsX:CE now has two import ban utilities:
# 1) ImportBans.pl is the original importing script written in perl.
#
# 2) hlstatsxbans.php is written by Peace-Maker and is written in PHP.
#
# More information on these scripts can be found in README.
# Please select your banning system below using the number that corresponds to the ban system above.
BANSYSTEM=1
### Nothing needs to be modified below here ###
# verify that you have a logs directory
if [ ! -d logs ];then
mkdir logs
fi
if [ ! -w logs ];then
echo "you need write access to the logs folder"
exit 1
fi
# print info to the log file and run importbans.pl
echo Importing Bans -- `date +%c` >> logs/log`date +_%Y%m%d`
case $BANSYSTEM in
1)
echo Using importbans.pl >> logs/log`date +_%Y%m%d` 2>&1
./importbans.pl >> logs/log`date +_%Y%m%d` 2>&1
;;
2)
echo Using hlstatsxbans.php >> logs/log`date +_%Y%m%d` 2>&1
/usr/bin/php `pwd`/hlstatsxban.php >> logs/log`date +_%Y%m%d` 2>&1
;;
*)
echo Warning: BANSYSTEM is not correctly configured. Please check your configuration.
;;
esac
echo >> logs/log`date +_%Y%m%d`
exit 0

500
scripts/TRcon.pm Normal file
View File

@ -0,0 +1,500 @@
package TRcon;
#
# TRcon Perl Module - execute commands on a remote Half-Life2 server using remote console.
#
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
use strict;
no strict 'vars';
use Sys::Hostname;
use IO::Socket;
use IO::Select;
use bytes;
use Scalar::Util;
do "$::opt_libdir/HLstats_GameConstants.plib";
my $VERSION = "1.00";
my $TIMEOUT = 1.0;
my $SERVERDATA_EXECCOMMAND = 2;
my $SERVERDATA_AUTH = 3;
my $SERVERDATA_RESPONSE_VALUE = 0;
my $SERVERDATA_AUTH_RESPONSE = 2;
my $REFRESH_SOCKET_COUNTER_LIMIT = 100;
my $AUTH_PACKET_ID = 1;
my $SPLIT_END_PACKET_ID = 2;
#
# Constructor
#
sub new
{
my ($class_name, $server_object) = @_;
my ($self) = {};
bless($self, $class_name);
$self->{"rcon_socket"} = 0;
$self->{"server_object"} = $server_object;
Scalar::Util::weaken($self->{"server_object"});
$self->{"auth"} = 0;
$self->{"refresh_socket_counter"} = 0;
$self->{"packet_id"} = 10;
return $self;
}
sub execute
{
my ($self, $command, $splitted_answer) = @_;
if ($::g_stdin == 0) {
my $answer = $self->sendrecv($command, $splitted_answer);
if ($answer =~ /bad rcon_password/i) {
&::printEvent("TRCON", "Bad Password");
}
return $answer;
}
}
sub get_auth_code
{
my ($self, $id) = @_;
my $auth = 0;
if ($id == $AUTH_PACKET_ID) {
&::printEvent("TRCON", "Rcon password accepted");
$auth = 1;
$self->{"auth"} = 1;
} elsif( $id == -1) {
&::printEvent("TRCON", "Rcon password refused");
$self->{"auth"} = 0;
$auth = 0;
} else {
&::printEvent("TRCON", "Bad password response id=$id");
$self->{"auth"} = 0;
$auth = 0;
}
return $auth;
}
sub sendrecv
{
my ($self, $msg, $splitted_answer) = @_;
my $rs_counter = $self->{"refresh_socket_counter"};
if ($rs_counter % $REFRESH_SOCKET_COUNTER_LIMIT == 0) {
if ($self->{"rcon_socket"} > 0) {
shutdown($self->{"rcon_socket"}, 2);
$self->{"rcon_socket"} = 0;
}
my $server_object = $self->{"server_object"};
$self->{"rcon_socket"} = IO::Socket::INET->new(
Proto=>"tcp",
PeerAddr=>$server_object->{address},
PeerPort=>$server_object->{port},
);
if (!$self->{"rcon_socket"}) {
&::printEvent("TRCON", "Cannot setup TCP socket on ".$server_object->{address}.":".$server_object->{port}.": $!");
}
$self->{"refresh_socket_counter"} = 0;
$self->{"auth"} = 0;
}
my $r_socket = $self->{"rcon_socket"};
my $server = $self->{"server_object"};
my $auth = $self->{"auth"};
my $response = "";
my $packet_id = $self->{"packet_id"};
if (($r_socket) && ($r_socket->connected() )) {
if ($auth == 0) {
&::printEvent("TRCON", "Trying to get rcon access (auth)");
if ($self->send_rcon($AUTH_PACKET_ID, $SERVERDATA_AUTH, $server->{rcon}, "")) {
&::printEvent("TRCON", "Couldn't send password");
return;
}
my ($id, $command, $response) = $self->recieve_rcon($AUTH_PACKET_ID);
if($command == $SERVERDATA_AUTH_RESPONSE) {
$auth = $self->get_auth_code($id);
} elsif (($command == $SERVERDATA_RESPONSE_VALUE) && ($id == $AUTH_PACKET_ID)) {
#Source servers sends one junk packet during the authentication step, before it responds
# with the correct authentication response.
&::printEvent("TRCON", "Junk packet from Source Engine");
my ($id, $command, $response) = $self->recieve_rcon($AUTH_PACKET_ID);
$auth = $self->get_auth_code($id);
}
}
if ($auth == 1) {
$self->{"refresh_socket_counter"}++;
$self->send_rcon($packet_id, $SERVERDATA_EXECCOMMAND, $msg);
if ($splitted_answer > 0) {
$self->send_rcon($SPLIT_END_PACKET_ID, $SERVERDATA_EXECCOMMAND, "");
}
my ($id, $command, $response) = $self->recieve_rcon($packet_id, $splitted_answer);
$self->{"packet_id"}++;
if ($self->{"packet_id"} > 32767) {
$self->{"packet_id"} = 10;
}
return $response;
}
} else {
$self->{"refresh_socket_counter"} = 0;
}
return;
}
#
# Send a package
#
sub send_rcon
{
my ($self, $id, $command, $string1, $string2) = @_;
my $data = pack("VVZ*Z*", $id, $command, $string1, $string2);
my $size = length($data);
if($size > 4096) {
&::printEvent("TRCON", "Command to long to send!");
return 1;
}
$data = pack("V", $size).$data;
my $r_socket = $self->{"rcon_socket"};
if ($r_socket && $r_socket->connected() && $r_socket->peeraddr()) {
$r_socket->send($data, 0);
return 0;
} else {
$self->{"refresh_socket_counter"} = 0;
}
return 1;
}
#
# Recieve a package
#
sub recieve_rcon
{
my ($self, $packet_id, $splitted_answer) = @_;
my ($size, $id, $command, $msg);
my $tmp = "";
my $r_socket = $self->{"rcon_socket"};
my $server = $self->{"server_object"};
my $auth = $self->{"auth"};
my $packet_id = $self->{"packet_id"};
if (($r_socket) && ($r_socket->connected() )) {
if(IO::Select->new($r_socket)->can_read($TIMEOUT)) { # $TIMEOUT seconds timeout
$r_socket->recv($tmp, 1500);
$size = unpack("V", substr($tmp, 0, 4));
if ($size == 0) {
$self->{"refresh_socket_counter"} = 0;
return (-1, -1, -1);
}
$id = unpack("V", substr($tmp, 4, 4));
$command = unpack("V", substr($tmp, 8, 4));
if ($id == $packet_id) {
$tmp = substr($tmp, 12, length($tmp)-12);
if ($splitted_answer > 0) {
my $last_packet_id = $id;
while ($last_packet_id != $SPLIT_END_PACKET_ID) {
if(IO::Select->new($r_socket)->can_read($TIMEOUT)) {
$r_socket->recv($split_data, 1500);
my $split_size = unpack("V", substr($split_data, 0, 4));
my $split_id = unpack("V", substr($split_data, 4, 4));
my $split_command = unpack("V", substr($split_data, 8, 4));
if ($split_id == $last_packet_id) {
$split_data = substr($split_data, 12, length($split_data)-12);
}
if (!defined($split_id)){
$last_packet_id = $SPLIT_END_PACKET_ID;
} else {
$last_packet_id = $split_id;
}
$tmp .= $split_data;
} else {
&::printNotice("TRCON", "Multiple packet error");
$last_packet_id = $SPLIT_END_PACKET_ID;
}
}
}
if (length($tmp) > 0) {
$tmp .= "\x00";
my ($string1, $string2) = unpack("Z*Z*", $tmp);
$msg = $string1.$string2;
} else {
$msg = "";
}
}
return ($id, $command, $msg);
} else {
$self->{"refresh_socket_counter"} = 0;
return (-1, -1, -1);
}
} else {
$self->{"refresh_socket_counter"} = 0;
return (-1, -1, -1);
}
}
#
# Get error message
#
sub error
{
my ($self) = @_;
return $self->{"rcon_error"};
}
#
# Parse "status" command output into player information
#
sub getPlayers
{
my ($self) = @_;
my $status = $self->execute("status", 1);
if (!$status)
{
return ("", -1, "", 0);
}
my @lines = split(/[\r\n]+/, $status);
my %players;
# HL2 standard
# userid name uniqueid connected ping loss state adr
# 187 ".:[SoV]:.Evil Shadow" STEAM_0:1:6200412 13:48 97 0 active 213.10.196.229:24085
# L4D
# userid name uniqueid connected ping loss state rate adr
# 2 1 "psychonic" STEAM_1:1:4153990 00:45 68 1 active 20000 192.168.5.115:27006
foreach my $line (@lines)
{
if ($line =~ /^\#\s*
(\d+)\s+ # userid
(?:\d+\s+|) # extra number in L4D, not sure what this is??
"(.+)"\s+ # name
(.+)\s+ # uniqueid
([\d:]+)\s+ # time
(\d+)\s+ # ping
(\d+)\s+ # loss
([A-Za-z]+)\s+ # state
(?:\d+\s+|) # rate (L4D only)
([^:]+): # addr
(\S+) # port
$/x)
{
my $userid = $1;
my $name = $2;
my $uniqueid = $3;
my $time = $4;
my $ping = $5;
my $loss = $6;
my $state = $7;
my $address = $8;
my $port = $9;
$uniqueid =~ s/^STEAM_[0-9]+?\://i;
# &::printEvent("DEBUG", "USERID: '$userid', NAME: '$name', UNIQUEID: '$uniqueid', TIME: '$time', PING: '$ping', LOSS: '$loss', STATE: '$state', ADDRESS:'$address', CLI_PORT: '$port'", 1);
if ($::g_mode eq "NameTrack") {
$players{$name} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
} elsif ($::g_mode eq "LAN") {
$players{$address} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
} else {
$players{$uniqueid} = {
"Name" => $name,
"UserID" => $userid,
"UniqueID" => $uniqueid,
"Time" => $time,
"Ping" => $ping,
"Loss" => $loss,
"State" => $state,
"Address" => $address,
"ClientPort" => $port
};
}
}
}
return %players;
}
sub getServerData
{
my ($self) = @_;
my $status = $self->execute("status", 1);
my $server_object = $self->{server_object};
my $game = $server_object->{play_game};
my @lines = split(/[\r\n]+/, $status);
my $servhostname = "";
my $map = "";
my $max_players = 0;
my $difficulty = 0;
foreach my $line (@lines)
{
if ($line =~ /^\s*hostname\s*:\s*([\S].*)$/)
{
$servhostname = $1;
}
elsif ($line =~ /^\s*map\s*:\s*([\S]+).*$/)
{
$map = $1;
}
elsif ($line =~ /^\s*players\s*:\s*\d+.+\((\d+)\smax.*$/)
{
$max_players = $1;
}
}
if ($game == L4D()) {
$difficulty = $self->getDifficulty();
}
return ($servhostname, $map, $max_players, $difficulty);
}
sub getVisiblePlayers
{
my ($self) = @_;
my $status = $self->execute("sv_visiblemaxplayers");
my @lines = split(/[\r\n]+/, $status);
my $max_players = -1;
foreach my $line (@lines)
{
# "sv_visiblemaxplayers" = "-1"
# - Overrides the max players reported to prospective clients
if ($line =~ /^\s*"sv_visiblemaxplayers"\s*=\s*"([-0-9]+)".*$/x)
{
$max_players = $1;
}
}
return ($max_players);
}
my %l4d_difficulties = (
'Easy' => 1,
'Normal' => 2,
'Hard' => 3,
'Impossible' => 4
);
sub getDifficulty
{
#z_difficulty
#"z_difficulty" = "Normal"
# game replicated
# - Difficulty of the current game (Easy, Normal, Hard, Impossible)
my ($self) = @_;
my $zdifficulty = $self->execute("z_difficulty");
my @lines = split(/[\r\n]+/, $zdifficulty);
foreach my $line (@lines)
{
if ($line =~ /^\s*"z_difficulty"\s*=\s*"([A-Za-z]+)".*$/x)
{
if (exists($l4d_difficulties{$1}))
{
return $l4d_difficulties{$1};
}
}
}
return 0;
}
#
# Get information about a player by userID
#
sub getPlayer
{
my ($self, $uniqueid) = @_;
my %players = $self->getPlayers();
if (defined($players{$uniqueid}))
{
return $players{$uniqueid};
}
else
{
$self->{"error"} = "No such player # $uniqueid";
return 0;
}
}
1;
# end

1282
scripts/hlstats-awards.pl Normal file

File diff suppressed because it is too large Load Diff

374
scripts/hlstats-resolve.pl Normal file
View File

@ -0,0 +1,374 @@
#!/usr/bin/perl
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
##
## Settings
##
# $opt_configfile - Absolute path and filename of configuration file.
$opt_configfile = "./hlstats.conf";
# $opt_libdir - Directory to look in for local required files
# (our *.plib, *.pm files).
$opt_libdir = "./";
##
##
################################################################################
## No need to edit below this line
##
use Getopt::Long;
use IO::Socket;
use DBI;
require "$opt_libdir/ConfigReaderSimple.pm";
do "$opt_libdir/HLstats.plib";
$|=1;
Getopt::Long::Configure ("bundling");
##
## Functions
##
sub is_number ($) { ( $_[0] ^ $_[0] ) eq '0' }
#
# void printEvent (int code, string description)
#
# Logs event information to stdout.
#
sub printEvent
{
my ($code, $description, $update_timestamp) = @_;
if ($g_debug > 0)
{
if ($update_timestamp > 0)
{
my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time());
my $timestamp = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
} else {
my $timestamp = $ev_timestamp;
}
print localtime(time) . "" unless ($timestamp);
if (is_number($code))
{
printf("%s: %21s - E%03d: %s\n", $timestamp, $s_addr, $code, $description);
} else {
printf("%s: %21s - %s: %s\n", $timestamp, $s_addr, $code, $description);
}
}
}
##
## MAIN
##
# Options
$opt_help = 0;
$opt_version = 0;
$opt_regroup = 0;
$db_host = "localhost";
$db_user = "";
$db_pass = "";
$db_name = "hlstats";
$g_dns_timeout = 5;
$g_debug = 0;
# Usage message
$usage = <<EOT
Usage: hlstats-resolve.pl [OPTION]...
Resolve player IP addresses to hostnames.
-h, --help display this help and exit
-v, --version output version information and exit
-d, --debug enable debugging output (-dd for more)
-n, --nodebug disables above; reduces debug level
--db-host=HOST database ip:port
--db-name=DATABASE database name
--db-password=PASSWORD database password (WARNING: specifying the
password on the command line is insecure.
Use the configuration file instead.)
--db-username=USERNAME database username
--dns-timeout=SEC timeout DNS queries after SEC seconds [$g_dns_timeout]
-r, --regroup only re-group hostnames--don't resolve any IPs
Long options can be abbreviated, where such abbreviation is not ambiguous.
Most options can be specified in the configuration file:
$opt_configfile
Note: Options set on the command line take precedence over options set in the
configuration file.
HLstats: http://www.hlstats.org
EOT
;
# Read Config File
if ($opt_configfile && -r $opt_configfile)
{
$conf = ConfigReaderSimple->new($opt_configfile);
$conf->parse();
%directives = (
"DBHost", "db_host",
"DBUsername", "db_user",
"DBPassword", "db_pass",
"DBName", "db_name",
"DNSTimeout", "g_dns_timeout",
"DebugLevel", "g_debug"
);
&doConf($conf, %directives);
}
else
{
print "-- Warning: unable to open configuration file '$opt_configfile'\n";
}
# Read Command Line Arguments
GetOptions(
"help|h" => \$opt_help,
"version|v" => \$opt_version,
"debug|d+" => \$g_debug,
"nodebug|n+" => \$g_nodebug,
"db-host=s" => \$db_host,
"db-name=s" => \$db_name,
"db-password=s" => \$db_pass,
"db-username=s" => \$db_user,
"dns-timeout=i" => \$g_dns_timeout,
"regroup|r" => \$opt_regroup
) or die($usage);
if ($opt_help)
{
print $usage;
exit(0);
}
if ($opt_version)
{
print "hlstats-resolve.pl (HLstats) $g_version\n"
. "Real-time player and clan rankings and statistics for Half-Life\n\n"
. "Copyright (C) 2001 Simon Garner\n"
. "This is free software; see the source for copying conditions. There is NO\n"
. "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
exit(0);
}
$g_debug -= $g_nodebug;
$g_debug = 0 if ($g_debug < 0);
if ($g_debug >= 2)
{
$opt_quiet = 0;
}
else
{
$opt_quiet = 1; # quiet name resolution
}
$g_dns_resolveip = 1;
# Startup
print "++ HLstats Resolve $g_version starting...\n\n";
# Connect to the database
print "-- Connecting to MySQL database '$db_name' on '$db_host' as user '$db_user' ... ";
$db_conn = DBI->connect(
"DBI:mysql:$db_name:$db_host",
$db_user, $db_pass
) or die ("Can't connect to MySQL database '$db_name' on '$db_host'\n" .
"$DBI::errstr\n");
print "connected OK\n";
# Print configuration
print "-- DNS timeout is $g_dns_timeout seconds. Debug level is $g_debug.\n";
# Main data routine
if ($opt_regroup)
{
my $result = &doQuery("
SELECT
id,
hostname
FROM
hlstats_Events_Connects
WHERE
hostname != ''
");
my $total = $result->rows;
if ($total > 0) {
print "\n++ Re-grouping hosts (total $total hostnames) ... ";
my $resultHG = &queryHostGroups();
if ($g_debug > 0)
{
print "\n\n";
}
else
{
print " ";
}
my $p = 1;
while( my($id, $hostname) = $result->fetchrow_array )
{
my $percent = ($p / $total) * 100;
my $hostgroup = &getHostGroup($hostname, $resultHG);
&execNonQuery("
UPDATE
hlstats_Events_Connects
SET
hostgroup='" . &quoteSQL($hostgroup) . "'
WHERE
id=$id
");
if ($g_debug > 0)
{
printf("-> (%3d%%) %50s = %s\n", $percent, $hostname, $hostgroup);
}
else
{
printf("\b\b\b\b%3d%%", $percent);
}
$p++;
}
print "\n" unless ($g_debug > 0);
} else {
print "\n++ No Connects found!\n";
}
}
else
{
my $result = &doQuery("
SELECT
DISTINCT ipAddress,
hostname
FROM
hlstats_Events_Connects
");
my $total = $result->rows;
if ($total > 0) {
print "\n++ Resolving IPs and re-grouping hosts (total $total connects) ... ";
my $resultHG = &queryHostGroups();
if ($g_debug > 0)
{
print "\n\n";
}
else
{
print " ";
}
my $p = 1;
while( my($ipAddress, $hostname) = $result->fetchrow_array )
{
my $percent = ($p / $total) * 100;
if ($hostname eq "")
{
$hostname = &resolveIp($ipAddress, $opt_quiet);
}
my $hostgroup = &getHostGroup($hostname, $resultHG);
&execNonQuery("
UPDATE
hlstats_Events_Connects
SET
hostname='$hostname',
hostgroup='" . &quoteSQL($hostgroup) . "'
WHERE
ipAddress='$ipAddress'
");
if ($g_debug > 0)
{
printf("-> (%3d%%) %15s = %50s = %s\n", $percent, $ipAddress, $hostname, $hostgroup);
}
else
{
printf("\b\b\b\b%3d%%", $percent);
}
$p++;
}
print "\n" unless ($g_debug > 0);
} else {
print "\n++ No Connects found!\n";
}
}
print "\n++ Operation complete.\n";
exit(0);

83
scripts/hlstats.conf Normal file
View File

@ -0,0 +1,83 @@
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
##
## Database Settings
##
# DBHost - Database server "address" or "address:port". Address can be an IP or
# a hostname. The default MySQL port is 3306 (tcp).
DBHost ""
# DBUsername - User to connect to the database as.
DBUsername ""
# DBPassword - Password for the database user.
DBPassword ""
# DBName - Name of the database to use.
DBName ""
##
## UDP Socket Settings (should match "logaddress ip port" on the game servers)
##
# BindIP - IP address to bind to (leave empty to use all interfaces).
BindIP ""
# Port - Port to listen on for log data from the game servers. this is also valid for proxy-daemon.pl
Port 27500
##
## Cpanel hack
##
## Set this to 1 if you use cpanel and need to use a user-installed Perl module
CpanelHack 0
##
## Event Queue
##
## Number of each type of events to queue before inserting events of that type
## (larger installs may try raising this for better performance
EventQueueSize 10
# DebugLevel - Set this to 1 to have debugging information printed on stdout.
# Set higher for even more debugging information. Set to 0 for
# quiet operation. It is recommended that you set this to 1 when
# first configuring HLstats, to help diagnose any problems.
DebugLevel 1

3626
scripts/hlstats.pl Normal file

File diff suppressed because it is too large Load Diff

456
scripts/proxy-daemon.pl Normal file
View File

@ -0,0 +1,456 @@
#!/usr/bin/perl
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
use strict;
use DBI;
use IO::Socket;
use IO::Select;
use Getopt::Long;
use Time::Local;
no strict 'vars';
##
## Settings
##
# $opt_configfile - Absolute path and filename of configuration file.
$opt_configfile = "./hlstats.conf";
# $opt_libdir - Directory to look in for local required files
# (our *.plib, *.pm files).
$opt_libdir = "./";
$heartbeat = 30;
##
##
################################################################################
## No need to edit below this line
##
require "$opt_libdir/ConfigReaderSimple.pm";
do "$opt_libdir/HLstats.plib";
$|=1;
Getopt::Long::Configure ("bundling");
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
# Variables
my %srv_list = ();
my ($datagram,$flags);
my $oldtime = (time + $heartbeat);
$usage = <<EOT
Usage: hlstats.pl [OPTION]...
Collect statistics from one or more Half-Life2 servers for distribution
to sub-daemons (hlstats.pl).
-h, --help display this help and exit
-d, --debug enable debugging output (-dd for more)
-c, --configfile Specific configfile to use, settings in this file can't
be overided with commandline settings.
HLstatsX: Community Edition http://www.hlxcommunity.com
EOT
;
# Read Config File
if ($opt_configfile && -r $opt_configfile) {
$conf = ConfigReaderSimple->new($opt_configfile);
$conf->parse();
%directives = (
"DBHost", "db_host",
"DBUsername", "db_user",
"DBPassword", "db_pass",
"DBName", "db_name",
"BindIP", "s_ip",
"Port", "proxy_port",
"DebugLevel", "g_debug",
);
&doConf($conf, %directives);
} else {
&printEvent("CONFIG", "-- Warning: unable to open configuration file '$opt_configfile'", 1);
}
# Read Command Line Arguments
GetOptions(
"help|h" => \$opt_help,
"configfile|c=s" => \$configfile,
"debug|d+" => \$g_debug
) or die($usage);
if ($opt_help) {
print $usage;
exit(0);
}
if ($configfile && -r $configfile) {
$conf = '';
$conf = ConfigReaderSimple->new($configfile);
$conf->parse();
&doConf($conf, %directives);
}
#
# assignDaemon(string ipaddr, string ipport, hash daemon, hash srv_list)
#
# Round-Robin kind of way of spreading the load to different daemons.
#
sub assignDaemon
{
my ($ipaddr, $ipport, $daemon, $srv_list) = @_;
my $next = "";
if (defined($$srv_list{'rr-next'})) {
$next = $$srv_list{'rr-next'};
} else {
$next = 0;
}
my $max = keys %$daemon;
if (!defined($$srv_list{$ipaddr}{$ipport})) {
if ($next eq $max) {
$next = 1;
} else {
$next++;
}
$$srv_list{'rr-next'} = $next;
$$srv_list{$ipaddr}{$ipport}{'dest_ip'} = $$daemon{$next}{'ip'};
$$srv_list{$ipaddr}{$ipport}{'dest_port'} = $$daemon{$next}{'port'};
}
return;
}
#
# checkHeartbeat (hash daemon, string proxy_key)
#
# Prints and update the state of the perl daemons, if they are up or not.
#
sub checkHeartbeat
{
my ($daemon, $proxy_key) = @_;
my $state = '';
foreach my $key (keys(%$daemon)) {
my $value = $$daemon{$key};
my $socket = IO::Socket::INET->new( Proto=>"udp",
PeerHost=>$$daemon{$key}{'ip'},
PeerPort=>$$daemon{$key}{'port'}
);
$packet = "C;HEARTBEAT;";
$socket->send("PROXY Key=$proxy_key PROXY $packet");
if(IO::Select->new($socket)->can_read(4)) { # 4 second timeout
$socket->recv($msg,1024);
if ($msg =~ /Heartbeat OK/) {
$state = "up";
} else {
$state = "down";
}
}
if ($$daemon{$key}{'curstate'} eq "") {
$$daemon{$key}{'curstate'} = "n/a";
}
$$daemon{$key}{'oldstate'} = $$daemon{$key}{'curstate'};
$$daemon{$key}{'curstate'} = $state;
&printEvent("HEARTBEAT", "Sending HB to $$daemon{$key}{'ip'}:$$daemon{$key}{'port'}... state: $$daemon{$key}{'curstate'} (old: $$daemon{$key}{'oldstate'})", 1);
$state = '';
}
return;
}
#
# string retunrServerList(hash srv_list)
#
# Return a list of servers to requestor (udp package C;SERVERLIST).
#
sub returnServerList
{
my ($srv_list) = @_;
#$srv_list{$ipaddr}{$ipport}{'dest_ip'}
for my $ip (keys(%srv_list)) {
for my $port (keys(%{$srv_list{$ip}})) {
$msg = $msg . "$ip:$port -> $srv_list{$ip}{$port}{'dest_ip'}:$srv_list{$ip}{$port}{'dest_port'}\n";
}
}
return $msg;
}
#
# string theTime(int sec, int min, int hour, int mday, int year, int wday, int yday, int isdst)
#
# Makes a pretty timestampformat to output
#
sub theTime
{
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = $year + 1900;
$mon = $mon + 1;
if ($mon <= 9) { $mon = "0$mon"; }
if ($mday <= 9) { $mday = "0$mday"; }
if ($hour <= 9) { $hour = "0$hour"; }
if ($min <= 9) { $min = "0$min"; }
if ($sec <= 9) { $sec = "0$sec"; }
my $time = "[$year-$mon-$mday $hour:$min:$sec] ";
return $time;
}
#
# string reloadDaemon(hash daemon, string proxy_key)
#
# Sends reload package to all daemons specified in hlstats.Options.Proxy_Daemons
#
sub reloadDaemon
{
my ($daemon, $proxy_key) = @_;
my $fake_ip = "127.0.0.1";
my $fake_port = "30000";
my $msg = '';
$packet = "C;RELOAD;";
foreach my $key (keys(%$daemon)) {
if ($$daemon{$key}{'curstate'} eq "up") {
&printEvent("CONTROL", "Sending RELOAD packet to $$daemon{$key}{'ip'}:$$daemon{$key}{'port'}", 1);
$msg = $msg . &theTime() . "Sending RELOAD packet to $daemon{$key}{'ip'}:$daemon{$key}{'port'}\n";
# Sedning actual message to the daemon.
my $cmd = IO::Socket::INET->new( Proto=>"udp",
PeerHost=>$$daemon{$key}{'ip'},
PeerPort=>$$daemon{$key}{'port'}
);
$cmd->send("PROXY Key=$proxy_key PROXY $packet");
}
}
return $msg;
}
#
# string getProxyKey ()
#
# Get the value for Proxy_Key
#
sub getProxyKey
{
my $query = "SELECT `value` FROM hlstats_Options WHERE `keyname` = 'Proxy_Key'";
my $result = &doQuery($query);
my ($proxy_key) = $result->fetchrow_array;
$result->finish;
return $proxy_key;
}
sub is_number ($) { ( $_[0] ^ $_[0] ) eq '0' }
############## Main program ##############
$g_stdin = 0;
# Connect yo mysql DB to get required settings
&doConnect();
my $proxy_key = &getProxyKey();
# Get the daemons you will use
$query = "SELECT `value` FROM hlstats_Options WHERE `keyname` = 'Proxy_Daemons'";
$result = &doQuery($query);
my ($daemonlist) = $result->fetchrow_array;
$result->finish;
my @proxy_daemons = split(/,/, $daemonlist);
my $total_daemons = scalar(@proxy_daemons);
my %daemon = ();
my $i = 1;
while ($i <= $total_daemons) {
($daemon{$i}{'ip'}, $daemon{$i}{'port'}) = split(/:/, $proxy_daemons[$i-1]);
$daemon{$i}{'oldstate'} = "";
$daemon{$i}{'curstate'} = "";
$i++;
}
# Setting up the proxy port to listen on.
my $server = IO::Socket::INET->new( LocalPort=>$proxy_port,
Proto=>"udp"
) or die "Can't create UDP server: $@";
# It went ok, lets start recive messages...
&printEvent("DAEMON", "HlstatsX Proxy Daemon up and running on port: $proxy_port, key: $proxy_key", 1);
# Do initial heartbeat check.
&checkHeartbeat(\%daemon, $proxy_key);
# Reload all child daemons config
&reloadDaemon(\%daemon, $proxy_key);
while ($server->recv($datagram,1024,$flags)) {
my $control = 0;
# Checks the subdaemons every 30 sec if they are alive.
# the interval can be changed by modify $heartbeat value in beginning of script.
if (time > $oldtime) {
&checkHeartbeat(\%daemon, $proxy_key);
$oldtime = (time + $heartbeat);
}
my $ipaddr = $server->peerhost;
my $ipport = $server->peerport;
if ($ipaddr eq "127.0.0.1" && $datagram =~/C;HEARTBEAT;/) {
$control = 1;
$msg = '';
$msg = "Heartbeat OK";
&printEvent("CONTROL", "Sending Heartbeat to $ipaddr:$ipport", 1);
} elsif ($ipaddr eq "127.0.0.1" && $datagram =~/C;SERVERLIST;/) {
$control = 1;
$msg = '';
$msg = returnServerList($srv_list);
$msg = "ServerList\n$msg";
&printEvent("CONTROL", "Sending Serverlist to $ipaddr:$ipport", 1);
} elsif ($ipaddr eq "127.0.0.1" && $datagram =~/C;RELOAD;/) {
$control = 1;
$msg = '';
$msg = &reloadDaemon($daemon);
}
if ($ipaddr eq "127.0.0.1" && $control == 1) {
# Sending actual message to the daemon.
my $dest = sockaddr_in($ipport, inet_aton($ipaddr));
my $bytes = send($server, $msg, 0, $dest);
next;
}
if ($datagram =~ /PROXY Key=(.+) (.*)PROXY (.+)/) {
if ($proxy_key eq $1) {
if ($3 =~ /C;HEARTBEAT;/) {
$msg = '';
$msg = "Heartbeat OK";
&printEvent("CONTROL", "Sending Heartbeat to $ipaddr:$ipport", 1);
} elsif ($3 =~ /C;SERVERLIST;/) {
$msg = '';
$msg = returnServerList($srv_list);
$msg = "ServerList\n$msg";
&printEvent("CONTROL", "Sending Serverlist to $ipaddr:$ipport", 1);
&printEvent("CONTROL", $msg, 1);
} elsif ($3 =~ /C;RELOAD;/) {
$msg = '';
$msg = &reloadDaemon($daemon);
}
} else {
$msg = "FAILED PROXY REQUEST ($ipaddr:$ipport)\n";
&printEvent("E403", "Sending FAILED PROXY REQUEST to $ipaddr:$ipport", 1);
}
# Sedning actual message to the daemon.
my $dest = sockaddr_in($ipport, inet_aton($ipaddr));
my $bytes = send($server, $msg, 0, $dest);
next;
}
if (defined($srv_list{$ipaddr}{$ipport})) {
# Check the oldstate, curstate of your logging daemon
foreach my $key (keys %daemon) {
if ($srv_list{$ipaddr}{$ipport}{'dest_ip'} eq $daemon{$key}{'ip'} && $srv_list{$ipaddr}{$ipport}{'dest_port'} eq $daemon{$key}{'port'}) {;
if ($daemon{$key}{'curstate'} eq "up" && $daemon{$key}{'oldstate'} eq "down") {
# Recovering, should do a reload of some kind here.
%srv_list = ();
} elsif ($daemon{$key}{'curstate'} eq "down" && $daemon{$key}{'oldstate'} eq "up") {
# Daemon died, assing a new daemon to server
delete $srv_list{$ipaddr}{$ipport};
($daemon, $srv_list) = &assignDaemon($ipaddr, $ipport, $daemon, $srv_list);
&printEvent("BALANCE", "down - up: Re-Assing daemon $srv_list{$ipaddr}{$ipport}{'dest_ip'}:$srv_list{$ipaddr}{$ipport}{'dest_port'} to $ipaddr:$ipport", 1);
} elsif ($daemon{$key}{'curstate'} eq "down" && $daemon{$key}{'oldstate'} eq "down") {
# DOWN, should already reassinged the daemon.
delete $srv_list{$ipaddr}{$ipport};
($daemon, $srv_list) = &assignDaemon($ipaddr, $ipport, $daemon, $srv_list);
&printEvent("BALANCE", "down-down: Re-Assing daemon $srv_list{$ipaddr}{$ipport}{'dest_ip'}:$srv_list{$ipaddr}{$ipport}{'dest_port'} to $ipaddr:$ipport", 1);
} elsif ($daemon{$key}{'curstate'} eq "down" && $daemon{$key}{'oldstate'} eq "n/a") {
# Daemon down when we started proxy, assing another daemon.
delete $srv_list{$ipaddr}{$ipport};
($daemon, $srv_list) = &assignDaemon($ipaddr, $ipport, $daemon, $srv_list);
&printEvent("BALANCE", "down - na: Assing daemon $srv_list{$ipaddr}{$ipport}{'dest_ip'}:$srv_list{$ipaddr}{$ipport}{'dest_port'} to $ipaddr:$ipport from down/na", 1);
}
}
}
} else {
# Assign a logging daemon for your server:port
delete $srv_list{$ipaddr}{$ipport};
&assignDaemon($ipaddr, $ipport, \%daemon, \%srv_list);
&printEvent("BALANCE", "Assing daemon $srv_list{$ipaddr}{$ipport}{'dest_ip'}:$srv_list{$ipaddr}{$ipport}{'dest_port'} to $ipaddr:$ipport", 1);
}
if ($datagram =~ /.*rcon from.*: command "status".*/ || $datagram =~ /.*rcon from.*: command "stats".*/ || $datagram =~ /.*rcon from.*: command "".*/) {
# skip messages that looks like this, to ease the load on the sub daemons alittle
&printEvent("NOTICE", "Skipping message...", 1) if ($g_debug > 1);
} else {
if (defined($srv_list{$ipaddr}{$ipport}{'dest_ip'}) && defined($srv_list{$ipaddr}{$ipport}{'dest_port'})) {
$datagram =~ s/^.*RL /RL /g;
&printEvent("NOTICE", "Sending $datagram to daemon $srv_list{$ipaddr}{$ipport}{'dest_ip'}:$srv_list{$ipaddr}{$ipport}{'dest_port'}", 1) if ($g_debug > 1);
# Sedning actual message to the daemon.
my $forward = IO::Socket::INET->new( Proto=>"udp",
PeerHost=>$srv_list{$ipaddr}{$ipport}{'dest_ip'},
PeerPort=>$srv_list{$ipaddr}{$ipport}{'dest_port'}
);
$forward->send("PROXY Key=$proxy_key $ipaddr:".$ipport."PROXY $datagram");
}
}
}

791
scripts/run_hlstats Normal file
View File

@ -0,0 +1,791 @@
#!/bin/bash
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxce.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
#------------------------------------------------------------------------------
# Usage
# Information on how to use this script can be found on our wiki:
# http://wiki.hlxce.com
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Script Configuration
# These parameters allow you to adjust various functions of the daemon.
# In general, they should not need to be modified.
# Please visit our wiki for more information: http://wiki.hlxce.com
#------------------------------------------------------------------------------
# SCRIPTPATH:
# File system path to daemon and supporting files
# NOTE: This is only needed if the other scripts files will be in another directory.
# In general, NO TOUCHY! :)
SCRIPTPATH=.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# CONFFILE:
# Specifies the configuration file (relative to SCRIPTPATH) to use for the daemon
CONFFILE=hlstats.conf
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# DAEMON:
# Specifies the daemon Perl script to be used
DAEMON=hlstats.pl
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# LOGDIR:
# Specifies the location to store logs
LOGDIR=${SCRIPTPATH}/logs
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# LOGDATE:
# Specifies the date format to use in log file names
LOGDATE_FORMAT=%Y-%m-%d_%H-%M-%S
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# PIDDIR:
# Specifies location to store daemon PID files
PIDDIR=${SCRIPTPATH}
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Nothing to modify below here
WEBSITE=http://www.hlxce.com
WIKI=http://wiki.hlxce.com
# Start output
echo
echo "HLstatsX:CE daemon control"
echo "${WEBSITE}"
echo "---------------------------"
# Change to directory of script
cd `dirname ${0}`
# Perform some initial checks before we encounter later errors
# Check if we can write to the SCRIPTPATH
if [ ! -w ${SCRIPTPATH} ]; then
echo "CRITICAL ERROR: Could not write to SCRIPTPATH: ${SCRIPTPATH}"
echo "Verify you have write access to this directory."
echo "Visit our wiki for more information: ${WIKI}."
exit 1
fi
# Check if the daemon perl script exists
if [ ! -f ${SCRIPTPATH}/${DAEMON} ]; then
echo "CRITICAL ERROR: Cannot access the daemon: ${DAEMON}"
echo "Verify that the daemon, and corresponding files, exist in ${SCRIPTPATH}"
echo "Visit our wiki for more information: ${WIKI}."
exit 1
fi
# Verify shebang line in daemon
SHEBANG=`head -n1 ${SCRIPTPATH}/${DAEMON}`
if [[ ${SHEBANG} =~ ^#! ]]; then
SHEBANG_BINARY=`echo "${SHEBANG}" | sed 's/^#!//'`
if [ ! -f ${SHEBANG_BINARY} ]; then
echo "CRITICAL ERROR: The path to Perl is incorrect in ${DAEMON}."
echo "Current Perl path in shebang: ${SHEBANG_BINARY}"
echo "Visit our wiki for more information: ${WIKI}."
echo
echo "Potential paths for Perl: "
echo `which perl`
exit 1
fi
else
echo "CRITICAL ERROR: The shebang line is incorrectly configured. Please verify that your shebang line is correct in ${DAEMON}."
echo "Current shebang line: ${SHEBANG}"
echo "Visit our wiki for more information: ${WIKI}."
exit 1
fi
# Create logdir if needed
if [ ! -d ${LOGDIR} ]; then
mkdir ${LOGDIR}
fi
# Make sure we can write to logdir
if [ ! -w ${LOGDIR} ]; then
echo "CRITICAL ERROR: Could not write to the log folder: ${LOGDIR}"
echo "Verify that you have write access to the log folder."
echo "Visit our wiki for more information: ${WIKI}."
exit 1
fi
# Daemon control functions
function start_daemon {
# This function handles the creation of a new daemon process.
# This function requires one parameter: PORT
# Returns:
# 0 - Daemon started
# 1 - Daemon failed to start
# 2 - Daemon already running
if [ ! $1 ]; then
echo "CRITICAL ERROR: No port was received on function start_daemon"
exit 1
else
local PORT=$1
fi
local LOG=${LOGDIR}/hlstats_${PORT}_`date +${LOGDATE_FORMAT}`
local PID=`get_pid ${PORT}`
# Check if a PID exists for this port number
if [ "${PID}" != "" ]; then
# PID exists -- check if the daemon is running.
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
# Daemon running -- nothing to do.
return 2
else
# Daemon not running -- remove pid.
remove_pidfile ${PORT}
fi
fi
# Start the daemon on requested port
echo -ne "Attempting to start HLstatsX:CE daemon on port ${PORT}..."
${SCRIPTPATH}/${DAEMON} --configfile=${CONFFILE} --port=${PORT} &> ${LOG} &
# Store PID in memory until we verify Daemon has launched
PID=$!
# Perform one quick check to see if PID is running
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
create_pidfile ${PORT} ${PID}
echo ""
return 0
else
# PID not detected in time, keep checking for 10 more seconds.
local i=1
while [ $i -le 10 ]
do
echo -ne " ${i}"
sleep 1
# Perform a kill check against saved PID
kill -0 ${PID} &> /dev/null
# Check results of pid test
if [ $? -eq 1 ]; then
# Process does not exist
let i++
if [ $i -eq 10 ]; then
# Daemon did not respond to start request within 10 seconds.
return 1
fi
else
# Daemon started successfully -- commit PID to file
create_pidfile ${PORT} ${PID}
echo ""
return 0
fi
done
fi
}
function stop_daemon {
# This function handles shutting a daemon down.
# This function requires one parameter: PORT.
# Returns:
# 0 - Daemon gracefully stopped
# 1 - Daemon forcefully stopped
# 2 - Daemon could not be stopped
# 3 - No daemon to stop or PID missing
if [ ! $1 ]; then
echo "CRITICAL ERROR: No port was received on function stop_daemon"
exit 1
else
local PORT=$1
fi
local PID=`get_pid ${PORT}`
if [ ${PID} -eq 0 ]; then
return 3
fi
# Attempt to stop the daemon
echo -n "Attempting graceful shutdown of HLstatsX:CE daemon on port ${PORT} "
kill -INT ${PID} &> /dev/null
if [ $? -ne 0 ]; then
# Daemon is not running, purge the PID.
remove_pidfile ${PORT}
echo ""
return 3
else
# Found running PID -- perform a quick check before entering loop
kill -0 ${PID} &> /dev/null
if [ $? -eq 1 ]; then
# Daemon stopped, remove PID
remove_pidfile ${PORT}
echo ""
return 0
else
local i=1
while [ $i -le 10 ]
do
echo -n " ${i}"
sleep 1
# Perform a kill check against saved PID
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
# Daemon still operating
let i++
else
# Daemon stopped, remove PID
remove_pidfile ${PORT}
echo ""
return 0
fi
done
fi
# Daemon did not respond to shutdown, attempt a forced kill
echo ""
echo "WARNING: Daemon did not respond to a graceful shut down. Forcing a shut down on port ${PORT} "
local i=1
while [ $i -le 5 ]
do
kill -KILL ${PID} &> /dev/null
echo -n " ${i}"
sleep 1
# Check if PID is still present
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
# Daemon still operating
let i++
else
# Daemon stopped successfully.
remove_pidfile ${PORT}
echo ""
return 1
fi
done
return 2
fi
}
function reload_daemon {
# This function handles reloading a daemon down.
# This function requires one parameter: PORT.
# Returns:
# 0 - Reload sent successfully
# 1 - Daemon not running or pid file missing
# Sanity check on incoming required parameter
if [ ! $1 ]; then
echo "CRITICAL ERROR: No port was received on function reload_daemon"
exit 1
else
local PORT=$1
fi
local PID=`get_pid ${PORT}`
# Check to verify the daemon is operational
if [ ${PID} -ne 0 ]; then
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
kill -HUP ${PID} &> /dev/null
return 0
else
return 1
fi
else
return 1
fi
}
function check_port {
# This function verifies user input on the port number
# One argument is required
# Returns:
# 0 - Valid input
# 1 - Invalid Input (non-digit or not in UDP port range)
if [ $1 ]; then
# Perform regex test on input
echo ${1} | grep -q '^[0-9]\{1,5\}$'
# Check if within range and if grep test was successful.
if [ $? -eq 0 ] && [ $1 -le 65535 ] && [ $1 -ge 1 ]; then
return 0
else
return 1
fi
fi
}
function get_status {
# This function performs a lookup for the PID on specified port and checks status
# Parameters:
# 1 - port
# Returns:
# 0 - PID is running
# 1 - PID is not running
# 2 - Invalid PID
if [ $1 ]; then
local PID=`get_pid ${1}`
if [ "${PID}" != "" ]; then
kill -0 ${PID} &> /dev/null
if [ $? -eq 0 ]; then
return 0
else
return 1
fi
else
return 2
fi
fi
}
function create_pidfile {
# This function will handle the creation of a PID file for a corresponding port
# Parameters required:
# 1 - port number
# 2 - PID
# Returns:
# 0 - PID saved
# 1 - Unable to save PID
if [[ $1 && $2 ]]; then
PIDFILE=${PIDDIR}/hlstats_${1}.pid
echo ${2} > ${PIDFILE}
if [ "`cat ${PIDFILE}`" -eq "${2}" ]; then
return 0
else
return 1
fi
fi
}
function remove_pidfile {
# This function will handle the deletion of a PID file for a corresponding port
# Parameters required:
# 1 - port number
# Returns:
# 0 - PID removed
# 1 - PID does not exist
if [ $1 ]; then
PIDFILE=${PIDDIR}/hlstats_${1}.pid
rm -f ${PIDFILE} &> /dev/null
if [ $? -eq 0 ]; then
return 0
else
return 1
fi
fi
}
function get_pid {
# This function will echo out the found pid and return 0, or return 1 if it finds nothing
# Parameters required:
# 1 - port number
# Output
# Requested PID on return 0
# Returns:
# 0 - PID number for corresponding process
# 1 - No PID file for specified port
if [ $1 ]; then
PIDFILE=${PIDDIR}/hlstats_${1}.pid
PID=`cat ${PIDFILE} 2> /dev/null`
if [ $? -eq 0 ]; then
echo ${PID}
return 0
else
return 1
fi
fi
}
# Cleanup old legacy run_hlstats stuff
# Check if hlstats.pid exists (original pid from legacy run_hlstats)
if [ -f ${PIDDIR}/hlstats.pid ]; then
echo "WARNING: A old PID file has been detected. To prevent further troubles this daemon will be shut down."
kill -KILL `cat ${PIDDIR}/hlstats.pid` &> /dev/null
sleep 1
# Check if PID is dead
i=1
while [ $i -le 5 ]
do
kill -0 `cat ${PIDDIR}/hlstats.pid` &> /dev/null
if [ $? -eq 0 ]; then
# Daemon still operating
let i++
sleep 1
else
# Daemon stopped successfully.
rm -f ${PIDDIR}/hlstats.pid
echo ""
echo "HLstatsX:CE daemon has been forcefully stopped."
echo "Please re-run this script to control your daemon."
exit
fi
done
fi
# Daemon control case switcher
case "$1" in
start)
# Usage: run_hlstats start <# of daemons> <first port number> <port increment number>
# All arguments are optional
# Defaults: # of Daemons = 1; First port number = 27500; Port increment number = 1
NUMDAEMONS=1
STARTPORT=27500
INCREMENT=1
# Get user-specified number of daemons
if [ $2 ]; then
NUMDAEMONS=$2
fi
if [ $3 ]; then
check_port $3
if [ $? -eq 0 ]; then
STARTPORT=$3
else
echo "CRITICAL ERROR: An invalid port number was specified."
exit 1
fi
fi
if [ $4 ]; then
INCREMENT=$4
fi
# Saving this for a future release -- right now this would prevent people from running run_hlstats every few minutes to make sure their daemon is operational.
#else
# # Lookup the highest currently used port number
# LASTPORT=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}' | tail -1`
# if [ "${LASTPORT}" != "" ]; then
# # We have currently running daemons, to take the current highest port number and increment it
# let STARTPORT=LASTPORT+INCREMENT
# fi
#
#fi
i=0
CURRENTPORT=${STARTPORT}
while [ ${i} -lt ${NUMDAEMONS} ]
do
start_daemon ${CURRENTPORT}
case $? in
0)
echo "Daemon successfully started on port ${CURRENTPORT}"
let CURRENTPORT=CURRENTPORT+INCREMENT
let i++
;;
1)
echo "CRITICAL ERROR: Unable to start daemon on port ${CURRENTPORT}"
exit 1
;;
2)
echo "Daemon is already running on port ${CURRENTPORT}"
let CURRENTPORT=CURRENTPORT+INCREMENT
let i++
;;
esac
done
;;
stop)
# Usage: run_hlstats stop <port>
# All arguments are optional
# Defaults: port = ALL
if [ $2 ]; then
check_port $2
if [ $? -eq 0 ]; then
PORT=$2
else
echo "CRITICAL ERROR: An invalid port number was specified."
exit 1
fi
else
PORT=0
fi
# Stop a single daemon
if [ ${PORT} -ne 0 ]; then
stop_daemon ${PORT}
case $? in
0)
echo "Daemon gracefully stopped on port ${PORT}"
exit 0
;;
1)
echo "Daemon forcefully stopped on port ${PORT}"
exit 0
;;
2)
echo "WARNING: Daemon could not be stopped on port ${PORT}"
exit 1
;;
3)
echo "No daemon running on port ${PORT} or PID file is missing."
exit 1
;;
esac
fi
# Stop all daemons
PORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`
if [ $? -eq 0 ]; then
for port in ${PORTS} ; do
stop_daemon ${port}
case $? in
0)
echo "Daemon gracefully stopped on port ${port}"
;;
1)
echo "Daemon forcefully stopped on port ${port}"
;;
2)
echo "WARNING: Daemon could not be stopped on port ${port}"
;;
3)
echo "No daemon running on port ${port} or PID file is missing."
;;
esac
done
else
echo "No daemons found running, or PID files are missing."
exit 1
fi
;;
restart)
# Usage: run_hlstats restart <port>
# All arguments are optional
# Defaults: port = ALL
if [ $2 ]; then
check_port $2
if [ $? -eq 0 ]; then
PORT=$2
else
echo "CRITICAL ERROR: An invalid port number was specified."
exit 1
fi
else
PORT=0
fi
# Handle individual restart request
if [ ${PORT} -ne 0 ]; then
stop_daemon ${PORT}
case $? in
0 | 1 | 3)
start_daemon ${PORT}
if [ $? -eq 0 ]; then
echo "Daemon successfully restarted on port ${PORT}"
exit 0
else
echo "CRITICAL ERROR: Failed to restart daemon on port ${PORT}"
exit 1
fi
;;
2)
echo "WARNING: Daemon could not be stopped on port ${port}"
exit 1
;;
esac
fi
# Restart all PIDs
PORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`
if [ $? -eq 0 ]; then
for port in ${PORTS} ; do
stop_daemon ${port}
case $? in
0 | 1 | 3)
start_daemon ${port}
if [ $? -eq 0 ]; then
echo "Daemon successfully restarted on port ${port}"
else
echo "WARNING: Failed to restart daemon on port ${port}"
fi
;;
2)
echo "WARNING: Daemon could not be stopped on port ${port}"
exit 1
;;
esac
done
else
echo "WARNING: No HLstatsX:CE daemons currently running."
exit 1
fi
;;
reload)
# Usage: run_hlstats reload <port>
# All arguments are optional
# Defaults: port = ALL
if [ $2 ]; then
check_port $2
if [ $? -eq 0 ]; then
PORT=$2
else
echo "CRITICAL ERROR: An invalid port number was specified."
exit 1
fi
else
PORT=0
fi
# Handle individual reload request
if [ ${PORT} -ne 0 ]; then
reload_daemon ${PORT}
if [ $? -eq 0 ]; then
echo "Successfully reloaded daemon running on port ${PORT}"
exit 0
else
echo "WARNING: Unable to reload daemon on port ${PORT} (daemon might not be running)"
exit 1
fi
fi
# Reload all PIDs
PORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`
if [ "${PORTS}" != "" ]; then
for port in ${PORTS} ; do
reload_daemon ${port}
if [ $? -eq 0 ]; then
echo "Successfully reloaded daemon running on port ${port}"
else
echo "WARNING: Unable to reload daemon on port ${port} (daemon might not be running)"
fi
done
else
echo "WARNING: No HLstatsX:CE daemons currently running."
exit 1
fi
;;
status)
# Usage: run_hlstats status <port>
# All arguments are optional
# Defaults: port = ALL
if [ $2 ]; then
check_port $2
if [ $? -eq 0 ]; then
PORT=$2
else
echo "CRITICAL ERROR: An invalid port number was specified."
exit 1
fi
else
PORT=0
fi
# Handle individual status request
if [ ${PORT} -ne 0 ]; then
get_status ${PORT}
case $? in
0)
echo "Daemon on port ${PORT} is currently running."
exit 0
;;
1)
echo "A stale process was found for daemon on port ${PORT}."
exit 0
;;
2)
echo "There is no daemon running on port ${PORT}."
exit 0
;;
esac
fi
# Reload all PIDs
PORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`
if [ "${PORTS}" != "" ]; then
for port in ${PORTS} ; do
get_status ${port}
case $? in
0)
echo "Daemon on port ${port} is currently running."
;;
1)
echo "A stale process was found for daemon on port ${port}. It has been removed."
;;
2)
echo "There is no daemon running on port ${port}."
;;
esac
done
else
echo "WARNING: No HLstatsX:CE daemons currently running."
exit 1
fi
;;
*)
echo "Usage"
echo "All optional arguments are in <>. The default is in ()."
echo ""
echo -e "\trun_hlstats start <number of daemons (1)> <starting port number (27500)> <port increment (1)>"
echo -e "\trun_hlstats stop <port # of daemon to stop (ALL)>"
echo -e "\trun_hlstats status <port # of daemon to check status of (ALL)>"
echo -e "\trun_hlstats restart <port # of daemon to restart (ALL)>"
echo -e "\trun_hlstats reload <port # of daemon to reload (ALL)>"
;;
esac
exit

50
scripts/run_hlstats_multi Normal file
View File

@ -0,0 +1,50 @@
#!/bin/bash
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# If you wish to run this script as a daemon script (in /etc/init.d, etc.)
# you must configure the "confdir" variable below.
# The other variables are optional and really should not be modified.
echo "
WARNING: run_hlstats_multi is deprecated as of 1.6.11.
If you need to start multiple daemons you should now use run_hlstats with the correct parameters.
For information run_hlstats, run:
./run_hlstats help
or visit http://wiki.hlxce.com/wiki/Controlling_the_HLXCE_daemon"
exit 0

151
scripts/run_proxy Normal file
View File

@ -0,0 +1,151 @@
#!/bin/bash
# HLstatsX Community Edition - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
# http://www.hlxcommunity.com
#
# HLstatsX Community Edition is a continuation of
# ELstatsNEO - Real-time player and clan rankings and statistics
# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
# http://ovrsized.neo-soft.org/
#
# ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
# http://www.hlstatsx.com/
# Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
#
# HLstatsX is an enhanced version of HLstats made by Simon Garner
# HLstats - Real-time player and clan rankings and statistics for Half-Life
# http://sourceforge.net/projects/hlstats/
# Copyright (C) 2001 Simon Garner
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# For support and installation notes visit http://www.hlxcommunity.com
# If you wish to run this script as a daemon script (in /etc/init.d, etc.)
# you must configure the "confdir" variable below.
# The other variables are optional and really should not be modified.
# Set the path to the scripts folder (you should not need to modify this.)
confdir=.
# Set the configuration file for the daemon (you should not need to modify this.)
conffile=hlstats.conf
# Set the filename of the daemon to use (you should not need to modify this.)
daemonfile=proxy-daemon.pl
# Set where you want to log to. This is a directory inside of the confdir setting.
# (You should not need to modify this.)
logdir=logs
# Set the format of the log file
logfile=proxy`date +_%Y%m%d_%H-%M-%S`
# Set where to store PID files
piddir=${confdir}
# verify that we can see the daemon file
if [ ! -f ${confdir}/${daemonfile} ]; then
echo "Can't see the daemon. (${daemonfile})"
exit 1
fi
# verify that you have write access to the directories
if [ ! -w ${confdir} ]; then
echo "you need write access to ${confdir}"
exit 1
fi
# verify that you have a logs directory
if [ ! -d ${confdir}/${logdir} ];then
mkdir ${confdir}/${logdir}
fi
if [ ! -w ${confdir}/${logdir} ];then
echo "you need write access to ${confdir}/${logdir}"
exit 1
fi
# Grab out original directory so we can return after
origdir=`pwd`
# Move into configured directory
cd ${confdir}
case "$1" in
start)
# verify that we have a .conf file
if [ ! -f ${conffile} ]; then
echo "You're missing your configuration file. (${conffile})"
exit 1
fi
echo "Starting HLstatsX:CE...";
if [ -f ${piddir}/proxy-daemon.pid ]; then
kill -0 `cat ${piddir}/proxy-daemon.pid` >/dev/null 2>&1
if [ "$?" == "0" ]; then
echo "HLstatsX:CE already running!"
else
rm -rf ${piddir}/proxy-daemon.pid
./${daemonfile} --configfile=${conffile} > ${logdir}/${logfile} 2>&1 &
echo $! >${piddir}/proxy-daemon.pid
echo "PID file created"
echo "Started successfully"
fi
else
./${daemonfile} --configfile=${conffile} > ${logdir}/${logfile} 2>&1 &
echo $! >${piddir}/proxy-daemon.pid
echo "PID file created"
echo "Started successfully"
fi
;;
stop)
echo "Stopping HLstatsX:CE..."
kill -9 `cat ${piddir}/proxy-daemon.pid` >/dev/null 2>&1
if [ "$?" == "0" ]; then
rm -rf ${piddir}/proxy-daemon.pid
echo "Stopped successfully"
else
echo "No HLstatsX:CE running!"
fi
;;
restart)
echo "Restarting HLstatsX:CE..."
kill -9 `cat ${piddir}/proxy-daemon.pid` >/dev/null 2>&1
if [ "$?" == "0" ]; then
rm -rf ${piddir}/proxy-daemon.pid
./${daemonfile} --configfile=${conffile} > ${logdir}/${logfile} 2>&1 &
echo $! >${piddir}/proxy-daemon.pid
echo "PID file created"
echo "Restarted successfully"
else
echo "HLstatsX:CE"
if [ -f ${piddir}/proxy-daemon.pid ]; then
rm -rf ${piddir}/proxy-daemon.pid
fi
./${daemonfile} --configfile=${conffile} > ${logdir}/${logfile} 2>&1 &
echo $! >${piddir}/proxy-daemon.pid
echo "PID file created"
echo "Started successfully"
fi
;;
*)
echo "Usage: ./run_hlstats [ start | stop | restart ]"
;;
esac
# Return to original directory
cd ${origdir}
exit 0

Binary file not shown.

View File

@ -0,0 +1 @@
As of HLX:CE 1.6.0, the hlstatsx.sp does not add any extra log information. To get auxilary logging for more actions supported by HLX:CE, please run the SuperLogs plugin for your game (in extras/SuperLogs or on the AlliedModders site). If a SuperLogs plugin is not available for your game, it is likely that the "SuperLogs: Generic" plugin will still be of use to add some extra information.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,198 @@
#define LOGHELPER_VERSION 3
#include <sourcemod>
#include <sdktools>
new String:g_team_list[16][64];
// Call this on map start to cache team names in g_team_list
stock GetTeams(bool:insmod = false)
{
if (!insmod)
{
new max_teams_count = GetTeamCount();
for (new team_index = 0; (team_index < max_teams_count); team_index++)
{
decl String: team_name[64];
GetTeamName(team_index, team_name, sizeof(team_name));
if (strcmp(team_name, "") != 0)
{
g_team_list[team_index] = team_name;
}
}
}
else
{
// they really need to get their act together... GetTeamName() would be awesome since they can't even keep their team indexes consistent
decl String:mapname[64];
GetCurrentMap(mapname, sizeof(mapname));
if (strcmp(mapname, "ins_karam") == 0 || strcmp(mapname, "ins_baghdad") == 0)
{
g_team_list[1] = "Iraqi Insurgents";
g_team_list[2] = "U.S. Marines";
}
else
{
g_team_list[1] = "U.S. Marines";
g_team_list[2] = "Iraqi Insurgents";
}
g_team_list[0] = "Unassigned";
g_team_list[3] = "SPECTATOR";
}
}
stock LogPlayerEvent(client, const String:verb[], const String:event[], bool:display_location = false, const String:properties[] = "")
{
if (IsValidPlayer(client))
{
decl String:player_authid[32];
if (!GetClientAuthString(client, player_authid, sizeof(player_authid)))
{
strcopy(player_authid, sizeof(player_authid), "UNKNOWN");
}
if (display_location)
{
decl Float:player_origin[3];
GetClientAbsOrigin(client, player_origin);
LogToGame("\"%N<%d><%s><%s>\" %s \"%s\"%s (position \"%d %d %d\")", client, GetClientUserId(client), player_authid, g_team_list[GetClientTeam(client)], verb, event, properties, RoundFloat(player_origin[0]), RoundFloat(player_origin[1]), RoundFloat(player_origin[2]));
}
else
{
LogToGame("\"%N<%d><%s><%s>\" %s \"%s\"%s", client, GetClientUserId(client), player_authid, g_team_list[GetClientTeam(client)], verb, event, properties);
}
}
}
stock LogPlyrPlyrEvent(client, victim, const String:verb[], const String:event[], bool:display_location = false, const String:properties[] = "")
{
if (IsValidPlayer(client) && IsValidPlayer(victim))
{
decl String:player_authid[32];
if (!GetClientAuthString(client, player_authid, sizeof(player_authid)))
{
strcopy(player_authid, sizeof(player_authid), "UNKNOWN");
}
decl String:victim_authid[32];
if (!GetClientAuthString(victim, victim_authid, sizeof(victim_authid)))
{
strcopy(victim_authid, sizeof(victim_authid), "UNKNOWN");
}
if (display_location)
{
decl Float:player_origin[3];
GetClientAbsOrigin(client, player_origin);
decl Float:victim_origin[3];
GetClientAbsOrigin(victim, victim_origin);
LogToGame("\"%N<%d><%s><%s>\" %s \"%s\" against \"%N<%d><%s><%s>\"%s (position \"%d %d %d\") (victim_position \"%d %d %d\")", client, GetClientUserId(client), player_authid, g_team_list[GetClientTeam(client)], verb, event, victim, GetClientUserId(victim), victim_authid, g_team_list[GetClientTeam(victim)], properties, RoundFloat(player_origin[0]), RoundFloat(player_origin[1]), RoundFloat(player_origin[2]), RoundFloat(victim_origin[0]), RoundFloat(victim_origin[1]), RoundFloat(victim_origin[2]));
}
else
{
LogToGame("\"%N<%d><%s><%s>\" %s \"%s\" against \"%N<%d><%s><%s>\"%s", client, GetClientUserId(client), player_authid, g_team_list[GetClientTeam(client)], verb, event, victim, GetClientUserId(victim), victim_authid, g_team_list[GetClientTeam(victim)], properties);
}
}
}
stock LogKill(attacker, victim, const String:weapon[], bool:display_location = false, const String:properties[] = "")
{
if (IsValidPlayer(attacker) && IsValidPlayer(victim))
{
decl String:attacker_authid[32];
if (!GetClientAuthString(attacker, attacker_authid, sizeof(attacker_authid)))
{
strcopy(attacker_authid, sizeof(attacker_authid), "UNKNOWN");
}
decl String:victim_authid[32];
if (!GetClientAuthString(victim, victim_authid, sizeof(victim_authid)))
{
strcopy(victim_authid, sizeof(victim_authid), "UNKNOWN");
}
if (display_location)
{
decl Float:attacker_origin[3];
GetClientAbsOrigin(attacker, attacker_origin);
decl Float:victim_origin[3];
GetClientAbsOrigin(victim, victim_origin);
LogToGame("\"%N<%d><%s><%s>\" killed \"%N<%d><%s><%s>\" with \"%s\"%s (attacker_position \"%d %d %d\") (victim_position \"%d %d %d\")", attacker, GetClientUserId(attacker), attacker_authid, g_team_list[GetClientTeam(attacker)], victim, GetClientUserId(victim), victim_authid, g_team_list[GetClientTeam(victim)], weapon, properties, RoundFloat(attacker_origin[0]), RoundFloat(attacker_origin[1]), RoundFloat(attacker_origin[2]), RoundFloat(victim_origin[0]), RoundFloat(victim_origin[1]), RoundFloat(victim_origin[2]));
}
else
{
LogToGame("\"%N<%d><%s><%s>\" killed \"%N<%d><%s><%s>\" with \"%s\"%s", attacker, GetClientUserId(attacker), attacker_authid, g_team_list[GetClientTeam(attacker)], victim, GetClientUserId(victim), victim_authid, g_team_list[GetClientTeam(victim)], weapon, properties);
}
}
}
// For Psychostats "KTRAJ" kill trajectory log lines
stock LogPSKillTraj(attacker, victim, const String:weapon[])
{
if (IsValidPlayer(attacker) && IsValidPlayer(victim))
{
decl String:attacker_authid[32];
if (!GetClientAuthString(attacker, attacker_authid, sizeof(attacker_authid)))
{
strcopy(attacker_authid, sizeof(attacker_authid), "UNKNOWN");
}
decl String:victim_authid[32];
if (!GetClientAuthString(victim, victim_authid, sizeof(victim_authid)))
{
strcopy(victim_authid, sizeof(victim_authid), "UNKNOWN");
}
decl Float:attacker_origin[3];
GetClientAbsOrigin(attacker, attacker_origin);
decl Float:victim_origin[3];
GetClientAbsOrigin(victim, victim_origin);
LogToGame("[KTRAJ] \"%N<%d><%s><%s>\" killed \"%N<%d><%s><%s>\" with \"%s\" (attacker_position \"%d %d %d\") (victim_position \"%d %d %d\")", attacker, GetClientUserId(attacker), attacker_authid, g_team_list[GetClientTeam(attacker)], victim, GetClientUserId(victim), victim_authid, g_team_list[GetClientTeam(victim)], weapon, RoundFloat(attacker_origin[0]), RoundFloat(attacker_origin[1]), RoundFloat(attacker_origin[2]), RoundFloat(victim_origin[0]), RoundFloat(victim_origin[1]), RoundFloat(victim_origin[2]));
}
}
// Verb should always be "triggered" for this.
stock LogTeamEvent(team, const String:verb[], const String:event[], const String:properties[] = "")
{
if (team > -1)
{
LogToGame("Team \"%s\" %s \"%s\"%s", g_team_list[team], verb, event, properties);
}
}
stock LogKillLoc(attacker, victim)
{
if (attacker > 0 && victim > 0)
{
decl Float:attacker_origin[3];
GetClientAbsOrigin(attacker, attacker_origin);
decl Float:victim_origin[3];
GetClientAbsOrigin(victim, victim_origin);
LogToGame("World triggered \"killlocation\" (attacker_position \"%d %d %d\") (victim_position \"%d %d %d\")", RoundFloat(attacker_origin[0]), RoundFloat(attacker_origin[1]), RoundFloat(attacker_origin[2]), RoundFloat(victim_origin[0]), RoundFloat(victim_origin[1]), RoundFloat(victim_origin[2]));
}
}
stock LogRoleChange(client, const String:role[], const String:properties[] = "")
{
LogPlayerEvent( client, "changed role to", role, false, properties );
}
stock LogMapLoad()
{
decl String:map[64];
GetCurrentMap(map, sizeof(map));
LogToGame("Loading map \"%s\"", map);
}
stock IsValidPlayer(client)
{
if (client > 0 && client <= MaxClients && IsClientInGame(client))
{
return true;
}
return false;
}

View File

@ -0,0 +1,76 @@
ALTER TABLE `hlstats_Actions`
DROP KEY `gamecode`,
ADD UNIQUE KEY `gamecode` (`code`,`game`,`object`,`event`,`team`);
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`, `count`, `object`, `event`) VALUES
('ff', 'headshot', 1, 0, '', 'Headshot kill', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', '', 0, NULL, NULL),
('hidden', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', '', 0, NULL, NULL);
UPDATE `hlstats_Actions` SET `for_PlayerActions`='0', `for_PlayerPlayerActions`='0', `for_TeamActions`='1', `for_WorldActions`='0' WHERE `game`='tf' AND `code` IN ('Round_Win','Mini_Round_Win');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`, `d_winner_id`, `d_winner_count`) VALUES
('W', 'hidden', 'fn2000', 'FN2000 Assault Rifle', 'kills with FN2000 Assault Rifle', NULL, NULL),
('W', 'hidden', 'p90', 'FN P90 Sub Machine Gun', 'kills with FN P90 Sub Machine Gun', NULL, NULL),
('W', 'hidden', 'shotgun', 'Remington 870 MCS Shotgun', 'kills with Remington 870 MCS Shotgun', NULL, NULL),
('W', 'hidden', 'fn303', 'FN303 Less Lethal Launcher', 'kills with FN303 Less Lethal Launcher', NULL, NULL),
('W', 'hidden', 'pistol', 'FN FiveSeven Pistol', 'kills with FN FiveSeven Pistol', NULL, NULL),
('W', 'hidden', 'pistol2', 'FNP-9 Pistol', 'kills with FNP-9 Pistol', NULL, NULL),
('W', 'hidden', 'knife', 'Kabar D2 Knife', 'kills with Kabar D2 Knife', NULL, NULL),
('W', 'hidden', 'grenade_projectile', 'Pipe Bomb', 'kills with Pipe Bomb', NULL, NULL),
('W', 'hidden', 'physics', 'Physics', 'kills with Physics', NULL, NULL);
INSERT IGNORE INTO `hlstats_Games` (`code`, `name`, `hidden`) VALUES
('hidden','The Hidden: Source','1');
INSERT IGNORE INTO `hlstats_Options` (`keyname`, `value`) VALUES
('gamehome_show_awards', '0');
INSERT IGNORE INTO `hlstats_Ranks` (`image`, `minKills`, `maxKills`, `rankName`, `game`) VALUES
('recruit',0,49,'Recruit','hidden'),
('private',50,99,'Private','hidden'),
('private_firstclass',100,149,'Private First Class','hidden'),
('second_lieutenant',150,249,'2nd Lieutenant','hidden'),
('first_lieutenant',250,499,'1st Lieutenant','hidden'),
('captain',500,749,'Captain','hidden'),
('major',750,999,'Major','hidden'),
('lieutenant_colonel',1000,1249,'Lieutenant Colonel','hidden'),
('colonel',1250,1749,'Colonel','hidden'),
('brigadier_general',1750,2499,'Brigardier General','hidden'),
('major_general',2500,4999,'Major General','hidden'),
('lieutenant_general',5000,7499,'Lieutenant General','hidden'),
('general',7500,9999,'General','hidden'),
('general_5Star',10000,14999,'5 Star General','hidden'),
('ubersoldat',15000,999999999,'The Ubersoldat','hidden');
INSERT IGNORE INTO `hlstats_Teams` (`game`, `code`, `name`, `hidden`, `playerlist_bgcolor`, `playerlist_color`, `playerlist_index`) VALUES
('hidden','Hidden','Subject 617', '0', '#F7FF89', '#808700', 1),
('hidden','IRIS','I.R.I.S.', '0', '#D2E8F7','#0080C0', 2),
('hidden','Spectator','Spectator','0', '#D5D5D5','#050505', 0);
UPDATE `hlstats_Teams` SET `code`='#FF_TEAM_UNASSIGNED' WHERE `code`='SPECTATOR' and `game`='ff';
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`, `kills`, `headshots`) VALUES
('ff', 'weapon_umbrella','Umbrella', 10.00, 0, 0),
('ff', 'grenade_gas','Gas Grenade', 1.00, 0, 0),
('ff', 'weapon_tommygun', 'Tommygun', 1.00, 0, 0),
('ff', 'weapon_nailgun', 'Nailgun', 1.00, 0, 0),
('hidden', 'fn2000','FN2000 Assault Rifle',1.50, 0, 0),
('hidden', 'p90','FN P90 Sub Machine Gun',2.00, 0, 0),
('hidden', 'shotgun','Remington 870 MCS Shotgun',2.00, 0, 0),
('hidden', 'fn303','FN303 Less Lethal Launcher',2.00, 0, 0),
('hidden', 'pistol','FN FiveSeven Pistol',3.00, 0, 0),
('hidden', 'pistol2','FNP-9 Pistol',3.00, 0, 0),
('hidden', 'knife','Kabar D2 Knife',2.50, 0, 0),
('hidden', 'grenade_projectile','Pipe Bomb',2.00, 0, 0),
('hidden', 'physics','Physics',3.00, 0, 0);

View File

@ -0,0 +1,3 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`, `count`, `object`, `event`) VALUES
('dods', 'domination', 7, 0, '', 'Domination', '1', '', '', '', 0, NULL, NULL),
('dods', 'revenge', 5, 0, '', 'Revenge', '1', '', '', '', 0, NULL, NULL);

View File

@ -0,0 +1,226 @@
DELETE FROM `hlstats_Actions` WHERE `game`='tf' and `code` in ('Round_Win','Mini_Round_Win') and `team`='red';
UPDATE `hlstats_Actions` SET `team`='' WHERE `game`='tf' and `code` in ('Round_Win','Mini_Round_Win') and `team`='blue';
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`, `count`, `object`, `event`) VALUES
('tf', 'Round_Win', 0, 10, '', 'Round Win', '', '', '1', '', 0, NULL, NULL),
('tf', 'Mini_Round_Win', 0, 5, '', 'Mini-Round Win', '', '', '1', '', 0, NULL, NULL),
('tf', 'sandvich', 0, 0, '', 'Ate a Sandvich', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', '', 0, NULL, NULL),
('zps', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', '', 0, NULL, NULL),
('aoc', 'headshot', 2, 0, '', 'Headshot/Decapitate Kill', '1', '', '', '', 0, NULL, NULL);
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`, `d_winner_id`, `d_winner_count`) VALUES
('O', 'tf', 'sandvich', 'Hungry Hungry Heavy', 'sandviches eaten.', NULL, NULL),
('W', 'zps', 'arms', 'Armed and Dangerous', 'kills with Zombie Arms', NULL, NULL),
('W', 'zps', 'carrierarms', 'Carry on...', 'kills with Carrier Arms', NULL, NULL),
('W', 'zps', 'ak47', 'AK-47', 'kills with AK-47', NULL, NULL),
('W', 'zps', 'mp5', 'MP5', 'kills with MP5', NULL, NULL),
('W', 'zps', 'revolver', 'Revolver', 'kills with Revolver', NULL, NULL),
('W', 'zps', 'glock', 'Glock 17', 'kills with Glock 17', NULL, NULL),
('W', 'zps', 'glock18c', 'Glock 18c', 'kills with Glock 18c', NULL, NULL),
('W', 'zps', 'ppk', 'PPK', 'kills with PPK', NULL, NULL),
('W', 'zps', 'usp', 'H & K USP', 'kills with H & K USP', NULL, NULL),
('W', 'zps', '870', 'Rem. 870', 'kills with Rem. 870', NULL, NULL),
('W', 'zps', 'supershorty', 'Super Shorty', 'kills with Super Shorty', NULL, NULL),
('W', 'zps', 'grenade_frag', 'Grenade', 'kills with Grenades', NULL, NULL),
('W', 'zps', 'sledgehammer', 'Sledgehammer', 'kills with Sledgehammer', NULL, NULL),
('W', 'zps', 'crowbar', 'Hello, I\'m Gordon Freeman', 'kills with Crowbar', NULL, NULL),
('W', 'zps', 'chair', 'Sorry, I thought this was \"pro\" wrestling', 'kills with Chair', NULL, NULL),
('W', 'zps', 'keyboard', 'Keyboard', 'kills with Keyboard', NULL, NULL),
('W', 'zps', 'plank', 'Plank', 'kills with Plank', NULL, NULL),
('W', 'zps', 'shovel', 'Grave Digger', 'kills with Shovel', NULL, NULL),
('W', 'zps', 'golf', 'Fore!', 'kills with Golf Club', NULL, NULL),
('W', 'zps', 'machete', 'Cuttin\' em Down', 'kills with Machete', NULL, NULL),
('W', 'zps', 'fryingpan', 'Frying Pan', 'kills with Frying Pan', NULL, NULL),
('W', 'zps', 'spanner', 'Wrench', 'kills with Wrench', NULL, NULL),
('W', 'zps', 'axe', 'Axe', 'kills with Axe', NULL, NULL),
('W', 'zps', 'tireiron', 'Tire Iron', 'kills with Tire Iron', NULL, NULL),
('W', 'zps', 'hammer', 'Hammer', 'kills with Hammer', NULL, NULL),
('W', 'zps', 'broom', 'Broom', 'kills with Broom', NULL, NULL),
('W', 'zps', 'pot', 'Pot', 'kills with Pot', NULL, NULL),
('W', 'zps', 'racket', 'Tennis Racket', 'kills with Tennis Racket', NULL, NULL),
('W', 'aoc', 'flamberge', 'Flamberge', 'kills with Flamberge', NULL, NULL),
('W', 'aoc', 'longsword', 'Longsword', 'kills with Longsword', NULL, NULL),
('W', 'aoc', 'halberd', 'Knights Halberd', 'kills with Knights Halbred', NULL, NULL),
('W', 'aoc', 'dagger', 'Daggers', 'kills with Dual Daggers', NULL, NULL),
('W', 'aoc', 'flamberge_kiteshield', 'Flamberge & Kite Shield', 'kills with Flamberge & Kite Shield', NULL, NULL),
('W', 'aoc', 'sword2', 'Shortsword', 'kills with Shortsword', NULL, NULL),
('W', 'aoc', 'warhammer', 'Warhammer', 'kills with Warhammer', NULL, NULL),
('W', 'aoc', 'mace', 'Mace', 'kills with Mace', NULL, NULL),
('W', 'aoc', 'mace_buckler', 'Mace & Buckler', 'kills with Mace & Buckler', NULL, NULL),
('W', 'aoc', 'sword01_evil_shield', 'Mason Broadsword & Shield', 'kills with Mason Broadsword & Shield', NULL, NULL),
('W', 'aoc', 'crossbow', 'Crossbow', 'kills with Crossbow', NULL, NULL),
('W', 'aoc', 'longbow', 'Longbow', 'kills with Longbow', NULL, NULL),
('W', 'aoc', 'longsword_kiteshield', 'Longsword & Kite Shield', 'kills with Longsword & Kite Shield', NULL, NULL),
('W', 'aoc', 'sword01_good_shield', 'Knights Broadsword & Shield', 'kills with Knights Broadsword & Shield', NULL, NULL),
('W', 'aoc', 'onehandaxe', 'Hatchet', 'kills with Hatchet', NULL, NULL),
('W', 'aoc', 'doubleaxe', 'Battle Axe', 'kills with Battle Axe', NULL, NULL),
('W', 'aoc', 'flail_evil_shield', 'Mason Flail & Shield', 'kills with Mason Flail & Shield', NULL, NULL),
('W', 'aoc', 'flail_good_shield', 'Knights Flail & Shield', 'kills with Knights Flail & Shield', NULL, NULL),
('W', 'aoc', 'thrown_spear', 'Javelin', 'kills with Javelin', NULL, NULL),
('W', 'aoc', 'shortsword', 'Spiked Mace', 'kills with Spiked Mace', NULL, NULL),
('W', 'aoc', 'spear_buckler', 'Knights Spear & Buckler', 'kills with Knights Spear & Buckler', NULL, NULL),
('W', 'aoc', 'spikedmace_buckler', 'Spiked Mace & Buckler', 'kills with Spiked Mace & Buckler', NULL, NULL),
('W', 'aoc', 'dagger2', 'Dagger', 'kills with Dagger', NULL, NULL),
('W', 'aoc', 'mtest', 'Footman Longsward', 'kills with Footman Longsword', NULL, NULL),
('W', 'aoc', 'thrown_dagger2', 'Thrown Dagger', 'kills with Thrown Dagger', NULL, NULL),
('W', 'aoc', 'spear_buckler2', 'Spiked Mace & Buckler', 'kills with Spiked Mace & Buckler', NULL, NULL),
('W', 'aoc', 'evil_halberd', 'Mason Halberd', 'kills with Mason Halberd', NULL, NULL),
('W', 'aoc', 'env_explosion', 'Fire', 'kills with Fire', NULL, NULL),
('W', 'aoc', 'oilpot', 'Oil Pot', 'kills with Oil Pot', NULL, NULL),
('O', 'aoc', 'headshot', 'Headshot/Decapitation', 'Headshots and Decapitations', NULL, NULL);
INSERT IGNORE INTO `hlstats_Games` (`code`, `name`, `hidden`) VALUES
('zps','Zombie Panic! Source','1'),
('aoc','Age of Chivalry','1');
DELETE FROM `hlstats_PerlConfig` WHERE `parameter` IN ('HLStatsXCountryMaster','MasterBanlistBantime');
DELETE FROM `hlstats_PerlConfig_Default` WHERE `parameter` IN ('HLStatsXCountryMaster','MasterBanlistBantime');
INSERT IGNORE INTO `hlstats_Ranks` (`image`, `minKills`, `maxKills`, `rankName`, `game`) VALUES
('recruit',0,49,'Recruit','zps'),
('private',50,99,'Private','zps'),
('private_firstclass',100,149,'Private First Class','zps'),
('second_lieutenant',150,249,'2nd Lieutenant','zps'),
('first_lieutenant',250,499,'1st Lieutenant','zps'),
('captain',500,749,'Captain','zps'),
('major',750,999,'Major','zps'),
('lieutenant_colonel',1000,1249,'Lieutenant Colonel','zps'),
('colonel',1250,1749,'Colonel','zps'),
('brigadier_general',1750,2499,'Brigardier General','zps'),
('major_general',2500,4999,'Major General','zps'),
('lieutenant_general',5000,7499,'Lieutenant General','zps'),
('general',7500,9999,'General','zps'),
('general_5Star',10000,14999,'5 Star General','zps'),
('ubersoldat',15000,999999999,'The Ubersoldat','zps'),
('recruit',0,49,'Recruit','aoc'),
('private',50,99,'Private','aoc'),
('private_firstclass',100,149,'Private First Class','aoc'),
('second_lieutenant',150,249,'2nd Lieutenant','aoc'),
('first_lieutenant',250,499,'1st Lieutenant','aoc'),
('captain',500,749,'Captain','aoc'),
('major',750,999,'Major','aoc'),
('lieutenant_colonel',1000,1249,'Lieutenant Colonel','aoc'),
('colonel',1250,1749,'Colonel','aoc'),
('brigadier_general',1750,2499,'Brigardier General','aoc'),
('major_general',2500,4999,'Major General','aoc'),
('lieutenant_general',5000,7499,'Lieutenant General','aoc'),
('general',7500,9999,'General','aoc'),
('general_5Star',10000,14999,'5 Star General','aoc'),
('ubersoldat',15000,999999999,'The Ubersoldat','aoc');
INSERT IGNORE INTO `hlstats_Roles` (`game`, `code`, `name`, `hidden`, `picked`, `kills`, `deaths`) VALUES
('ff','Engineer','Engineer','0',0,0,0),
('ff','Spy','Spy','0',0,0,0),
('ff','Soldier','Soldier','0',0,0,0),
('ff','Scout','Scout','0',0,0,0),
('ff','Demoman','Demo Man','0',0,0,0),
('ff','Sniper','Sniper','0',0,0,0),
('ff','Medic','Medic','0',0,0,0),
('ff','Pyro','Pyro','0',0,0,0),
('ff','HWGuy','HWGuy','0',0,0,0),
('ff','Civilian','Civilian','0',0,0,0);
DELETE FROM `hlstats_Servers_Config` WHERE `parameter` IN ('MasterServerData','MasterServerInterval','RawSocketSupport','RawSocketHelpNotice');
DELETE FROM `hlstats_Servers_Config_Default` WHERE `parameter` IN ('MasterServerData','MasterServerInterval','RawSocketSupport','RawSocketHelpNotice');
ALTER TABLE `hlstats_Servers`
ADD COLUMN `lat` varchar(32) NOT NULL default '',
ADD COLUMN `lng` varchar(32) NOT NULL default '',
ADD COLUMN `city` varchar(128) NOT NULL default '',
ADD COLUMN `country` varchar(128) NOT NULL default '';
INSERT IGNORE INTO `hlstats_Teams` (`game`, `code`, `name`, `hidden`, `playerlist_bgcolor`, `playerlist_color`, `playerlist_index`) VALUES
('zps','Undead','Undead', '0', '#F7FF89', '#808700', 1),
('zps','Survivor','Survivors', '0', '#D2E8F7','#0080C0', 2),
('zps','Spectator','Spectator','0', '#D5D5D5','#050505', 0),
('aoc','The Mason Order','The Mason Order','','#FFD5D5','#FF2D2D',2),
('aoc','Agathia Knights','Agathia Knights','','#D2E8F7','#0080C0',1),
('aoc','Spectator','Spectator','0', '#D5D5D5','#050505', 0);
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`, `kills`, `headshots`) VALUES
('zps', 'arms','Zombie',1, 0, 0),
('zps', 'carrierarms','Carrier',1, 0, 0),
('zps', 'ak47','AK-47',1, 0, 0),
('zps', 'mp5','MP5',1, 0, 0),
('zps', 'revolver','Revolver',1, 0, 0),
('zps', 'glock','Glock 17',1, 0, 0),
('zps', 'glock18c','Glock 18c',1, 0, 0),
('zps', 'ppk','Walther PPK',1, 0, 0),
('zps', 'usp','Heckler & Kock USP',1, 0, 0),
('zps', '870','Remington 870',1, 0, 0),
('zps', 'supershorty','Mossberg Super Shorty',1, 0, 0),
('zps', 'grenade_frag','Grenade',1, 0, 0),
('zps', 'sledgehammer','Sledgehammer',1.5, 0, 0),
('zps', 'crowbar','Crowbar',1.5, 0, 0),
('zps', 'chair','Chair',1.5, 0, 0),
('zps', 'keyboard','Keyboard',1.5, 0, 0),
('zps', 'plank','Wooden Plank',1.5, 0, 0),
('zps', 'shovel','Shovel',1.5, 0, 0),
('zps', 'golf','Golf Club',1.5, 0, 0),
('zps', 'machete','Machete',1.5, 0, 0),
('zps', 'fryingpan','Frying Pan',1.5, 0, 0),
('zps', 'spanner','Wrench',1.5, 0, 0),
('zps', 'axe','Axe',1.5, 0, 0),
('zps', 'tireiron','Tire Iron',1.5, 0, 0),
('zps', 'hammer','Hammer',1.5, 0, 0),
('zps', 'broom','Broom',1.5, 0, 0),
('zps', 'pot','Pot',1.5, 0, 0),
('zps', 'world','World',1.5, 0, 0),
('zps', 'physics','Physics',1.5, 0, 0),
('zps', 'racket','Tennis Racket',1.5, 0, 0),
('zps', 'torque','Torque', 1.5, 0, 0),
('aoc', 'flamberge','Flamberge',1, 0, 0),
('aoc', 'longsword','Longsword',1, 0, 0),
('aoc', 'halberd','Knights Halberd',1, 0, 0),
('aoc', 'dagger','Dual Daggers',1, 0, 0),
('aoc', 'flamberge_kiteshield', 'Flamberge & Kite Shield', 1, 0, 0),
('aoc', 'world','World',1, 0, 0),
('aoc', 'chivalry','Chivalry',1, 0, 0),
('aoc', 'sword2','Shortsword',1, 0, 0),
('aoc', 'warhammer','Warhammer',1, 0, 0),
('aoc', 'mace','Mace',1, 0, 0),
('aoc', 'mace_buckler','Mace & Buckler',1, 0, 0),
('aoc', 'sword01_evil_shield', 'Mason Broadsword & Shield', 1, 0, 0),
('aoc', 'crossbow','Crossbow',1, 0, 0),
('aoc', 'longbow','Longbow',1, 0, 0),
('aoc', 'longsword_kiteshield', 'Longsword & Kite Shield', 1, 0, 0),
('aoc', 'sword01_good_shield', 'Knights Broadsword & Shield', 1, 0, 0),
('aoc', 'onehandaxe', 'Hatchet', 1, 0, 0),
('aoc', 'doubleaxe','Battle Axe',1, 0, 0),
('aoc', 'flail_evil_shield','Mason Flail & Shield',1, 0, 0),
('aoc', 'flail_good_shield','Knights Flail & Shield',1, 0, 0),
('aoc', 'thrown_spear', 'Javelin', 1, 0, 0),
('aoc', 'spear_buckler', 'Knights Spear & Buckler', 1, 0, 0),
('aoc', 'dagger2', 'Dagger', 1, 0, 0),
('aoc', 'mtest', 'Footman Longsword', 1, 0, 0),
('aoc', 'thrown_dagger2', 'Thrown Dagger', 1, 0, 0),
('aoc', 'spear_buckler2', 'Mason Spear & Buckler', 1, 0, 0),
('aoc', 'shortsword', 'Spiked Mace', 1, 0, 0),
('aoc', 'spikedmace_buckler','Spiked Mace & Buckler',1, 0, 0),
('aoc', 'evil_halberd', 'Mason Halberd', 1, 0, 0),
('aoc', 'env_explosion', 'Fire', 1, 4, 0),
('aoc', 'oilpot', 'Oil Pot', 1, 1, 0);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,834 @@
UPDATE `hlstats_Actions` SET `code` = 'flagevent_defended' WHERE `code` = 'flagevent' AND `event` = 'defended' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'flagevent_captured' WHERE `code` = 'flagevent' AND `event` = 'captured' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'flagevent_dropped', `description` = 'Dropped the flag (while alive)' WHERE `code` = 'flagevent' AND `event` = 'dropped' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'flagevent_picked_up' WHERE `code` = 'flagevent' AND `event` = 'picked up' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'killedobject_obj_teleporter_exit' WHERE `code` = 'killedobject' AND `object` = 'OBJ_TELEPORTER_EXIT' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'killedobject_obj_teleporter_entrance' WHERE `code` = 'killedobject' AND `object` = 'OBJ_TELEPORTER_ENTRANCE' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'killedobject_obj_dispenser' WHERE `code` = 'killedobject' AND `object` = 'OBJ_DISPENSER' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'killedobject_obj_sentrygun' WHERE `code` = 'killedobject' AND `object` = 'OBJ_SENTRYGUN' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'killedobject_obj_attachment_sapper' WHERE `code` = 'killedobject' AND `object` = 'OBJ_ATTACHMENT_SAPPER' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'builtobject_obj_teleporter_exit' WHERE `code` = 'builtobject' AND `object` = 'OBJ_TELEPORTER_EXIT' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'builtobject_obj_teleporter_entrance' WHERE `code` = 'builtobject' AND `object` = 'OBJ_TELEPORTER_ENTRANCE' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'builtobject_obj_dispenser' WHERE `code` = 'builtobject' AND `object` = 'OBJ_DISPENSER' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'builtobject_obj_sentrygun' WHERE `code` = 'builtobject' AND `object` = 'OBJ_SENTRYGUN' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'builtobject_obj_attachment_sapper' WHERE `code` = 'builtobject' AND `object` = 'OBJ_ATTACHMENT_SAPPER' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'owner_killedobject_obj_teleporter_exit' WHERE `code` = 'owner_killedobject' AND `object` = 'OBJ_TELEPORTER_EXIT' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'owner_killedobject_obj_teleporter_entrance' WHERE `code` = 'owner_killedobject' AND `object` = 'OBJ_TELEPORTER_ENTRANCE' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'owner_killedobject_obj_dispenser' WHERE `code` = 'owner_killedobject' AND `object` = 'OBJ_DISPENSER' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE `hlstats_Actions` SET `code` = 'owner_killedobject_obj_sentrygun' WHERE `code` = 'owner_killedobject' AND `object` = 'OBJ_SENTRYGUN' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
ALTER TABLE `hlstats_Actions`
DROP KEY `gamecode`,
DROP COLUMN `object`,
DROP COLUMN `event`,
ADD UNIQUE KEY `gamecode` (`code`,`game`,`team`);
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`) VALUES
('tf', 'flagevent_dropped_death', 0, 0, '', 'Dropped the flag (on death)', '1', '', '', ''),
('tf', 'crit_kill', -1, 0, '', 'Critical Kill', '1', '', '', ''),
('tf', 'force_suicide', 0, 0, '', 'Force Suicide', '1', '', '', ''),
('tf', 'hit_by_train', 0, 0, '', 'LOL TRAIN\'D', '1', '', '', ''),
('tf', 'drowned', 0, 0, '', 'Drowned', '1', '', '', ''),
('tf', 'owner_killedobject_obj_attachment_sapper', -2, 0, '', 'Console-killed sapper', '1', '', '', ''),
('tfc','Sentry_Dismantle',3,0,'0','Dismantled Sentry Gun','0','1','0','0'),
('tfc','Dispenser_Dismantle',3,0,'0','Dismantled Dispenser','0','1','0','0'),
('l4d', 'headshot', 0, 0, '', 'Headshot Kill', '1', '', '', ''),
('l4d', 'rescued_survivor', 2, 0, '', 'Rescued Teammate', '1', '0', '0', '0'),
('l4d', 'healed_teammate', 5, 0, '', 'Healed Teammate', '1', '0', '0', '0'),
('l4d', 'revived_teammate', 3, 0, '', 'Revived Teammate', '1', '0', '0', '0'),
('l4d', 'startled_witch', -5, 0, '', 'Startled the Witch', '1', '0', '0', '0'),
('l4d', 'pounce', 6, 0, '', '(Hunter) Pounced on Survivor', '0', '1', '0', '0'),
('l4d', 'tongue_grab', 6, 0, '', '(Smoker) Tongue Grabbed Survivor', '0', '1', '0', '0'),
('l4d', 'vomit', 6, 0, '', '(Boomer) Vomited on Survivor', '0', '1', '0', '0'),
('l4d', 'killed_gas', 1, 0, '', 'Killed a Smoker', '1', '0', '0', '0'),
('l4d', 'killed_exploding', 1, 0, '', 'Killed a Boomer', '1', '0', '0', '0'),
('l4d', 'killed_hunter', 1, 0, '', 'Killed a Hunter', '1', '0', '0', '0'),
('l4d', 'killed_tank', 3, 0, '', 'Killed a Tank', '1', '0', '0', '0'),
('l4d', 'killed_witch', 3, 0, '', 'Killed a Witch', '1', '0', '0', '0'),
('l4d', 'killed_survivor', 25, 0, '', 'Incapacitated/Killed Survivor', '0', '1', '0', '0'),
('l4d', 'friendly_fire', -10, 0, '', 'Friendly Fire', '1', '0', '0', '0'),
('ff', 'sentrygun_upgraded', 1, 0, '', 'Upgraded Sentry Gun', '1', '', '', ''),
('ff', 'build_sentrygun', 1, 0, '', 'Built Sentry Gun', '1', '', '', ''),
('ff', 'build_dispenser', 1, 0, '', 'Built Dispenser', '1', '', '', ''),
('ff', 'dispenser_detonated', -1, 0, '', 'Dispenser Detonated', '1', '', '', ''),
('ff', 'sentry_detonated', -1, 0, '', 'Sentry Gun Detonated', '1', '', '', ''),
('ff', 'sentry_dismantled', -1, 0, '', 'Sentry Gun Dismantled', '1', '', '', ''),
('ff', 'dispenser_dismantled', -1, 0, '', 'Dispenser Dismantled', '1', '', '', ''),
('ff', 'build_mancannon', 1, 0, '', 'Built Jump Pad', '1', '', '', ''),
('ff', 'mancannon_detonated', -1, 0, '', 'Detonated Jump Pad', '1', '', '', ''),
('ff', 'build_detpack', 1, 0, '', 'Placed Detpack', '1', '', '', ''),
('ff', 'flag_touch', 3, 0, '', 'Flag Picked Up', '1', '', '', ''),
('ff', 'flag_capture', 3, 0, '', 'Flag Captured', '1', '', '', ''),
('ff', 'flag_dropped', -3, 0, '', 'Flag Dropped', '1', '', '', ''),
('ff', 'flag_thrown', -3, 0, '', 'Flag Thrown', '1', '', '', ''),
('ff', 'disguise_lost', 1, 0, '', 'Uncovered Enemy', '', '1', '', ''),
('fof', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', ''),
('fof', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', ''),
('fof', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', ''),
('fof', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', ''),
('fof', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', ''),
('fof', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', ''),
('fof', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', ''),
('fof', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', ''),
('fof', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', ''),
('fof', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', ''),
('fof', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', ''),
('fof', 'loot_drop', -2, 0, '', 'Dropped the loot', '1', '', '', ''),
('fof', 'loot_capture', 8, 0, '', 'Captured the loot', '1', '', '', ''),
('fof', 'carrier_protect', 5, 0, '', 'Protected the carrier', '1', '', '', ''),
('fof', 'headshot', 1, 0, '', 'Headshot Kill', '1', '', '', ''),
('ges', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', ''),
('ges', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', ''),
('ges', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', ''),
('ges', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', ''),
('ges', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', ''),
('ges', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', ''),
('ges', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', ''),
('ges', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', ''),
('ges', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', ''),
('ges', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', ''),
('ges', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', ''),
('ges', 'Round_Win', 5, 0, '', 'Round Win', '1', '', '', ''),
('ges', 'Round_Win_Team', 0, 3, '', 'Team Round Win', '', '', '1', '');
ALTER TABLE `hlstats_Awards` CHANGE `awardType` `awardType` CHAR( 1 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'W';
UPDATE `hlstats_Awards` SET `code` = 'weapon_fnfal' WHERE `code`='weapon_fnfa1' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('O', 'l4d', 'headshot', 'Brain Salad', 'headshot kills'),
('O', 'l4d', 'healed_teammate', 'Field Medic', 'healed Survivors'),
('O', 'l4d', 'killed_exploding', 'Stomach Upset', 'killed Boomers'),
('O', 'l4d', 'killed_gas', 'No Smoking Section', 'killed Smokers'),
('O', 'l4d', 'killed_hunter', 'Hunter Punter', 'killed Hunters'),
('P', 'l4d', 'killed_survivor', 'Dead Wreckening', 'downed Survivors'),
('O', 'l4d', 'killed_tank', 'Tankbuster', 'killed Tanks'),
('O', 'l4d', 'killed_witch', 'Inquisitor', 'killed Witches'),
('P', 'l4d', 'pounce', 'Free to Fly', 'pounced Survivors'),
('O', 'l4d', 'rescued_survivor', 'Ground Cover', 'rescued Survivors'),
('O', 'l4d', 'revived_teammate', 'Helping Hand', 'revived Survivors'),
('P', 'l4d', 'tongue_grab', 'Drag &amp; Drop', 'constricted Survivors'),
('P', 'l4d', 'vomit', 'Barf Bagged', 'vomited on Survivors'),
('W', 'l4d', 'autoshotgun', 'Automation', 'kills with Auto Shotgun'),
('W', 'l4d', 'boomer_claw', 'Boom!', 'kills with Boomer\'s Claws'),
('W', 'l4d', 'dual_pistols', 'Akimbo Assassin', 'kills with Dual Pistols'),
('W', 'l4d', 'hunter_claw', 'Open Season', 'kills with Hunter\'s Claws'),
('W', 'l4d', 'hunting_rifle', 'Hawk Eye', 'kills with Hunting Rifle'),
('W', 'l4d', 'inferno', 'Pyromaniac', 'cremated Infected'),
('W', 'l4d', 'pipe_bomb', 'Pyrotechnician', 'blown up Infected'),
('W', 'l4d', 'pistol', 'Ammo Saver', 'kills with Pistol'),
('W', 'l4d', 'prop_minigun', 'No-One Left Behind', 'kills with Mounted Machine Gun'),
('W', 'l4d', 'pumpshotgun', 'Pump It!', 'kills with Pump Shotgun'),
('W', 'l4d', 'rifle', 'Commando', 'kills with M16 Assault Rifle'),
('W', 'l4d', 'smg', 'Safety First', 'kills with Uzi'),
('W', 'l4d', 'smoker_claw', 'Chain Smoker', 'kills with Smoker\'s Claws'),
('W', 'l4d', 'tank_claw', 'Burger Tank', 'kills with Tank\'s Claws'),
('W', 'l4d', 'tank_rock', 'Rock Star', 'kills with Tank\'s Rock'),
('W', 'l4d', 'latency', 'Lowest Ping', 'ms average connection'),
('W', 'fof', 'deringer', 'Deringer', 'kills with Deringer'),
('W', 'fof', 'carbine', 'Carbine', 'kills with Carbine'),
('W', 'fof', 'coltnavy', 'Colt Navy', 'kills with Colt Navy'),
('W', 'fof', 'bow', 'Bow', 'kills with Bow'),
('W', 'fof', 'arrow', 'Arrow', 'kills with Arrow'),
('W', 'fof', 'sharps', 'Sharps', 'kills with Sharps'),
('W', 'fof', 'coachgun', 'Coach Gun', 'kills with Coach Gun'),
('W', 'fof', 'peacemaker', 'Peacemaker', 'kills with Peacemaker'),
('W', 'fof', 'knife', 'Knife', 'kills with Knife'),
('W', 'fof', 'dualderinger', 'Dual Deringers', 'kills with Dual Deringers'),
('W', 'fof', 'thrown_axe', 'Thrown Axe', 'kills with Thrown Axe'),
('W', 'fof', 'arrow_fiery', 'Fire Arrow', 'kills with Fire Arrow'),
('W', 'fof', 'thrown_knife', 'Thrown Knife', 'kills with Thrown Knife'),
('W', 'fof', 'dualnavy', 'Dual Colt Navys', 'kills with Dual Colt Navys'),
('W', 'fof', 'dynamite', 'Dynamite', 'kills with Dynamite'),
('W', 'fof', 'explosive_arrow', 'Explosive Arrow', 'kills with Explosive Arrows'),
('W', 'fof', 'fists', 'Fists', 'kills with Fists'),
('W', 'fof', 'axe', 'Axe', 'kills with Axe'),
('W', 'fof', 'dualpeacemaker', 'Dual Peacemakers', 'kills with Dual Peacemakers'),
('W', 'fof', 'henryrifle', 'Henry Rifle', 'kills with Henry Rifle'),
('W', 'fof', 'whiskey', 'Whiskey', 'kills with Whiskey'),
('O', 'fof', 'loot_drop', 'Butter Fingers', 'Loot Drops'),
('O', 'fof', 'loot_capture', 'Gimme all yo loot', 'Loot Captures'),
('O', 'fof', 'carrier_protect', 'Grand Protector', 'carrier protections'),
('O', 'fof', 'headshot', 'BOOM HEADSHOT','headshot kills'),
('W', 'fof', 'latency', 'Lowest Ping','ms average connection'),
('W', 'ges', '#GE_ProximityMine', 'Proximity Mines', 'kills with Proximity Mines'),
('W', 'ges', '#GE_AutoShotgun', 'Automatic Shotgun', 'kills with Automatic Shotgun'),
('W', 'ges', '#GE_Phantom', 'Phantom', 'kills with Phantom'),
('W', 'ges', '#GE_Knife', 'Knife', 'kills with Hunting Knife'),
('W', 'ges', '#GE_D5K', 'D5K', 'kills with D5K Deutsche'),
('W', 'ges', '#GE_SilverPP7', 'Silver PP7', 'kills with Silver PP7'),
('W', 'ges', '#GE_DD44', 'DD44', 'kills with DD44'),
('W', 'ges', '#GE_Grenade', 'Grenade', 'kills with Grenades'),
('W', 'ges', '#GE_CougarMagnum', 'Cougar Magnum', 'kills with Cougar Magnum'),
('W', 'ges', '#GE_D5K_SILENCED', 'Silenced D5K', 'kills with D5K (Silenced)'),
('W', 'ges', '#GE_Shotgun', 'Shotgun', 'kills with Shotgun'),
('W', 'ges', '#GE_Klobb', 'Klobb', 'kills with Klobb'),
('W', 'ges', '#GE_RCP90', 'RC-P90', 'kills with RC-P90'),
('W', 'ges', '#GE_RemoteMine', 'Remote Mines', 'kills with Remote Mines'),
('W', 'ges', '#GE_KF7Soviet', 'KF7 Soviet', 'kills with KF7 Soviet'),
('W', 'ges', '#GE_ZMG', 'ZMG', 'kills with ZMG'),
('W', 'ges', '#GE_SniperRifle', 'Sniper Rifle', 'kills with Sniper Rifle'),
('W', 'ges', '#GE_GoldPP7', 'Golden PP7', 'kills with Golden PP7'),
('W', 'ges', '#GE_AR33', 'AR33', 'kills with US AR33 Assault'),
('W', 'ges', '#GE_GoldenGun', 'Golden Gun', 'kills with Golden Gun'),
('W', 'ges', '#GE_ThrowingKnife', 'Thorwing Knives', 'kills with Throwing Knives'),
('W', 'ges', '#GE_PP7', 'PP7', 'kills with PP7'),
('W', 'ges', '#GE_PP7_SILENCED', 'Silenced PP7', 'kills with PP7 (Silenced)'),
('W', 'ges', '#GE_TimedMine', 'Timed Mines', 'kills with Timed Mines'),
('W', 'ges', '#GE_MilitaryLaser', 'Military Laser', 'kills with Military Laser'),
('W', 'ges', '#GE_GrenadeLauncher', 'Grenade Launcher', 'kills with Grenade Launcher'),
('W', 'ges', '#GE_Rocket', 'Rocket Launcher', 'kills with Rocket Launcher'),
('W', 'ges', '#GE_Taser', 'Taser', 'kills with Taser'),
('W', 'ges', '#GE_SniperButt', 'Sniper Butt', 'kills with Sniper Butt'),
('W', 'ges', '#GE_Slapper', 'Slapper', 'kills with Slappers'),
('W', 'ges', '#GE_RocketLauncher', ', Rocket Launcher', 'kills with Rocket Launcher'),
('W', 'ges', 'latency', 'Lowest Ping','ms average connection');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'flagevent_defended','Defender of the Flag','flag defenses' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'flagevent_captured','The Mad Capper','flag captures' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'killedobject_obj_dispenser','NO METAL FOR YOU!','dispensers destroyed' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'killedobject_obj_sentrygun','Say no to sentries','sentry guns destoryed' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'builtobject_obj_sentrygun','Bob the Builder','sentry guns built' FROM `hlstats_Games` WHERE `realgame` = 'tf');
ALTER TABLE `hlstats_Events_Admin`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_ChangeName`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_ChangeRole`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `role` `role` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_ChangeTeam`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `team` `team` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Chat`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Connects`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Disconnects`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Entries`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Frags`
DROP INDEX `map`,
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `weapon` `weapon` VARCHAR( 64 ) NOT NULL default '',
CHANGE `killerRole` `killerRole` VARCHAR( 64 ) NOT NULL default '',
CHANGE `victimRole` `victimRole` VARCHAR( 64 ) NOT NULL default '',
ADD INDEX ( `serverId` ),
ADD INDEX ( `headshot` ),
ADD INDEX ( `map` ( 5 ) );
UPDATE `hlstats_Events_Frags` SET `weapon` = 'weapon_fnfal' WHERE `weapon` = 'weapon_fnfa1' AND serverId IN (SELECT serverId FROM `hlstats_Servers` WHERE `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod'));
ALTER TABLE `hlstats_Events_Latency`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_PlayerActions`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_PlayerPlayerActions`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Rcon`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `password` `password` VARCHAR( 128 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Statsme`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `weapon` `weapon` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Statsme2`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `weapon` `weapon` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_StatsmeLatency`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_StatsmeTime`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Suicides`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `weapon` `weapon` VARCHAR( 64 ) NOT NULL default '';
UPDATE `hlstats_Events_Suicides` SET `weapon` = 'weapon_fnfal' WHERE `weapon` = 'weapon_fnfa1' AND serverId IN (SELECT serverId FROM `hlstats_Servers` WHERE `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod'));
ALTER TABLE `hlstats_Events_TeamBonuses`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Events_Teamkills`
CHANGE `map` `map` VARCHAR( 64 ) NOT NULL default '',
CHANGE `weapon` `weapon` VARCHAR( 64 ) NOT NULL default '';
UPDATE `hlstats_Events_Teamkills` SET `weapon` = 'weapon_fnfal' WHERE `weapon` = 'weapon_fnfa1' AND serverId IN (SELECT serverId FROM `hlstats_Servers` WHERE `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod'));
INSERT IGNORE INTO `hlstats_Games` (`code`, `name`, `realgame`, `hidden`) VALUES
('l4d', 'Left 4 Dead', 'l4d', '1'),
('fof', 'Fistful of Frags', 'fof', '1'),
('ges', 'GoldenEye: Source', 'ges', '1');
DELETE FROM `hlstats_Games_Defaults` WHERE `parameter` = 'AdminContact';
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`) VALUES
('l4d', 'DisplayResultsInBrowser', '1'),
('l4d', 'GameEngine', '3'),
('l4d', 'AddressPort', '0.0.0.0:27015'),
('l4d', 'Admins', ''),
('l4d', 'AutoBanRetry', '0'),
('l4d', 'AutoTeamBalance', '0'),
('l4d', 'BonusRoundIgnore', '0'),
('l4d', 'BonusRoundTime', '0'),
('l4d', 'BroadCastEvents', '0'),
('l4d', 'BroadCastPlayerActions', '0'),
('l4d', 'EnablePublicCommands', '0'),
('l4d', 'GameType', '0'),
('l4d', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('l4d', 'IgnoreBots', '0'),
('l4d', 'MinimumPlayersRank', '0'),
('l4d', 'MinPlayers', '1'),
('l4d', 'PlayerEvents', '1'),
('l4d', 'ShowStats', '1'),
('l4d', 'SkillMode', '0'),
('l4d', 'SuicidePenalty', '5'),
('l4d', 'SwitchAdmins', '0'),
('l4d', 'TKPenalty', '25'),
('l4d', 'TrackServerLoad', '1'),
('fof', 'DisplayResultsInBrowser', '1'),
('fof', 'GameEngine', '3'),
('fof', 'AddressPort', '0.0.0.0:27015'),
('fof', 'Admins', ''),
('fof', 'AutoBanRetry', '0'),
('fof', 'AutoTeamBalance', '0'),
('fof', 'BonusRoundIgnore', '0'),
('fof', 'BonusRoundTime', '0'),
('fof', 'BroadCastEvents', '1'),
('fof', 'BroadCastPlayerActions', '1'),
('fof', 'EnablePublicCommands', '1'),
('fof', 'GameType', '0'),
('fof', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('fof', 'IgnoreBots', '1'),
('fof', 'MinimumPlayersRank', '0'),
('fof', 'MinPlayers', '4'),
('fof', 'PlayerEvents', '1'),
('fof', 'ShowStats', '1'),
('fof', 'SkillMode', '0'),
('fof', 'SuicidePenalty', '5'),
('fof', 'SwitchAdmins', '0'),
('fof', 'TKPenalty', '25'),
('fof', 'TrackServerLoad', '1'),
('ges', 'DisplayResultsInBrowser', '1'),
('ges', 'GameEngine', '3'),
('ges', 'AddressPort', '0.0.0.0:27015'),
('ges', 'Admins', ''),
('ges', 'AutoBanRetry', '0'),
('ges', 'AutoTeamBalance', '0'),
('ges', 'BonusRoundIgnore', '0'),
('ges', 'BonusRoundTime', '0'),
('ges', 'BroadCastEvents', '1'),
('ges', 'BroadCastPlayerActions', '1'),
('ges', 'EnablePublicCommands', '1'),
('ges', 'GameType', '0'),
('ges', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('ges', 'IgnoreBots', '1'),
('ges', 'MinimumPlayersRank', '0'),
('ges', 'MinPlayers', '4'),
('ges', 'PlayerEvents', '1'),
('ges', 'ShowStats', '1'),
('ges', 'SkillMode', '0'),
('ges', 'SuicidePenalty', '5'),
('ges', 'SwitchAdmins', '0'),
('ges', 'TKPenalty', '25'),
('ges', 'TrackServerLoad', '1');
INSERT IGNORE INTO `hlstats_Games_Supported` (`code`, `name`) VALUES
('l4d', 'Left 4 Dead'),
('fof', 'Fistful of Frags'),
('ges', 'GoldenEye: Source');
ALTER TABLE `hlstats_Livestats`
CHANGE `team` `team` VARCHAR( 64 ) NOT NULL default '';
ALTER TABLE `hlstats_Options`
ADD `opttype` TINYINT NOT NULL DEFAULT '1',
ADD INDEX ( `opttype` );
UPDATE `hlstats_Options` SET `opttype` = 2;
INSERT INTO `hlstats_Options` (`keyname`, `value`, `opttype`)
(SELECT `parameter`, `value`, 0 FROM `hlstats_PerlConfig`);
INSERT IGNORE INTO `hlstats_Options` (`keyname`, `value`, `opttype`) VALUES
('slider', '1',2),
('modrewrite','0',2),
('UseGeoIPBinary', '0',0);
UPDATE `hlstats_Options` SET `value` = 'skill' WHERE `keyname` = 'rankingtype' AND `value`=1;
UPDATE `hlstats_Options` SET `value` = 'kills' WHERE `keyname` = 'rankingtype' AND `value`=2;
UPDATE `hlstats_Options` SET `opttype` = 1 WHERE `keyname` IN ('Mode','rankingtype','DeleteDays','MinActivity');
TRUNCATE TABLE `hlstats_Options_Choices`;
INSERT IGNORE INTO `hlstats_Options_Choices` (`keyname`, `value`, `text`, `isDefault`) VALUES
('rankingtype', 'skill', 'Skill', 1),
('rankingtype', 'kills', 'Kills', 0),
('bannerdisplay', '0', 'None', 1),
('bannerdisplay', '1', 'All Pages', 0),
('bannerdisplay', '2', 'Contents Page Only', 0),
('playerinfo_tabs', '1', 'New Style (hide sections by default)', 1),
('playerinfo_tabs', '0', 'Old Style (show all at once)', 0),
('nav_globalchat', '1', 'Show', 1),
('nav_globalchat', '0', 'Hide', 0),
('nav_cheaters', '0', 'Hide', 1),
('nav_cheaters', '1', 'Show', 0),
('show_weapon_target_flash', '1', 'Flash hitbox', 1),
('show_weapon_target_flash', '0', 'HTML Table', 0),
('show_server_load_image', '1', 'Show', 0),
('show_server_load_image', '0', 'Hide', 1),
('countrydata', '1', 'Show', 1),
('countrydata', '0', 'Hide', 0),
('gamehome_show_awards', '1', 'Show', 0),
('gamehome_show_awards', '0', 'Hide', 1),
('show_google_map', '0', 'Hide', 0),
('show_google_map', '1', 'Show', 1),
('google_map_region', 'NORTH AMERICA', 'North America', 1),
('google_map_region', 'SOUTH AMERICA', 'South America', 0),
('google_map_region', 'NORTH AFRICA', 'North Africa', 0),
('google_map_region', 'SOUTH AFRICA', 'South Africa', 0),
('google_map_region', 'NORTH EUROPE', 'North Europe', 0),
('google_map_region', 'EAST EUROPE', 'East Europe', 0),
('google_map_region', 'GERMANY', 'Germany', 0),
('google_map_region', 'FRANCE', 'France', 0),
('google_map_region', 'SPAIN', 'Spain', 0),
('google_map_region', 'UNITED KINGDOM', 'United Kingdom', 0),
('google_map_region', 'DENMARK', 'Denmark', 0),
('google_map_region', 'SWEDEN', 'Sweden', 0),
('google_map_region', 'NORWAY', 'Norway', 0),
('google_map_region', 'FINLAND', 'Finland', 0),
('google_map_region', 'NETHERLANDS', 'Netherlands', 0),
('google_map_region', 'BELGIUM', 'Belgium', 0),
('google_map_region', 'POLAND', 'Poland', 0),
('google_map_region', 'SUISSE', 'Suisse', 0),
('google_map_region', 'AUSTRIA', 'Austria', 0),
('google_map_region', 'ITALY', 'Italy', 0),
('google_map_region', 'TURKEY', 'Turkey', 0),
('google_map_region', 'BRAZIL', 'Brazil', 0),
('google_map_region', 'ARGENTINA', 'Argentina', 0),
('google_map_region', 'RUSSIA', 'Russia', 0),
('google_map_region', 'ASIA', 'Asia', 0),
('google_map_region', 'CHINA', 'China', 0),
('google_map_region', 'JAPAN', 'Japan', 0),
('google_map_region', 'SOUTH KOREA', 'South Korea', 0),
('google_map_region', 'AUSTRALIA', 'Australia', 0),
('google_map_region', 'WORLD', 'World', 0),
('google_map_type', 'HYBRID', 'Hybrid', 1),
('google_map_type', 'SATELLITE', 'Satellite', 0),
('google_map_type', 'MAP', 'Normal', 0),
('google_map_type', 'PHYSICAL', 'Physical', 0),
('slider', '1', 'Enabled', 1),
('slider', '0', 'Disabled', 0),
('modrewrite', '1', 'Enabled', 0),
('modrewrite', '0', 'Disabled', 1),
('DNSResolveIP', '1', 'Yes', 1),
('DNSResolveIP', '0', 'No', 0),
('Rcon', '1', 'Yes', 1),
('Rcon', '0', 'No', 0),
('RconIgnoreSelf', '0', 'No', 1),
('RconIgnoreSelf', '1', 'Yes', 0),
('RconRecord', '0', 'No', 1),
('RconRecord', '1', 'Yes', 0),
('Mode', 'Normal', 'Steam ID (recommended)', 1),
('Mode', 'NameTrack', 'Player Name', 0),
('Mode', 'LAN', 'IP Address', 0),
('UseTimestamp', '0', 'No', 1),
('UseTimestamp', '1', 'Yes', 0),
('AllowOnlyConfigServers', '0', 'No', 0),
('AllowOnlyConfigServers', '1', 'Yes', 1),
('TrackStatsTrend', '0', 'No', 0),
('TrackStatsTrend', '1', 'Yes', 1),
('GlobalBanning', '0', 'No', 1),
('GlobalBanning', '1', 'Yes', 0),
('LogChat', '0', 'No', 0),
('LogChat', '1', 'Yes', 1),
('LogChatAdmins', '0', 'No', 0),
('LogChatAdmins', '1', 'Yes', 1),
('GlobalChat', '0', 'None', 1),
('GlobalChat', '1', 'Broadcast to all', 0),
('GlobalChat', '2', 'Broadcast to admins', 0),
('SkillRatioCap', '0', 'No', 1),
('SkillRatioCap', '1', 'Yes', 0),
('UseGeoIPBinary', '0', 'GeoIP lookup via database', 1),
('UseGeoIPBinary', '1', 'GeoIP lookup via binary file', 0);
DROP TABLE `hlstats_PerlConfig`;
DROP TABLE `hlstats_PerlConfig_Choices`;
ALTER TABLE `hlstats_Players` CHANGE `last_event` `last_event` INT( 11 ) NOT NULL DEFAULT '0';
INSERT IGNORE INTO `hlstats_Ranks` (`image`, `minKills`, `maxKills`, `rankName`, `game`) VALUES
('recruit', 0, 49, 'Recruit', 'l4d'),
('private', 50, 99, 'Private', 'l4d'),
('private-first-class', 100, 199, 'Private First Class', 'l4d'),
('lance-corporal', 200, 299, 'Lance Corporal', 'l4d'),
('corporal', 300, 399, 'Corporal', 'l4d'),
('sergeant', 400, 499, 'Sergeant', 'l4d'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'l4d'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'l4d'),
('master-sergeant', 700, 799, 'Master Sergeant', 'l4d'),
('first-sergeant', 800, 899, 'First Sergeant', 'l4d'),
('master-chief', 900, 999, 'Master Chief', 'l4d'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'l4d'),
('ensign', 1200, 1399, 'Ensign', 'l4d'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'l4d'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'l4d'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'l4d'),
('captain', 2000, 2249, 'Captain', 'l4d'),
('group-captain', 2250, 2499, 'Group Captain', 'l4d'),
('senior-captain', 2500, 2749, 'Senior Captain', 'l4d'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'l4d'),
('major', 3000, 3499, 'Major', 'l4d'),
('group-major', 3500, 3999, 'Group Major', 'l4d'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'l4d'),
('commander', 4500, 4999, 'Commander', 'l4d'),
('group-commander', 5000, 5749, 'Group Commander', 'l4d'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'l4d'),
('colonel', 6500, 7249, 'Colonel', 'l4d'),
('brigadier', 7250, 7999, 'Brigadier', 'l4d'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'l4d'),
('major-general', 9000, 9999, 'Major General', 'l4d'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'l4d'),
('general', 12500, 14999, 'General', 'l4d'),
('commander-general', 15000, 17499, 'Commander General', 'l4d'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'l4d'),
('field-marshal', 20000, 22499, 'Field Marshal', 'l4d'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'l4d'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'l4d'),
('high-commander', 27500, 29999, 'High Commander', 'l4d'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'l4d'),
('terminator', 35000, 9999999, 'Terminator', 'l4d'),
('recruit', 0, 49, 'Recruit', 'fof'),
('private', 50, 99, 'Private', 'fof'),
('private-first-class', 100, 199, 'Private First Class', 'fof'),
('lance-corporal', 200, 299, 'Lance Corporal', 'fof'),
('corporal', 300, 399, 'Corporal', 'fof'),
('sergeant', 400, 499, 'Sergeant', 'fof'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'fof'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'fof'),
('master-sergeant', 700, 799, 'Master Sergeant', 'fof'),
('first-sergeant', 800, 899, 'First Sergeant', 'fof'),
('master-chief', 900, 999, 'Master Chief', 'fof'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'fof'),
('ensign', 1200, 1399, 'Ensign', 'fof'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'fof'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'fof'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'fof'),
('captain', 2000, 2249, 'Captain', 'fof'),
('group-captain', 2250, 2499, 'Group Captain', 'fof'),
('senior-captain', 2500, 2749, 'Senior Captain', 'fof'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'fof'),
('major', 3000, 3499, 'Major', 'fof'),
('group-major', 3500, 3999, 'Group Major', 'fof'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'fof'),
('commander', 4500, 4999, 'Commander', 'fof'),
('group-commander', 5000, 5749, 'Group Commander', 'fof'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'fof'),
('colonel', 6500, 7249, 'Colonel', 'fof'),
('brigadier', 7250, 7999, 'Brigadier', 'fof'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'fof'),
('major-general', 9000, 9999, 'Major General', 'fof'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'fof'),
('general', 12500, 14999, 'General', 'fof'),
('commander-general', 15000, 17499, 'Commander General', 'fof'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'fof'),
('field-marshal', 20000, 22499, 'Field Marshal', 'fof'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'fof'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'fof'),
('high-commander', 27500, 29999, 'High Commander', 'fof'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'fof'),
('terminator', 35000, 9999999, 'Terminator', 'fof'),
('recruit', 0, 49, 'Recruit', 'ges'),
('private', 50, 99, 'Private', 'ges'),
('private-first-class', 100, 199, 'Private First Class', 'ges'),
('lance-corporal', 200, 299, 'Lance Corporal', 'ges'),
('corporal', 300, 399, 'Corporal', 'ges'),
('sergeant', 400, 499, 'Sergeant', 'ges'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'ges'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'ges'),
('master-sergeant', 700, 799, 'Master Sergeant', 'ges'),
('first-sergeant', 800, 899, 'First Sergeant', 'ges'),
('master-chief', 900, 999, 'Master Chief', 'ges'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'ges'),
('ensign', 1200, 1399, 'Ensign', 'ges'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'ges'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'ges'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'ges'),
('captain', 2000, 2249, 'Captain', 'ges'),
('group-captain', 2250, 2499, 'Group Captain', 'ges'),
('senior-captain', 2500, 2749, 'Senior Captain', 'ges'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'ges'),
('major', 3000, 3499, 'Major', 'ges'),
('group-major', 3500, 3999, 'Group Major', 'ges'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'ges'),
('commander', 4500, 4999, 'Commander', 'ges'),
('group-commander', 5000, 5749, 'Group Commander', 'ges'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'ges'),
('colonel', 6500, 7249, 'Colonel', 'ges'),
('brigadier', 7250, 7999, 'Brigadier', 'ges'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'ges'),
('major-general', 9000, 9999, 'Major General', 'ges'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'ges'),
('general', 12500, 14999, 'General', 'ges'),
('commander-general', 15000, 17499, 'Commander General', 'ges'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'ges'),
('field-marshal', 20000, 22499, 'Field Marshal', 'ges'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'ges'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'ges'),
('high-commander', 27500, 29999, 'High Commander', 'ges'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'ges'),
('terminator', 35000, 9999999, 'Terminator', 'ges');
UPDATE `hlstats_Ribbons` SET `awardCode` = 'weapon_fnfal' WHERE `awardCode`='weapon_fnfa1' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod');
INSERT INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`) VALUES
('ak47',5,0,'cstrike','1_ak47.png','Award of AK47'),
('awp',5,0,'cstrike','1_awp.png','Award of AWP Sniper'),
('deagle',5,0,'cstrike','1_deagle.png','Award of Desert Eagle'),
('elite',5,0,'cstrike','1_elite.png','Award of Dual Beretta Elites'),
('famas',5,0,'cstrike','1_famas.png','Award of Fusil Automatique'),
('galil',5,0,'cstrike','1_galil.png','Award of Galil'),
('glock18',5,0,'cstrike','1_glock.png','Award of Glock'),
('knife',5,0,'cstrike','1_knife.png','Award of Combat Knife'),
('latency',5,0,'cstrike','1_latency.png','Award of Lowpinger'),
('m3',5,0,'cstrike','1_m3.png','Award of M3 Super'),
('m4a1',5,0,'cstrike','1_m4a1.png','Award of Colt M4A1'),
('p90',5,0,'cstrike','1_p90.png','Award of P90'),
('scout',5,0,'cstrike','1_scout.png','Award of Scout Elite'),
('usp',5,0,'cstrike','1_usp.png','Award of USP'),
('boomer_claw', '5', '0', 'l4d', '1_boomer_claw.png', 'Bronze Boom!'),
('headshot', '5', '0', 'l4d', '1_headshot.png', 'Bronze Brain Salad'),
('healed_teammate', '5', '0', 'l4d', '1_healed_teammate.png', 'Bronze Field Medic'),
('hunter_claw', '5', '0', 'l4d', '1_hunter_claw.png', 'Bronze Grim Reaper'),
('inferno', '5', '0', 'l4d', '1_inferno.png', 'Bronze Cremator'),
('killed_exploding', '5', '0', 'l4d', '1_killed_exploding.png', 'Bronze Stomach Upset'),
('killed_gas', '5', '0', 'l4d', '1_killed_gas.png', 'Bronze Tongue Twister'),
('killed_hunter', '5', '0', 'l4d', '1_killed_hunter.png', 'Bronze Hunter Punter'),
('killed_survivor', '5', '0', 'l4d', '1_killed_survivor.png', 'Bronze Dead Wreckening'),
('killed_tank', '5', '0', 'l4d', '1_killed_tank.png', 'Bronze Tankbuster'),
('killed_witch', '5', '0', 'l4d', '1_killed_witch.png', 'Bronze Inquisitor'),
('latency', '5', '0', 'l4d', '1_latency.png', 'Bronze Nothing Special'),
('pipe_bomb', '5', '0', 'l4d', '1_pipe_bomb.png', 'Bronze Pyrotechnician'),
('pounce', '5', '0', 'l4d', '1_pounce.png', 'Bronze Free 2 Fly'),
('rescued_survivor', '5', '0', 'l4d', '1_rescued_survivor.png', 'Bronze Ground Cover'),
('revived_teammate', '5', '0', 'l4d', '1_revived_teammate.png', 'Bronze Helping Hand'),
('smoker_claw', '5', '0', 'l4d', '1_smoker_claw.png', 'Bronze Chain Smoker'),
('tank_claw', '5', '0', 'l4d', '1_tank_claw.png', 'Bronze Lambs 2 Slaughter'),
('tongue_grab', '5', '0', 'l4d', '1_tongue_grab.png', 'Bronze Drag &amp; Drop'),
('vomit', '5', '0', 'l4d', '1_vomit.png', 'Bronze Barf Bagged'),
('boomer_claw', '15', '0', 'l4d', '2_boomer_claw.png', 'Silver Boom!'),
('headshot', '15', '0', 'l4d', '2_headshot.png', 'Silver Brain Salad'),
('healed_teammate', '15', '0', 'l4d', '2_healed_teammate.png', 'Silver Field Medic'),
('hunter_claw', '15', '0', 'l4d', '2_hunter_claw.png', 'Silver Grim Reaper'),
('inferno', '15', '0', 'l4d', '2_inferno.png', 'Silver Cremator'),
('killed_exploding', '15', '0', 'l4d', '2_killed_exploding.png', 'Silver Stomach Upset'),
('killed_gas', '15', '0', 'l4d', '2_killed_gas.png', 'Silver Tongue Twister'),
('killed_hunter', '15', '0', 'l4d', '2_killed_hunter.png', 'Silver Hunter Punter'),
('killed_survivor', '15', '0', 'l4d', '2_killed_survivor.png', 'Silver Dead Wreckening'),
('killed_tank', '15', '0', 'l4d', '2_killed_tank.png', 'Silver Tankbuster'),
('killed_witch', '15', '0', 'l4d', '2_killed_witch.png', 'Silver Inquisitor'),
('latency', '15', '0', 'l4d', '2_latency.png', 'Silver Nothing Special'),
('pipe_bomb', '15', '0', 'l4d', '2_pipe_bomb.png', 'Silver Pyrotechnician'),
('pounce', '15', '0', 'l4d', '2_pounce.png', 'Silver Free 2 Fly'),
('rescued_survivor', '15', '0', 'l4d', '2_rescued_survivor.png', 'Silver Ground Cover'),
('revived_teammate', '15', '0', 'l4d', '2_revived_teammate.png', 'Silver Helping Hand'),
('smoker_claw', '15', '0', 'l4d', '2_smoker_claw.png', 'Silver Chain Smoker'),
('tank_claw', '15', '0', 'l4d', '2_tank_claw.png', 'Silver Lambs 2 Slaughter'),
('tongue_grab', '15', '0', 'l4d', '2_tongue_grab.png', 'Silver Drag &amp; Drop'),
('vomit', '15', '0', 'l4d', '2_vomit.png', 'Silver Barf Bagged'),
('boomer_claw', '30', '0', 'l4d', '3_boomer_claw.png', 'Golden Boom!'),
('headshot', '30', '0', 'l4d', '3_headshot.png', 'Golden Brain Salad'),
('healed_teammate', '30', '0', 'l4d', '3_healed_teammate.png', 'Golden Field Medic'),
('hunter_claw', '30', '0', 'l4d', '3_hunter_claw.png', 'Golden Grim Reaper'),
('inferno', '30', '0', 'l4d', '3_inferno.png', 'Golden Cremator'),
('killed_exploding', '30', '0', 'l4d', '3_killed_exploding.png', 'Golden Stomach Upset'),
('killed_gas', '30', '0', 'l4d', '3_killed_gas.png', 'Golden Tongue Twister'),
('killed_hunter', '30', '0', 'l4d', '3_killed_hunter.png', 'Golden Hunter Punter'),
('killed_survivor', '30', '0', 'l4d', '3_killed_survivor.png', 'Golden Dead Wreckening'),
('killed_tank', '30', '0', 'l4d', '3_killed_tank.png', 'Golden Tankbuster'),
('killed_witch', '30', '0', 'l4d', '3_killed_witch.png', 'Golden Inquisitor'),
('latency', '30', '0', 'l4d', '3_latency.png', 'Golden Nothing Special'),
('pipe_bomb', '30', '0', 'l4d', '3_pipe_bomb.png', 'Golden Pyrotechnician'),
('pounce', '30', '0', 'l4d', '3_pounce.png', 'Golden Free 2 Fly'),
('rescued_survivor', '30', '0', 'l4d', '3_rescued_survivor.png', 'Golden Ground Cover'),
('revived_teammate', '30', '0', 'l4d', '3_revived_teammate.png', 'Golden Helping Hand'),
('smoker_claw', '30', '0', 'l4d', '3_smoker_claw.png', 'Golden Chain Smoker'),
('tank_claw', '30', '0', 'l4d', '3_tank_claw.png', 'Golden Lambs 2 Slaughter'),
('tongue_grab', '30', '0', 'l4d', '3_tongue_grab.png', 'Golden Drag &amp; Drop'),
('vomit', '30', '0', 'l4d', '3_vomit.png', 'Golden Barf Bagged'),
('boomer_claw', '50', '0', 'l4d', '4_boomer_claw.png', 'Bloody Boom!'),
('headshot', '50', '0', 'l4d', '4_headshot.png', 'Bloody Brain Salad'),
('healed_teammate', '50', '0', 'l4d', '4_healed_teammate.png', 'Bloody Field Medic'),
('hunter_claw', '50', '0', 'l4d', '4_hunter_claw.png', 'Bloody Grim Reaper'),
('inferno', '50', '0', 'l4d', '4_inferno.png', 'Bloody Cremator'),
('killed_exploding', '50', '0', 'l4d', '4_killed_exploding.png', 'Bloody Stomach Upset'),
('killed_gas', '50', '0', 'l4d', '4_killed_gas.png', 'Bloody Tongue Twister'),
('killed_hunter', '50', '0', 'l4d', '4_killed_hunter.png', 'Bloody Hunter Punter'),
('killed_survivor', '50', '0', 'l4d', '4_killed_survivor.png', 'Bloody Dead Wreckening'),
('killed_tank', '50', '0', 'l4d', '4_killed_tank.png', 'Bloody Tankbuster'),
('killed_witch', '50', '0', 'l4d', '4_killed_witch.png', 'Bloody Inquisitor'),
('latency', '50', '0', 'l4d', '4_latency.png', 'Bloody Nothing Special'),
('pipe_bomb', '50', '0', 'l4d', '4_pipe_bomb.png', 'Bloody Pyrotechnician'),
('pounce', '50', '0', 'l4d', '4_pounce.png', 'Bloody Free 2 Fly'),
('rescued_survivor', '50', '0', 'l4d', '4_rescued_survivor.png', 'Bloody Ground Cover'),
('revived_teammate', '50', '0', 'l4d', '4_revived_teammate.png', 'Bloody Helping Hand'),
('smoker_claw', '50', '0', 'l4d', '4_smoker_claw.png', 'Bloody Chain Smoker'),
('tank_claw', '50', '0', 'l4d', '4_tank_claw.png', 'Bloody Lambs 2 Slaughter'),
('tongue_grab', '50', '0', 'l4d', '4_tongue_grab.png', 'Bloody Drag &amp; Drop'),
('vomit', '50', '0', 'l4d', '4_vomit.png', 'Bloody Barf Bagged');
UPDATE `hlstats_Roles` SET `code` = 'scout' WHERE `code`='Scout' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'sniper' WHERE `code`='Sniper' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'soldier' WHERE `code`='Soldier' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'pyro' WHERE `code`='Pyro' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'hwguy' WHERE `code`='HWGuy' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'spy' WHERE `code`='Spy' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'demoman' WHERE `code`='Demoman' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'engineer' WHERE `code`='Engineer' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'medic' WHERE `code`='Medic' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
UPDATE `hlstats_Roles` SET `code` = 'civilian' WHERE `code`='Civilian' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'ff');
INSERT IGNORE INTO `hlstats_Roles` (`game`, `code`, `name`, `hidden`) VALUES
('l4d', 'NamVet', 'Bill', '0'),
('l4d', 'TeenGirl', 'Zoey', '0'),
('l4d', 'Biker', 'Francis', '0'),
('l4d', 'Manager', 'Louis', '0'),
('l4d', 'GAS', 'Smoker', '0'),
('l4d', 'EXPLODING', 'Boomer', '0'),
('l4d', 'HUNTER', 'Hunter', '0'),
('l4d', 'TANK', 'tank', '0'),
('l4d', 'infected', 'Infected Horde', '0'),
('l4d', 'witch', 'Witch', '0');
ALTER TABLE `hlstats_Servers`
CHANGE `act_map` `act_map` varchar(64) NOT NULL default '',
ADD COLUMN `sortorder` tinyint NOT NULL DEFAULT '0' AFTER `name`;
DROP TABLE `hlstats_server_addons`;
ALTER TABLE `hlstats_server_load`
CHANGE `map` `map` varchar(64) default NULL;
DELETE FROM `hlstats_Servers_Config` WHERE `parameter` = 'AdminContact';
DELETE FROM `hlstats_Servers_Config_Default` WHERE `parameter` = 'AdminContact';
UPDATE `hlstats_Servers_Config_Default` SET `description` = 'Mode of skill changes on frags with following options:\r\n<UL>\r\n<LI>0 = Normal (Victims lose all the points which the killer gains).\r\n<LI>1 = Victims lose 3/4 the points which the killer gains.\r\n<LI>2 = Victims lose 1/2 the points which the killer gains.\r\n<LI>3 = Victims lose 1/4 the points which the killer gains.\r\n<LI>4 = Victims lose no points.\r\n<LI>ZPS-only. Survivor victims lose 1/2, Zombie victims lose 1/4\r\n</UL>' WHERE `parameter` = 'SkillMode';
UPDATE `hlstats_Servers_Config_Default` SET `description` = 'Mode of the current gametype:<UL>\r\n<LI>0 = Normal mod standard (default).\r\n<LI>1 = Deathmatch (only need to set if team names are NOT "Unassigned" during deathmatch (ie. in CSS Deathmatch).</UL>' WHERE `parameter` = 'GameType';
DELETE FROM `hlstats_Teams` WHERE `code` IN ('Spectator','Spectators','Unassigned','#FF_TEAM_UNASSIGNED');
UPDATE `hlstats_Teams` SET `code` = 'Spectator' WHERE `code`='Spectators' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod');
INSERT IGNORE INTO `hlstats_Teams` (`game`, `code`, `name`, `hidden`, `playerlist_bgcolor`, `playerlist_color`, `playerlist_index`) VALUES
('l4d', 'Survivor', 'Survivors', '0', '#E0E4E5', '#4B6168', 1),
('l4d', 'Infected', 'Infected', '0', '#E5D5D5', '#68090B', 2),
('fof', 'DESPERADOS', 'Desparados', '0', '#D2E8F7','#0080C0', 1),
('fof', 'VIGILANTES', 'Vigilantes', '0', '#FFD5D5','#FF2D2D', 2),
('ges', 'MI6', 'MI6', '0', '#D2E8F7','#0080C0', 1),
('ges', 'Janus', 'Janus', '0', '#FFD5D5','#FF2D2D', 2);
UPDATE `hlstats_Weapons` SET `code` = 'weapon_fnfal' WHERE `code`='weapon_fnfa1' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'insmod');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`) VALUES
('zps', 'winchester','Winchester Double Barreled Shotgun',1),
('l4d', 'rifle', 'M16 Assault Rifle', 1.00),
('l4d', 'autoshotgun', 'Auto Shotgun', 1.00),
('l4d', 'pumpshotgun', 'Pump Shotgun', 1.30),
('l4d', 'smg', 'Uzi', 1.20),
('l4d', 'dual_pistols', 'Dual Pistols', 1.60),
('l4d', 'pipe_bomb', 'Pipe Bomb', 1.00),
('l4d', 'hunting_rifle', 'Hunting Rifle', 1.00),
('l4d', 'pistol', 'Pistol', 2.00),
('l4d', 'prop_minigun', 'Mounted Machine Gun', 1.20),
('l4d', 'tank_claw', 'Tank\'s Claws', 3.00),
('l4d', 'hunter_claw', 'Hunter\'s Claws', 3.00),
('l4d', 'smoker_claw', 'Smoker\'s Claws', 3.00),
('l4d', 'boomer_claw', 'Boomer\'s Claws', 3.00),
('l4d', 'inferno', 'Molotov/Gas Can Fire', 1.20),
('l4d', 'pipe_bomb', 'Pipe Bomb/Explosion', 0.80),
('l4d', 'infected', 'Infected Horde', 1.00),
('l4d', 'witch', 'Witch\'s Claws', 1.00),
('l4d', 'first_aid_kit', 'First Aid Kit Smash', 1.5),
('l4d', 'entityflame', 'Blaze', 3),
('l4d', 'gascan', 'Gas Can Smash', 1.5),
('l4d', 'molotov', 'Molotov Smash', 1.5),
('l4d', 'pain_pills', 'Pain Pills Smash', 1.5),
('l4d', 'player', 'Player', 1),
('l4d', 'propanetank', 'Propane Tank Smash', 1.5),
('l4d', 'tank_rock', 'Tank\'s Rock', 1.5),
('l4d', 'oxygentank', 'Oxygen Tank Smash', 1.5),
('l4d', 'world', 'World', 1),
('l4d', 'prop_physics', 'Prop Physics', 1),
('fof', 'deringer', 'Deringer', 1),
('fof', 'carbine', 'Carbine', 1),
('fof', 'coltnavy', 'Colt Navy', 1),
('fof', 'bow', 'Bow', 1),
('fof', 'arrow', 'Arrow', 1),
('fof', 'sharps', 'Sharps', 1),
('fof', 'coachgun', 'Coach Gun', 1),
('fof', 'peacemaker', 'Peacemaker', 1),
('fof', 'knife', 'Knife', 2),
('fof', 'physics', 'Exploding Barrel', 1),
('fof', 'dualderinger', 'Dual Deringers', 1),
('fof', 'thrown_axe', 'Thrown Axe', 3),
('fof', 'arrow_fiery', 'Fire Arrow', 2),
('fof', 'thrown_knife', 'Thrown Knife', 3),
('fof', 'dualnavy', 'Dual Colt Navys', 1),
('fof', 'dynamite', 'Dynamite', 3),
('fof', 'explosive_arrow', 'Explosive Arrow', 2),
('fof', 'fists', 'Fists', 2),
('fof', 'axe', 'Axe', 2),
('fof', 'dualpeacemaker', 'Dual Peacemakers', 1),
('fof', 'henryrifle', 'Henry Rifle', 1),
('ges', '#GE_ProximityMine', 'Proximity Mines', 1),
('ges', '#GE_AutoShotgun', 'Automatic Shotgun', 1),
('ges', '#GE_Phantom', 'Phantom', 1),
('ges', '#GE_Knife', 'Hunting Knife', 1),
('ges', '#GE_D5K', 'D5K Deutsche', 1),
('ges', '#GE_SilverPP7', 'Silver PP7', 1),
('ges', '#GE_DD44', 'DD44', 1),
('ges', '#GE_Grenade', 'Grenade', 1),
('ges', '#GE_CougarMagnum', 'Cougar Magnum', 1),
('ges', '#GE_D5K_SILENCED', 'D5K (Silenced)', 1),
('ges', '#GE_Shotgun', 'Shotgun', 1),
('ges', '#GE_Klobb', 'Klobb', 1),
('ges', '#GE_RCP90', 'RC-P90', 1),
('ges', '#GE_RemoteMine', 'Remote Mines', 1),
('ges', '#GE_KF7Soviet', 'KF7 Soviet', 1),
('ges', '#GE_ZMG', 'ZMG', 1),
('ges', '#GE_SniperRifle', 'Sniper Rifle', 1),
('ges', '#GE_GoldPP7', 'Golden PP7', 1),
('ges', '#GE_AR33', 'US AR33 Assault', 1),
('ges', '#GE_GoldenGun', 'Golden Gun', 1),
('ges', '#GE_ThrowingKnife', 'Throwing Knives', 1),
('ges', '#GE_PP7', 'PP7', 1),
('ges', '#GE_PP7_SILENCED', 'PP7 (Silenced)', 1),
('ges', '#GE_TimedMine', 'Timed Mines', 1),
('ges', '#GE_MilitaryLaser', 'Military Laser', 1),
('ges', '#GE_GrenadeLauncher', 'Grenade Launcher', 1),
('ges', '#GE_Rocket', 'Rocket Launcher', 1),
('ges', '#GE_Taser', 'Taser', 1),
('ges', '#GE_SniperButt', 'Sniper Butt', 1),
('ges', '#GE_Slapper', 'Slappers', 1),
('ges', '#GE_RocketLauncher', 'Rocket Launcher', 1);

View File

@ -0,0 +1,216 @@
DELETE FROM `hlstats_Ribbons` WHERE game = 'tf';
INSERT INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`) VALUES
('tf_projectile_rocket',1,0,'tf','1_tf_projectile_rocket.png','Bronze Rocket Launcher'),
('tf_projectile_rocket',5,0,'tf','2_tf_projectile_rocket.png','Silver Rocket Launcher'),
('tf_projectile_rocket',10,0,'tf','3_tf_projectile_rocket.png','Gold Rocket Launcher'),
('sniperrifle',1,0,'tf','1_sniperrifle.png','Bronze Sniper Rifle'),
('sniperrifle',5,0,'tf','2_sniperrifle.png','Silver Sniper Rifle'),
('sniperrifle',10,0,'tf','3_sniperrifle.png','Gold Sniper Rifle'),
('minigun',1,0,'tf','1_minigun.png','Bronze Minigun'),
('minigun',5,0,'tf','2_minigun.png','Silver Minigun'),
('minigun',10,0,'tf','3_minigun.png','Gold Minigun'),
('obj_sentrygun',1,0,'tf','1_obj_sentrygun.png','Bronze Sentry Gun'),
('obj_sentrygun',5,0,'tf','2_obj_sentrygun.png','Silver Sentry Gun'),
('obj_sentrygun',10,0,'tf','3_obj_sentrygun.png','Gold Sentry Gun'),
('knife',1,0,'tf','1_knife.png','Bronze Knife'),
('knife',5,0,'tf','2_knife.png','Silver Knife'),
('knife',10,0,'tf','3_knife.png','Gold Knife'),
('scattergun',1,0,'tf','1_scattergun.png','Bronze Scatter Gun'),
('scattergun',5,0,'tf','2_scattergun.png','Silver Scatter Gun'),
('scattergun',10,0,'tf','3_scattergun.png','Gold Scatter Gun'),
('tf_projectile_pipe',1,0,'tf','1_tf_projectile_pipe.png','Bronze Grenade Launcher'),
('tf_projectile_pipe',5,0,'tf','2_tf_projectile_pipe.png','Silver Grenade Launcher'),
('tf_projectile_pipe',10,0,'tf','3_tf_projectile_pipe.png','Gold Grenade Launcher'),
('flamethrower',1,0,'tf','1_flamethrower.png','Bronze Flamethrower'),
('flamethrower',5,0,'tf','2_flamethrower.png','Silver Flamethrower'),
('flamethrower',10,0,'tf','3_flamethrower.png','Gold Flamethrower'),
('tf_projectile_pipe_remote',1,0,'tf','1_tf_projectile_pipe_remote.png','Bronze Sticky Launcher'),
('tf_projectile_pipe_remote',5,0,'tf','2_tf_projectile_pipe_remote.png','Silver Sticky Launcher'),
('tf_projectile_pipe_remote',10,0,'tf','3_tf_projectile_pipe_remote.png','Gold Sticky Launcher'),
('shotgun_primary',1,0,'tf','1_shotgun_primary.png','Bronze Engy Shotgun'),
('shotgun_primary',5,0,'tf','2_shotgun_primary.png','Silver Engy Shotgun'),
('shotgun_primary',10,0,'tf','3_shotgun_primary.png','Gold Engy Shotgun'),
('smg',1,0,'tf','1_smg.png','Bronze Submachine Gun'),
('smg',5,0,'tf','2_smg.png','Silver Submachine Gun'),
('smg',10,0,'tf','3_smg.png','Gold Submachine Gun'),
('shotgun_soldier',1,0,'tf','1_shotgun_soldier.png','Bronze Soldier Shotgun'),
('shotgun_soldier',5,0,'tf','2_shotgun_soldier.png','Silver Soldier Shotgun'),
('shotgun_soldier',10,0,'tf','3_shotgun_soldier.png','Gold Soldier Shotgun'),
('revolver',1,0,'tf','1_revolver.png','Bronze Revolver'),
('revolver',5,0,'tf','2_revolver.png','Silver Revolver'),
('revolver',10,0,'tf','3_revolver.png','Gold Revolver'),
('shotgun_pyro',1,0,'tf','1_shotgun_pyro.png','Bronze Pyro Shotgun'),
('shotgun_pyro',5,0,'tf','2_shotgun_pyro.png','Silver Pyro Shotgun'),
('shotgun_pyro',10,0,'tf','3_shotgun_pyro.png','Gold Pyro Shotgun'),
('bat',1,0,'tf','1_bat.png','Bronze Bat'),
('bat',5,0,'tf','2_bat.png','Silver Bat'),
('bat',10,0,'tf','3_bat.png','Gold Bat'),
('wrench',1,0,'tf','1_wrench.png','Bronze Wrench'),
('wrench',5,0,'tf','2_wrench.png','Silver Wrench'),
('wrench',10,0,'tf','3_wrench.png','Gold Wrench'),
('shotgun_hwg',1,0,'tf','1_shotgun_hwg.png','Bronze Heavy Shotgun'),
('shotgun_hwg',5,0,'tf','2_shotgun_hwg.png','Silver Heavy Shotgun'),
('shotgun_hwg',10,0,'tf','3_shotgun_hwg.png','Gold Heavy Shotgun'),
('club',1,0,'tf','1_club.png','Bronze Machete'),
('club',5,0,'tf','2_club.png','Silver Machete'),
('club',10,0,'tf','3_club.png','Gold Machete'),
('pistol_scout',1,0,'tf','1_pistol_scout.png','Bronze Scout Pistol'),
('pistol_scout',5,0,'tf','2_pistol_scout.png','Silver Scout Pistol'),
('pistol_scout',10,0,'tf','3_pistol_scout.png','Gold Scout Pistol'),
('pistol',1,0,'tf','1_pistol.png','Bronze Engy Pistol'),
('pistol',5,0,'tf','2_pistol.png','Silver Engy Pistol'),
('pistol',10,0,'tf','3_pistol.png','Gold Engy Pistol'),
('bottle',1,0,'tf','1_bottle.png','Bronze Bottle'),
('bottle',5,0,'tf','2_bottle.png','Silver Bottle'),
('bottle',10,0,'tf','3_bottle.png','Gold Bottle'),
('shovel',1,0,'tf','1_shovel.png','Bronze Shovel'),
('shovel',5,0,'tf','2_shovel.png','Silver Shovel'),
('shovel',10,0,'tf','3_shovel.png','Gold Shovel'),
('fireaxe',1,0,'tf','1_fireaxe.png','Bronze Fire Axe'),
('fireaxe',5,0,'tf','2_fireaxe.png','Silver Fire Axe'),
('fireaxe',10,0,'tf','3_fireaxe.png','Gold Fire Axe'),
('fists',1,0,'tf','1_fists.png','Bronze Fists'),
('fists',5,0,'tf','2_fists.png','Silver Fists'),
('fists',10,0,'tf','3_fists.png','Gold Fists'),
('ubersaw',1,0,'tf','1_ubersaw.png','Bronze Ubersaw'),
('ubersaw',5,0,'tf','2_ubersaw.png','Silver Ubersaw'),
('ubersaw',10,0,'tf','3_ubersaw.png','Gold Ubersaw'),
('blutsauger',1,0,'tf','1_blutsauger.png','Bronze Blutsauger'),
('blutsauger',5,0,'tf','2_blutsauger.png','Silver Blutsauger'),
('blutsauger',10,0,'tf','3_blutsauger.png','Gold Blutsauger'),
('axtinguisher',1,0,'tf','1_axtinguisher.png','Bronze Axtinguisher'),
('axtinguisher',5,0,'tf','2_axtinguisher.png','Silver Axtinguisher'),
('axtinguisher',10,0,'tf','3_axtinguisher.png','Gold Axtinguisher'),
('deflect_flare',1,0,'tf','1_deflect_flare.png','Bronze Deflected Flare'),
('deflect_flare',5,0,'tf','2_deflect_flare.png','Silver Deflected Flare'),
('deflect_flare',10,0,'tf','3_deflect_flare.png','Gold Deflected Flare'),
('syringegun_medic',1,0,'tf','1_syringegun_medic.png','Bronze Syringe Gun'),
('syringegun_medic',5,0,'tf','2_syringegun_medic.png','Silver Syringe Gun'),
('syringegun_medic',10,0,'tf','3_syringegun_medic.png','Gold Syringe Gun'),
('bonesaw',1,0,'tf','1_bonesaw.png','Bronze Bonesaw'),
('bonesaw',5,0,'tf','2_bonesaw.png','Silver Bonesaw'),
('bonesaw',10,0,'tf','3_bonesaw.png','Gold Bonesaw'),
('deflect_promode',1,0,'tf','1_deflect_promode.png','Bronze Deflected Grenade'),
('deflect_promode',5,0,'tf','2_deflect_promode.png','Silver Deflected Grenade'),
('deflect_promode',10,0,'tf','3_deflect_promode.png','Gold Deflected Grenade'),
('deflect_rocket',1,0,'tf','1_deflect_rocket.png','Bronze Deflected Rocket'),
('deflect_rocket',5,0,'tf','2_deflect_rocket.png','Silver Deflected Rocket'),
('deflect_rocket',10,0,'tf','3_deflect_rocket.png','Gold Deflected Rocket'),
('deflect_sticky',1,0,'tf','1_deflect_sticky.png','Bronze Deflected Sticky'),
('deflect_sticky',5,0,'tf','2_deflect_sticky.png','Silver Deflected Sticky'),
('deflect_sticky',10,0,'tf','3_deflect_sticky.png','Gold Deflected Sticky'),
('flaregun',1,0,'tf','1_flaregun.png','Bronze Flare Gun'),
('flaregun',5,0,'tf','2_flaregun.png','Silver Flare Gun'),
('flaregun',10,0,'tf','3_flaregun.png','Gold Flare Gun'),
('natascha',1,0,'tf','1_natascha.png','Bronze Natascha'),
('natascha',5,0,'tf','2_natascha.png','Silver Natascha'),
('natascha',10,0,'tf','3_natascha.png','Gold Natascha'),
('gloves',1,0,'tf','1_gloves.png','Bronze K.G.B.'),
('gloves',5,0,'tf','2_gloves.png','Silver K.G.B.'),
('gloves',10,0,'tf','3_gloves.png','Gold K.G.B.'),
('taunt_heavy',1,0,'tf','1_taunt_heavy.png','Bronze Heavy Taunt'),
('taunt_heavy',5,0,'tf','2_taunt_heavy.png','Silver Heavy Taunt'),
('taunt_heavy',10,0,'tf','3_taunt_heavy.png','Gold Heavy Taunt'),
('taunt_pyro',1,0,'tf','1_taunt_pyro.png','Bronze Hadouken'),
('taunt_pyro',5,0,'tf','2_taunt_pyro.png','Silver Hadouken'),
('taunt_pyro',10,0,'tf','3_taunt_pyro.png','Gold Hadouken'),
('chargedeployed',1,0,'tf','1_chargedeployed.png','Bronze Uber'),
('chargedeployed',5,0,'tf','2_chargedeployed.png','Silver Uber'),
('chargedeployed',10,0,'tf','3_chargedeployed.png','Gold Uber'),
('sandvich',1,0,'tf','1_sandvich.png','Bronze Sandvich'),
('sandvich',5,0,'tf','2_sandvich.png','Silver Sandvich'),
('sandvich',10,0,'tf','3_sandvich.png','Gold Sandvich'),
('domination',1,0,'tf','1_domination.png','Bronze Dominator'),
('domination',5,0,'tf','2_domination.png','Silver Dominator'),
('domination',10,0,'tf','3_domination.png','Gold Dominator'),
('revenge',1,0,'tf','1_revenge.png','Bronze Revenger'),
('revenge',5,0,'tf','2_revenge.png','Silver Revenger'),
('revenge',10,0,'tf','3_revenge.png','Gold Revenger'),
('mostkills',1,0,'tf','1_mostkills.png','Bronze Kill Award'),
('mostkills',5,0,'tf','2_mostkills.png','Silver Kill Award'),
('mostkills',10,0,'tf','3_mostkills.png','Gold Kill Award'),
('backstab',1,0,'tf','1_backstab.png','Bronze Backstabber'),
('backstab',5,0,'tf','2_backstab.png','Silver Backstabber'),
('backstab',10,0,'tf','3_backstab.png','Gold Backstabber'),
('pointcaptured',1,0,'tf','1_pointcaptured.png','Bronze Capture Point'),
('pointcaptured',5,0,'tf','2_pointcaptured.png','Silver Capture Point'),
('pointcaptured',10,0,'tf','3_pointcaptured.png','Gold Capture Point'),
('captureblocked',1,0,'tf','1_captureblocked.png','Bronze Blocker'),
('captureblocked',5,0,'tf','2_captureblocked.png','Silver Blocker'),
('captureblocked',10,0,'tf','3_captureblocked.png','Gold Blocker'),
('flagevent_defended',1,0,'tf','1_flagevent_defended.png','Bronze Defender'),
('flagevent_defended',5,0,'tf','2_flagevent_defended.png','Silver Defender'),
('flagevent_defended',10,0,'tf','3_flagevent_defended.png','Gold Defender'),
('flagevent_captured',1,0,'tf','1_flagevent_captured.png','Bronze Intelligence'),
('flagevent_captured',5,0,'tf','2_flagevent_captured.png','Silver Intelligence'),
('flagevent_captured',10,0,'tf','3_flagevent_captured.png','Gold Intelligence'),
('kill assist',1,0,'tf','1_kill assist.png','Bronze Assister'),
('kill assist',5,0,'tf','2_kill assist.png','Silver Assister'),
('kill assist',10,0,'tf','3_kill assist.png','Gold Assister'),
('bonuspoints',1,0,'tf','1_bonuspoints.png','Bronze Healer'),
('bonuspoints',5,0,'tf','2_bonuspoints.png','Silver Healer'),
('bonuspoints',10,0,'tf','3_bonuspoints.png','Gold Healer'),
('kill_assist_medic',1,0,'tf','1_kill_assist_medic.png','Bronze Healer'),
('kill_assist_medic',5,0,'tf','2_kill_assist_medic.png','Silver Healer'),
('kill_assist_medic',10,0,'tf','3_kill_assist_medic.png','Gold Healer'),
('builtobject_obj_attachment_sapper',1,0,'tf','1_builtobject_obj_attachement_sapper.png','Bronze Sapper'),
('builtobject_obj_attachment_sapper',5,0,'tf','2_builtobject_obj_attachement_sapper.png','Silver Sapper'),
('builtobject_obj_attachment_sapper',10,0,'tf','3_builtobject_obj_attachement_sapper.png','Gold Sapper');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('W','tf','tf_projectile_pipe_remote','Remote Demolition Man','pipe bomb kills'),
('W','tf','tf_projectile_pipe','Demolition Man','pipe bomb kills'),
('W','tf','sniperrifle','Top Sniper','snipings'),
('W','tf','smg','Submachine gun','smg kills'),
('W','tf','shotgun_soldier','Shotgun Soldier','shotgun kills'),
('W','tf','shotgun_pyro','Shotgun Pyro','shotgun kills'),
('W','tf','shotgun_primary','Shotgun','shotgun kills'),
('W','tf','scattergun','Fast and Furious','scattergun kills'),
('W','tf','revolver','Wayne','revolver kills'),
('W','tf','pistol','Pistol','pistol kills'),
('W','tf','obj_sentrygun','Engineer','sentry kills'),
('W','tf','minigun','Terminator','minigun kills'),
('W','tf','knife','Stabber','knifings'),
('W','tf','flamethrower','Pyro','flame burnings'),
('W','tf','bat','Baseball freak','bat kills'),
('O','tf','pointcaptured','Capturer','checkpoint captures'),
('O','tf','kill assist','Assistance','kill assists'),
('O','tf','captureblocked','Blocker','checkpoint blockings'),
('O','tf','chargedeployed','Ubermedic','deployed charges'),
('W','tf','latency','Best Latency','ms average connection'),
('W','tf','tf_projectile_rocket','Soldier','rocket kills'),
('W','tf','wrench','Engineer on Rage','wrench kills'),
('W','tf','shovel','Grave Digger','shovel kills'),
('W','tf','fireaxe','Axe-O-Mania','axe kills'),
('W','tf','bottle','Drunken Demoman','bottle kills'),
('W','tf','bonesaw','The Saw','sawed bones'),
('W','tf','fists','Fisting king','fistings'),
('W','tf','club','Now that\'s a knife','machete kills'),
('W','tf','pistol_scout','Scout Pistol','pistol kills'),
('W','tf','shotgun_hwg','Shotgun Heavy','shotgun kills'),
('W','tf','syringegun_medic','The Injector','syringe kills'),
('W','tf','axtinguisher', 'Axtinguisher', 'kills with the axtinguisher'),
('W','tf','backburner', 'Backburner', 'burned backs'),
('W','tf','blutsauger', 'Blutsauger', 'times sucked blood'),
('W','tf','flaregun', 'Flare Gun', 'flare gun kills'),
('W','tf','gloves', 'Heavy surgery', 'KGB kills'),
('W','tf','natascha', 'Nataschas Friend', 'Natascha kills'),
('W','tf','ubersaw', 'Ubersaw', 'kills with ubersaw'),
('W','tf','deflect_flare', 'Deflected Flare', 'kills with deflected flare'),
('W','tf','deflect_promode', 'Deflected Grenade', 'kills with deflected grenade'),
('W','tf','deflect_rocket', 'Deflected Rocket', 'kills with deflected rocket'),
('W','tf','deflect_sticky', 'Deflected Sticky', 'kills with deflected sticky'),
('W','tf','taunt_heavy', 'POW! Ha Ha', 'kills with heavy taunt'),
('W','tf','taunt_pyro', 'Hadouken', 'kills with Hadouken'),
('W','tf','mostkills','Most Kills','kills'),
('W','tf','bonuspoints','Most Bonus Points','bonus points'),
('O','tf', 'sandvich', 'Hungry Hungry Heavy', 'sandviches eaten'),
('O','tf', 'backstab', 'Backstabber', 'backstabs'),
('O','tf','flagevent_defended','Defender of the Flag','flag defenses'),
('O','tf','flagevent_captured','The Mad Capper','flag captures'),
('O','tf','killedobject_obj_dispenser','NO METAL FOR YOU!','dispensers destroyed'),
('O','tf','killedobject_obj_sentrygun','Say no to sentries','sentry guns destroyed'),
('O','tf','builtobject_obj_sentrygun','Bob the Builder','sentry guns built'),
('O','tf','builtobject_obj_attachment_sapper','Super Sapper','sappers placed'),
('O','tf','kill_assist_medic','Medic Assistance','medic assists');

View File

@ -0,0 +1,4 @@
UPDATE
hlstats_PlayerUniqueIds
SET
uniqueId = replace(uniqueId, 'STEAM_1:',''), uniqueId = replace(uniqueId, 'STEAM_0:','');

View File

@ -0,0 +1,46 @@
ALTER TABLE `hlstats_Actions`
CHANGE `description` `description` varchar(128) default NULL;
ALTER TABLE `hlstats_Events_Admin`
CHANGE `type` `type` varchar(64) NOT NULL default 'Unknown',
CHANGE `message` `message` varchar(128) NOT NULL default '',
CHANGE `playerName` `playerName` varchar(64) NOT NULL default '';
ALTER TABLE `hlstats_Events_ChangeName`
CHANGE `oldName` `oldName` varchar(64) NOT NULL default '',
CHANGE `newName` `newName` varchar(64) NOT NULL default '',
ADD KEY `playerId` (`playerId`);
ALTER TABLE `hlstats_Events_ChangeRole`
ADD KEY `playerId` (`playerId`);
ALTER TABLE `hlstats_Events_ChangeTeam`
ADD KEY `playerId` (`playerId`);
ALTER TABLE `hlstats_Events_Chat`
CHANGE `message` `message` varchar(128) NOT NULL default '';
ALTER TABLE `hlstats_Events_PlayerPlayerActions`
ADD KEY `playerId` (`playerId`);
ALTER TABLE `hlstats_Events_Statsme2`
ADD KEY `weapon` (`weapon`);
ALTER TABLE `hlstats_Events_Suicides`
ADD KEY `playerId` (`playerId`);
ALTER TABLE `hlstats_Events_Teamkills`
ADD KEY `killerId` (`killerId`);
ALTER TABLE `hlstats_Options`
CHANGE `keyname` `keyname` varchar(32) NOT NULL default '',
CHANGE `value` `value` varchar(128) NOT NULL default '';
ALTER TABLE `hlstats_Options_Choices`
CHANGE `keyname` `keyname` varchar(32) NOT NULL;
ALTER TABLE `hlstats_Players`
CHANGE `lastName` `lastName` varchar(64) NOT NULL default '';
ALTER TABLE `hlstats_PlayerUniqueIds`
CHANGE `uniqueId` `uniqueId` varchar(64) NOT NULL default '';

View File

@ -0,0 +1,14 @@
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('W','cstrike','grenade','Grenadier','kills with grenade');
UPDATE `hlstats_Options` SET `opttype` = 2 WHERE `keyname` IN ('awards_d_date','awards_numdays');
INSERT IGNORE INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`) VALUES
('killed_a_hostage',5,0,'cstrike','1_killed_a_hostage.png','Award of Hostage Killing'),
('rescued_a_hostage',5,0,'cstrike','1_rescued_a_hostage.png','Award of Hostage Rescue'),
('planted_the_bomb',5,0,'cstrike','1_planted_the_bomb.png','Award of Planting the Bomb'),
('grenade',5,0,'cstrike','1_grenade.png','Award of Grenade'),
('defused_the_bomb',5,0,'cstrike','1_defused_the_bomb.png','Award of Defusing');
UPDATE `hlstats_Servers_Config_Default` SET `description` = 'If enabled, bots are not tracked 1=on 0=off(default).' WHERE `parameter` = 'IgnoreBots';
UPDATE `hlstats_Servers_Config_Default` SET `description` = 'Valid values are SOURCEMOD, MINISTATS, BEETLE, MANI, and AMXX if one of such plugins are installed.' WHERE `parameter` = 'Mod';

View File

@ -0,0 +1,97 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`) VALUES
('tf', 'first_blood', 1, 0, '', 'First Blood', '1', '', '', ''),
('tf', 'steal_sandvich', 2, 0, '', 'Steal Sandvich', '', '1', '', ''),
('tf', 'stun', 0, 0, '', 'Stun', '', '1', '', ''),
('tfc','Capture Point 1',2,5,'1','Captured Point 1','1','0','0','0'),
('tfc','Capture Point 2',2,5,'1','Captured Point 2','1','0','0','0'),
('tfc','Capture Point 3',2,5,'1','Captured Point 3','1','0','0','0'),
('tfc','headshot',1,0,'0','Headshot Kill','1','0','0','0'),
('ges', 'headshot', 1, 0, '', 'Headshot Kill', '1', '', '', '');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',`code`,'taunt_scout','Home Run King','grand slams' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',`code`,'bat_wood','Mr. Sandman','kills with the Sandman' FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',`code`,'stun','Absolutely Stunning','stuns' FROM `hlstats_Games` WHERE `realgame` = 'tf');
UPDATE IGNORE `hlstats_Awards` SET `code` = 'builtobject_obj_attachment_sapper' WHERE `code` = 'builtobject_obj_attachement_sapper';
DELETE FROM `hlstats_Awards` WHERE `code` = 'builtobject_obj_attachement_sapper';
ALTER TABLE `hlstats_Events_Entries`
ADD KEY `playerId` (`playerId`);
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`)
(SELECT `code`, 'ConnectAnnounce','1' FROM `hlstats_Games`);
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`)
(SELECT `code`, 'UpdateHostname','1' FROM `hlstats_Games`);
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`)
(SELECT `code`, 'DefaultDisplayEvents','1' FROM `hlstats_Games`);
UPDATE `hlstats_Games_Defaults` SET `value` = 0 WHERE `code` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'l4d');
ALTER TABLE `hlstats_Livestats`
CHANGE `cli_city` `cli_city` varchar(64) NOT NULL default '',
CHANGE `cli_country` `cli_country` varchar(64) NOT NULL default '',
CHANGE `cli_state` `cli_state` varchar(64) NOT NULL default '',
CHANGE `steam_id` `steam_id` varchar(64) NOT NULL default '',
CHANGE `name` `name` varchar(64) NOT NULL;
INSERT IGNORE INTO `hlstats_Options` (`keyname`, `value`, `opttype`) VALUES
('dbversion', '1.5.3', 2);
ALTER TABLE `hlstats_PlayerNames`
CHANGE `name` `name` varchar(64) NOT NULL default '';
UPDATE IGNORE `hlstats_Ribbons` SET `awardCode` = 'builtobject_obj_attachment_sapper' WHERE `awardCode` = 'builtobject_obj_attachement_sapper';
UPDATE IGNORE `hlstats_Ribbons` SET `image` = replace(image, 'attachement','attachment') WHERE `image` LIKE '%attachement%';
ALTER TABLE `hlstats_Roles`
CHANGE `name` `name` varchar(64) NOT NULL default '';
INSERT IGNORE INTO `hlstats_Roles` (`game`, `code`, `name`, `hidden`) VALUES
('ges', 'jaws', 'Jaws', '0'),
('ges', 'bond', 'Bond', '0'),
('ges', 'boris', 'Boris', '0'),
('ges', 'Mayday', 'May Day', '0'),
('ges', 'Mishkin', 'Mishkin', '0'),
('ges', 'oddjob', 'Oddjob', '0'),
('ges', 'ourumov', 'Ourumov', '0'),
('ges', 'samedi', 'Samedi', '0'),
('ges', 'valentin', 'Valentin', '0');
ALTER TABLE `hlstats_Servers`
CHANGE `city` `city` varchar(64) NOT NULL default '',
CHANGE `country` `country` varchar(64) NOT NULL default '';
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverid`, `parameter`, `value`)
(SELECT `serverId`, 'ConnectAnnounce','1' FROM `hlstats_Servers`);
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverid`, `parameter`, `value`)
(SELECT `serverId`, 'UpdateHostname','1' FROM `hlstats_Servers`);
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverid`, `parameter`, `value`)
(SELECT `serverId`, 'DefaultDisplayEvents','1' FROM `hlstats_Servers`);
INSERT IGNORE INTO `hlstats_Servers_Config_Default` (`parameter`, `value`, `description`) VALUES
('ConnectAnnounce', '1', 'Toggle display of message upon each player connect showing player points/kills, rank, and country of origin. 1=on(default) 0=off'),
('UpdateHostname', '1', 'Toggles auto-update of server name from hostname cvar 1=on(default) 0=off'),
('DefaultDisplayEvents', '1', 'Toggle players default option to see kill/event messages on server. 1=on(default) 0=off');
UPDATE `hlstats_Weapons` SET `name` = 'Sentry Gun (Level 1)' WHERE `code` = 'obj_sentrygun' AND `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT `code`, 'taunt_scout', 'Grand Slam', 3 FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT `code`, 'bat_wood', 'The Sandman', 1.75 FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT `code`, 'obj_sentrygun2', 'Sentry Gun (Level 2)', 3 FROM `hlstats_Games` WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT `code`, 'obj_sentrygun3', 'Sentry Gun (Level 3)', 3 FROM `hlstats_Games` WHERE `realgame` = 'tf');

View File

@ -0,0 +1,489 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`) VALUES
('bg2', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', ''),
('bg2', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', ''),
('bg2', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', ''),
('bg2', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', ''),
('bg2', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', ''),
('bg2', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', ''),
('bg2', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', ''),
('bg2', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', ''),
('bg2', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', ''),
('bg2', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', ''),
('bg2', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', ''),
('sgtls', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', ''),
('sgtls', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', ''),
('sgtls', 'Goa\'uld_Win', 5, 0, '', 'Goa\'uld Won Round', '', '', '1', ''),
('sgtls', 'Tau\'ri_Win', 5, 0, '', 'Tau\'ri Won Round', '', '', '1', ''),
('dystopia', 'kill_streak_2', 1, 0, '', 'Double Kill (2 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_3', 2, 0, '', 'Triple Kill (3 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_4', 3, 0, '', 'Domination (4 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_5', 4, 0, '', 'Rampage (5 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_6', 5, 0, '', 'Mega Kill (6 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_7', 6, 0, '', 'Ownage (7 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_8', 7, 0, '', 'Ultra Kill (8 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_9', 8, 0, '', 'Killing Spree (9 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_10', 9, 0, '', 'Monster Kill (10 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_11', 10, 0, '', 'Unstoppable (11 kills)', '1', '', '', ''),
('dystopia', 'kill_streak_12', 11, 0, '', 'God Like (12+ kills)', '1', '', '', ''),
('dystopia', 'Capture Guard Post', 2, 0, '', 'Capture Guard Post', '1', '', '', ''),
('dystopia', 'Capture Interior Spawn', 2, 0, '', 'Capture Interior Spawn', '1', '', '', ''),
('dystopia', 'Capture Internal Spawn', 2, 0, '', 'Capture Internal Spawn', '1', '', '', ''),
('dystopia', 'Capture The Docks', 2, 0, '', 'Capture The Docks', '1', '', '', ''),
('dystopia', 'Capture the Inner Base', 2, 0, '', 'Capture the Inner Base', '1', '', '', ''),
('dystopia', 'Capture the Spawn', 2, 0, '', 'Capture the Spawn', '1', '', '', ''),
('dystopia', 'Cut Entrance Spawn Power', 2, 0, '', 'Cut Entrance Spawn Power', '1', '', '', ''),
('dystopia', 'Defend Interior Spawn', 2, 0, '', 'Defend Interior Spawn', '1', '', '', ''),
('dystopia', 'Defend Middle Spawn', 2, 0, '', 'Defend Middle Spawn', '1', '', '', ''),
('dystopia', 'Defend Security JIP', 2, 0, '', 'Defend Security JIP', '1', '', '', ''),
('dystopia', 'Destroy Broadcast Server', 2, 0, '', 'Destroy Broadcast Server', '1', '', '', ''),
('dystopia', 'Destroy Cooling Access Door', 2, 0, '', 'Destroy Cooling Access Door', '1', '', '', ''),
('dystopia', 'Destroy Cooling Tank', 2, 0, '', 'Destroy Cooling Tank', '1', '', '', ''),
('dystopia', 'Destroy The Bulkhead', 2, 0, '', 'Destroy The Bulkhead', '1', '', '', ''),
('dystopia', 'Destroy The Core', 2, 0, '', 'Destroy The Core', '1', '', '', ''),
('dystopia', 'Destroy the Firewall', 2, 0, '', 'Destroy the Firewall', '1', '', '', ''),
('dystopia', 'Destroy the Reactor', 2, 0, '', 'Destroy the Reactor', '1', '', '', ''),
('dystopia', 'Destroy Transformer', 2, 0, '', 'Destroy Transformer', '1', '', '', ''),
('dystopia', 'Enable Auxilary Power Feed', 2, 0, '', 'Enable Auxilary Power Feed', '1', '', '', ''),
('dystopia', 'Enable The 4-Point Override', 2, 0, '', 'Enable The 4-Point Override', '1', '', '', ''),
('dystopia', 'Escort Hostage', 2, 0, '', 'Escort Hostage', '1', '', '', ''),
('dystopia', 'Hack Middle Spawn', 2, 0, '', 'Hack Middle Spawn', '1', '', '', ''),
('dystopia', 'Hack Spawn Controls', 2, 0, '', 'Hack Spawn Controls', '1', '', '', ''),
('dystopia', 'Hack the Perimeter', 2, 0, '', 'Hack the Perimeter', '1', '', '', ''),
('dystopia', 'Inject The Virus', 2, 0, '', 'Inject The Virus', '1', '', '', ''),
('dystopia', 'Launch Missile', 2, 0, '', 'Launch Missile', '1', '', '', ''),
('dystopia', 'Locate profile', 2, 0, '', 'Locate profile', '1', '', '', ''),
('dystopia', 'Maintain Power Routing', 2, 0, '', 'Maintain Power Routing', '1', '', '', ''),
('dystopia', 'Open And Destroy Data Stores / Establish An Uplink', 2, 0, '', 'Open And Destroy Data Stores / Establish An Uplink', '1', '', '', ''),
('dystopia', 'Redirect Laser', 2, 0, '', 'Redirect Laser', '1', '', '', ''),
('dystopia', 'Reroute Power To Control Room', 2, 0, '', 'Reroute Power To Control Room', '1', '', '', ''),
('dystopia', 'Shut Down Security', 2, 0, '', 'Shut Down Security', '1', '', '', ''),
('dystopia', 'Shutdown The Production Line', 2, 0, '', 'hutdown The Production Line', '1', '', '', ''),
('dystopia', 'Smash Data Storage', 2, 0, '', 'Smash Data Storage', '1', '', '', ''),
('dystopia', 'Turn Power Offline', 2, 0, '', 'Turn Power Offline', '1', '', '', ''),
('l4d', 'cr0wned', 0, 0, '', 'Cr0wned (killed witch with single headshot)', '1', '', '', ''),
('l4d', 'hunter_punter', 0, 0, '', 'Hunter Punter (melee a Hunter mid-jump)', '1', '', '', ''),
('l4d', 'tounge_twister', 0, 0, '', 'Tounge Twister (kill a Smoker while he is dragging you)', '1', '', '', ''),
('l4d', 'protect_teammate', 0, 0, '', 'Protected Teammate', '1', '', '', ''),
('l4d', 'no_death_on_tank', 0, 0, '', 'No survivors died/incapped from tank', '1', '', '', ''),
('l4d', 'killed_all_survivors', 0, 0, '', 'Killed all survivors', '1', '', '', '');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('O', 'l4d', 'hunter_punter', 'Hunter Punter', 'hunter punts'),
('O', 'l4d', 'protect_teammate', 'Protector', 'hunter punts'),
('W', 'fof', 'shotgun', 'Winchester Shotgun', 'kills with the Winchester'),
('W', 'bg2', 'brownbess', 'Brown Bess', 'kills with Brown Bess'),
('W', 'bg2', 'brownbess_bayonet', 'Brown Bess - Bayonet', 'kills with Brown Bess Bayonet'),
('W', 'bg2', 'charleville', 'Charleville', 'kills with Charleville'),
('W', 'bg2', 'charleville_bayonet', 'Charleville - Bayonet', 'kills with Charleville Bayonet'),
('W', 'bg2', 'hirschf', 'Hirschfaenger', 'kills with Hirschfaenger'),
('W', 'bg2', 'jaeger', 'Jaeger Rifle', 'kills with Jaeger Rifle'),
('W', 'bg2', 'knife', 'Knife', 'kills with Knife'),
('W', 'bg2', 'pennsylvania', 'Pennsylvania', 'kills with Pennsylvania'),
('W', 'bg2', 'pistol_a', 'British Pistol', 'kills with British Pistol'),
('W', 'bg2', 'pistol_b', 'American Pistol', 'kills with American Pistol'),
('W', 'bg2', 'sabre_a', 'British Sabre', 'kills with British Sabre'),
('W', 'bg2', 'sabre_b', 'American Sabre', 'kills with American Sabre'),
('W', 'bg2', 'mostkills', 'Most Kills', 'kills'),
('W', 'bg2', 'latency', 'Best Latency', 'ms average connection'),
('W', 'sgtls', 'mostkills', 'Most Kills', 'kills'),
('W', 'sgtls', 'latency', 'Best Latency', 'ms average connection'),
('W', 'sgtls', 'p90', 'FN Herstal P-90 Red Dot / FN-H P-90RD', 'kills'),
('W', 'sgtls', 'pistol', 'Beretta M92F-s', 'kills'),
('W', 'sgtls', 'knife', 'Combat Knife', 'kills'),
('W', 'sgtls', 'staff_blast', 'Staff Weapon', 'kills'),
('W', 'sgtls', 'p90D', 'FN Herstal P-90 w/ Disruptor', 'kills'),
('W', 'sgtls', 'hdevice', 'Hand Device / Ribbon Device', 'kills'),
('W', 'sgtls', 'tac_pulse', 'Tac (turrent)', 'kills'),
('W', 'sgtls', 'tac_projectile', 'Tac (bomb)', 'kills'),
('W', 'sgtls', 'c4_charge', 'C4', 'kills'),
('W', 'sgtls', 'grenade_projectile', 'M67 Frag Grenade', 'kills'),
('W', 'sgtls', 'g36', 'H&K G-36', 'kills'),
('W', 'sgtls', 'kull_blast', 'Kull Warrior Staff Device', 'kills'),
('W', 'sgtls', 'suicide_bomb', 'Goa\'uld Suicide Bomb', 'kills'),
('W', 'sgtls', 'kullblaster', 'Kull Warrior Staff Device (blast)', 'kills'),
('W', 'sgtls', 'staff', 'Staff Weapon Melee', 'kills'),
('W', 'sgtls', 'zat_blast', 'Zat', 'kills'),
('W', 'sgtls', 'awp', 'AWP Rifle', 'kills'),
('W', 'sgtls', 'grenade', 'M67 Frag Grenade', 'kills'),
('W', 'sgtls', 'zat', 'Zat (splash)', 'kills'),
('W', 'sgtls', 'tac', 'Tac (splash)', 'kills'),
('O', 'dystopia', 'Capture Guard Post', 'Capture Guard Post', 'captures'),
('O', 'dystopia', 'Capture Interior Spawn', 'Capture Interior Spawn', 'captures'),
('O', 'dystopia', 'Capture Internal Spawn', 'Capture Internal Spawn', 'captures'),
('O', 'dystopia', 'Capture The Docks', 'Capture The Docks', 'captures'),
('O', 'dystopia', 'Capture the Inner Base', 'Capture the Inner Base', 'captures'),
('O', 'dystopia', 'Capture the Spawn', 'Capture the Spawn', 'captures'),
('O', 'dystopia', 'Cut Entrance Spawn Power', 'Cut Entrance Spawn Power', 'power cuts'),
('O', 'dystopia', 'Defend Interior Spawn', 'Defend Interior Spawn', 'defenses'),
('O', 'dystopia', 'Defend Middle Spawn', 'Defend Middle Spawn', 'defenses'),
('O', 'dystopia', 'Defend Security JIP', 'Defend Security JIP', 'defenses'),
('O', 'dystopia', 'Destroy Broadcast Server', 'Destroy Broadcast Server', 'destructions'),
('O', 'dystopia', 'Destroy Cooling Access Door', 'Destroy Cooling Access Door', 'destructions'),
('O', 'dystopia', 'Destroy Cooling Tank', 'Destroy Cooling Tank', 'destructions'),
('O', 'dystopia', 'Destroy The Bulkhead', 'Destroy The Bulkhead', 'destructions'),
('O', 'dystopia', 'Destroy The Core', 'Destroy The Core', 'destructions'),
('O', 'dystopia', 'Destroy the Firewall', 'Destroy the Firewall', 'destructions'),
('O', 'dystopia', 'Destroy the Reactor', 'Destroy the Reactor', 'destructions'),
('O', 'dystopia', 'Destroy Transformer', 'Destroy Transformer', 'destructions'),
('O', 'dystopia', 'Enable Auxilary Power Feed', 'Enable Auxilary Power Feed', 'power feed enablings'),
('O', 'dystopia', 'Enable The 4-Point Override', 'Enable The 4-Point Override', '4-point override enablings'),
('O', 'dystopia', 'Escort Hostage', 'Escort Hostage', 'escorts'),
('O', 'dystopia', 'Hack Middle Spawn', 'Hack Middle Spawn', 'hacks'),
('O', 'dystopia', 'Hack Spawn Controls', 'Hack Spawn Controls', 'hacks'),
('O', 'dystopia', 'Hack the Perimeter', 'Hack the Perimeter', 'hacks'),
('O', 'dystopia', 'Inject The Virus', 'Inject The Virus', 'injections'),
('O', 'dystopia', 'Launch Missile', 'Launch Missile', 'launches'),
('O', 'dystopia', 'Locate profile', 'Locate profile', 'locations'),
('O', 'dystopia', 'Maintain Power Routing', 'Maintain Power Routing', 'maintenances'),
('O', 'dystopia', 'Open And Destroy Data Stores / Establish An Uplink', 'Open And Destroy Data Stores / Establish An Uplink', 'times'),
('O', 'dystopia', 'Redirect Laser', 'Redirect Laser', 'redirections'),
('O', 'dystopia', 'Reroute Power To Control Room', 'Reroute Power To Control Room', 'reroutings'),
('O', 'dystopia', 'Shut Down Security', 'Shut Down Security', 'shutdowns'),
('O', 'dystopia', 'Shutdown The Production Line', 'hutdown The Production Line', 'shutdowns'),
('O', 'dystopia', 'Smash Data Storage', 'Smash Data Storage', 'smashings'),
('O', 'dystopia', 'Turn Power Offline', 'Turn Power Offline', 'times'),
('W', 'dystopia', 'bonuspoints', 'Most Bonus Points', 'bonus points'),
('W', 'dystopia', 'latency', 'Best Latency', 'ms average connection'),
('W', 'dystopia', 'Light Katana', 'Light Katana', 'kills'),
('W', 'dystopia', 'Medium Katana', 'Medium Katana', 'kills'),
('W', 'dystopia', 'Fatman Fist', 'Fatman Fist', 'kills'),
('W', 'dystopia', 'Machine Pistol', 'Machine Pistol', 'kills'),
('W', 'dystopia', 'Shotgun', 'Shotgun', 'kills'),
('W', 'dystopia', 'Laser Rifle', 'Laser Rifle', 'kills'),
('W', 'dystopia', 'BoltGun', 'Bolt Gun', 'kills'),
('W', 'dystopia', 'SmartLock Pistols', 'Smartlock Pistols', 'kills'),
('W', 'dystopia', 'Assault Rifle', 'Assault Rifle', 'kills'),
('W', 'dystopia', 'Grenade Launcher', 'Grenade Launcher', 'kills'),
('W', 'dystopia', 'MK-808 Rifle', 'MK-808 Rifle', 'kills'),
('W', 'dystopia', 'Tesla Rifle', 'Tesla Rifle', 'kills'),
('W', 'dystopia', 'Rocket Launcher', 'Rocket Launcher', 'kills'),
('W', 'dystopia', 'Minigun', 'Minigun', 'kills'),
('W', 'dystopia', 'Ion Cannon', 'Ion Cannon', 'kills'),
('W', 'dystopia', 'Basilisk', 'Basilisk', 'kills'),
('W', 'dystopia', 'Frag Grenade', 'Frag Grenade', 'kills'),
('W', 'dystopia', 'EMP Grenade', 'EMP Grenade', 'kills'),
('W', 'dystopia', 'Spider Grenade', 'Spider Grenade', 'kills'),
('W', 'dystopia', 'Cortex Bomb', 'Cortex Bomb', 'kills'),
('W', 'dystopia', 'Leg Boosters', 'Leg Boosters', 'kills'),
('W', 'dystopia', 'Trap', 'Trap', 'kills'),
('W', 'dystopia', 'Turret', 'Turret', 'kills');
ALTER TABLE `hlstats_Clans`
ADD COLUMN `mapregion` varchar(128) NOT NULL default '';
ALTER TABLE `hlstats_Events_Admin`
CHANGE `message` `message` varchar(255) NOT NULL default '';
INSERT IGNORE INTO `hlstats_Games` (`code`, `name`, `realgame`, `hidden`) VALUES
('bg2', 'Battle Grounds 2', 'bg2', '1'),
('sgtls', 'Stargate: The Last Stand', 'sgtls', '1'),
('dystopia', 'Dystopia', 'dystopia', '1');
UPDATE `hlstats_Games_Defaults` SET `value` = 0 WHERE `parameter` = 'DisplayResultsInBrowser' AND `code` IN ('ges','insmod');
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`) VALUES
('bg2', 'DisplayResultsInBrowser', '1'),
('bg2', 'GameEngine', '3'),
('bg2', 'AddressPort', '0.0.0.0:27015'),
('bg2', 'Admins', ''),
('bg2', 'AutoBanRetry', '0'),
('bg2', 'AutoTeamBalance', '0'),
('bg2', 'BonusRoundIgnore', '0'),
('bg2', 'BonusRoundTime', '0'),
('bg2', 'BroadCastEvents', '1'),
('bg2', 'BroadCastPlayerActions', '1'),
('bg2', 'DefaultDisplayEvents', '1'),
('bg2', 'EnablePublicCommands', '1'),
('bg2', 'GameType', '0'),
('bg2', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('bg2', 'IgnoreBots', '1'),
('bg2', 'MinimumPlayersRank', '0'),
('bg2', 'MinPlayers', '4'),
('bg2', 'PlayerEvents', '1'),
('bg2', 'ShowStats', '1'),
('bg2', 'SkillMode', '0'),
('bg2', 'SuicidePenalty', '5'),
('bg2', 'SwitchAdmins', '0'),
('bg2', 'TKPenalty', '25'),
('bg2', 'TrackServerLoad', '1'),
('bg2', 'ConnectAnnounce', '1'),
('bg2', 'UpdateHostname', '1'),
('sgtls', 'DisplayResultsInBrowser', '1'),
('sgtls', 'GameEngine', '3'),
('sgtls', 'AddressPort', '0.0.0.0:27015'),
('sgtls', 'Admins', ''),
('sgtls', 'AutoBanRetry', '0'),
('sgtls', 'AutoTeamBalance', '0'),
('sgtls', 'BonusRoundIgnore', '0'),
('sgtls', 'BonusRoundTime', '0'),
('sgtls', 'BroadCastEvents', '1'),
('sgtls', 'BroadCastPlayerActions', '1'),
('sgtls', 'DefaultDisplayEvents', '1'),
('sgtls', 'EnablePublicCommands', '1'),
('sgtls', 'GameType', '0'),
('sgtls', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('sgtls', 'IgnoreBots', '1'),
('sgtls', 'MinimumPlayersRank', '0'),
('sgtls', 'MinPlayers', '4'),
('sgtls', 'PlayerEvents', '1'),
('sgtls', 'ShowStats', '1'),
('sgtls', 'SkillMode', '0'),
('sgtls', 'SuicidePenalty', '5'),
('sgtls', 'SwitchAdmins', '0'),
('sgtls', 'TKPenalty', '25'),
('sgtls', 'TrackServerLoad', '1'),
('sgtls', 'ConnectAnnounce', '1'),
('sgtls', 'UpdateHostname', '1'),
('dystopia', 'DisplayResultsInBrowser', '1'),
('dystopia', 'GameEngine', '2'),
('dystopia', 'AddressPort', '0.0.0.0:27015'),
('dystopia', 'Admins', ''),
('dystopia', 'AutoBanRetry', '0'),
('dystopia', 'AutoTeamBalance', '0'),
('dystopia', 'BonusRoundIgnore', '0'),
('dystopia', 'BonusRoundTime', '0'),
('dystopia', 'BroadCastEvents', '1'),
('dystopia', 'BroadCastPlayerActions', '1'),
('dystopia', 'DefaultDisplayEvents', '1'),
('dystopia', 'EnablePublicCommands', '1'),
('dystopia', 'GameType', '0'),
('dystopia', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('dystopia', 'IgnoreBots', '1'),
('dystopia', 'MinimumPlayersRank', '0'),
('dystopia', 'MinPlayers', '4'),
('dystopia', 'PlayerEvents', '1'),
('dystopia', 'ShowStats', '1'),
('dystopia', 'SkillMode', '0'),
('dystopia', 'SuicidePenalty', '5'),
('dystopia', 'SwitchAdmins', '0'),
('dystopia', 'TKPenalty', '25'),
('dystopia', 'TrackServerLoad', '1'),
('dystopia', 'ConnectAnnounce', '1'),
('dystopia', 'UpdateHostname', '1'),
('bg2', 'PlayerEventsCommandOSD', ''),
('hl2mp', 'PlayerEventsCommandOSD', '');
INSERT IGNORE INTO `hlstats_Games_Supported` (`code`, `name`) VALUES
('bg2', 'Battle Grounds 2'),
('sgtls', 'Stargate: The Last Stand'),
('dystopia', 'Dystopia');
DELETE FROM `hlstats_Options` WHERE `keyname` = 'dbversion';
INSERT IGNORE INTO `hlstats_Options` (`keyname`, `value`, `opttype`) VALUES
('dbversion', '4', 2),
('version', '1.5.4', 1),
('showqueries','1',2);
INSERT IGNORE INTO `hlstats_Options_Choices` (`keyname`, `value`, `text`, `isDefault`) VALUES
('showqueries', '0', 'No', 1),
('showqueries', '1', 'Yes', 0),
('google_map_region', 'EUROPE', 'Europe', 0);
ALTER TABLE `hlstats_Players`
ADD COLUMN `blockavatar` int(1) unsigned NOT NULL default '0';
INSERT IGNORE INTO `hlstats_Ranks` (`image`, `minKills`, `maxKills`, `rankName`, `game`) VALUES
('recruit', 0, 49, 'Recruit', 'bg2'),
('private', 50, 99, 'Private', 'bg2'),
('private-first-class', 100, 199, 'Private First Class', 'bg2'),
('lance-corporal', 200, 299, 'Lance Corporal', 'bg2'),
('corporal', 300, 399, 'Corporal', 'bg2'),
('sergeant', 400, 499, 'Sergeant', 'bg2'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'bg2'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'bg2'),
('master-sergeant', 700, 799, 'Master Sergeant', 'bg2'),
('first-sergeant', 800, 899, 'First Sergeant', 'bg2'),
('master-chief', 900, 999, 'Master Chief', 'bg2'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'bg2'),
('ensign', 1200, 1399, 'Ensign', 'bg2'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'bg2'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'bg2'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'bg2'),
('captain', 2000, 2249, 'Captain', 'bg2'),
('group-captain', 2250, 2499, 'Group Captain', 'bg2'),
('senior-captain', 2500, 2749, 'Senior Captain', 'bg2'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'bg2'),
('major', 3000, 3499, 'Major', 'bg2'),
('group-major', 3500, 3999, 'Group Major', 'bg2'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'bg2'),
('commander', 4500, 4999, 'Commander', 'bg2'),
('group-commander', 5000, 5749, 'Group Commander', 'bg2'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'bg2'),
('colonel', 6500, 7249, 'Colonel', 'bg2'),
('brigadier', 7250, 7999, 'Brigadier', 'bg2'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'bg2'),
('major-general', 9000, 9999, 'Major General', 'bg2'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'bg2'),
('general', 12500, 14999, 'General', 'bg2'),
('commander-general', 15000, 17499, 'Commander General', 'bg2'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'bg2'),
('field-marshal', 20000, 22499, 'Field Marshal', 'bg2'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'bg2'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'bg2'),
('high-commander', 27500, 29999, 'High Commander', 'bg2'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'bg2'),
('terminator', 35000, 9999999, 'Terminator', 'bg2'),
('recruit', 0, 49, 'Recruit', 'sgtls'),
('private', 50, 99, 'Private', 'sgtls'),
('private-first-class', 100, 199, 'Private First Class', 'sgtls'),
('lance-corporal', 200, 299, 'Lance Corporal', 'sgtls'),
('corporal', 300, 399, 'Corporal', 'sgtls'),
('sergeant', 400, 499, 'Sergeant', 'sgtls'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'sgtls'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'sgtls'),
('master-sergeant', 700, 799, 'Master Sergeant', 'sgtls'),
('first-sergeant', 800, 899, 'First Sergeant', 'sgtls'),
('master-chief', 900, 999, 'Master Chief', 'sgtls'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'sgtls'),
('ensign', 1200, 1399, 'Ensign', 'sgtls'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'sgtls'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'sgtls'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'sgtls'),
('captain', 2000, 2249, 'Captain', 'sgtls'),
('group-captain', 2250, 2499, 'Group Captain', 'sgtls'),
('senior-captain', 2500, 2749, 'Senior Captain', 'sgtls'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'sgtls'),
('major', 3000, 3499, 'Major', 'sgtls'),
('group-major', 3500, 3999, 'Group Major', 'sgtls'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'sgtls'),
('commander', 4500, 4999, 'Commander', 'sgtls'),
('group-commander', 5000, 5749, 'Group Commander', 'sgtls'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'sgtls'),
('colonel', 6500, 7249, 'Colonel', 'sgtls'),
('brigadier', 7250, 7999, 'Brigadier', 'sgtls'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'sgtls'),
('major-general', 9000, 9999, 'Major General', 'sgtls'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'sgtls'),
('general', 12500, 14999, 'General', 'sgtls'),
('commander-general', 15000, 17499, 'Commander General', 'sgtls'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'sgtls'),
('field-marshal', 20000, 22499, 'Field Marshal', 'sgtls'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'sgtls'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'sgtls'),
('high-commander', 27500, 29999, 'High Commander', 'sgtls'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'sgtls'),
('terminator', 35000, 9999999, 'Terminator', 'sgtls'),
('recruit', 0, 49, 'Recruit', 'dystopia'),
('private', 50, 99, 'Private', 'dystopia'),
('private-first-class', 100, 199, 'Private First Class', 'dystopia'),
('lance-corporal', 200, 299, 'Lance Corporal', 'dystopia'),
('corporal', 300, 399, 'Corporal', 'dystopia'),
('sergeant', 400, 499, 'Sergeant', 'dystopia'),
('staff-sergeant', 500, 599, 'Staff Sergeant', 'dystopia'),
('gunnery-sergeant', 600, 699, 'Gunnery Sergeant', 'dystopia'),
('master-sergeant', 700, 799, 'Master Sergeant', 'dystopia'),
('first-sergeant', 800, 899, 'First Sergeant', 'dystopia'),
('master-chief', 900, 999, 'Master Chief', 'dystopia'),
('sergeant-major', 1000, 1199, 'Sergeant Major', 'dystopia'),
('ensign', 1200, 1399, 'Ensign', 'dystopia'),
('third-lieutenant', 1400, 1599, 'Third Lieutenant', 'dystopia'),
('second-lieutenant', 1600, 1799, 'Second Lieutenant', 'dystopia'),
('first-lieutenant', 1800, 1999, 'First Lieutenant', 'dystopia'),
('captain', 2000, 2249, 'Captain', 'dystopia'),
('group-captain', 2250, 2499, 'Group Captain', 'dystopia'),
('senior-captain', 2500, 2749, 'Senior Captain', 'dystopia'),
('lieutenant-major', 2750, 2999, 'Lieutenant Major', 'dystopia'),
('major', 3000, 3499, 'Major', 'dystopia'),
('group-major', 3500, 3999, 'Group Major', 'dystopia'),
('lieutenant-commander', 4000, 4499, 'Lieutenant Commander', 'dystopia'),
('commander', 4500, 4999, 'Commander', 'dystopia'),
('group-commander', 5000, 5749, 'Group Commander', 'dystopia'),
('lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel', 'dystopia'),
('colonel', 6500, 7249, 'Colonel', 'dystopia'),
('brigadier', 7250, 7999, 'Brigadier', 'dystopia'),
('brigadier-general', 8000, 8999, 'Brigadier General', 'dystopia'),
('major-general', 9000, 9999, 'Major General', 'dystopia'),
('lieutenant-general', 10000, 12499, 'Lieutenant General', 'dystopia'),
('general', 12500, 14999, 'General', 'dystopia'),
('commander-general', 15000, 17499, 'Commander General', 'dystopia'),
('field-vice-marshal', 17500, 19999, 'Field Vice Marshal', 'dystopia'),
('field-marshal', 20000, 22499, 'Field Marshal', 'dystopia'),
('vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army', 'dystopia'),
('commander-of-the-army', 25000, 27499, 'Commander of the Army', 'dystopia'),
('high-commander', 27500, 29999, 'High Commander', 'dystopia'),
('supreme-commander', 30000, 34999, 'Supreme Commander', 'dystopia'),
('terminator', 35000, 9999999, 'Terminator', 'dystopia');
INSERT IGNORE INTO `hlstats_Roles` (`game`, `code`, `name`, `hidden`) VALUES
('dystopia','1','Light','0'),
('dystopia','2','Medium','0'),
('dystopia','3','Heavy','0');
UPDATE `hlstats_Servers_Config` SET `value` = 0 WHERE `parameter` = 'DisplayResultsInBrowser' AND `serverId` IN (SELECT `serverId` FROM `hlstats_Servers` WHERE `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` IN ('ges','insmod')));
INSERT IGNORE INTO `hlstats_Teams` (`game`, `code`, `name`, `hidden`, `playerlist_bgcolor`, `playerlist_color`, `playerlist_index`) VALUES
('bg2','British','The British','','#FFD5D5','#FF2D2D',2),
('bg2','Americans','The Americans','','#D2E8F7','#0080C0',1),
('sgtls','Goa\'uld','Goa\'uld','','#FFD5D5','#FF2D2D',2),
('sgtls','Tau\'ri','Tau\'ri','','#D2E8F7','#0080C0',1),
('dystopia','Punks','Punks','','#FFD5D5','#FF2D2D',2),
('dystopia','Corps','Corps','','#D2E8F7','#0080C0',1);
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`) VALUES
('fof', 'shotgun', 'Winchester Shotgun', 1),
('bg2', 'brownbess', 'Brown Bess', 1),
('bg2', 'brownbess_bayonet', 'Brown Bess - Bayonet', 1),
('bg2', 'charleville', 'Charleville', 1),
('bg2', 'charleville_bayonet', 'Charleville - Bayonet', 1),
('bg2', 'hirschf', 'Hirschfaenger', 1),
('bg2', 'jaeger', 'Jaeger Rifle', 1),
('bg2', 'knife', 'Knife', 2),
('bg2', 'pennsylvania', 'Pennsylvania', 1),
('bg2', 'pistol_a', 'British Pistol', 1.5),
('bg2', 'pistol_b', 'American Pistol', 1.5),
('bg2', 'sabre_a', 'British Sabre', 1),
('bg2', 'sabre_b', 'American Sabre', 1),
('sgtls', 'p90', 'FN Herstal P-90 Red Dot / FN-H P-90RD', 1),
('sgtls', 'pistol', 'Beretta M92F-s', 1),
('sgtls', 'knife', 'Combat Knife', 1),
('sgtls', 'staff_blast', 'Staff Weapon', 1),
('sgtls', 'p90D', 'FN Herstal P-90 w/ Disruptor', 1),
('sgtls', 'hdevice', 'Hand Device / Ribbon Device', 1),
('sgtls', 'tac_pulse', 'Tac (turrent)', 1),
('sgtls', 'tac_projectile', 'Tac (bomb)', 1),
('sgtls', 'c4_charge', 'C4', 1),
('sgtls', 'grenade_projectile', 'M67 Frag Grenade', 1),
('sgtls', 'g36', 'H&K G-36', 1),
('sgtls', 'kull_blast', 'Kull Warrior Staff Device', 1),
('sgtls', 'suicide_bomb', 'Goa\'uld Suicide Bomb', 1),
('sgtls', 'kullblaster', 'Kull Warrior Staff Device (blast)', 1),
('sgtls', 'staff', 'Staff Weapon Melee', 1),
('sgtls', 'zat_blast', 'Zat', 1),
('sgtls', 'awp', 'AWP Rifle', 1),
('sgtls', 'grenade', 'M67 Frag Grenade', 1),
('sgtls', 'zat', 'Zat (splash)', 1),
('sgtls', 'tac', 'Tac (splash)', 1),
('dystopia', 'Light Katana', 'Light Katana', 1),
('dystopia', 'Medium Katana', 'Medium Katana', 1),
('dystopia', 'Fatman Fist', 'Fatman Fist', 1),
('dystopia', 'Machine Pistol', 'Machine Pistol', 1),
('dystopia', 'Shotgun', 'Shotgun', 1),
('dystopia', 'Laser Rifle', 'Laser Rifle', 1),
('dystopia', 'BoltGun', 'Bolt Gun', 1),
('dystopia', 'SmartLock Pistols', 'Smartlock Pistols', 1),
('dystopia', 'Assault Rifle', 'Assault Rifle', 1),
('dystopia', 'Grenade Launcher', 'Grenade Launcher', 1),
('dystopia', 'MK-808 Rifle', 'MK-808 Rifle', 1),
('dystopia', 'Tesla Rifle', 'Tesla Rifle', 1),
('dystopia', 'Rocket Launcher', 'Rocket Launcher', 1),
('dystopia', 'Minigun', 'Minigun', 1),
('dystopia', 'Ion Cannon', 'Ion Cannon', 1),
('dystopia', 'Basilisk', 'Basilisk', 1),
('dystopia', 'Frag Grenade', 'Frag Grenade', 1),
('dystopia', 'EMP Grenade', 'EMP Grenade', 1),
('dystopia', 'Spider Grenade', 'Spider Grenade', 1),
('dystopia', 'Cortex Bomb', 'Cortex Bomb', 1),
('dystopia', 'Leg Boosters', 'Leg Boosters', 1),
('dystopia', 'Trap', 'Trap', 1),
('dystopia', 'Turret', 'Turret', 1);

View File

@ -0,0 +1,67 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`) VALUES
('insmod', 'headshot', 1, 0, '', 'Headshot Kill', '1', '', '', ''),
('insmod', 'Round_Win', 0, 10, '', 'Round Win', '', '', '1', ''),
('ges', 'GE_AWARD_DEADLY', 10, 0, '', 'Most Deadly', '1', '', '', ''),
('ges', 'GE_AWARD_HONORABLE', 5, 0, '', 'Most Honorable', '1', '', '', ''),
('ges', 'GE_AWARD_PROFESSIONAL', 10, 0, '', 'Most Professional', '1', '', '', ''),
('ges', 'GE_AWARD_MARKSMANSHIP', 1, 0, '', 'Marksmanship Award', '1', '', '', ''),
('ges', 'GE_AWARD_AC10', 2, 0, '', 'AC-10 Award', '1', '', '', ''),
('ges', 'GE_AWARD_FRANTIC', 2, 0, '', 'Most Frantic', '1', '', '', ''),
('ges', 'GE_AWARD_WTA', 1, 0, '', 'Where''s the Ammo?', '1', '', '', ''),
('ges', 'GE_AWARD_LEMMING', -1, 0, '', 'Lemming (suicide)', '1', '', '', ''),
('ges', 'GE_AWARD_LONGIN', 1, 0, '', 'Longest Innings', '1', '', '', ''),
('ges', 'GE_AWARD_SHORTIN', -1, 0, '', 'Shortest Innings', '1', '', '', ''),
('ges', 'GE_AWARD_DISHONORABLE', -10, 0, '', 'Most Dishonorable', '1', '', '', ''),
('ges', 'GE_AWARD_NOTAC10', 4, 0, '', 'Where''s the Armor?', '1', '', '', ''),
('ges', 'GE_AWARD_MOSTLYHARMLESS', -1, 0, '', 'Mostly Harmless', '1', '', '', '');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('W', 'ges', 'mostkills', 'Bond, James Bond', 'kills');
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`) VALUES
('bg2', 'PlayerEventsCommandHint', ''),
('dystopia', 'PlayerEventsCommandHint', ''),
('ff', 'PlayerEventsCommandHint', ''),
('fof', 'PlayerEventsCommandHint', ''),
('ges', 'PlayerEventsCommandHint', ''),
('hidden', 'PlayerEventsCommandHint', ''),
('insmod', 'PlayerEventsCommandHint', ''),
('l4d', 'PlayerEventsCommandHint', ''),
('sgtls', 'PlayerEventsCommandHint', ''),
('zps', 'PlayerEventsCommandHint', '');
INSERT IGNORE INTO `hlstats_Mods_Defaults` (`code`, `parameter`, `value`) VALUES
('', 'PlayerEventsCommandHint', ''),
('AMXX', 'PlayerEventsCommandHint', 'hlx_amx_hint'),
('BEETLE', 'PlayerEventsCommandHint', ''),
('MANI', 'PlayerEventsCommandHint', 'ma_hlx_hint'),
('MINISTATS', 'PlayerEventsCommandHint', ''),
('SOURCEMOD', 'PlayerEventsCommandHint', 'hlx_sm_hint');
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
(SELECT `serverId`, 'PlayerEventsCommandHint', '' FROM hlstats_Servers_Config WHERE `parameter`='MOD' and `value` IN ('', 'BEETLE', 'MINISTATS'));
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
(SELECT `serverId`, 'PlayerEventsCommandHint', 'hlx_amx_hint' FROM hlstats_Servers_Config WHERE `parameter`='MOD' and `value` = 'AMXX');
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
(SELECT `serverId`, 'PlayerEventsCommandHint', 'ma_hlx_hint' FROM hlstats_Servers_Config WHERE `parameter`='MOD' and `value` = 'MANI');
INSERT IGNORE INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
(SELECT `serverId`, 'PlayerEventsCommandHint', 'hlx_sm_hint' FROM hlstats_Servers_Config WHERE `parameter`='MOD' and `value` = 'SOURCEMOD');
UPDATE `hlstats_Servers_Config` SET `value` = '' WHERE `parameter` = 'PlayerEventsCommandHint' AND `serverId` IN (SELECT `serverId` FROM `hlstats_Servers` WHERE `game` IN (SELECT `code` FROM `hlstats_Games` WHERE `realgame` IN ('bg2', 'dystopia', 'ff', 'fof', 'ges', 'hidden', 'insmod', 'l4d', 'sgtls', 'zps')));
UPDATE `hlstats_Servers_Config` SET `value` = 'amx_chat' WHERE `parameter` = 'PlayerEventsAdminCommand' AND `value` = '' AND serverId IN (SELECT serverId FROM (SELECT serverId FROM `hlstats_Servers_Config` WHERE `parameter` = 'MOD' AND `value` = 'AMXX') AS x);
UPDATE `hlstats_Servers_Config` SET `value` = 'admin_chat' WHERE `parameter` = 'PlayerEventsAdminCommand' AND `value` = '' AND serverId IN (SELECT serverId FROM (SELECT serverId FROM `hlstats_Servers_Config` WHERE `parameter` = 'MOD' AND `value` = 'BEETLE') AS x);
UPDATE `hlstats_Servers_Config` SET `value` = 'ma_chat' WHERE `parameter` = 'PlayerEventsAdminCommand' AND `value` = '' AND serverId IN (SELECT serverId FROM (SELECT serverId FROM `hlstats_Servers_Config` WHERE `parameter` = 'MOD' AND `value` = 'MANI') AS x);
UPDATE `hlstats_Servers_Config` SET `value` = 'sm_chat' WHERE `parameter` = 'PlayerEventsAdminCommand' AND `value` = '' AND serverId IN (SELECT serverId FROM (SELECT serverId FROM `hlstats_Servers_Config` WHERE `parameter` = 'MOD' AND `value` = 'SOURCEMOD') AS x);
INSERT INTO `hlstats_Servers_Config_Default` (`parameter`, `value`, `description`) VALUES
('PlayerEventsCommandHint', 'hlx_sm_hint', 'The command to display "hint" style messages for ATB switches. Default is "".');
UPDATE `hlstats_Options` SET `value` = '1.5.5' WHERE `keyname` = 'version';
UPDATE `hlstats_Options` SET `value` = '5' WHERE `keyname` = 'dbversion';

View File

@ -0,0 +1,54 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'pyro_extinguish', 1, 0, '', 'Extinguished Teammate (Pyro)', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'sniper_extinguish', 1, 0, '', 'Extinguished Teammate (Sniper)', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
UPDATE `hlstats_Awards` SET `code` = 'sandman' WHERE `code` = 'bat_wood';
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O', code, 'pyro_extinguish', 'Give It a Little Blow', 'extinguishes with Flamethrower' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O', code, 'sniper_extinguish', 'Douser', 'extinguishes with Jarate' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W', code, 'force_a_nature', 'Who wants some of this?', 'kills with the Force-A-Nature' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W', code, 'ambassador', 'Diplomatic Immunity', 'kills with the Ambassador' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W', code, 'tf_projectile_arrow', 'Quivering Fool', 'kills with the Huntsman' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W', code, 'taunt_spy', 'Dangerous Crab', 'spy taunt kills' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W', code, 'taunt_sniper', 'Robin Hood', 'sniper taunt kills' FROM hlstats_Games WHERE `realgame` = 'tf');
UPDATE `hlstats_Events_Frags` SET `weapon` = 'sandman' WHERE `weapon` = 'bat_wood';
UPDATE `hlstats_Events_Suicides` SET `weapon` = 'sandman' WHERE `weapon` = 'bat_wood';
UPDATE `hlstats_Events_Teamkills` SET `weapon` = 'sandman' WHERE `weapon` = 'bat_wood';
UPDATE `hlstats_Options` SET `value` = '1.5.6' WHERE `keyname` = 'version';
UPDATE `hlstats_Options` SET `value` = '6' WHERE `keyname` = 'dbversion';
UPDATE `hlstats_Weapons` SET `code` = 'sandman' WHERE `code` = 'bat_wood';
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'force_a_nature', 'Force-A-Nature', 1 FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'ambassador', 'Ambassador', 1 FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'tf_projectile_arrow', 'Huntsman', 1 FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'taunt_spy', 'Spy Taunt', 3 FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'taunt_sniper', 'Sniper Taunt', 3 FROM hlstats_Games WHERE `realgame` = 'tf');

View File

@ -0,0 +1,711 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'medic_extinguish', 1, 0, '', 'Extinguished Teammate (Medic)', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'engineer_extinguish', 1, 0, '', 'Extinguished Teammate (Engineer)', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'teleport', 1, 0, '', 'Teleporter used', '1', '', '', '' FROM hlstats_Games where `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'teleport_self', 0, 0, '', 'Teleporter used (self)', '1', '', '', '' FROM hlstats_Games where `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`) VALUES
('W', 'nts', 'aa13', 'AA13', 'kills with AA13'),
('W', 'nts', 'grenade_projectile', 'Frag Grenade', 'kills with Frag Grenade'),
('W', 'nts', 'jitte', 'Jitte', 'kills with Jitte'),
('W', 'nts', 'jittescoped', 'Jitte (Scoped)', 'kills with Jitte (Scoped)'),
('W', 'nts', 'knife', 'Knife', 'kills with Knife'),
('W', 'nts', 'kyla', 'KYLA', 'kills with KYLA'),
('W', 'nts', 'm41', 'M41', 'kills with M41'),
('W', 'nts', 'm41l', 'M41L', 'kills with M41L'),
('W', 'nts', 'milso', 'MilSO', 'kills with MilSO'),
('W', 'nts', 'mp5', 'MP5', 'kills with MP5'),
('W', 'nts', 'mpn', 'MPN45', 'kills with MPN45'),
('W', 'nts', 'mx', 'MX', 'kills with MX'),
('W', 'nts', 'mx_silenced', 'MX Silenced', 'kills with MX Silenced'),
('W', 'nts', 'pz', 'PZ252', 'kills with PZ252'),
('W', 'nts', 'grenade_detapack', 'DetPac', 'kills with DetPac'),
('W', 'nts', 'smac', 'SMAC', 'kills with SMAC'),
('W', 'nts', 'srm', 'SRM', 'kills with SRM'),
('W', 'nts', 'srm_s', 'SRM-S', 'kills with SRM-S'),
('W', 'nts', 'srs', 'SRS', 'kills with SRS'),
('W', 'nts', 'supa7', 'MURATA SUPA 7', 'kills with MURATA SUPA 7'),
('W', 'nts', 'tachi', 'TACHI', 'kills with TACHI'),
('W', 'nts', 'zr68c', 'ZR68C', 'kills with ZR68C'),
('W', 'nts', 'zr68l', 'ZR68L', 'kills with ZR68L'),
('W', 'nts', 'zr68s', 'ZR68S', 'kills with ZR68S'),
('W', 'nts', 'mostkills', 'Most Kills', 'kills'),
('W', 'nts', 'latency', 'Best Latency', 'ms average connection'),
('W','hl2mp','mostkills','17. Most Kills','kills'),
('W','hl2mp','suicide','18. Most Suicides','suicides');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'P', code, 'shield_blocked', 'Razor Breakin', 'razorbacks broken' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'V', code, 'shield_blocked', 'Broken Back', 'razorbacks broken (sniper)' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'P', code, 'jarate', 'Urine'' For A Surprise', 'jarates' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'V', code, 'jarate', 'Yellow Bellied Spies', 'victims jarated' FROM hlstats_Games WHERE `realgame` = 'tf');
UPDATE `hlstats_Events_Frags` SET `pos_x` = NULL WHERE `pos_x` = '';
UPDATE `hlstats_Events_Frags` SET `pos_y` = NULL WHERE `pos_y` = '';
UPDATE `hlstats_Events_Frags` SET `pos_z` = NULL WHERE `pos_z` = '';
ALTER TABLE `hlstats_Events_Frags`
CHANGE `pos_x` `pos_x` MEDIUMINT default NULL,
CHANGE `pos_y` `pos_y` MEDIUMINT default NULL,
CHANGE `pos_z` `pos_z` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_x` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_y` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_z` MEDIUMINT default NULL;
UPDATE `hlstats_Events_PlayerActions` SET `pos_x` = NULL WHERE `pos_x` = '';
UPDATE `hlstats_Events_PlayerActions` SET `pos_y` = NULL WHERE `pos_y` = '';
UPDATE `hlstats_Events_PlayerActions` SET `pos_z` = NULL WHERE `pos_z` = '';
ALTER TABLE `hlstats_Events_PlayerActions`
CHANGE `pos_x` `pos_x` MEDIUMINT default NULL,
CHANGE `pos_y` `pos_y` MEDIUMINT default NULL,
CHANGE `pos_z` `pos_z` MEDIUMINT default NULL;
UPDATE `hlstats_Events_PlayerPlayerActions` SET `pos_x` = NULL WHERE `pos_x` = '';
UPDATE `hlstats_Events_PlayerPlayerActions` SET `pos_y` = NULL WHERE `pos_y` = '';
UPDATE `hlstats_Events_PlayerPlayerActions` SET `pos_z` = NULL WHERE `pos_z` = '';
ALTER TABLE `hlstats_Events_PlayerPlayerActions`
ADD COLUMN `pos_victim_x` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_y` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_z` MEDIUMINT default NULL;
UPDATE `hlstats_Events_Suicides` SET `pos_x` = NULL WHERE `pos_x` = '';
UPDATE `hlstats_Events_Suicides` SET `pos_y` = NULL WHERE `pos_y` = '';
UPDATE `hlstats_Events_Suicides` SET `pos_z` = NULL WHERE `pos_z` = '';
ALTER TABLE `hlstats_Events_Suicides`
CHANGE `pos_x` `pos_x` MEDIUMINT default NULL,
CHANGE `pos_y` `pos_y` MEDIUMINT default NULL,
CHANGE `pos_z` `pos_z` MEDIUMINT default NULL;
UPDATE `hlstats_Events_Teamkills` SET `pos_x` = NULL WHERE `pos_x` = '';
UPDATE `hlstats_Events_Teamkills` SET `pos_y` = NULL WHERE `pos_y` = '';
UPDATE `hlstats_Events_Teamkills` SET `pos_z` = NULL WHERE `pos_z` = '';
ALTER TABLE `hlstats_Events_Teamkills`
CHANGE `pos_x` `pos_x` MEDIUMINT default NULL,
CHANGE `pos_y` `pos_y` MEDIUMINT default NULL,
CHANGE `pos_z` `pos_z` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_x` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_y` MEDIUMINT default NULL,
ADD COLUMN `pos_victim_z` MEDIUMINT default NULL;
INSERT IGNORE INTO `hlstats_Games` (`code`, `name`, `realgame`, `hidden`) VALUES
('nts','NeoTokyo','nts','1');
INSERT IGNORE INTO `hlstats_Games_Defaults` (`code`, `parameter`, `value`) VALUES
('nts', 'Admins', ''),
('nts', 'AutoBanRetry', '0'),
('nts', 'AutoTeamBalance', '0'),
('nts', 'BonusRoundIgnore', '0'),
('nts', 'BonusRoundTime', '0'),
('nts', 'BroadCastEvents', '1'),
('nts', 'BroadCastPlayerActions', '1'),
('nts', 'ConnectAnnounce', '1'),
('nts', 'DefaultDisplayEvents', '1'),
('nts', 'DisplayResultsInBrowser', '1'),
('nts', 'EnablePublicCommands', '1'),
('nts', 'GameEngine', '2'),
('nts', 'GameType', '0'),
('nts', 'HLStatsURL', 'http://yoursite.com/hlstats'),
('nts', 'IgnoreBots', '1'),
('nts', 'MinimumPlayersRank', '0'),
('nts', 'MinPlayers', '4'),
('nts', 'PlayerEvents', '1'),
('nts', 'ShowStats', '1'),
('nts', 'SkillMode', '0'),
('nts', 'SuicidePenalty', '5'),
('nts', 'SwitchAdmins', '0'),
('nts', 'TKPenalty', '25'),
('nts', 'TrackServerLoad', '1'),
('nts', 'UpdateHostname', '1');
INSERT IGNORE INTO `hlstats_Games_Supported` (`code`, `name`) VALUES
('nts','NeoTokyo');
CREATE TABLE IF NOT EXISTS `hlstats_Heatmap_Config` (
`id` int(255) NOT NULL auto_increment,
`map` varchar(64) NOT NULL,
`game` varchar(32) NOT NULL,
`xoffset` float NOT NULL,
`yoffset` float NOT NULL,
`flipx` tinyint(1) NOT NULL default '0',
`flipy` tinyint(1) NOT NULL default '1',
`days` tinyint(4) NOT NULL default '30',
`brush` varchar(5) NOT NULL default 'small',
`scale` float NOT NULL,
`font` tinyint(2) NOT NULL default '10',
`thumbw` float NOT NULL default '0.170312',
`thumbh` float NOT NULL default '0.170312',
`cropx1` int(11) NOT NULL default '0',
`cropy1` int(11) NOT NULL default '0',
`cropx2` int(11) NOT NULL default '0',
`cropy2` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `gamemap` (`map`, `game`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `hlstats_Heatmap_Config`
--
INSERT IGNORE INTO `hlstats_Heatmap_Config` (`map`, `game`, `xoffset`, `yoffset`, `flipx`, `flipy`, `days`, `brush`, `scale`, `font`, `thumbw`, `thumbh`, `cropx1`, `cropy1`, `cropx2`, `cropy2`) VALUES
('de_dust2', 'css', 5290, 4259, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('plr_pipeline', 'tf', 8006, 9236, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_hoodoo_final', 'tf', 9564, 5592, 0, 1, 30, 'small', 14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_dustbowl', 'tf', 5109, 4821, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_2fort', 'tf', 5112, 4079, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_goldrush', 'tf', 10669, 4221, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_egypt_final', 'tf', 9844, 9241, 0, 1, 30, 'small', 16, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_junction_final', 'tf', 4077, 5145, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_fastlane', 'tf', 7692, 5622, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_badwater', 'tf', 4269, 3237, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_steel', 'tf', 4069, 2637, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_badlands', 'tf', 6205, 5059, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_granary', 'tf', 9274, 6088, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_gravelpit', 'tf', 5735, 5645, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_cashworks_b3a', 'tf', 5500, 4635, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_office', 'css', 2357, 1766, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_ambush', 'bg2', 5592, 1159, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_townguard', 'bg2', 4489, 2670, 0, 1, 30, 'small', 5.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_dust', 'css', 3425, 4022, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_anzio', 'dods', 4031, 3979, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_argentan', 'dods', 4773, 2963, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_avalanche', 'dods', 3204, 2885, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_colmar', 'dods', 5915, 5373, 0, 1, 30, 'small', 9.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_donner', 'dods', 4013, 1743, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_flash', 'dods', 3895, 2330, 0, 1, 30, 'small', 5.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_jagd', 'dods', 3592, 3082, 0, 1, 30, 'small', 6.6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_kalt', 'dods', 777, 6987, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_palermo', 'dods', 2494, 3797, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_abdallah', 'insmod', 7508, 2723, 0, 1, 30, 'small', 9.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_almaden', 'insmod', 2881, 3200, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_bagdad', 'insmod', 9166, 4578, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_buhriz', 'insmod', 11943, 8220, 0, 1, 30, 'small', 16, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_haditha', 'insmod', 5582, 2630, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_haditha_night', 'insmod', 5582, 2630, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_hillah', 'insmod', 6755, 3550, 0, 1, 30, 'small', 11.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_karkar', 'insmod', 10355, 1306, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_ramadi', 'insmod', 5069, 1430, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_samawah', 'insmod', 2947, 2112, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_sinjar', 'insmod', 7427, 6887, 0, 1, 30, 'small', 11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ins_samawah_day', 'insmod', 2809, 2152, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_badlands', 'tf', 5125, 4119, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_granary', 'tf', 6759, 4013, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_lumberyard', 'tf', 6616, 5421, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_nucleus', 'tf', 2562, 1940, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_ravine', 'tf', 2647, 3547, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_sawmill', 'tf', 4551, 4259, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_watchtower', 'tf', 3789, 3075, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_well', 'tf', 5331, 3389, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_turbine', 'tf', 4496, 3593, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_well', 'tf', 6437, 5123, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('tc_hydro', 'tf', 6038, 4348, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_castle4', 'tf', 4120, 7826, 0, 1, 30, 'small', 11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_follower', 'tf', 8871, 6631, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_labor', 'tf', 5788, 3873, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_stag', 'tf', 5099, 4021, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_chaos', 'tf', 3899, 3214, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dom_canalzone', 'tf', 4044, 3664, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_frontier', 'tf', 6094, 4051, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_halfacre', 'tf', 5098, 5920, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport01_greenhouse', 'l4d', 979, 3935, 0, 0, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport03_garage', 'l4d', 11413, 6781, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport04_terminal', 'l4d', 2659, 6795, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport05_runway', 'l4d', 8197, 12894, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm01_hilltop', 'l4d', 14734, 5840, 1, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm02_traintunnel', 'l4d', 11001, 3377, 1, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm03_bridge', 'l4d', 1353, 7488, 1, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm04_barn', 'l4d', 3091, 186, 1, 0, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm05_cornfield', 'l4d', 4448, 5460, 0, 0, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital01_apartment', 'l4d', 662, 5571, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital02_subway', 'l4d', 1621, 8552, 0, 0, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital03_sewers', 'l4d', 7045, 14101, 0, 0, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital04_interior', 'l4d', 9513, 16235, 0, 0, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital05_rooftop', 'l4d', 4450, 10005, 0, 0, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_smalltown01_caves', 'l4d', 20542, 3156, 1, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_smalltown02_drainage', 'l4d', 12149, 4040, 1, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown05_houseboat', 'l4d', 6554, 5155, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_jungle_a1c', 'tf', 3024, 5391, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_strider_v1', 'tf', 7109, 4078, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_warpath_v3', 'tf', 3995, 3298, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('grubas_nabijacz!_v6', 'tf', 2004, 2478, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_boulder_v5', 'tf', 9562, 12307, 0, 1, 30, 'small', 16, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_broma', 'tf', 5261, 3192, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_busytown', 'tf', 6413, 5961, 0, 1, 30, 'small', 11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_roswell', 'tf', 2809, 4448, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_vertigo_beta3', 'tf', 3584, 3108, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_wolf2_b1', 'tf', 2182, 3838, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_convoy_v2', 'tf', 3732, 2694, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_well', 'tf', 10371, 7681, 0, 1, 30, 'small', 15, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_furnace_b2', 'tf', 4667, 4823, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('pl_borax_b2', 'tf', 5252, 593, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_jailbreak_b3', 'tf', 8570, -702, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_desertfortress', 'tf', 3675, 3269, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_train', 'css', 2616, 2619, 0, 1, 30, 'small', 4.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_tides', 'css', 2385, 1589, 0, 1, 30, 'small', 3.7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_prodigy', 'css', 1025, 2198, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_port', 'css', 4189, 4131, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_piranesi', 'css', 3082, 3239, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_nuke', 'css', 3541, 1856, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_inferno', 'css', 3336, 4252, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_chateau', 'css', 2121, 3074, 0, 1, 30, 'small', 4.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_cbble', 'css', 4704, 3587, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_aztec', 'css', 4235, 3430, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_militia', 'css', 2838, 2745, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_italy', 'css', 3071, 2920, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_havana', 'css', 2958, 2678, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_compound', 'css', 1734, 3943, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_assault', 'css', 2467, 8268, 0, 0, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_lockdown', 'hl2mp', 7301, 7172, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_overwatch', 'hl2mp', 1997, 8416, 0, 0, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_powerhouse', 'hl2mp', 2558, 762, 0, 1, 30, 'small', 3.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_resistance', 'hl2mp', 2606, 2129, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_runoff', 'hl2mp', 5116, 5210, 0, 0, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_steamlab', 'hl2mp', 3854, 3471, 0, 1, 30, 'small', 2.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dm_underpass', 'hl2mp', 1611, 364, 0, 1, 30, 'small', 2.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('coop_elpaso', 'fof', 7369, 4167, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('coop_peligro', 'fof', 10378, 4070, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('coop_revenge', 'fof', 1687, 2560, 0, 1, 30, 'small', 3.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('coop_sweetwater', 'fof', 2289, 1565, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_canyonland', 'fof', 6026, 6913, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_desert', 'fof', 5996, 2255, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_desperados', 'fof', 613, -645, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_eliminator', 'fof', 5944, 7040, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_eliminator_lite', 'fof', 3306, 4981, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_elpaso', 'fof', 7031, 4138, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_loothill', 'fof', 6196, 5624, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_monumentvalley', 'fof', 2563, 6738, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_nowhere', 'fof', 4977, 1796, 0, 1, 30, 'small', 5.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_peligro', 'fof', 4913, 4044, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_peligro_lite', 'fof', 3983, 3030, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_presidio', 'fof', 3149, 1539, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_revenge', 'fof', 1685, 2584, 0, 1, 30, 'small', 3.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_sweetwater', 'fof', 2289, 1565, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_tijuana', 'fof', 3692, 3638, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_tramonto', 'fof', 4743, 2026, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fof_tramonto_lite', 'fof', 3465, 1094, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('as_oilrig', 'cstrike', 588.81, -730.75, 0, 0, 30, 'small', 2.48, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_747', 'cstrike', 64, -608, 0, 1, 30, 'small', 1.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_assault', 'cstrike', 720, 1024, 0, 1, 30, 'small', 1.54, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_backalley', 'cstrike', 148, 1360, 0, 0, 30, 'small', 2.08, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_estate', 'cstrike', 144, -928, 0, 1, 30, 'small', 2.04, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_havana', 'cstrike', 256, 56, 0, 0, 30, 'small', 1.38, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_italy', 'cstrike', 248, 16, 0, 1, 30, 'small', 1.57, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_militia', 'cstrike', 621, -534, 0, 0, 30, 'small', 1.69, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_office', 'cstrike', 64, -260, 0, 1, 30, 'small', 1.47, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cs_siege', 'cstrike', 564, 1252, 0, 0, 30, 'small', 1.15, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_airstrip', 'cstrike', 1116, -368, 0, 1, 30, 'small', 1.21, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_aztec', 'cstrike', 447.31, -62.94, 0, 1, 30, 'small', 1.12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_cbble', 'cstrike', 832, 576, 0, 1, 30, 'small', 1.07, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_chateau', 'cstrike', 1032, 688.5, 0, 0, 30, 'small', 1.46, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_dust', 'cstrike', 96, 960, 0, 1, 30, 'small', 1.1, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_dust2', 'cstrike', 384, 1120, 0, 1, 30, 'small', 1.26, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_inferno', 'cstrike', 404, 1312, 0, 0, 30, 'small', 1.39, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_nuke', 'cstrike', 244, -936, 0, 0, 30, 'small', 1.14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_piranesi', 'cstrike', 48, 864, 0, 0, 30, 'small', 1.37, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_prodigy', 'cstrike', 1476, -264, 0, 0, 30, 'small', 1.94, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_storm', 'cstrike', 191, -104, 0, 0, 30, 'small', 1.42, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_survivor', 'cstrike', 832, 880, 0, 0, 30, 'small', 1.38, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_torn', 'cstrike', 112, 664, 0, 0, 30, 'small', 1.24, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_train', 'cstrike', 49.19, 156, 0, 0, 30, 'small', 1.58, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_vertigo', 'cstrike', 1280, -256, 0, 1, 30, 'small', 2.13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_dusk_patrol', 'bg2', 6504, 4690, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_fall', 'bg2', 1198, 2503, 0, 1, 30, 'small', 4.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_foothills', 'bg2', 5440, 5115, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_freemans_farm', 'bg2', 6648, 5275, 0, 1, 30, 'small', 10.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_maricopa', 'bg2', 6398, 2313, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_pillage', 'bg2', 3746, 6363, 0, 1, 30, 'small', 9.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_pinebarrens', 'bg2', 257, 6121, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_plateau', 'bg2', 3840, 3085, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_road', 'bg2', 5149, 3755, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_snowlake', 'bg2', 6194, 7018, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_woodland', 'bg2', 4924, 3236, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('bg_harbourtown', 'bg2', 2123, 4443, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_battleground', 'aoc', 4969, 2889, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_darkforest', 'aoc', 5984, 9812, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_firecrag', 'aoc', 3585, 10952, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_helms_deep', 'aoc', 5672, 2522, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_invasion', 'aoc', 3979, 3593, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_monastery', 'aoc', 5549, 3561, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_overlook', 'aoc', 3711, 2781, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_siege', 'aoc', 3186, 4274, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_sorrow', 'aoc', 4128, 6654, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_stoneshill', 'aoc', 7175, 5685, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_theshore', 'aoc', 540, 7698, 0, 0, 30, 'small', 14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_tombs', 'aoc', 1287, 995, 0, 1, 30, 'small', 2, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_tournament', 'aoc', 1353, 1750, 0, 1, 30, 'small', 2.2, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_valley', 'aoc', 4573, 3442, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('aoc_westerlyn', 'aoc', 7166, 6094, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_2fort', 'ff', 5582, 4318, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_2morforever', 'ff', 3458, 2582, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_aardvark', 'ff', 5725, 3384, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_anticitizen', 'ff', 9919, 5646, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_attrition', 'ff', 3086, 2571, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_bases', 'ff', 5084, 4099, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_cornfield', 'ff', 4987, 3476, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_crossover', 'ff', 5996, 4577, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_cz2', 'ff', 4672, 3836, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_destroy', 'ff', 4945, 4018, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_dm', 'ff', 1917, 1501, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_dropdown', 'ff', 4529, 3539, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_dustbowl', 'ff', 5457, 4520, 0, 1, 30, 'small', 8.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_epicenter', 'ff', 3781, 3037, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_hunted', 'ff', 6151, 5125, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_impact', 'ff', 4096, 2190, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_monkey', 'ff', 4989, 4082, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_openfire', 'ff', 3173, 2504, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_palermo', 'ff', 6191, 3333, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_pitfall', 'ff', 4485, 3633, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_push', 'ff', 4744, 3849, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_schtop', 'ff', 4802, 3837, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_shutdown2', 'ff', 4703, 3825, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_tiger', 'ff', 2686, 1858, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_vertigo', 'ff', 2010, 1500, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_waterpolo', 'ff', 3209, 2608, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ff_well', 'ff', 4482, 3423, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport01_greenhouse', 'l4d', 979, 3935, 0, 0, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport03_garage', 'l4d', 11413, 6781, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport04_terminal', 'l4d', 2659, 6795, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport05_runway', 'l4d', 8197, 12894, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm01_hilltop', 'l4d', 14734, 5840, 1, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm02_traintunnel', 'l4d', 11001, 3377, 1, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm03_bridge', 'l4d', 1353, 7488, 1, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm04_barn', 'l4d', 3091, 186, 1, 0, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm05_cornfield', 'l4d', 4448, 5460, 0, 0, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital01_apartment', 'l4d', 662, 5571, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital02_subway', 'l4d', 1621, 8552, 0, 0, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital03_sewers', 'l4d', 7045, 14101, 0, 0, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital04_interior', 'l4d', 9513, 16235, 0, 0, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital05_rooftop', 'l4d', 4450, 10005, 0, 0, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown01_caves', 'l4d', 20542, 3156, 1, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown02_drainage', 'l4d', 12149, 4040, 1, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_dawn_ctg', 'nts', 3447, 5426, 0, 1, 30, 'small', 5.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_engage_ctg', 'nts', 4112, 4024, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_ghost_ctg', 'nts', 4951, 6131, 0, 1, 30, 'small', 7.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_isolation_ctg', 'nts', 5357, 3549, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_rise_ctg', 'nts', 2205, 2044, 0, 1, 30, 'small', 3.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_shrine_ctg', 'nts', 4976, 6388, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_skyline_ctg', 'nts', 4516, 2141, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_subsurface_ctg', 'nts', 3319, 1552, 0, 1, 30, 'small', 6.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_tarmac_ctg', 'nts', 2359, 3388, 0, 1, 30, 'small', 5.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('nt_transit_ctg', 'nts', 2749, 1879, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0);
DROP TABLE `hlstats_Livestats`;
CREATE TABLE IF NOT EXISTS `hlstats_Livestats` (
`player_id` int(10) NOT NULL default '0',
`server_id` int(4) NOT NULL default '0',
`cli_address` varchar(32) NOT NULL default '',
`cli_city` varchar(64) NOT NULL default '',
`cli_country` varchar(64) NOT NULL default '',
`cli_flag` varchar(16) NOT NULL default '',
`cli_state` varchar(64) NOT NULL default '',
`cli_lat` FLOAT(7,4) NULL,
`cli_lng` FLOAT(7,4) NULL,
`steam_id` varchar(64) NOT NULL default '',
`name` varchar(64) NOT NULL,
`team` varchar(64) NOT NULL default '',
`kills` int(6) NOT NULL default '0',
`deaths` int(6) NOT NULL default '0',
`suicides` int(6) NOT NULL default '0',
`headshots` int(6) NOT NULL default '0',
`shots` int(11) NOT NULL default '0',
`hits` int(11) NOT NULL default '0',
`is_dead` tinyint(1) NOT NULL default '0',
`has_bomb` int(1) NOT NULL default '0',
`ping` int(6) NOT NULL default '0',
`connected` int(10) NOT NULL default '0',
`skill_change` int(10) NOT NULL default '0',
`skill` int(10) NOT NULL default '0',
PRIMARY KEY (`player_id`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
CREATE TABLE `hlstats_Maps_Counts` (
`rowId` int(11) NOT NULL auto_increment,
`game` varchar(32) character set utf8 NOT NULL,
`map` varchar(64) character set utf8 NOT NULL,
`kills` int(11) NOT NULL,
`headshots` int(11) NOT NULL,
PRIMARY KEY (`game`,`map`),
INDEX ( `rowId` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `hlstats_Maps_Counts` (`game`, `map`, `kills`, `headshots`)
SELECT `hlstats_Servers`.`game`, `hlstats_Events_Frags`.`map`, COUNT(`hlstats_Events_Frags`.`killerId`), SUM(`hlstats_Events_Frags`.`headshot`) FROM `hlstats_Events_Frags` INNER JOIN `hlstats_Servers` ON `hlstats_Events_Frags`.`serverId` = `hlstats_Servers`.`serverId` WHERE `hlstats_Events_Frags`.`map` <> '' GROUP BY `hlstats_Servers`.`game`, `hlstats_Events_Frags`.`map`;
UPDATE `hlstats_Options` SET `opttype` = 2 WHERE `keyname` = 'MinActivity';
ALTER TABLE `hlstats_Players`
ADD `activity` int(11) NOT NULL default '100',
CHANGE `lat` `lat` FLOAT(7,4) NULL,
CHANGE `lng` `lng` FLOAT(7,4) NULL;
INSERT IGNORE INTO `hlstats_Ranks` (`game`, `image`, `minKills`, `maxKills`, `rankName`) VALUES
('nts', 'recruit', 0, 49, 'Recruit'),
('nts', 'private', 50, 99, 'Private'),
('nts', 'private-first-class', 100, 199, 'Private First Class'),
('nts', 'lance-corporal', 200, 299, 'Lance Corporal'),
('nts', 'corporal', 300, 399, 'Corporal'),
('nts', 'sergeant', 400, 499, 'Sergeant'),
('nts', 'staff-sergeant', 500, 599, 'Staff Sergeant'),
('nts', 'gunnery-sergeant', 600, 699, 'Gunnery Sergeant'),
('nts', 'master-sergeant', 700, 799, 'Master Sergeant'),
('nts', 'first-sergeant', 800, 899, 'First Sergeant'),
('nts', 'master-chief', 900, 999, 'Master Chief'),
('nts', 'sergeant-major', 1000, 1199, 'Sergeant Major'),
('nts', 'ensign', 1200, 1399, 'Ensign'),
('nts', 'third-lieutenant', 1400, 1599, 'Third Lieutenant'),
('nts', 'second-lieutenant', 1600, 1799, 'Second Lieutenant'),
('nts', 'first-lieutenant', 1800, 1999, 'First Lieutenant'),
('nts', 'captain', 2000, 2249, 'Captain'),
('nts', 'group-captain', 2250, 2499, 'Group Captain'),
('nts', 'senior-captain', 2500, 2749, 'Senior Captain'),
('nts', 'lieutenant-major', 2750, 2999, 'Lieutenant Major'),
('nts', 'major', 3000, 3499, 'Major'),
('nts', 'group-major', 3500, 3999, 'Group Major'),
('nts', 'lieutenant-commander', 4000, 4499, 'Lieutenant Commander'),
('nts', 'commander', 4500, 4999, 'Commander'),
('nts', 'group-commander', 5000, 5749, 'Group Commander'),
('nts', 'lieutenant-colonel', 5750, 6499, 'Lieutenant Colonel'),
('nts', 'colonel', 6500, 7249, 'Colonel'),
('nts', 'brigadier', 7250, 7999, 'Brigadier'),
('nts', 'brigadier-general', 8000, 8999, 'Brigadier General'),
('nts', 'major-general', 9000, 9999, 'Major General'),
('nts', 'lieutenant-general', 10000, 12499, 'Lieutenant General'),
('nts', 'general', 12500, 14999, 'General'),
('nts', 'commander-general', 15000, 17499, 'Commander General'),
('nts', 'field-vice-marshal', 17500, 19999, 'Field Vice Marshal'),
('nts', 'field-marshal', 20000, 22499, 'Field Marshal'),
('nts', 'vice-commander-of-the-army', 22500, 24999, 'Vice Commander of the Army'),
('nts', 'commander-of-the-army', 25000, 27499, 'Commander of the Army'),
('nts', 'high-commander', 27500, 29999, 'High Commander'),
('nts', 'supreme-commander', 30000, 34999, 'Supreme Commander'),
('nts', 'terminator', 35000, 9999999, 'Terminator');
INSERT IGNORE INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`) VALUES
('ak47',1,0,'cstrike','1_ak47.png','Award of AK47'),
('awp',1,0,'cstrike','1_awp.png','Award of AWP Sniper'),
('deagle',1,0,'cstrike','1_deagle.png','Award of Desert Eagle'),
('elite',1,0,'cstrike','1_elite.png','Award of Dual Beretta Elites'),
('famas',1,0,'cstrike','1_famas.png','Award of Fusil Automatique'),
('galil',1,0,'cstrike','1_galil.png','Award of Galil'),
('glock18',1,0,'cstrike','1_glock.png','Award of Glock'),
('grenade',1,0,'cstrike','1_hegrenade.png','Award of Grenade'),
('knife',1,0,'cstrike','1_knife.png','Award of Combat Knife'),
('latency',1,0,'cstrike','1_latency.png','Award of Lowpinger'),
('m3',1,0,'cstrike','1_m3.png','Award of M3 Super'),
('m4a1',1,0,'cstrike','1_m4a1.png','Award of Colt M4A1'),
('p90',1,0,'cstrike','1_p90.png','Award of P90'),
('scout',1,0,'cstrike','1_scout.png','Award of Scout Elite'),
('usp',1,0,'cstrike','1_usp.png','Award of USP'),
('Defused_The_Bomb',1,0,'cstrike','1_defused_the_bomb.png','Award of Bomb Defuser'),
('Planted_The_Bomb',1,0,'cstrike','1_planted_the_bomb.png','Award of Bomb Planter'),
('Rescued_A_Hostage',1,0,'cstrike','1_rescued_a_hostage.png','Award of Hostage Rescuer'),
('Assassinated_The_VIP',1,0,'cstrike','1_killed_a_hostage.png','Award of Top Assassin'),
('ak47',5,0,'cstrike','2_ak47.png','Bronze AK47'),
('awp',5,0,'cstrike','2_awp.png','Bronze AWP Sniper'),
('deagle',5,0,'cstrike','2_deagle.png','Bronze Desert Eagle'),
('elite',5,0,'cstrike','2_elite.png','Bronze Dual Beretta Elites'),
('famas',5,0,'cstrike','2_famas.png','Bronze Fusil Automatique'),
('galil',5,0,'cstrike','2_galil.png','Bronze Galil'),
('glock18',5,0,'cstrike','2_glock.png','Bronze Glock'),
('grenade',5,0,'cstrike','2_hegrenade.png','Bronze Grenade'),
('knife',5,0,'cstrike','2_knife.png','Bronze Combat Knife'),
('latency',5,0,'cstrike','2_latency.png','Bronze Lowpinger'),
('m3',5,0,'cstrike','2_m3.png','Bronze Award M3 Super'),
('m4a1',5,0,'cstrike','2_m4a1.png','Bronze AColt M4A1'),
('p90',5,0,'cstrike','2_p90.png','Bronze P90'),
('scout',5,0,'cstrike','2_scout.png','Bronze Scout Elite'),
('usp',5,0,'cstrike','2_usp.png','Bronze USP'),
('Defused_The_Bomb',5,0,'cstrike','2_defused_the_bomb.png','Bronze Bomb Defuser'),
('Planted_The_Bomb',5,0,'cstrike','2_planted_the_bomb.png','Bronze Bomb Planter'),
('Rescued_A_Hostage',5,0,'cstrike','2_rescued_a_hostage.png','Bronze Hostage Rescuer'),
('Assassinated_The_VIP',5,0,'cstrike','2_killed_a_hostage.png','Bronze Top Assassin'),
('ak47',12,0,'cstrike','3_ak47.png','Silver AK47'),
('awp',12,0,'cstrike','3_awp.png','Silver Sniper'),
('deagle',12,0,'cstrike','3_deagle.png','Silver Desert Eagle'),
('elite',12,0,'cstrike','3_elite.png','Silver Dual Beretta Elites'),
('famas',12,0,'cstrike','3_famas.png','Silver Fusil Automatique'),
('galil',12,0,'cstrike','3_galil.png','Silver Galil'),
('glock18',12,0,'cstrike','3_glock.png','Silver Glock'),
('grenade',12,0,'cstrike','3_hegrenade.png','Silver Grenade'),
('knife',12,0,'cstrike','3_knife.png','Silver Combat Knife'),
('latency',12,0,'cstrike','3_latency.png','Silver Lowpinger'),
('m3',12,0,'cstrike','3_m3.png','Silver M3 Super'),
('m4a1',12,0,'cstrike','3_m4a1.png','Silver Colt M4A1'),
('p90',12,0,'cstrike','3_p90.png','Silver P90'),
('scout',12,0,'cstrike','3_scout.png','Silver Scout Elite'),
('usp',12,0,'cstrike','3_usp.png','Silver USP'),
('Defused_The_Bomb',12,0,'cstrike','3_defused_the_bomb.png','Silver Bomb Defuser'),
('Planted_The_Bomb',12,0,'cstrike','3_planted_the_bomb.png','Silver Bomb Planter'),
('Rescued_A_Hostage',12,0,'cstrike','3_rescued_a_hostage.png','Silver Hostage Rescuer'),
('Assassinated_The_VIP',12,0,'cstrike','3_killed_a_hostage.png','Silver Top Assassin'),
('ak47',20,0,'cstrike','4_ak47.png','Gold AK47'),
('awp',20,0,'cstrike','4_awp.png','Gold AWP Sniper'),
('deagle',20,0,'cstrike','4_deagle.png','Gold Desert Eagle'),
('elite',20,0,'cstrike','4_elite.png','Gold Dual Beretta Elites'),
('famas',20,0,'cstrike','4_famas.png','Gold Fusil Automatique'),
('galil',20,0,'cstrike','4_galil.png','GoldGalil'),
('glock18',20,0,'cstrike','4_glock.png','Gold Glock'),
('grenade',20,0,'cstrike','4_hegrenade.png','Gold Grenade'),
('knife',20,0,'cstrike','4_knife.png','Gold Combat Knife'),
('latency',20,0,'cstrike','4_latency.png','Gold Lowpinger'),
('m3',20,0,'cstrike','4_m3.png','Gold M3 Super'),
('m4a1',20,0,'cstrike','4_m4a1.png','Gold Colt M4A1'),
('p90',20,0,'cstrike','4_p90.png','Gold P90'),
('scout',20,0,'cstrike','4_scout.png','Gold Scout Elite'),
('usp',20,0,'cstrike','4_usp.png','Gold USP'),
('Defused_The_Bomb',20,0,'cstrike','4_defused_the_bomb.png','Gold Bomb Defuser'),
('Planted_The_Bomb',20,0,'cstrike','4_planted_the_bomb.png','Gold Bomb Planter'),
('Rescued_A_Hostage',20,0,'cstrike','4_rescued_a_hostage.png','Gold Hostage Rescuer'),
('Assassinated_The_VIP',20,0,'cstrike','4_killed_a_hostage.png','Gold Top Assassin'),
('ak47',30,0,'cstrike','5_ak47.png','Platinum AK47'),
('awp',30,0,'cstrike','5_awp.png','Platinum AWP Sniper'),
('deagle',30,0,'cstrike','5_deagle.png','Platinum Desert Eagle'),
('elite',30,0,'cstrike','5_elite.png','Platinum Dual Beretta Elites'),
('famas',30,0,'cstrike','5_famas.png','Platinum Fusil Automatique'),
('galil',30,0,'cstrike','5_galil.png','Platinum Galil'),
('glock18',30,0,'cstrike','5_glock.png','Platinum Glock'),
('grenade',30,0,'cstrike','5_hegrenade.png','Platinum Grenade'),
('knife',30,0,'cstrike','5_knife.png','PlatinumCombat Knife'),
('latency',30,0,'cstrike','5_latency.png','PlatinumLowpinger'),
('m3',30,0,'cstrike','5_m3.png','Platinum M3 Super'),
('m4a1',30,0,'cstrike','5_m4a1.png','Platinum Colt M4A1'),
('p90',30,0,'cstrike','5_p90.png','Platinum P90'),
('scout',30,0,'cstrike','5_scout.png','Platinum Scout Elite'),
('usp',30,0,'cstrike','5_usp.png','Platinum USP'),
('Defused_The_Bomb',30,0,'cstrike','5_defused_the_bomb.png','Platinum Bomb Defuser'),
('Planted_The_Bomb',30,0,'cstrike','5_planted_the_bomb.png','Platinum Bomb Planter'),
('Rescued_A_Hostage',30,0,'cstrike','5_rescued_a_hostage.png','Platinum Hostage Rescuer'),
('Assassinated_The_VIP',30,0,'cstrike','5_killed_a_hostage.png','Platinum Top Assassin'),
('ak47',50,0,'cstrike','6_ak47.png','Supreme AK47'),
('awp',50,0,'cstrike','6_awp.png','Supreme AWP Sniper'),
('deagle',50,0,'cstrike','6_deagle.png','Supremef Desert Eagle'),
('elite',50,0,'cstrike','6_elite.png','Supreme Dual Beretta Elites'),
('famas',50,0,'cstrike','6_famas.png','Supreme Fusil Automatique'),
('galil',50,0,'cstrike','6_galil.png','Supreme Galil'),
('glock18',50,0,'cstrike','6_glock.png','Supreme Glock'),
('grenade',50,0,'cstrike','6_hegrenade.png','Supreme Grenade'),
('knife',50,0,'cstrike','6_knife.png','Supreme Combat Knife'),
('latency',50,0,'cstrike','6_latency.png','Supreme Lowpinger'),
('m3',50,0,'cstrike','6_m3.png','Supreme M3 Super'),
('m4a1',50,0,'cstrike','6_m4a1.png','Supreme Colt M4A1'),
('p90',50,0,'cstrike','6_p90.png','Supremef P90'),
('scout',50,0,'cstrike','6_scout.png','Supreme Scout Elite'),
('usp',50,0,'cstrike','6_usp.png','Supreme USP'),
('Defused_The_Bomb',50,0,'cstrike','6_defused_the_bomb.png','Supreme Bomb Defuser'),
('Planted_The_Bomb',50,0,'cstrike','6_planted_the_bomb.png','Supreme Bomb Planter'),
('Rescued_A_Hostage',50,0,'cstrike','6_rescued_a_hostage.png','Supreme Hostage Rescuer'),
('Assassinated_The_VIP',50,0,'cstrike','6_killed_a_hostage.png','Supreme Top Assassin'),
('*total connection hours*',25,2,'css','1_connect.png','Connection Time 25 Hours'),
('*total connection hours*',50,2,'css','2_connect.png','Connection Time 50 Hours'),
('*total connection hours*',75,2,'css','3_connect.png','Connection Time 75 Hours'),
('*total connection hours*',100,2,'css','4_connect.png','Connection Time 100 Hours'),
('*total connection hours*',125,2,'css','5_connect.png','Connection Time 125 Hours'),
('*total connection hours*',150,2,'css','6_connect.png','Connection Time 150 Hours'),
('latency',3,0,'hl2mp','1_latency.png','Award of Lowpinger'),
('mostkills',3,0,'hl2mp','1_mostkills.png','Award of Most Kills'),
('suicide',3,0,'hl2mp','1_suicide.png','Award of Most Suicides'),
('latency',7,0,'hl2mp','2_latency.png','Bronze Lowpinger'),
('mostkills',7,0,'hl2mp','2_mostkills.png','Most Kills - Bronze'),
('suicide',7,0,'hl2mp','2_suicide.png','Most Suicides - Bronze'),
('latency',12,0,'hl2mp','3_latency.png','Silver Lowpinger'),
('mostkills',12,0,'hl2mp','3_mostkills.png','Most Kills - Silver'),
('suicide',12,0,'hl2mp','3_suicide.png','Most Suicides - Silver'),
('latency',17,0,'hl2mp','x_latency.png','Supreme Lowpinger'),
('mostkills',17,0,'hl2mp','x_mostkills.png','Most Kills - Supreme'),
('suicide',17,0,'hl2mp','x_suicide.png','Most Suicides - Supreme'),
('galil',1,0,'css','1_galil.png','Award of Galil'),
('galil',5,0,'css','2_galil.png','Bronze Galil'),
('galil',12,0,'css','3_galil.png','Silver Galil'),
('galil',20,0,'css','4_galil.png','Gold Galil'),
('galil',30,0,'css','5_galil.png','Platinum Galil'),
('galil',50,0,'css','6_galil.png','Supreme Galil');
DELETE FROM `hlstats_Ribbons` WHERE `ribbonName` = 'Army Service' AND `game` = 'css' AND `image` = 'ribbon_of_army_service.gif';
INSERT IGNORE INTO `hlstats_Roles` (`game`, `code`, `name`, `hidden`) VALUES
('aoc', 'Longbowman', 'Longbowman', '0'),
('aoc', 'Crossbowman', 'Crossbowman', '0'),
('aoc', 'Javelineer', 'Javelineer', '0'),
('aoc', 'Man at Arms', 'Man at Arms', '0'),
('aoc', 'Sergeant', 'Sergeant', '0'),
('aoc', 'Guardsman', 'Guardsman', '0'),
('aoc', 'Crusader', 'Crusader', '0'),
('aoc', 'Knight', 'Knight', '0'),
('aoc', 'Heavy Knight', 'Heavy Knight', '0');
ALTER TABLE `hlstats_Servers`
ADD `last_event` int(10) unsigned NOT NULL default '0',
CHANGE `lat` `lat` FLOAT(7,4) NULL,
CHANGE `lng` `lng` FLOAT(7,4) NULL;
DELETE FROM `hlstats_Servers_Config` WHERE `parameter` = 'AddressPort';
ALTER TABLE `hlstats_Servers_Teamspeak` RENAME TO `hlstats_Servers_VoiceComm`;
ALTER TABLE `hlstats_Servers_VoiceComm`
CHANGE `tsId` `serverId` int(11) unsigned NOT NULL auto_increment,
CHANGE `tsName` `name` varchar(128) NOT NULL,
CHANGE `tsAddr` `addr` varchar(128) NOT NULL,
CHANGE `tsPassword` `password` varchar(128) default NULL,
CHANGE `tsDesc` `descr` varchar(255) default NULL,
CHANGE `tsQueryPort` `queryPort` int(11) unsigned NOT NULL default '51234',
CHANGE `tsUDPPort` `UDPPort` int(11) unsigned NOT NULL default '8767',
ADD COLUMN `serverType` tinyint(4) NOT NULL default '0';
ALTER TABLE `hlstats_server_load` ADD KEY `timestamp` (`timestamp`);
INSERT IGNORE INTO `hlstats_Teams` (`game`, `code`, `name`, `hidden`, `playerlist_bgcolor`, `playerlist_color`, `playerlist_index`) VALUES
('nts','Jinrai','Jinrai','0','#9AFF9A','#447044',1),
('nts','NSF','NSF','0','#7EA5CC','#4F677F',2);
ALTER TABLE `hlstats_Trend` ADD KEY `timestamp` (`timestamp`);
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`) VALUES
('nts', 'aa13', 'AA13', 1.00),
('nts', 'grenade_projectile', 'Frag Grenade', 1.00),
('nts', 'jitte', 'Jitte', 1.00),
('nts', 'jittescoped', 'Jitte (Scoped)', 1.00),
('nts', 'knife', 'Knife', 1.50),
('nts', 'kyla', 'KYLA', 1.00),
('nts', 'm41', 'M41', 1.00),
('nts', 'm41l', 'M41L', 1.00),
('nts', 'milso', 'MilSO', 1.00),
('nts', 'mp5', 'MP5', 1.00),
('nts', 'mpn', 'MPN45', 1.00),
('nts', 'mx', 'MX', 1.00),
('nts', 'mx_silenced', 'MX Silenced', 1.00),
('nts', 'pz', 'PZ252', 1.00),
('nts', 'grenade_detapack', 'DetPac', 1.00),
('nts', 'smac', 'SMAC', 1.00),
('nts', 'srm', 'SRM', 1.00),
('nts', 'srm_s', 'SRM-S', 1.00),
('nts', 'srs', 'SRS', 1.00),
('nts', 'supa7', 'MURATA SUPA 7', 1.00),
('nts', 'tachi', 'TACHI', 1.00),
('nts', 'zr68c', 'ZR68C', 1.00),
('nts', 'zr68l', 'ZR68L', 1.00),
('nts', 'zr68s', 'ZR68S', 1.00);
INSERT IGNORE INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT `code`, 'deflect_arrow', 'Deflected Arrow', 2 FROM hlstats_Games WHERE `realgame` = 'tf');
UPDATE `hlstats_Options` SET `value` = '1.6.0' WHERE `keyname` = 'version';

View File

@ -0,0 +1,269 @@
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'killed_charged_medic', 2, 0, '', 'Killed charged medic', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
UPDATE hlstats_Options SET opttype = 2 WHERE keyname = 'Proxy_Daemons';
INSERT IGNORE INTO `hlstats_Options` (`keyname`, `value`, `opttype`) VALUES
('Proxy_Key', '', 1),
('Proxy_Daemons', '', 2);
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'O',code,'capblock','Capture Blocked','flags blocked' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'30cal','.30 Caliber Machine Gun','kills with .30 Caliber Machine Gun' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'c96','Pistol c96','kills with Pistol c96' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'k98','Mauser Kar 98k','kills with Mauser Kar 98k' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'k98_scoped','Mauser Karbiner k98 Sniper Rifle','kills with Mauser Karbiner k98 Sniper Rifle' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'m1carbine','M1 Carbine','kills with M1 Carbine' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'p38','Pistol 38','kills with Pistol 38' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'riflegren_ger','German Rifle Grenade','kills with German Rifle Grenade' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'riflegren_us','M1 Garand Rifle','kills with M1 Garand Rifle' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'smoke_us','U.S. Smoke Grenade','kills with the U.S. Smoke Grenade' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'smoke_ger','German Smoke Grenade','kills with the German Smoke Grenade' FROM hlstats_Games WHERE `realgame` = 'dods');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'backstab', 'Backstabber', 'backstab kills' FROM hlstats_Games WHERE `realgame` = 'ff');
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_airport01_greenhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_airport01_greenhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_airport03_offices";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_airport04_terminal";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_airport05_runway";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_farm01_hilltop";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_farm02_traintunnel";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_farm03_bridge";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_farm04_barn";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_farm05_cornfield";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_hospital01_apartment";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_hospital02_subway";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_hospital03_sewers";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_hospital04_interior";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_hospital05_rooftop";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_smalltown01_caves";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_smalltown02_drainage";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_smalltown03_ranchhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_smalltown04_mainstreet";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_smalltown05_houseboat";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_airport01_greenhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_airport01_greenhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_airport03_offices";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_airport04_terminal";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_airport05_runway";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_farm01_hilltop";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_farm02_traintunnel";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_farm03_bridge";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_farm04_barn";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_farm05_cornfield";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_hospital01_apartment";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_hospital02_subway";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_hospital03_sewers";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_hospital04_interior";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_hospital05_rooftop";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_smalltown01_caves";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_smalltown02_drainage";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_smalltown03_ranchhouse";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_smalltown04_mainstreet";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_vs_smalltown05_houseboat";
DELETE IGNORE FROM `hlstats_Heatmap_Config` WHERE `game` = "l4d" AND `map` = "l4d_sv_lighthouse";
INSERT IGNORE INTO `hlstats_Heatmap_Config` (`map`, `game`, `xoffset`, `yoffset`, `flipx`, `flipy`, `days`, `brush`, `scale`, `font`, `thumbw`, `thumbh`, `cropx1`, `cropy1`, `cropx2`, `cropy2`) VALUES
('koth_viaduct','tf', 7074, 3773, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('koth_sawmill','tf', 4604, 4094, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('koth_nucleus','tf', 3156, 2520, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ctf_sawmill','tf', 4603, 4073, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('arena_offblast_final','tf', 1920, 1536, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_yukon_final','tf', 6602, 5123, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('2tpl_mine_alpine','tf', 1238, 1462, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_blackmesa','tf', 4110, 1755, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_bloodstained','tf', 7182, 5447, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_corporation_b2','tf', 5272, 3113, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_frontline_a1','tf', 6534, 6439, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_furnace_b3','tf', 6114, 5236, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fy_twotowers','css',591,1561,1,1,30,'small',2.5,10,0.170312,0.170312,0,0,0,0),
('fy_twotowers32','css',591,1561,1,1,30,'small',2.5,10,0.170312,0.170312,0,0,0,0),
('fy_twotowers2009','css',591,1561,1,1,30,'small',2.5,10,0.170312,0.170312,0,0,0,0),
('de_alberta', 'css', 4187, 2071, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_alivemetal', 'css', 1158, 1221, 0, 1, 30, 'small', 2.9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_boston', 'css', 3116, 1189, 0, 1, 30, 'small', 4.4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_carpediem_arena', 'css', 1961, 1262, 0, 1, 30, 'small', 3.2, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_deltamill2', 'css', 2388, 652, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_gristmill', 'css', 1724, -72, 0, 1, 30, 'small', 2.7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_losttemple_pro', 'css', 2495, 1838, 0, 1, 30, 'small', 5.1, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_nightfever', 'css', 3262, 4871, 0, 1, 30, 'small', 6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_pira_legos', 'css', 2964, 3027, 0, 1, 30, 'small', 4.3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_rumpeldust2', 'css', 3678, 3925, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_sandland', 'css', 2795, 2344, 0, 1, 30, 'small', 4.6, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_snowcapped', 'css', 2248, 2633, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_toxin', 'css', 3394, 2023, 0, 1, 30, 'small', 5.4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('de_winery_final', 'css', 2911, 2014, 0, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_anzio', 'dod', 50.97, -82.75, 0, 1, 30, 'small', 1.01, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_avalanche', 'dod', 424, 160, 0, 1, 30, 'small', 1.58, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_charlie', 'dod', 32, 0, 1, 1, 30, 'small', 0.77, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_chemille', 'dod', 692, -568, 1, 1, 30, 'small', 1.19, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_donner', 'dod', 192, -1248, 1, 1, 30, 'small', 1.11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_escape', 'dod', 176, 410, 1, 1, 30, 'small', 1.26, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_falaise', 'dod', 36.5, 227, 0, 1, 30, 'small', 0.82, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_flash', 'dod', 295.99, -504, 1, 1, 30, 'small', 1.19, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_flugplatz', 'dod', 199.5, -33, 0, 1, 30, 'small', 0.85, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_forest', 'dod', 492.5, 361, 1, 1, 30, 'small', 0.9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_glider', 'dod', 426, 308, 0, 1, 30, 'small', 1.14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_jagd', 'dod', 64, 40, 0, 1, 30, 'small', 0.86, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_kalt', 'dod', 0, -504, 0, 1, 30, 'small', 1.22, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_kraftstoff', 'dod', 656, -308, 0, 1, 30, 'small', 1.1, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_merderet', 'dod', 532, 409, 1, 1, 30, 'small', 0.93, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_northbound', 'dod', 83.5, -10.5, 1, 1, 30, 'small', 1.01, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_saints', 'dod', 704, 196, 1, 1, 30, 'small', 1.25, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_sturm', 'dod', 210, 546, 1, 1, 30, 'small', 1.06, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_switch', 'dod', 1146, 582.5, 0, 1, 30, 'small', 1.19, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_vicenza', 'dod', 48, -48, 1, 1, 30, 'small', 1.05, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_zalec', 'dod', 8, -48, 1, 1, 30, 'small', 0.77, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dod_cean', 'dod', 540, 259, 0, 1, 30, 'small', 0.87, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_angst', 'ns', 828, 376, 1, 1, 30, 'small', 1.42, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_core', 'ns', 146, -472, 1, 1, 30, 'small', 2.25, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_daimos', 'ns', 968, -128, 1, 1, 30, 'small', 1.17, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_faceoff', 'ns', 1184, -368, 0, 1, 30, 'small', 1.48, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_kestrel', 'ns', 962, 1648, 1, 1, 30, 'small', 1.42, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_niveus', 'ns', 384, 1728, 0, 1, 30, 'small', 1.27, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_pulse', 'ns', 764, -268, 1, 1, 30, 'small', 1.83, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_sava', 'ns', 310, 974, 0, 1, 30, 'small', 1.09, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_ulysses', 'ns', 688, -1056, 1, 1, 30, 'small', 1.64, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('co_umbra', 'ns', 1760, 192, 0, 1, 30, 'small', 1.21, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_altair', 'ns', 360, 24, 1, 1, 30, 'small', 0.92, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_ayumi', 'ns', 260, -512, 0, 1, 30, 'small', 1.21, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_bast', 'ns', 152.5, 63, 1, 1, 30, 'small', 0.9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_caged', 'ns', 256, 456, 1, 1, 30, 'small', 0.95, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_eclipse', 'ns', 164, -40, 1, 1, 30, 'small', 0.91, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_eon', 'ns', 23, 91.5, 1, 1, 30, 'small', 0.92, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_hera', 'ns', 180, -24, 1, 1, 30, 'small', 0.83, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_lost', 'ns', 12, 256, 0, 1, 30, 'small', 1.28, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_lucid', 'ns', 380, -632, 1, 1, 30, 'small', 1.04, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_machina', 'ns', 112, -404, 0, 1, 30, 'small', 0.86, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_metal', 'ns', 164, 388, 0, 1, 30, 'small', 0.91, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_nancy', 'ns', 170, 0, 1, 1, 30, 'small', 0.84, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_nothing', 'ns', 212, 176, 1, 1, 30, 'small', 0.88, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_origin', 'ns', 20, -344, 0, 1, 30, 'small', 0.97, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_shiva', 'ns', 40, 480, 0, 1, 30, 'small', 0.88, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_tanith', 'ns', 44, -4, 0, 1, 30, 'small', 1.03, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ns_veil', 'ns', 160, 144, 0, 1, 30, 'small', 0.91, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('tls_abydos', 'sgtls', 13395, 7390, 1, 1, 30, 'small', 16, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('tls_erebus', 'sgtls', 17564, 11518, 1, 1, 30, 'small', 24, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('tls_lockdown', 'sgtls', 989, 1517, 1, 1, 30, 'small', 4, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('2fort', 'tfc', 90.63, 0, 0, 1, 30, 'small', 1.03, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('avanti', 'tfc', 304, 192, 0, 1, 30, 'small', 1.17, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('badlands', 'tfc', 8, 0, 1, 1, 30, 'small', 0.95, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('casbah', 'tfc', 552, -124, 0, 1, 30, 'small', 1.1, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('crossover2', 'tfc', 0, 0, 0, 1, 30, 'small', 1.11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cz2', 'tfc', 144, 256, 0, 1, 30, 'small', 1.15, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('dustbowl', 'tfc', 448, 288, 1, 1, 30, 'small', 0.98, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('epicenter', 'tfc', 416, 0, 0, 1, 30, 'small', 1.32, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('flagrun', 'tfc', 0, 704, 0, 1, 30, 'small', 1.07, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('hunted', 'tfc', 432, 76, 1, 1, 30, 'small', 1.42, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('push', 'tfc', 0, 0, 0, 1, 30, 'small', 1.11, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('ravelin', 'tfc', 0, 0, 0, 1, 30, 'small', 1.04, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('rock2', 'tfc', 0, 0, 0, 1, 30, 'small', 0.98, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('warpath', 'tfc', 112, 0, 0, 1, 30, 'small', 1.02, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('well', 'tfc', 0, 0, 0, 1, 30, 'small', 0.94, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport01_greenhouse', 'l4d', 175, 5272, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport02_offices', 'l4d', -1723, 8693, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport03_garage', 'l4d', 11413, 6781, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport04_terminal', 'l4d', 2659, 6795, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_airport05_runway', 'l4d', 8197, 12894, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm01_hilltop', 'l4d', 16423, -3193, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm02_traintunnel', 'l4d', 12106, -2749, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm03_bridge', 'l4d', 2307, -5227, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm04_barn', 'l4d', 1584, 2778, 0, 1, 30, 'small', 17, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_farm05_cornfield', 'l4d', -1851, 7619, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital01_apartment', 'l4d', 662, 5571, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital02_subway', 'l4d', -1621, 8552, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital03_sewers', 'l4d', -7045, 14101, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital04_interior', 'l4d', -9513, 16235, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_hospital05_rooftop', 'l4d', -4450, 10005, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_smalltown01_caves', 'l4d', 20542, -3156, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_smalltown03_ranchhouse', 'l4d', 16026, 2930, 0, 1, 30, 'small', 14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_smalltown05_houseboat', 'l4d', 6554, 5155, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_sv_lighthouse', 'l4d', 4681, 2143, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport01_greenhouse', 'l4d', 175, 5272, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport02_offices', 'l4d', -1723, 8693, 0, 1, 30, 'small', 9, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport03_garage', 'l4d', 11413, 6781, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport04_terminal', 'l4d', 2659, 6795, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_airport05_runway', 'l4d', 8197, 12894, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm01_hilltop', 'l4d', 16423, -3193, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm02_traintunnel', 'l4d', 12106, -2749, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm03_bridge', 'l4d', 2307, -5227, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm04_barn', 'l4d', 1584, 2778, 0, 1, 30, 'small', 17, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_farm05_cornfield', 'l4d', -1851, 7619, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital01_apartment', 'l4d', 662, 5571, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital02_subway', 'l4d', -1621, 8552, 0, 1, 30, 'small', 8, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital03_sewers', 'l4d', -7045, 14101, 0, 1, 30, 'small', 10, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital04_interior', 'l4d', -9513, 16235, 0, 1, 30, 'small', 5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_hospital05_rooftop', 'l4d', -4450, 10005, 0, 1, 30, 'small', 3, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown01_caves', 'l4d', 20542, -3156, 0, 1, 30, 'small', 13, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown03_ranchhouse', 'l4d', 16026, 2930, 0, 1, 30, 'small', 14, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('l4d_vs_smalltown05_houseboat', 'l4d', 6554, 5155, 0, 1, 30, 'small', 12, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_freight','tf', 4470, 3520, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_freight_final','tf', 4477, 3517, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('fy_iceworld','tf', 1600, 1279, 0, 1, 30, 'small', 2.5, 10, 0.170312, 0.170312, 0, 0, 0, 0),
('cp_orange_x3','tf', 5321, 7321, 0, 1, 30, 'small', 7, 10, 0.170312, 0.170312, 0, 0, 0, 0);
ALTER TABLE `hlstats_Players`
DROP INDEX `clan`,
ADD INDEX `skill` (`skill`),
ADD INDEX `game` (`game`),
ADD INDEX `kills` (`kills`);
ALTER TABLE `hlstats_Events_Frags`
ADD INDEX `weapon16` (`weapon`(16)),
ADD INDEX `killerRole` (`killerRole`(8));
ALTER TABLE `hlstats_Events_PlayerPlayerActions`
ADD INDEX `actionId` (`actionId`);
ALTER TABLE `hlstats_Players_History`
ADD INDEX `playerId` (`playerId`);
ALTER TABLE `hlstats_Ranks`
ADD INDEX `game` (`game`(8));
ALTER TABLE `hlstats_Servers_VoiceComm`
DROP INDEX `address`,
ADD UNIQUE `address` ( `addr` , `queryPort` );
ALTER TABLE `hlstats_PlayerNames`
ADD INDEX `name16` (`name`(16));
ALTER TABLE `hlstats_Heatmap_Config` ADD `rotate` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `flipy` ;
INSERT IGNORE INTO `hlstats_Actions` (`game`, `code`, `reward_player`, `reward_team`, `team`, `description`, `for_PlayerActions`, `for_PlayerPlayerActions`, `for_TeamActions`, `for_WorldActions`)
(SELECT code, 'death_sawblade', 0, 0, '', 'LOL SAW''D', '1', '0', '0', '0' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`)
(SELECT 'deflect_arrow',1,0,code,'1_deflect_arrow.png','Bronze Deflected Arrow' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`)
(SELECT 'deflect_arrow',5,0,code,'2_deflect_arrow.png','Silver Deflected Arrow' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Ribbons` (`awardCode`, `awardCount`, `special`, `game`, `image`, `ribbonName`)
(SELECT 'deflect_arrow',10,0,code,'3_deflect_arrow.png','Gold Deflected Arrow' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'backstab', 'Backstab', 1 FROM hlstats_Games WHERE realgame = 'ff');
INSERT INTO `hlstats_Weapons` (`game`, `code`, `name`, `modifier`)
(SELECT code, 'telefrag', 'Telefrag', 2 FROM hlstats_Games WHERE realgame = 'tf');
INSERT IGNORE INTO `hlstats_Awards` (`awardType`, `game`, `code`, `name`, `verb`)
(SELECT 'W',code,'telefrag', 'Lucky Duck', 'kills by telefrag' FROM hlstats_Games WHERE `realgame` = 'tf');
INSERT IGNORE INTO `hlstats_Options_Choices` (`keyname`, `value`, `text`, `isDefault`) VALUES
('google_map_region', 'ROMANIA', 'Romania', 0);
UPDATE `hlstats_Options` SET `value` = '1.6.1' WHERE `keyname` = 'version';

View File

@ -0,0 +1,13 @@
HLstatsX: Community Edition
Version 1.6.2
IF YOU ARE CURRENTLY RUNNING 1.6.1 AND ARE UPGRADING TO 1.6.2:
Upload the web portion of the package to your web site and visit http://path_to_your/stats/updater/.
You will receive instructions to upgrade your database to the latest revision.
IF YOU ARE NOT RUNNING 1.6.1 AND WANT TO UPGRADE TO 1.6.2:
Run every upgrade SQL found in the "sql" folder through 1.6.1. Afterwards upload the "web" folder contents to your web server and go to http://path_to_your/stats/updater/.
No upgrade.sql will be provided for future releases.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

7599
sql/install.sql Normal file

File diff suppressed because it is too large Load Diff

33
web/autocomplete.php Normal file
View File

@ -0,0 +1,33 @@
<?php
define('IN_HLSTATS', true);
// Load required files
require('config.php');
require(INCLUDE_PATH . '/class_db.php');
require(INCLUDE_PATH . '/functions.php');
$db_classname = 'DB_' . DB_TYPE;
if (class_exists($db_classname))
{
$db = new $db_classname(DB_ADDR, DB_USER, DB_PASS, DB_NAME, DB_PCONNECT);
}
else
{
error('Database class does not exist. Please check your config.php file for DB_TYPE');
}
$game = valid_request($_GET['game']);
$search = valid_request($_POST['value']);
$game_escaped = $db->escape($game);
$search_escaped = $db->escape($search);
if (is_string($search) && strlen($search) >= 3 && strlen($search) < 64) {
// Building the query
$sql = "SELECT hlstats_PlayerNames.name FROM hlstats_PlayerNames INNER JOIN hlstats_Players ON hlstats_PlayerNames.playerId = hlstats_Players.playerId WHERE game = '{$game_escaped}' AND name LIKE '{$search_escaped}%'";
$result = $db->query($sql);
while($row=$db->fetch_row($result)) {
print "<li class=\"playersearch\">" . $row[0] . "</li>\n";
}
}
?>

95
web/config.php Normal file
View File

@ -0,0 +1,95 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly'); }
// DB_ADDR - The address of the database server, in host:port format.
// (You might also try setting this to e.g. ":/tmp/mysql.sock" to
// use a Unix domain socket, if your mysqld is on the same box as
// your web server.)
define("DB_ADDR", "localhost");
// DB_USER - The username to connect to the database as
define("DB_USER", "");
// DB_PASS - The password for DB_USER
define("DB_PASS", "");
// DB_NAME - The name of the database
define("DB_NAME", "");
// DB_TYPE - The database server type. Only "mysql" is supported currently
define("DB_TYPE", "mysql");
// DB_PCONNECT - Set to 1 to use persistent database connections. Persistent
// connections can give better performance, but may overload
// the database server. Set to 0 to use non-persistent
// connections.
define("DB_PCONNECT", 0);
// INCLUDE_PATH - Filesystem path to the includes directory, relative to hlstats.php. This must be specified
// as a relative path.
//
// Under Windows, make sure you use forward slash (/) instead
// of back slash (\) and use absolute paths if you are having any issue.
define("INCLUDE_PATH", "./includes");
// PAGE_PATH - Filesystem path to the pages directory, relative to hlstats.php. This must be specified
// as a relative path.
//
// Under Windows, make sure you use forward slash (/) instead
// of back slash (\) and use absolute paths if you are having any issue.
define("PAGE_PATH", "./pages");
// PAGE_PATH - Filesystem path to the hlstatsimg directory, relative to hlstats.php. This must be specified
// as a relative path.
//
// Under Windows, make sure you use forward slash (/) instead
// of back slash (\) and use absolute paths if you are having any issue.
//
// Note: the progress directory under hlstatsimg must be writable!!
define("IMAGE_PATH", "./hlstatsimg");
// How often dynamicly generated images are updated (in seconds)
define("IMAGE_UPDATE_INTERVAL", 300);
//define("DB_DEBUG", true);
?>

61
web/css/Autocompleter.css Normal file
View File

@ -0,0 +1,61 @@
ul.autocompleter-choices
{
position: absolute;
margin: 0;
padding: 0;
list-style: none;
border: 1px solid #7c7c7c;
border-left-color: #c3c3c3;
border-right-color: #c3c3c3;
border-bottom-color: #ddd;
background-color: #fff;
text-align: left;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
z-index: 50;
}
ul.autocompleter-choices li
{
position: relative;
margin: -2px 0 0 0;
padding: 0.2em 1.5em 0.2em 1em;
display: block;
float: none !important;
cursor: pointer;
font-weight: normal;
white-space: nowrap;
font-size: 1em;
line-height: 1.5em;
}
ul.autocompleter-choices li.autocompleter-selected
{
background-color: #444;
color: #fff;
}
ul.autocompleter-choices span.autocompleter-queried
{
display: inline;
float: none;
font-weight: bold;
margin: 0;
padding: 0;
}
ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried
{
color: #9FCFFF;
}
li.playersearch {
color: #000;
}
input.autocompleter-loading
{
background-image: url(../css/spinner.gif);
background-repeat: no-repeat;
background-position: right 50%;
}

141
web/css/SqueezeBox.css Normal file
View File

@ -0,0 +1,141 @@
/**
* SqueezeBox - Expandable Lightbox
*
* Allows to open various content as modal,
* centered and animated box.
*
* @version 1.1 rc4
*
* @license MIT-style license
* @author Harald Kirschner <mail [at] digitarald.de>
* @copyright Author
*/
#sbox-overlay {
position: absolute;
background-color: #000;
left: 0px;
top: 0px;
zoom: 1;
}
#sbox-window {
position: absolute;
background-color: #fff;
text-align: left;
overflow: visible;
padding: 10px;
/* invalid values, but looks smoother! */
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#sbox-btn-close {
position: absolute;
width: 30px;
height: 30px;
right: -15px;
top: -15px;
background: url(closebox.png) no-repeat center;
border: none;
}
.sbox-window-ie6 #sbox-btn-close {
background-image: url(closebox.gif);
}
.sbox-loading #sbox-content {
background-image: url(spinner.gif);
background-repeat: no-repeat;
background-position: center;
}
#sbox-content {
clear: both;
overflow: auto;
background-color: #fff;
height: 100%;
width: 100%;
}
.sbox-content-image#sbox-content {
overflow: visible;
}
#sbox-image {
display: block;
}
.sbox-content-image img {
display: block;
width: 100%;
height: 100%;
}
.sbox-content-iframe#sbox-content {
overflow: visible;
}
/* Hides scrollbars */
.body-overlayed {
overflow: hidden;
}
/* Hides flash (Firefox problem) and selects (IE) */
.body-overlayed embed, .body-overlayed object, .body-overlayed select {
visibility: hidden;
}
#sbox-window embed, #sbox-window object, #sbox-window select {
visibility: visible;
}
/* Shadows */
.sbox-bg {
position: absolute;
width: 33px;
height: 40px;
}
.sbox-bg-n {
left: 0;
top: -40px;
width: 100%;
background: url(bg_n.png) repeat-x;
}
.sbox-bg-ne {
right: -33px;
top: -40px;
background: url(bg_ne.png) no-repeat;
}
.sbox-bg-e {
right: -33px;
top: 0;
height: 100%;
background: url(bg_e.png) repeat-y;
}
.sbox-bg-se {
right: -33px;
bottom: -40px;
background: url(bg_se.png) no-repeat;
}
.sbox-bg-s {
left: 0;
bottom: -40px;
width: 100%;
background: url(bg_s.png) repeat-x;
}
.sbox-bg-sw {
left: -33px;
bottom: -40px;
background: url(bg_sw.png) no-repeat;
}
.sbox-bg-w {
left: -33px;
top: 0;
height: 100%;
background: url(bg_w.png) repeat-y;
}
.sbox-bg-nw {
left: -33px;
top: -40px;
background: url(bg_nw.png) no-repeat;
}

BIN
web/css/bg_e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

BIN
web/css/bg_n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

BIN
web/css/bg_ne.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
web/css/bg_nw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
web/css/bg_s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

BIN
web/css/bg_se.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
web/css/bg_sw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
web/css/bg_w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

BIN
web/css/closebox.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

BIN
web/css/closebox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
web/css/spinner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
web/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

82
web/hlstats.css Normal file
View File

@ -0,0 +1,82 @@
.weapon {text-decoration: none;}
input, textarea, select {font-family: Verdana, Arial, sans-serif;font-size: 11px;}
input.textbox, input.checkbox {border-width: 1px;}
input.submit {height: 22px;}
input.smallsubmit {font-size: 9px;height: 20px;}
tt { font-family: Arial, Courier New, Courier, fixed; font-size: 12px;}
BODY {font: 10pt Arial; }
TD {font: 11pt Arial; }
h2 {font: 11px Arial; }
h1 {font: 11px Arial; }
h3 {font: 11px Arial; }
.helpwindow {
position:fixed;
top:10px;
left:10px;
width:95%;
visibility:hidden;
border:thin solid red;
background-color:#AAAAAA;
color:#FFFFFF;
font-family: Courier New, Courier, Arial, fixed;
font-size:10pt;
}
table#accordion
{
border-collapse: collapse;
}
table#accordion tr.toggler td
{
border-width: 0 0 0px 1px;
}
#footer {
text-align: center;
}
.header_gameslist {
margin: 0 auto;
float: right;
position: absolute;
top:0;
right:0;
}
ul#header_gameslist{
margin: auto;
text-align: right;
}
ul#header_gameslist li{
list-style: none;
float: left;
padding: 0 10px;
}
#ingame .headerblock a:visited a:link {
color: #FFFFFF;
}
.location .arrow {
font-size: 14px;
}
.warning {
border: thin solid red;
padding: 1em;
}
.warning .warning-heading {
font-size: 2em;
}
.warning .warning-text {
font-size: 1em;
}

233
web/hlstats.php Normal file
View File

@ -0,0 +1,233 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
define('IN_HLSTATS', true);
require('config.php');
$historical_cache=0;
if(defined('HISTORICAL_CACHE'))
{
$historical_cache=constant('HISTORICAL_CACHE');
}
if($historical_cache==1)
{
$rawmd5=md5(http_build_query($_REQUEST));
$dir1=substr($rawmd5,0,1);
$dir2=substr($rawmd5,1,1);
$cachetarget=sprintf("cache/%s/%s/%s", $dir1, $dir2, $rawmd5);
@mkdir("cache/$dir1");
@mkdir("cache/$dir1/$dir2");
if(file_exists($cachetarget))
{
file_put_contents("cache/cachehit",$cachetarget . "\n", FILE_APPEND);
echo file_get_contents($cachetarget);
die;
}
}
session_start();
if((!empty($_GET['logout'])) && $_GET['logout'] == '1') {
unset($_SESSION['loggedin']);
header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']);
die;
}
// Several stuff added by Malte Bayer
global $scripttime, $siteurlneo;
$scripttime = microtime(true);
$siteurlneo='http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],strrchr($_SERVER['PHP_SELF'],'/'))+1);
$siteurlneo=str_replace('\\','/',$siteurlneo);
// Several Stuff end
foreach ($_SERVER as $key => $entry) {
if ($key !== 'HTTP_COOKIE') {
$search_pattern = array('/<script>/', '/<\/script>/', '/[^A-Za-z0-9.\-\/=:;_?#&~]/');
$replace_pattern = array('', '', '');
$entry = preg_replace($search_pattern, $replace_pattern, $entry);
if ($key == "PHP_SELF") {
if ((strrchr($entry, '/') !== '/hlstats.php') &&
(strrchr($entry, '/') !== '/ingame.php') &&
(strrchr($entry, '/') !== '/show_graph.php') &&
(strrchr($entry, '/') !== '/sig.php') &&
(strrchr($entry, '/') !== '/sig2.php') &&
(strrchr($entry, '/') !== '/index.php') &&
(strrchr($entry, '/') !== '/status.php') &&
(strrchr($entry, '/') !== '/top10.php') &&
(strrchr($entry, '/') !== '/config.php') &&
(strrchr($entry, '/') !== '/') &&
($entry !== '')) {
header("Location: http://$siteurlneo/hlstats.php");
exit;
}
}
$_SERVER[$key] = $entry;
}
}
@header('Content-Type: text/html; charset=utf-8');
// do not report NOTICE warnings
@error_reporting(E_ALL ^ E_NOTICE);
////
//// Initialisation
////
define('PAGE', 'HLSTATS');
///
/// Classes
///
// Load required files
require(INCLUDE_PATH . '/class_db.php');
require(INCLUDE_PATH . '/class_table.php');
require(INCLUDE_PATH . '/functions.php');
$db_classname = 'DB_' . DB_TYPE;
if ( class_exists($db_classname) )
{
$db = new $db_classname(DB_ADDR, DB_USER, DB_PASS, DB_NAME, DB_PCONNECT);
}
else
{
error('Database class does not exist. Please check your config.php file for DB_TYPE');
}
$g_options = getOptions();
if (!isset($g_options['scripturl'])) {
$g_options['scripturl'] = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
}
////
//// Main
////
$game = valid_request(isset($_GET['game'])?$_GET['game']:'', 0);
if (!$game)
{
$game = isset($_SESSION['game'])?$_SESSION['game']:'';
}
else
{
$_SESSION['game'] = $game;
}
if (!$realgame && $game)
{
$realgame = getRealGame($game);
$_SESSION['realgame'] = $realgame;
}
$mode = isset($_GET['mode'])?$_GET['mode']:'';
$valid_modes = array(
'players',
'clans',
'weapons',
'roles',
'rolesinfo',
'maps',
'actions',
'claninfo',
'playerinfo',
'weaponinfo',
'mapinfo',
'actioninfo',
'playerhistory',
'playersessions',
'playerawards',
'search',
'admin',
'help',
'bans',
'servers',
'chathistory',
'ranks',
'rankinfo',
'ribbons',
'ribboninfo',
'chat',
'globalawards',
'awards',
'dailyawardinfo',
'countryclans',
'countryclansinfo',
'teamspeak',
'ventrilo',
'updater',
'profile'
);
if (file_exists('./updater') && $mode != 'updater')
{
pageHeader(array('Update Notice'), array('Update Notice' => ''));
echo "<div class=\"warning\">\n" .
"<span class=\"warning-heading\"><img src=\"".IMAGE_PATH."/warning.gif\" alt=\"Warning\"> Warning:</span><br />\n" .
"<span class=\"warning-text\">The updater folder was detected in your web directory.<br />
To perform a Database Update, please go to <strong><a href=\"{$g_options['scripturl']}?mode=updater\">HLX:CE Database Updater</a></strong> to perform the database update.<br /><br />
<strong>If you have already performed the database update, <strong>you must delete the \"updater\" folder from your web folder.</span>\n</div>";
pageFooter();
die();
}
if ( !in_array($mode, $valid_modes) )
{
$mode = 'contents';
}
if ( file_exists(PAGE_PATH . "/$mode.php") )
{
@include(PAGE_PATH . "/$mode.php");
pageFooter();
}
else
{
header('HTTP/1.1 404 File Not Found', false, 404);
error('Unable to find ' . PAGE_PATH . "/$mode.php");
pageFooter();
}
?>

BIN
web/hlstatsimg/ajax.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
web/hlstatsimg/allies.swf Normal file

Binary file not shown.

BIN
web/hlstatsimg/alyx.swf Normal file

Binary file not shown.

BIN
web/hlstatsimg/award.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
web/hlstatsimg/axis.swf Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More