foohey
04-30-2009, 20:14
MySQL server informations
This plugin allows you to record in a MySQL database, many informations of your servers and players.
Original plugin by dmustanger: http://forums.alliedmods.net/showthread.php?t=84899
For who ?
This plugin is good if you want retrieve informations from your game server by a MySQL database.
I do not develop in PHP, no web interface planned.
How it work
You need to set the SERVER_ID if you want to use it on multiple servers.
(1 for 1st server, 2 for the 2nd...)
When the plugin start, if no servers, a new is created. if already created, just the maxplayers and hostname is updated.
When a client connect, a new row with name, steam id, server id, frags, deaths... is created. when disconnected, row are deleted.
When map change, all players are deleted.
When server start, all players are deleted.
On round end, teams scores are updated.
If you want the number of current players in a server, make a COUNT(*) query of players in your app.
Installation
Create a database named server_info
Create tables:
CREATE TABLE IF NOT EXISTS `servers` (
`server_id` int(11) NOT NULL,
`server` varchar(50) NOT NULL,
`port` varchar(50) NOT NULL,
`maxplayers` int(11) NOT NULL default '0',
`servername` varchar(100) NOT NULL default 'noserver',
`map` varchar(50) NOT NULL default 'de_dust',
`score_t` int(11) NOT NULL,
`score_ct` int(11) NOT NULL,
PRIMARY KEY (`server_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `players` (
`userid` int(11) NOT NULL,
`steam_id` varchar(200) NOT NULL,
`server_id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`score` int(11) NOT NULL,
`time` int(50) NOT NULL,
PRIMARY KEY (`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
And add to your configs/databases.cfg:
"server_info"
{
"driver" "mysql"
"host" "HOST"
"database" "server_info"
"user" "USER"
"pass" "PASS"
}
Notes
This plugin is under dev, and tested on a cs:s server.
This plugin allows you to record in a MySQL database, many informations of your servers and players.
Original plugin by dmustanger: http://forums.alliedmods.net/showthread.php?t=84899
For who ?
This plugin is good if you want retrieve informations from your game server by a MySQL database.
I do not develop in PHP, no web interface planned.
How it work
You need to set the SERVER_ID if you want to use it on multiple servers.
(1 for 1st server, 2 for the 2nd...)
When the plugin start, if no servers, a new is created. if already created, just the maxplayers and hostname is updated.
When a client connect, a new row with name, steam id, server id, frags, deaths... is created. when disconnected, row are deleted.
When map change, all players are deleted.
When server start, all players are deleted.
On round end, teams scores are updated.
If you want the number of current players in a server, make a COUNT(*) query of players in your app.
Installation
Create a database named server_info
Create tables:
CREATE TABLE IF NOT EXISTS `servers` (
`server_id` int(11) NOT NULL,
`server` varchar(50) NOT NULL,
`port` varchar(50) NOT NULL,
`maxplayers` int(11) NOT NULL default '0',
`servername` varchar(100) NOT NULL default 'noserver',
`map` varchar(50) NOT NULL default 'de_dust',
`score_t` int(11) NOT NULL,
`score_ct` int(11) NOT NULL,
PRIMARY KEY (`server_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `players` (
`userid` int(11) NOT NULL,
`steam_id` varchar(200) NOT NULL,
`server_id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`score` int(11) NOT NULL,
`time` int(50) NOT NULL,
PRIMARY KEY (`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
And add to your configs/databases.cfg:
"server_info"
{
"driver" "mysql"
"host" "HOST"
"database" "server_info"
"user" "USER"
"pass" "PASS"
}
Notes
This plugin is under dev, and tested on a cs:s server.