Raised This Month: $32 Target: $400
 8% 

[ANY] Player Analytics


Post New Thread Reply   
 
Thread Tools Display Modes
DrFallen
AlliedModders Donor
Join Date: Jul 2013
Location: ./root
Old 09-28-2014 , 01:18   Re: [ANY] Player Analytics
Reply With Quote #181

[QUOTE=Pickles47;2204407]Premium or F2P and HTML MOTD Enabled/Disabled. They can be changed in getconnections.php.

Oh ok nice, Do you have any plans to add chat logging in since most of the ones on AM atm seem to be dead or not working.
DrFallen is offline
Pickles47
Member
Join Date: Jun 2013
Old 09-28-2014 , 12:50   Re: [ANY] Player Analytics
Reply With Quote #182

I could but that would require a separate plugin, I will look into it tomorrow when I have a day off.
__________________
Pickles47 is offline
Pythong
SourceMod Donor
Join Date: Dec 2008
Old 09-30-2014 , 14:47   Re: [ANY] Player Analytics
Reply With Quote #183

Quote:
Originally Posted by pcmaster View Post
Some indexes would be nice, even loading the session page causes by webserver to use 100% cpu and then die after 30 seconds.
Currently got ~2.2M connection records.

Same here.. got 2.5M records.

Last edited by Pythong; 09-30-2014 at 14:47.
Pythong is offline
caxanga334
Member
Join Date: Nov 2013
Location: Brazil
Old 10-12-2014 , 14:50   Re: [ANY] Player Analytics
Reply With Quote #184

I am getting this error on the web panel
PHP Code:
Parse error:  syntax errorunexpected T_CONST in <directory>/analytics/inc/config.php on line 15 
I am using this webpanel https://forums.alliedmods.net/showpo...8&postcount=69
line 15 is the Steam web API.
PHP version 5.4.24
caxanga334 is offline
ChristopherMylls
Junior Member
Join Date: Jul 2013
Old 10-16-2014 , 04:52   Re: [ANY] Player Analytics
Reply With Quote #185

Quote:
Originally Posted by caxanga334 View Post
I am getting this error on the web panel
PHP Code:
Parse error:  syntax errorunexpected T_CONST in <directory>/analytics/inc/config.php on line 15 
I am using this webpanel https://forums.alliedmods.net/showpo...8&postcount=69
line 15 is the Steam web API.
PHP version 5.4.24
I've the same problem

Last edited by ChristopherMylls; 10-16-2014 at 04:53.
ChristopherMylls is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 10-16-2014 , 14:04   Re: [ANY] Player Analytics
Reply With Quote #186

You might want to post your config.php file.
__________________
Impact123 is offline
caxanga334
Member
Join Date: Nov 2013
Location: Brazil
Old 10-19-2014 , 16:34   Re: [ANY] Player Analytics
Reply With Quote #187

config.php

PHP Code:
<?php

//Set encoding
ini_set('default_charset''utf-8');

//Database Info
define("DB_HOST",  'localhost');
define("DB_USER",  'XXXXXX');
define("DB_PASS",  'XXXXXX');
define("DB_NAME",  'XXXXXX');

$Home "/";
$Title "Server Analytics";

const 
STEAM_APIKEY  'XXXXXX';

function 
ServerName($key)
{
  
$servers = array(
    
"201.92.61.50" => "Gamers ala Pro #2 TRADE/FUN",
  );

  if (
array_key_exists($key$servers)) {
    return 
$servers[$key];
  }
  else {
    return 
$key;
  }
}

function 
SteamTo64($key

  if (
preg_match('/^\[U:[0-9]:([0-9]+)\]$/'$key$matches)) {
    
$key '7656'.(1197960265728 $matches[1]);
    return 
$key;
  }
  else {
    
$key '7656'.(((substr($key10)) * 2) + 1197960265728 + (substr($key81)));
    return 
$key;
  }
}

function 
ToSteam64($key
{
  
$key = ((substr($key4) - 1197960265728) / 2);
  if(
strpos$key"." )) {$int 1;}
  else{
$int 0;}
  
$key 'STEAM_0:'.$int.':'.floor($key);
  return 
$key
}

function 
GetPlayerInformation($key)
{
  
$url "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".STEAM_APIKEY."&steamids=".$key."&format=json";

  
$data file_get_contents($url);
  
$information json_decode($datatrue);

  return 
$information['response']['players'][0];
}

function 
StatCon($key,$lock)
{
  if (
$lock == 0) {
    return 
"$key";
  }
  elseif (
$key == 0) {
    return 
"0";
  }
  else {
    return 
round("$key"/"$lock"2);
  }
}

function 
PlaytimeCon($key)
{
  return 
floor($key/3600).gmdate(':i:s',$key);
}

function 
ConnMethod($key
{
  if (
preg_match("/quickplay/"$key)) {
    
$key 'quickplay';
  }
  
$ConnMethod = array("steam" => "SteamURL","serverbrowser_history" => "History","serverbrowser_favorites" => "Favorites","serverbrowser_internet" => "Internet","quickplay" => "Quickplay","serverbrowser_lan" => "Lan","serverbrowser_friends" => "Friends","matchmaking" => "Matchmaking","redirect" => "Redirect","" => "Console");
  return 
$ConnMethod[$key];
}

?>
caxanga334 is offline
Pitbull3
AlliedModders Donor
Join Date: Aug 2009
Location: Degree-Gaming.com
Old 11-04-2014 , 03:38   Re: [ANY] Player Analytics
Reply With Quote #188

Hey I wanted to know how I could rip the connections graph into it's own page.

Edit, nvm figured it out... here's the php in case anyone wants to use it.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="width=device-width, initial-scale=1" name="viewport">
	<title>Player Analytics</title>
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/dataTables.bootstrap.css" rel="stylesheet">
	<link href="css/sb-admin-2.css" rel="stylesheet">
	<link href="css/morris.css" rel="stylesheet">
	<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/jquery-jvectormap-1.2.2.css">
	<link rel="stylesheet" href="css/daterangepicker.css">
	<style>
		#overlay {
		  position:absolute; 
		  width:100%;
		  height:100%;
		  margin-left:-300px;
		  margin-top:-50px;
		  background-color:rgba(255,255,255,.80);
		  text-align:center;
		  z-index:999;
		  display:none;
		}
		#overlay i {
			position: fixed;
			top: 49%;
			left: 49%;
			margin:auto;
			color:#3498db;
			filter: alpha(opacity=50);
			-moz-opacity: 0.50;
			opacity: 0.50;
			z-index:999;
		}
		#reportrange {
			cursor:pointer;
		}
		.refresh {
			color:#3498db;
			cursor:pointer;
		}
	</style>
</head>
<body>
	<div id="wrapper">
		<div class="row">
					<div class="col-lg-12">
						<div class="panel panel-default">
							<div class="panel-heading">
								<i class="fa fa-bar-chart-o fa-fw"></i> Connections for
								<div class="pull-right">
									<div id="reportrange" class="pull-right">
										<i class="fa fa-calendar fa-lg"></i>
										<span><?php echo date("F j, Y", strtotime('-7 day')); ?> - <?php echo date("F j, Y"); ?></span> <b class="caret"></b>
									</div>
								</div>
							</div><!-- /.panel-heading -->
							<div class="panel-body">
								<div id="chart" style="cursor:pointer;"></div>
							</div><!-- /.panel-body -->
						</div><!-- /.panel -->
					</div><!-- /.col-lg-12 -->
				</div><!-- /.row -->
	</div><!-- /#wrapper -->
	<!-- Modal -->

	<script src="js/jquery-1.11.0.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/moment.min.js"></script>
	<script src="js/daterangepicker.js"></script>
	<script src="js/plugins/morris/raphael.min.js"></script>
	<script src="js/plugins/morris/morris.min.js"></script>
	<script src="js/plugins/dataTables/jquery.dataTables.min.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="js/plugins/jvectormaps/jquery-jvectormap-1.2.2.min.js"></script>
	<script src="js/plugins/jvectormaps/jquery-jvectormap-world-merc-en.js"></script>

	<script type="text/javascript">
	$(document).ready(function() {
		$("#bottomrow").load("inc/getbottomrow.php");
	});
	function data(dates){
			$.ajax({
				type: "GET",
				dataType: 'json',
				url: "inc/getdashboardrange.php", // This is the URL to the API
				data: "id=" + dates,
				beforeSend: function(){
					$('#overlay').fadeIn("fast");
				},
				success: function(msg){
					$('#overlay').fadeOut("fast");
					chart.setData(msg);
				}
			})
		}
	$('#reportrange').daterangepicker(
		{
			ranges: {
				'Today': [moment(), moment()],
				'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
				'Last 7 Days': [moment().subtract(6, 'days'), moment()],
				'Last 30 Days': [moment().subtract(29, 'days'), moment()],
				'This Month': [moment().startOf('month'), moment().endOf('month')],
				'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
			},
			startDate: moment().subtract(6, 'days'),
			endDate: moment()
		},
		function(start, end) {
			$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
		}
	);
	$('#reportrange').on('apply.daterangepicker', function(ev, picker) {
		var dates = picker.startDate.format('YYYY-M-D')+","+picker.endDate.format('YYYY-M-D');
		data(dates);
		$.ajax({
			type: "GET",
			url: "inc/getbottomrow.php",
			data: 'id=' + picker.startDate.format('YYYY-M-D')+","+picker.endDate.format('YYYY-M-D'),
			success: function(msg){
				$('#bottomrow').empty();
				$('#bottomrow').html(msg);
			}
		});
	});
	var chart =  Morris.Area ({
		element: 'chart',
		data: data(moment().subtract('days', 6).format('YYYY-M-D')+","+moment().format('YYYY-M-D')),
		xkey: 'time',
		ykeys: ['total'],
		labels: ['Total'],
		barRatio: 0.4,
		xLabelAngle: 0,
		hideHover: 'auto',
		parseTime: false,
		resize: true
	}).on('click', function(i, row){
		$('#modal').modal('show');
		$.ajax({
			type: "GET",
			url: "inc/getdateinfo.php",
			data: 'id='+row['d'],
			success: function(msg){
				$('#modal').html(msg);
			}
		});
	});
	</script>
</body>
</html>

Last edited by Pitbull3; 11-04-2014 at 03:57.
Pitbull3 is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 11-23-2014 , 06:45   Re: [ANY] Player Analytics
Reply With Quote #189

Is there a way to disable various logging options?

Say I don't care about what map they joined on, their admin flags, etc.
__________________
Chdata is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-23-2014 , 09:26   Re: [ANY] Player Analytics
Reply With Quote #190

Quote:
Originally Posted by Chdata View Post
Is there a way to disable various logging options?

Say I don't care about what map they joined on, their admin flags, etc.
Nope.
__________________
Dr. McKay is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode