Skip to content

Commit

Permalink
Add TeamSpeak 3 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmacwhite committed Jan 5, 2015
1 parent 48257f9 commit e290114
Show file tree
Hide file tree
Showing 27 changed files with 711 additions and 12 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ It is a directly clone of the web folder from the original source code of HLstat
* All template pages using the HTML5 Doctype
* SourceBans Redux theme
* Mobile optimisation
* TeamSpeak 3 Support (See Credits)

## Installing

Simply copy the entire contents to the location of where you want to host HLstatsX:CE, in replacement of the original web folder provided by the main version.

Original source code can be found at:
## Credits

TeamSpeak 3 Support: https://forums.alliedmods.net/showpost.php?p=1854304&postcount=4

Original source code for HLstatsX:CE can be found here:

https://bitbucket.org/Maverick_of_UC/hlstatsx-community-edition/src

Expand Down
Binary file added hlstatsimg/teamspeak3/16x16_away.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_channel_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_channel_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_channel_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_hardware_input_muted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_input_muted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_moderated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_output_muted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_player_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_player_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_register.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/16x16_server_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/changroup_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/changroup_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hlstatsimg/teamspeak3/servergroup_300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions hlstatsimg/teamspeak3/ts3.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.tsstatus{
width: 350px;
overflow: hidden;
position: relative;
}
.tsstatus, .tsstatus *{
font-family: Verdana;
font-size: 10px;
vertical-align: middle;
margin: 0;
padding: 0;
white-space:nowrap;
}
.tsstatuserror{
font-family: Verdana;
font-size: 10px;
color: red;
}
.tsstatus .tsstatusNickname{
border-bottom: 1px solid #aaa;
padding-bottom: 2px;
margin-bottom: 2px;
}
.tsstatus .tsstatusServerName{

}
.tsstatus input{
width: 135px;
height: 18px;
}
.tsstatus .tsstatusItem{
margin-left: 18px;
clear: both;
}
.tsstatus .tsstatusLabell{
float: left;
}
.tsstatus .tsstatusLabelr{
float: right;
}
.tsstatus .tsstatusFlags{
position: absolute;
right: 0;
clear: right;
}
.tsstatus a{
text-decoration: none;
color: #333;
}
.tsstatus a:hover{
color: #AEAEAE;
text-decoration:none;

}
.tsstatus img{
margin-right: 2px;
border: 0;
}
Binary file added hlstatsimg/teamspeak3/ts3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions pages/admintasks/voicecomm.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata['acclevel'] < 80) die ('Access denied!');

$edlist = new EditList('serverId', 'hlstats_Servers_VoiceComm', '', false);
$edlist = new EditList('serverId', 'hlstats_Servers_VoiceComm', '');
$edlist->columns[] = new EditListColumn('name', 'Server Name', 45, true, 'text', '', 64);
$edlist->columns[] = new EditListColumn('addr', 'Server IP or Hostname', 20, true, 'text', '', 64);
$edlist->columns[] = new EditListColumn('password', 'Password', 20, false, 'text', '', 64);
$edlist->columns[] = new EditListColumn('UDPPort', 'UDP Port (TS only)', 6, false, 'text', '8767', 64);
$edlist->columns[] = new EditListColumn('queryPort', 'Query Port (TS)/Connect Port (Vent)', 6, true, 'text', '51234', 64);
$edlist->columns[] = new EditListColumn('UDPPort', 'UDP Port (TS only or TS3 Server-ID)', 6, false, 'text', '8767', 64);
$edlist->columns[] = new EditListColumn('queryPort', 'Query Port (TS/TS3)/Connect Port (Vent)', 6, true, 'text', '51234/10011', 64);
$edlist->columns[] = new EditListColumn('descr', 'Notes', 40, false, 'text', '', 64);
$edlist->columns[] = new EditListColumn('serverType', 'Server Type', 20, true, 'select', '0/Teamspeak;1/Ventrilo');
$edlist->columns[] = new EditListColumn('serverType', 'Server Type', 20, true, 'select', '0/Teamspeak;1/Ventrilo;2/Teamspeak3');

if ($_POST)
{
Expand Down
53 changes: 46 additions & 7 deletions pages/teamspeak.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
array('Teamspeak viewer'),
array('Teamspeak viewer' => '')
);
include (PAGE_PATH.'/voicecomm_serverlist.php');
include (PAGE_PATH.'/teamspeak_query.php');
include_once (PAGE_PATH.'/voicecomm_serverlist.php');
include_once (PAGE_PATH.'/teamspeak_query.php');
include_once (PAGE_PATH.'/teamspeak3_query.php');

$tsId = valid_request($_GET['tsId'],1);

Expand All @@ -27,7 +28,7 @@ function show($tpl, $array)

if(function_exists(fopen))
{
$db->query("SELECT addr, queryPort, UDPPort FROM hlstats_Servers_VoiceComm WHERE serverId=$tsId");
$db->query("SELECT addr, queryPort, UDPPort, serverType FROM hlstats_Servers_VoiceComm WHERE serverId=$tsId");
$s = $db->fetch_array();

$uip = $s['addr'];
Expand Down Expand Up @@ -218,9 +219,9 @@ function show($tpl, $array)
$type = 0;
}

if($type==0) $info = defaultInfo($uip,$tPort,$port);
elseif($type==1) $info = channelInfo($uip,$tPort,$port,$cID);


if ( $s['serverType'] == "0" )
{
$outp_str = show("teamspeak", array("name" => $name,
"os" => $os,
"uptime" => time_convert($uptime),
Expand All @@ -243,7 +244,45 @@ function show($tpl, $array)
"idletime" => "Idle time",
"channelstats" => $channelstats,
"userstats" => $userstats));

}
elseif( $s['serverType'] == "2" )
{
$tsstatus = new TSStatus($uip, $tPort, $port);
$tsstatus->imagePath = IMAGE_PATH."/teamspeak3/";
$tsstatus->showNicknameBox = false;
$tsstatus->decodeUTF8 = false;
$tsstatus->timeout = 2;
function ts3_get_data($was,$data)
{
global $tsstatus;
$data = $tsstatus->serverdata();
return $data[$was];
}
$channels = '<link rel="stylesheet" type="text/css" href="'.IMAGE_PATH.'/teamspeak3/ts3.css" />'.$tsstatus->render();
$outp_str = show("teamspeak3", array("name" => ts3_get_data('virtualserver_name'),
"os" => ts3_get_data('virtualserver_platform'),
"uptime" => time_convert(ts3_get_data('virtualserver_uptime')),
"user" => ts3_get_data('virtualserver_clientsonline'),
"t_name" => "Server name",
"t_os" => "Operating system",
"uchannels" => $channels,
"info" => $tsstatus->info($uip),
"t_uptime" => "Uptime",
"t_channels" => "Channels",
"t_user" => "Users",
"head" => "Teamspeak Overview",
"users_head" => "User Information",
"player" => "User",
"channel" => "Channel",
"channel_head" => "Channel Information",
"max" => $max,
"channels" => ts3_get_data('virtualserver_channelsonline'),
"logintime" => "Login time",
"idletime" => "Idle time",
"channelstats" => $channelstats,
"userstats" => $tsstatus->userstats() ));
$tsstatus->disconn();
}
echo $outp_str;

}
Expand Down
Loading

0 comments on commit e290114

Please sign in to comment.