#
# HLstats Database Installation file
# ----------------------------------
#
# To install, type:
#
# 	mysql hlstats < hlstats.sql
#


#
# Create database (uncomment if you want this)
#

#CREATE DATABASE IF NOT EXISTS hlstats;


#
# Table structure for table 'hlstats_Actions'
#

CREATE TABLE hlstats_Actions (
  id int(10) unsigned NOT NULL auto_increment,
  game varchar(16) DEFAULT 'valve' NOT NULL,
  code varchar(64) DEFAULT '' NOT NULL,
  reward_player int(11) DEFAULT '10' NOT NULL,
  reward_team int(11) DEFAULT '0' NOT NULL,
  team varchar(32) DEFAULT '' NOT NULL,
  description varchar(128),
  for_PlayerActions enum('0', '1') DEFAULT '0' NOT NULL,
  for_PlayerPlayerActions enum('0', '1') DEFAULT '0' NOT NULL,
  for_TeamActions enum('0', '1') DEFAULT '0' NOT NULL,
  for_WorldActions enum('0', '1') DEFAULT '0' NOT NULL,
  PRIMARY KEY (id),
  KEY code (code),
  UNIQUE gamecode (game,code)
);

#
# Table structure for table 'hlstats_Awards'
#

CREATE TABLE hlstats_Awards (
  awardId int(10) unsigned NOT NULL auto_increment,
  awardType enum('W','O') DEFAULT 'W' NOT NULL,
  game varchar(32) DEFAULT 'valve' NOT NULL,
  code varchar(128) DEFAULT '' NOT NULL,
  name varchar(128) DEFAULT '' NOT NULL,
  verb varchar(64) DEFAULT '' NOT NULL,
  d_winner_id int(10) unsigned,
  d_winner_count int(10) unsigned,
  PRIMARY KEY (awardId),
  UNIQUE KEY code (game, awardType, code)
);

#
# Table structure for table 'hlstats_Clans'
#

CREATE TABLE hlstats_Clans (
  clanId int(10) unsigned NOT NULL auto_increment,
  tag varchar(32) DEFAULT '' NOT NULL,
  name varchar(128) DEFAULT '' NOT NULL,
  homepage varchar(64) DEFAULT '' NOT NULL,
  game varchar(16) DEFAULT '' NOT NULL,
  PRIMARY KEY (clanId),
  KEY game (game),
  UNIQUE tag (game,tag)
);

#
# Table structure for table 'hlstats_ClanTags'
#

CREATE TABLE hlstats_ClanTags (
  id int(10) unsigned NOT NULL auto_increment,
  pattern varchar(64) DEFAULT '' NOT NULL,
  position enum('EITHER','START','END') DEFAULT 'EITHER' NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY pattern(pattern)
);

#
# Dumping data for table 'hlstats_ClanTags'
#

INSERT INTO hlstats_ClanTags VALUES (1,'[AXXXXX]','EITHER');
INSERT INTO hlstats_ClanTags VALUES (2,'|AXXXXX|','EITHER');
INSERT INTO hlstats_ClanTags VALUES (3,'(AXXXXX)','EITHER');
INSERT INTO hlstats_ClanTags VALUES (4,'{AXXXXX}','EITHER');
INSERT INTO hlstats_ClanTags VALUES (5,'-=AXXX=-','START');
INSERT INTO hlstats_ClanTags VALUES (6,'=AXXXXX=','START');
INSERT INTO hlstats_ClanTags VALUES (7,'-AXXXXX-','START');
INSERT INTO hlstats_ClanTags VALUES (8,'=[AXXXX]=','START');
INSERT INTO hlstats_ClanTags VALUES (9,'-=|AXXXXXX|=-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (10,'-=[AXXXXXX]=-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (11,'-=]AXXXXXX[=-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (12,'~{|AXXXXXX|}~','EITHER');
INSERT INTO hlstats_ClanTags VALUES (13,'-|-AXXXXXX-|-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (14,'-(AXXXXXX)-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (15,'::AXXXXXX::','EITHER');
INSERT INTO hlstats_ClanTags VALUES (16,'<<AXXXXXX>>','EITHER');
INSERT INTO hlstats_ClanTags VALUES (17,'{{AXXXXXX}}','EITHER');
INSERT INTO hlstats_ClanTags VALUES (18,'((AXXXXXX))','EITHER');
INSERT INTO hlstats_ClanTags VALUES (19,'.|AXXXXXX|.','EITHER');
INSERT INTO hlstats_ClanTags VALUES (20,'--AXXXXXX--','EITHER');
INSERT INTO hlstats_ClanTags VALUES (21,'-)AXXXXXX(-','EITHER');
INSERT INTO hlstats_ClanTags VALUES (22,'/AXXXXXX\\','EITHER');
INSERT INTO hlstats_ClanTags VALUES (23,'//AXXXXXX\\\\','EITHER');
INSERT INTO hlstats_ClanTags VALUES (24,'_AXXXXXX_','EITHER');
INSERT INTO hlstats_ClanTags VALUES (25,'_=|AXXXXXX|=_','EITHER');
INSERT INTO hlstats_ClanTags VALUES (26,'*AXXXXXX*','EITHER');
INSERT INTO hlstats_ClanTags VALUES (27,'.:AXXXXXX:','START');
INSERT INTO hlstats_ClanTags VALUES (28,'[(AXXXXXX)]','EITHER');

#
# Table structure for table 'hlstats_Games'
#

CREATE TABLE hlstats_Games (
  code varchar(16) DEFAULT '' NOT NULL,
  name varchar(128) DEFAULT '' NOT NULL,
  source tinyint(1) DEFAULT '0' NOT NULL,
  hidden enum('0', '1') DEFAULT '0' NOT NULL,
  PRIMARY KEY (code)
);

#
# Table structure for table 'hlstats_HostGroups'
#

CREATE TABLE hlstats_HostGroups (
  id int(11) NOT NULL auto_increment,
  pattern varchar(128) DEFAULT '' NOT NULL,
  name varchar(128) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Dumping data for table 'hlstats_HostGroups'
#

INSERT INTO hlstats_HostGroups VALUES (NULL, '.aol.com', 'AOL');

#
# Table structure for table 'hlstats_Options'
#

CREATE TABLE hlstats_Options (
  keyname varchar(32) DEFAULT '' NOT NULL,
  value varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (keyname)
);

#
# Dumping data for table 'hlstats_Options'
#

INSERT INTO hlstats_Options VALUES ('font_normal','<font face=\"Verdana, Arial, sans-serif\" size=2 class=\"fontNormal\">');
INSERT INTO hlstats_Options VALUES ('fontend_normal','</font>');
INSERT INTO hlstats_Options VALUES ('font_small','<font face=\"Verdana, Arial, sans-serif\" size=1 class=\"fontSmall\">');
INSERT INTO hlstats_Options VALUES ('fontend_small','</font>');
INSERT INTO hlstats_Options VALUES ('font_title','<font face=\"Arial, sans-serif\" size=4 class=\"fontTitle\"><b>');
INSERT INTO hlstats_Options VALUES ('fontend_title','</b></font>');
INSERT INTO hlstats_Options VALUES ('table_bgcolor1','#15154D');
INSERT INTO hlstats_Options VALUES ('table_bgcolor2','#161652');
INSERT INTO hlstats_Options VALUES ('table_wpnbgcolor','#000000');
INSERT INTO hlstats_Options VALUES ('table_border','#001B73');
INSERT INTO hlstats_Options VALUES ('table_head_text','#EEEEEE');
INSERT INTO hlstats_Options VALUES ('table_head_bgcolor','#002E8A');
INSERT INTO hlstats_Options VALUES ('location_link','#FFFFFF');
INSERT INTO hlstats_Options VALUES ('location_text','#FFFFFF');
INSERT INTO hlstats_Options VALUES ('location_bgcolor','#003399');
INSERT INTO hlstats_Options VALUES ('body_leftmargin','10');
INSERT INTO hlstats_Options VALUES ('body_topmargin','15');
INSERT INTO hlstats_Options VALUES ('body_alink','#FFBB00');
INSERT INTO hlstats_Options VALUES ('body_link','#FF9900');
INSERT INTO hlstats_Options VALUES ('body_hlink', '#FF9900');
INSERT INTO hlstats_Options VALUES ('body_vlink','#FF9000');
INSERT INTO hlstats_Options VALUES ('body_text','#EEEEEE');
INSERT INTO hlstats_Options VALUES ('body_bgcolor','#0C1D40');
INSERT INTO hlstats_Options VALUES ('body_background','');
INSERT INTO hlstats_Options VALUES ('imgdir','hlstatsimg');
INSERT INTO hlstats_Options VALUES ('contact','mailto:admin@example.com');
INSERT INTO hlstats_Options VALUES ('sitename','Some Site');
INSERT INTO hlstats_Options VALUES ('siteurl','http://www.example.com');
INSERT INTO hlstats_Options VALUES ('style', 'def');
INSERT INTO hlstats_Options VALUES ('hideAwards', '0');

#
# Table structure for table 'hlstats_Players'
#

CREATE TABLE hlstats_Players (
  playerId int(10) unsigned NOT NULL auto_increment,
  lastName varchar(64) DEFAULT '' NOT NULL,
  clan int(10) unsigned DEFAULT '0' NOT NULL,
  kills int(11) DEFAULT '0' NOT NULL,
  deaths int(11) DEFAULT '0' NOT NULL,
  suicides int(11) DEFAULT '0' NOT NULL,
  skill int(11) DEFAULT '1000' NOT NULL,
  fullName varchar(128),
  email varchar(128),
  homepage varchar(128),
  icq int(10) unsigned,
  game varchar(16) DEFAULT '' NOT NULL,
  hideranking int(1) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (playerId),
  KEY clan (clan),
  KEY game (game)
);

#
# Table structure for table 'hlstats_PlayerNames'
#

CREATE TABLE hlstats_PlayerNames (
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  name varchar(64) DEFAULT '' NOT NULL,
  lastuse datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  numuses int(10) unsigned DEFAULT '0' NOT NULL,
  kills int(11) DEFAULT '0' NOT NULL,
  deaths int(11) DEFAULT '0' NOT NULL,
  suicides int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (playerId,name)
);

#
# Table structure for table 'hlstats_PlayerUniqueIds'
#

CREATE TABLE hlstats_PlayerUniqueIds (
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  uniqueId varchar(64) DEFAULT '' NOT NULL,
  game varchar(16) DEFAULT '' NOT NULL,
  merge int(10) unsigned,
  KEY playerId (playerId),
  PRIMARY KEY (uniqueId,game)
);

#
# Table structure for table 'hlstats_Roles'
#

CREATE TABLE hlstats_Roles (
  roleId int(10) unsigned NOT NULL auto_increment,
  game varchar(16) DEFAULT 'valve' NOT NULL,
  code varchar(32) DEFAULT '' NOT NULL,
  name varchar(64) DEFAULT '' NOT NULL,
  hidden enum('0', '1') DEFAULT '0' NOT NULL,
  PRIMARY KEY (roleId),
  UNIQUE gamecode (game,code)
);

#
# Table structure for table 'hlstats_Servers'
#

CREATE TABLE hlstats_Servers (
  serverId int(10) unsigned NOT NULL auto_increment,
  address varchar(15) DEFAULT '' NOT NULL,
  port int(5) unsigned DEFAULT '0' NOT NULL,
  name varchar(64) DEFAULT '' NOT NULL,
  game varchar(16) DEFAULT 'valve' NOT NULL,
  publicaddress varchar(64) DEFAULT '' NOT NULL,
  statusurl varchar(255),
  rcon_password varchar(48) DEFAULT '' NOT NULL,
  PRIMARY KEY (serverId),
  UNIQUE addressport (address,port)
);

#
# Table structure for table 'hlstats_Teams'
#

CREATE TABLE hlstats_Teams (
  teamId int(10) unsigned NOT NULL auto_increment,
  game varchar(16) DEFAULT 'valve' NOT NULL,
  code varchar(32) DEFAULT '' NOT NULL,
  name varchar(64) DEFAULT '' NOT NULL,
  hidden enum('0', '1') DEFAULT '0' NOT NULL,
  PRIMARY KEY (teamId),
  UNIQUE gamecode (game,code)
);

#
# Table structure for table 'hlstats_Users'
#

CREATE TABLE hlstats_Users (
  username varchar(16) DEFAULT '' NOT NULL,
  password varchar(32) DEFAULT '' NOT NULL,
  acclevel int(11) DEFAULT '0' NOT NULL,
  playerId int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (username)
);

#
# Dumping data for table 'hlstats_Users'
#

INSERT INTO hlstats_Users VALUES ('admin',MD5('123456'),100,0);

#
# Table structure for table 'hlstats_Weapons'
#

CREATE TABLE hlstats_Weapons (
  weaponId int(10) unsigned NOT NULL auto_increment,
  game varchar(16) DEFAULT 'valve' NOT NULL,
  code varchar(32) DEFAULT '' NOT NULL,
  name varchar(64) DEFAULT '' NOT NULL,
  modifier float(10,2) DEFAULT '1.00' NOT NULL,
  PRIMARY KEY (weaponId),
  UNIQUE gamecode (game,code)
);

#
# Table structure for table 'hlstats_Style`
#

CREATE TABLE hlstats_Style (
  keyname varchar(32) NOT NULL default '',
  def varchar(255) NOT NULL default '',
  black varchar(255) NOT NULL default '',
  light_blue varchar(255) NOT NULL default '',
  grey varchar(255) NOT NULL default '',
  ua_style varchar(255) NOT NULL default '',
  red varchar(255) NOT NULL default '',
  light_grey varchar(255) NOT NULL default '',
  white varchar(255) NOT NULL default '',
  PRIMARY KEY  (`keyname`)
) TYPE=MyISAM;

#
# Dumping data for table `hlstats_Style`
#

INSERT INTO hlstats_Style VALUES ('font_normal', '<font face="Verdana, Arial, sans-serif" size=2 class="fontNormal">', '<font face="Courier New, Courier" size=2 class="fontNormal">', '<font face="Verdana, Arial, sans-serif" size=2 class="fontNormal">', '<font face="Georgia, Times New Roman, Times, serif" size=2 class="fontNormal">', '<font face="Verdana,Arial,Helvetica" size="2" class="fontNormal">', '<font face="Verdana, Arial, sans-serif" size=2 class="fontNormal">', '<font face="Georgia, Times New Roman, Times, serif" size=2 class="fontNormal">', '<font face="Geneva, Arial, Helvetica, sans-serif" size=2 class="fontNormal">');
INSERT INTO hlstats_Style VALUES ('fontend_normal', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>');
INSERT INTO hlstats_Style VALUES ('font_small', '<font face="Verdana, Arial, sans-serif" size=1 class="fontSmall">', '<font face="Courier New, Courier" size=1 class="fontSmall">', '<font face="Verdana, Arial, sans-serif" size=1 class="fontSmall">', '<font face="Georgia, Times New Roman, Times, serif" size=1 class="fontSmall">', '<font face="Verdana,Arial,Helvetica" size="1" class="fontSmall">', '<font face="Verdana, Arial, sans-serif" size=1 class="fontSmall">', '<font face="Georgia, Times New Roman, Times, serif" size=1 class="fontSmall">', '<font face="Geneva, Arial, Helvetica, sans-serif" size=1 class="fontSmall">');
INSERT INTO hlstats_Style VALUES ('fontend_small', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>', '</font>');
INSERT INTO hlstats_Style VALUES ('font_title', '<font face="Arial, sans-serif" size=4 class="fontTitle"><b>', '<font face="Courier New, Courier" size=4 class="fontTitle"><b>', '<font face="Arial, sans-serif" size=4 class="fontTitle"><b>', '<font face="Georgia, Times New Roman, Times, serif" size=4 class="fontTitle"><b>', '<font face="Arial,Helvetica" size="3" class="fontTitle"><b>', '<font face="Arial, sans-serif" size=4 class="fontTitle"><b>', '<font face="Georgia, Times New Roman, Times, serif" size=4 class="fontTitle"><b>', '<font face="Geneva, Arial, Helvetica, sans-serif" size=4 class="fontTitle"><b>');
INSERT INTO hlstats_Style VALUES ('fontend_title', '</b></font>', '</b></font>', '</b></font>', '</b></font>', '</b></font>', '</b></font>', '</b></font>', '</b></font>');
INSERT INTO hlstats_Style VALUES ('table_bgcolor1', '#15154D', '#282828', '#3F5576', '#CCCCCC', '#283846', '#550000', '#FFFFFF', '#edf3f9');
INSERT INTO hlstats_Style VALUES ('table_bgcolor2', '#161652', '#282828', '#3F5569', '#999999', '#1F2F3D', '#440000', '#FAFAFA', '#d0dbe6');
INSERT INTO hlstats_Style VALUES ('table_wpnbgcolor', '#000000', '#000000', '#3F5569', '#999999', '#253546', '#440000', '#EAEAEA', '#d0dbe6');
INSERT INTO hlstats_Style VALUES ('table_border', '#001B73', '#E0E0E0', '#59748D', '#333333', '#39495A', '#000000', '#000000', '#000000');
INSERT INTO hlstats_Style VALUES ('table_head_text', '#EEEEEE', '#EEEEEE', '#EEEEEE', '#FFFFFF', '#C6C6C6', '#FFFFFF', '#000000', '#000000');
INSERT INTO hlstats_Style VALUES ('table_head_bgcolor', '#002E8A', '#282828', '#3F5576', '#666666', '#39495A', '#660000', '#AEAEAE', '#E8E8E8');
INSERT INTO hlstats_Style VALUES ('location_link', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#808080', '#FFFFFF', '#FFFFFF', '#AEAEAE', '#000000');
INSERT INTO hlstats_Style VALUES ('location_text', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#000000', '#FFFFFF', '#FFFFFF', '#000000', '#000000');
INSERT INTO hlstats_Style VALUES ('location_bgcolor', '#003399', '#003399', '#3F5576', '#AAAAAA', '#39495A', '#660000', '#EAEAEA', '#E8E8E8');
INSERT INTO hlstats_Style VALUES ('body_leftmargin', '10', '10', '10', '5', '10', '10', '10', '10');
INSERT INTO hlstats_Style VALUES ('body_topmargin', '15', '15', '15', '8', '15', '15', '15', '15');
INSERT INTO hlstats_Style VALUES ('body_alink', '#FFBB00', '#FFFFFF', '#B0B0B0', '#808080', '#C6C6C6', '#800000', '#AEAEAE', '#000000');
INSERT INTO hlstats_Style VALUES ('body_link', '#FF9900', '#FFFFFF', '#B0B0B0', '#808080', '#C6C6C6', '#C0C0C0', '#AEAEAE', '#000000');
INSERT INTO hlstats_Style VALUES ('body_text', '#EEEEEE', '#CCCCCC', '#FFFFFF', '#000000', '#C6C6C6', '#FFFFFF', '#000000', '#000000');
INSERT INTO hlstats_Style VALUES ('body_vlink', '#FF9000', '#FFFFFF', '#B0B0B0', '#808080', '#C6C6C6', '#C0C0C0', '#AEAEAE', '#000000');
INSERT INTO hlstats_Style VALUES ('body_bgcolor', '#0C1D40', '#000000', '#3F5569', '#AAAAAA', '#253546', '#000000', '#EAEAEA', '#FFFFFF');
INSERT INTO hlstats_Style VALUES ('body_background', '', '', '', '', '', '', '', '');
INSERT INTO hlstats_Style VALUES ('body_hlink', '#FF9900', '#494949', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#800000', '#7A7A7A', '#404040');


##
## Events Tables
##

#
# Table structure for table 'hlstats_Events_Admin'
#

CREATE TABLE hlstats_Events_Admin (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(32) DEFAULT '' NOT NULL,
  type varchar(32) DEFAULT 'Unknown' NOT NULL,
  message varchar(128) DEFAULT '' NOT NULL,
  playerName varchar(128) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_ChangeName'
#

CREATE TABLE hlstats_Events_ChangeName (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  oldName varchar(64) DEFAULT '' NOT NULL,
  newName varchar(64) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_ChangeRole'
#

CREATE TABLE hlstats_Events_ChangeRole (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  role varchar(32) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_ChangeTeam'
#

CREATE TABLE hlstats_Events_ChangeTeam (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  team varchar(32) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Connects'
#

CREATE TABLE hlstats_Events_Connects (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(32) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  ipAddress varchar(15) DEFAULT '' NOT NULL,
  hostname varchar(128) DEFAULT '' NOT NULL,
  hostgroup varchar(128) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Disconnects'
#

CREATE TABLE hlstats_Events_Disconnects (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Entries'
#

CREATE TABLE hlstats_Events_Entries (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Frags'
#

CREATE TABLE hlstats_Events_Frags (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  killerId int(10) unsigned DEFAULT '0' NOT NULL,
  victimId int(10) unsigned DEFAULT '0' NOT NULL,
  weapon varchar(20) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_PlayerActions'
#

CREATE TABLE hlstats_Events_PlayerActions (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  actionId int(10) unsigned DEFAULT '0' NOT NULL,
  bonus int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_PlayerPlayerActions'
#

CREATE TABLE hlstats_Events_PlayerPlayerActions (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  victimId int(10) unsigned DEFAULT '0' NOT NULL,
  actionId int(10) unsigned DEFAULT '0' NOT NULL,
  bonus int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Rcon'
#

CREATE TABLE hlstats_Events_Rcon (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(32) DEFAULT '' NOT NULL,
  type varchar(6) DEFAULT 'UNK' NOT NULL,
  remoteIp varchar(15) DEFAULT '' NOT NULL,
  password varchar(32) DEFAULT '' NOT NULL,
  command varchar(128) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Suicides'
#

CREATE TABLE hlstats_Events_Suicides (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  weapon varchar(20) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_TeamBonuses'
#

CREATE TABLE hlstats_Events_TeamBonuses (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(32) DEFAULT '' NOT NULL,
  playerId int(10) unsigned DEFAULT '0' NOT NULL,
  actionId int(10) unsigned DEFAULT '0' NOT NULL,
  bonus int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Teamkills'
#

CREATE TABLE hlstats_Events_Teamkills (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  serverId int(10) unsigned DEFAULT '0' NOT NULL,
  map varchar(20) DEFAULT '' NOT NULL,
  killerId int(10) unsigned DEFAULT '0' NOT NULL,
  victimId int(10) unsigned DEFAULT '0' NOT NULL,
  weapon varchar(20) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# Table structure for table 'hlstats_Events_Statsme'
#

CREATE TABLE hlstats_Events_Statsme (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime NOT NULL default '0000-00-00 00:00:00',
  serverId int(10) unsigned NOT NULL default '0',
  map varchar(32) NOT NULL default '',
  playerId int(10) unsigned NOT NULL default '0',
  weapon varchar(32) NOT NULL default '',
  shots int(6) unsigned NOT NULL default '0',
  hits int(6) unsigned NOT NULL default '0',
  headshots int(6) unsigned NOT NULL default '0',
  damage int(6) unsigned NOT NULL default '0',
  kills int(6) unsigned NOT NULL default '0',
  deaths int(6) unsigned NOT NULL default '0',
  KEY playerId (playerId),
  PRIMARY KEY  (id)
) TYPE=MyISAM;

#
# Table structure for table 'hlstats_Events_Statsme2'
#

CREATE TABLE hlstats_Events_Statsme2 (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime NOT NULL default '0000-00-00 00:00:00',
  serverId int(10) unsigned NOT NULL default '0',
  map varchar(32) NOT NULL default '',
  playerId int(10) unsigned NOT NULL default '0',
  weapon varchar(32) NOT NULL default '',
  head int(6) unsigned NOT NULL default '0',
  chest int(6) unsigned NOT NULL default '0',
  stomach int(6) unsigned NOT NULL default '0',
  leftarm int(6) unsigned NOT NULL default '0',
  rightarm int(6) unsigned NOT NULL default '0',
  leftleg int(6) unsigned NOT NULL default '0',
  rightleg int(6) unsigned NOT NULL default '0',
  KEY playerId (playerId),
  PRIMARY KEY  (id)
) TYPE=MyISAM;

#
# Table structure for table 'hlstats_Events_StatsmeTime'
#

CREATE TABLE hlstats_Events_StatsmeTime (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime NOT NULL default '0000-00-00 00:00:00',
  serverId int(10) unsigned NOT NULL default '0',
  map varchar(32) NOT NULL default '',
  playerId int(10) unsigned NOT NULL default '0',
  time time NOT NULL default '00:00:00',
  KEY playerId (playerId),
  PRIMARY KEY  (id)
) TYPE=MyISAM;

#
# Table structure for table 'hlstats_Events_StatsmeLatency'
#

CREATE TABLE hlstats_Events_StatsmeLatency (
  id int(10) unsigned NOT NULL auto_increment,
  eventTime datetime NOT NULL default '0000-00-00 00:00:00',
  serverId int(10) unsigned NOT NULL default '0',
  map varchar(32) NOT NULL default '',
  playerId int(10) unsigned NOT NULL default '0',
  ping int(6) unsigned NOT NULL default '0',
  KEY playerId (playerId),
  PRIMARY KEY  (id)
) TYPE=MyISAM;

#
# Table structure for table `hlstats_server_addons`
#

CREATE TABLE hlstats_server_addons (
rule varchar(64) NOT NULL default '',
addon varchar(64) NOT NULL default '',
url varchar(255) NOT NULL default '',
PRIMARY KEY  (rule)
) TYPE=MyISAM;

#
# Dumping data for table `hlstats_server_addons`
#

INSERT INTO hlstats_server_addons VALUES ('hlg_version', 'HLGuard %', 'http://www.thezproject.org/projects.php?pid=1');
INSERT INTO hlstats_server_addons VALUES ('clanmod_version', 'ClanMod %', 'http://www.unitedadmins.com/index.php?p=content&content=clanmod');
INSERT INTO hlstats_server_addons VALUES ('statsme_version', 'StatsMe %', 'http://www.unitedadmins.com/index.php?p=content&content=statsme');
INSERT INTO hlstats_server_addons VALUES ('phpua_mm_version', 'phpUA %', 'http://www.phpua.com');
INSERT INTO hlstats_server_addons VALUES ('cdversion', 'Cheating-Death %', 'http://www.unitedadmins.com/index.php?p=content&content=cd');
INSERT INTO hlstats_server_addons VALUES ('metamod_version', 'MetaMod %', 'http://www.metamod.org');
INSERT INTO hlstats_server_addons VALUES ('amxmodx_version', 'AMXX %', 'http://www.amxmodx.org');
INSERT INTO hlstats_server_addons VALUES ('sbsrv_version', 'Steambans %', 'http://www.steambans.com');
INSERT INTO hlstats_server_addons VALUES ('logmod_version', 'LogMod %', 'http://www.hlsw.org/index.php?page=logmod_info');
