Jump to content

Chat, GUID, Stats and Mapstats Logger[1.1.0.1][BF3]


ImportBot

Recommended Posts

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

  • ImportBot

    1934

Originally Posted by XpKiller*:

 

XP, thanks for the queries once again! :smile: For the second query of your post: I don't want to filter (where-clause) with servername, I want to see it back in the results. I can't seem to get that working as well...

 

So what I would like to have is the servername and then the stats fom the player.

Code:
SELECT ts.ServerName, `AEK-971_kills` , `AEK-971_hs` , `AEK-971_deaths` , `AN-94_Abakan_kills` , `AN-94_Abakan_hs` , `AN-94_Abakan_deaths` , `AS_Val_kills` , `AS_Val_hs` , `AS_Val_deaths` , `F2000_kills` , `F2000_hs` , `F2000_deaths` , `M16A4_kills` , `M16A4_hs` , `M16A4_deaths` , `AK74M_kills` , `AK74M_hs` , `AK74M_deaths` , `G3A3_kills` , `G3A3_hs` , `G3A3_deaths` , `KH2002_kills` , `KH2002_hs` , `KH2002_deaths` , `M416_kills` , `M416_hs` , `M416_deaths`
FROM tbl_server_player tsp
INNER JOIN tbl_playerdata tpd ON tsp.PlayerID = tpd.PlayerID
INNER JOIN tbl_weapons_assaultrifle twa ON tsp.StatsID = twa.StatsID
INNER JOIN tbl_server ts ON tsp.ServerID = ts.ServerID
WHERE tpd.SoldierName = "CptChaos"
@Legate

do you use a tbalesuffix?

Will look at this.

* Restored post. It could be that the author is no longer active.
Link to comment

I made a stats page for a phpBB forum based off the data collected by this plugin.

Example:
http://thetacteam.info/stats.php

If you use it, you must enable the "Allow php in templates" feature located in Admin Control Panel -> General Tab -> Security Settings section. Otherwise it won't parse the ... section.

<table class="tablebg" width="100%" cellspacing="1"> 
<tr> 
<td class="row1"><div class="gen">
<table border="0" width="100%" align="center">
<tr>
<td>
<center>
<!-- PHP -->

//DATABASE INFORMATION

$db['host']		='YOUR_HOSTS_ADDRESS';
$db['uname']	='YOUR_DATABASE_USER_NAME';
$db['pass']		='YOUR_DATABASE_PASSWORD';
$db['name']		='YOUR_DATABASE_NAME';

//DATABASE ACCESS

mysql_connect($db['host'], $db['uname'], $db['pass']);
mysql_select_db("$db[name]") or die ("<b><center><br><br>Unable to access database. Please notify administrator.</center></b>");

//PAGE CONTENT

//CONTENT TABLE

echo "<br><br><table width='100%'>";

//LEFT SPACER

echo "<tr><td width='5%'>";
echo "</td><td>";

//END LEFT SPACER

//CENTER CONTENT

echo "<table width='100%' class='tablebg'>";
echo "<tr><td class='row1'>";
		
//CENTER SEARCH BLOCK

echo "<table align='left' width='100%' border='0'>";
echo "<form action='stats.php' method='POST'>";
echo "<tr><td>";
echo "<font color='EEEEEE'>Search for player's stats:</font>  ";
echo "<input type='text' name='player_name' /> ";
echo "<input type='submit' name='search_player' value='Search' />";
echo "</form>";
echo "</td></tr>";
echo "</table>";
			
//END CENTER SEARCH BLOCK

//SPACER BELOWER SEARCH BLOCK

echo "<table width='100%'><tr><td>";
echo "</td></tr><tr><td></td></tr><tr><td></td></tr></table>";

//END SPACER BELOW SEARCH BLOCK

//BEGIN SEARCH PLAYER LOGIC

if($_POST['search_player'])
{
	$player_name = $_POST['player_name'];

//NO RESULTS RETURNED BLOCK

	if ($player_name == null){
		
		echo "<table width='100%' class='container' border='0'>";
		echo "<tr><td class='row1'>";
		echo "<br><center>Please enter a player name.</center><br>";
		echo "</td></tr>";
		echo "</table>";

//END NO RESULTS RETURNED BLOCK

	}
	else
	{

//BEGIN PLAYER NAME'S TITLE BLOCK

		echo "<table width='100%' class='container' border='0'>";
		echo "<tr><td class='row1'>";
		echo "<br><center><b class='genmed'><font color='EEEEEE'>$player_name's stats</font></b></center><br>";
		echo "</td></tr>";
		echo "</table>";

//END PLAYER NAME'S TITLE BLOCK

//BEGIN 16-SLOT RESULTS BLOCK

		echo "<table width='100%' class='container' border='0'>";
		echo "<tr><td class='row1'>";
		
		$player_data16_query = "SELECT * FROM tbl_playerdata_16 WHERE SoldierName = '$player_name'";
		$player_data16_result = mysql_query($player_data16_query);
		
		if(mysql_num_rows($player_data16_result)==0)
			{

				echo "<br><center>No player data found for 16-slot server.</center><br>";

			}
			else
			{

				echo "<b class='genmed'><font color='EEEEEE'>16-slot server</font></b><br>";

				while($player_data16_row = mysql_fetch_array($player_data16_result))
				{
					$PlayerID = $player_data16_row['PlayerID'];

					$playerid_16_query  = "SELECT * FROM tbl_server_player_16 WHERE PlayerID = '$PlayerID'";
					$playerid_16_result = mysql_query($playerid_16_query);

					while($playerid_16_row = mysql_fetch_array($playerid_16_result))
					{

						$StatsID = $playerid_16_row['StatsID'];

						$playerstats_16_query  = "SELECT * FROM tbl_playerstats_16 WHERE StatsID = '$StatsID'";
						$playerstats_16_result = mysql_query($playerstats_16_query);

						while($playerstats_16_row = mysql_fetch_array($playerstats_16_result))
						{

							$Score = $playerstats_16_row['Score'];
							$Kills = $playerstats_16_row['Kills'];
							$Deaths = $playerstats_16_row['Deaths'];
							$Headshots = $playerstats_16_row['Headshots'];
							$HSrationumber = ($Headshots / $Kills);
							$HSratio = round($HSrationumber, 2);
							$Rounds = $playerstats_16_row['Rounds'];
							$Killstreak = $playerstats_16_row['Killstreak'];
							$Deathstreak = $playerstats_16_row['Deathstreak'];
							$StatsID = $playerstats_16_row['StatsID'];
							$KDRnumber = ($Kills / $Deaths);
							$KDR = round($KDRnumber, 2);

//BEGIN 16-SLOT STATS INFORMATION

							echo "<table width='100%' border='0' class='container'>";
							echo "<tr>";
							echo "<td width='11%' style='text-align: center;'>Score: $Score</td>";
							echo "<td width='11%' style='text-align: center;'>Rounds Played: $Rounds</td>";
							echo "<td width='11%' style='text-align: center;'>Kills: $Kills</td>";
							echo "<td width='11%' style='text-align: center;'>Deaths: $Deaths</td>";
							echo "<td width='11%' style='text-align: center;'>KDR: $KDR</td>";			
							echo "<td width='11%' style='text-align: center;'>Headshots: $Headshots</td>";
							echo "<td width='11%' style='text-align: center;'>Headshot Ratio: $HSratio</td>";
							echo "<td width='11%' style='text-align: center;'>Killstreak: $Killstreak</td>";
							echo "<td width='11%' style='text-align: center;'>Deathstreak: $Deathstreak</td>";
							echo "</tr>";		
							echo "</table>";

//END 16-SLOT STATS INFORMATION

						}
					}
				}	
			}

echo "</td></tr>";
echo "</table>";

//END 16-SLOT RESULTS BLOCK

//BEGIN 32-SLOT RESULTS BLOCK

echo "<table width='100%' class='container' border='0'>";
echo "<tr><td class='row1'>";

$player_data32_query = "SELECT * FROM tbl_playerdata_32 WHERE SoldierName = '$player_name'";
$player_data32_result = mysql_query($player_data32_query);
		
		if(mysql_num_rows($player_data32_result)==0)
		{

			echo "<br><center>No player data found for 32-slot server.</center><br>";

		}
		else
		{

			echo "<b class='genmed'><font color='EEEEEE'>32-slot server</font></b><br>";

			while($player_data32_row = mysql_fetch_array($player_data32_result))
			{

				$PlayerID = $player_data32_row['PlayerID'];

				$playerid_32_query  = "SELECT * FROM tbl_server_player_32 WHERE PlayerID = '$PlayerID'";
				$playerid_32_result = mysql_query($playerid_32_query);

				while($playerid_32_row = mysql_fetch_array($playerid_32_result))
				{

					$StatsID = $playerid_32_row['StatsID'];

					$playerstats_32_query  = "SELECT * FROM tbl_playerstats_32 WHERE StatsID = '$StatsID'";
					$playerstats_32_result = mysql_query($playerstats_32_query);

					while($playerstats_32_row = mysql_fetch_array($playerstats_32_result))
					{

						$Score = $playerstats_32_row['Score'];
						$Kills = $playerstats_32_row['Kills'];
						$Deaths = $playerstats_32_row['Deaths'];
						$Headshots = $playerstats_32_row['Headshots'];
						$HSrationumber = ($Headshots / $Kills);
						$HSratio = round($HSrationumber, 2);
						$Rounds = $playerstats_32_row['Rounds'];
						$Killstreak = $playerstats_32_row['Killstreak'];
						$Deathstreak = $playerstats_32_row['Deathstreak'];
						$StatsID = $playerstats_32_row['StatsID'];
						$KDRnumber = ($Kills / $Deaths);
						$KDR = round($KDRnumber, 2);

//BEGIN 32-SLOT STATS INFORMATION

						echo "<table width='100%' border='0' class='container'>";
						echo "<tr>";
						echo "<td width='11%' style='text-align: center;'>Score: $Score</td>";
						echo "<td width='11%' style='text-align: center;'>Rounds Played: $Rounds</td>";
						echo "<td width='11%' style='text-align: center;'>Kills: $Kills</td>";
						echo "<td width='11%' style='text-align: center;'>Deaths: $Deaths</td>";
						echo "<td width='11%' style='text-align: center;'>KDR: $KDR</td>";			
						echo "<td width='11%' style='text-align: center;'>Headshots: $Headshots</td>";
						echo "<td width='11%' style='text-align: center;'>Headshot Ratio: $HSratio</td>";
						echo "<td width='11%' style='text-align: center;'>Killstreak: $Killstreak</td>";
						echo "<td width='11%' style='text-align: center;'>Deathstreak: $Deathstreak</td>";
						echo "</tr>";		
						echo "</table>";

//END 32-SLOT STATS INFORMATION

					}
				}
			}	
		}

echo "</td></tr>";
echo "</table>";
//END 32-SLOT RESULTS BLOCK

//BEGIN EXTERNAL STATS BLOCK

echo "<table width='100%' class='container' border='0'>";
echo "<tr>";
echo "<tr><td class='row1'>";
echo "<br><center>Check $player_name's stats at <a href='http://bf3stats.com/stats_pc/$player_name' target='_blank'>http://bf3stats.com</a>.</center><br>";
echo "</td></tr>";
echo "</table>";

//END EXTERNAL STATS BLOCK

	}
}

//END SEARCH PLAYER LOGIC

//BEGIN TOP PLAYERS CENTER BLOCK

echo "<br>";
echo "<table width='100%' border='0'>";
echo "<tr>";

//BEGIN TOP PLAYERS CENTER BLOCK LEFT BLOCK

echo "<td valign='top'>";

//BEGIN TOP-25 16-SLOT BLOCK

echo "<table width='100%' class='tablebg' border='0'>";
echo "<tr>";
echo "<th>Top 25 Players for 16-Slot server</th>";
echo "</tr>";
echo "<tr>";
echo "<td class='row1'>";

$count = 0;
$playerstats_16_query  = "SELECT * FROM tbl_playerstats_16 ORDER BY Score DESC LIMIT 25";
$playerstats_16_result = mysql_query($playerstats_16_query);

while($playerstats_16_row = mysql_fetch_array($playerstats_16_result))
{

	$Score = $playerstats_16_row['Score'];
	$StatsID = $playerstats_16_row['StatsID'];

	$playerid_16_query  = "SELECT * FROM tbl_server_player_16 WHERE StatsID = '$StatsID'";
	$playerid_16_result = mysql_query($playerid_16_query);

	while($playerid_16_row = mysql_fetch_array($playerid_16_result))
	{

		$PlayerID = $playerid_16_row['PlayerID'];

		$player_data_16_query  = "SELECT * FROM tbl_playerdata_16 WHERE PlayerID = '$PlayerID'";
		$player_data_16_result = mysql_query($player_data_16_query);

		while($player_data_16_row = mysql_fetch_array($player_data_16_result))
		{

			$SoldierName_16 = $player_data_16_row['SoldierName'];
			$count=$count+1;

//BEGIN PLAYER NAME POSITION BLOCK

						echo "<table width='100%' border='0' class='container'>";
						echo "<tr>";
						echo "<th style='text-align: left;'>";
						echo "<form action='stats.php' method='POST'>";
						echo "<input type='hidden' name='player_name' value='$SoldierName_16'/> ";
						echo "$count: <input type='submit' name='search_player' style='color:#99CCFF;width:140px;text-align:center;font-weight:bold' value='$SoldierName_16' /> <font color='#8E8E8E' size='1'>click name for stats</font>";
						echo "</form>";
						echo "</th>";
						echo "<tr>";
						echo "<td width='100%' style='text-align: left;' class='row1'>      Score: $Score</td>";
						echo "</tr>";		
						echo "</table>";

//END PLAYER NAME POSITION BLOCK

		}
	}
}

echo "</td>";
echo "</tr>";
echo "</table>";

//END TOP-25 16-SLOT BLOCK

echo "</td>";

//END TOP PLAYERS CENTER BLOCK LEFT BLOCK

//BEGIN TOP PLAYERS CENTER BLOCK MIDDLE SPACER

echo "<td width='1%'></td>";

//END TOP PLAYERS CENTER BLOCK MIDDLE SPACER

//BEGIN TOP PLAYERS CENTER BLOCK RIGHT BLOCK

echo "<td valign='top'>";

//BEGIN TOP-25 32-SLOT BLOCK

echo "<table width='100%' border='0' class='tablebg'>";
echo "<tr>";
echo "<th>Top 25 Players for 32-Slot server</th>";
echo "</tr>";
echo "<tr>";
echo "<td class='row1'>";

$count = 0;
$playerstats_32_query  = "SELECT * FROM tbl_playerstats_32 ORDER BY Score DESC LIMIT 25";
$playerstats_32_result = mysql_query($playerstats_32_query);

while($playerstats_32_row = mysql_fetch_array($playerstats_32_result))
{

	$Score = $playerstats_32_row['Score'];
	$StatsID = $playerstats_32_row['StatsID'];

	$playerid_32_query  = "SELECT * FROM tbl_server_player_32 WHERE StatsID = '$StatsID'";
	$playerid_32_result = mysql_query($playerid_32_query);

	while($playerid_32_row = mysql_fetch_array($playerid_32_result))
	{

		$PlayerID = $playerid_32_row['PlayerID'];

		$player_data_32_query  = "SELECT * FROM tbl_playerdata_32 WHERE PlayerID = '$PlayerID'";
		$player_data_32_result = mysql_query($player_data_32_query);

		while($player_data_32_row = mysql_fetch_array($player_data_32_result))
		{

			$SoldierName_32 = $player_data_32_row['SoldierName'];
			$count=$count+1;

//BEGIN PLAYER NAME POSITION BLOCK

			echo "<table width='100%' border='0' class='container'>";
			echo "<tr>";
			echo "<th style='text-align: left;'>";
			echo "<form action='stats.php' method='POST'>";
			echo "<input type='hidden' name='player_name' value='$SoldierName_32'/> ";
			echo "$count: <input type='submit' name='search_player' style='color:#99CCFF;width:140px;text-align:center;font-weight:bold' value='$SoldierName_32' /> <font color='#8E8E8E' size='1'>click name for stats</font>";
			echo "</form>";
			echo "</th>";
			echo "</tr>";
			echo "<tr>";
			echo "<td width='100%' style='text-align: left;' class='row1'>      Score: $Score</td>";
			echo "</tr>";		
			echo "</table>";

//END PLAYER NAME POSITION BLOCK

		}
	}
}

echo "</td>";
echo "</tr>";
echo "</table>";

//END TOP-25 32-SLOT BLOCK

echo "</td>";

//END TOP PLAYERS CENTER BLOCK RIGHT BLOCK

echo "</tr></table>";

//END TOP PLAYERS CENTER BLOCK

echo "</td></tr></table>";
echo "</td>";

//END CENTER CONTENT BLOCK

//BEGIN RIGHT SPACER BLOCK

echo "<td width='5%'></td>";

//END RIGHT SPACER BLOCK

echo "</tr>";
echo "</table>";

//END CONTENT TABLE

echo "<br><br>";

<!-- ENDPHP -->
</center>
</td>
</tr> 
</table>
</td>
</tr>
</table>

I am still a bit of a novice at PHP, but this may help someone.

You would need to enter all the correct database information. Also, your table names would have to be corrected if you are using a different structure than me. I am using two suffixes in the same database for two different servers. One has the suffix of _16 and the other the suffix of _32. You would have to correct for this.

You may have to change the CSS style references if your style doesn't use the same reference names.

Edited by maxdralle
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XpKiller*:

 

@ty_ger07

You could put everything in one query and you would get a better performance. If your db gets more entries you can run in performance issues.

 

SQL Query:

Code:

SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, tps.Suicide, tps.TKs, tps.Playtime, tps.Headshots, tps.Rounds, tps.Killstreak, tps.Deathstreak  
FROM tbl_playerstats tps 
INNER JOIN tbl_server_player tsp ON tsp.StatsID = tps.StatsID
INNER JOIN tbl_playerdata tpd ON tsp.PlayerID = tpd.PlayerID
WHERE tsp.ServerID = 1
ORDER BY Score DESC 
LIMIT 25
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XpKiller*:

 

I've never done a query in that sort of syntax. Does php support it?

Yes Php support this . This just a SQlquery. All kind of SQL Query is support by PHP.

If you question regarding the syntax feel free to ask.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CptChaos*:

 

Code:

SELECT ts.ServerName, `AEK-971_kills` , `AEK-971_hs` , `AEK-971_deaths` , `AN-94_Abakan_kills` , `AN-94_Abakan_hs` , `AN-94_Abakan_deaths` , `AS_Val_kills` , `AS_Val_hs` , `AS_Val_deaths` , `F2000_kills` , `F2000_hs` , `F2000_deaths` , `M16A4_kills` , `M16A4_hs` , `M16A4_deaths` , `AK74M_kills` , `AK74M_hs` , `AK74M_deaths` , `G3A3_kills` , `G3A3_hs` , `G3A3_deaths` , `KH2002_kills` , `KH2002_hs` , `KH2002_deaths` , `M416_kills` , `M416_hs` , `M416_deaths`
FROM tbl_server_player tsp
INNER JOIN tbl_playerdata tpd ON tsp.PlayerID = tpd.PlayerID
INNER JOIN tbl_weapons_assaultrifle twa ON tsp.StatsID = twa.StatsID
INNER JOIN tbl_server ts ON tsp.ServerID = ts.ServerID
WHERE tpd.SoldierName = "CptChaos"
@Legate

do you use a tbalesuffix?

Will look at this.

You sir, are very generous! #LikeABoss!

 

I also have a feature request: is it possible to add the Procon (layer) connection info to the server table (Procon's IP-address and port, just like the gameserver the Procon layer is connected to) as well? Now I mod that in manually, if it would be part of this awesomeness anyone can easily make a check wether if Procon is up or not.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by tbagger*:

 

Great work thus far on the plugin XPkiller. Any news on when the full completed version might be ready? My server is currently ranked 8th in the world on GameTracker and I have this plugin implemented. However with some of the functions not working it is hard to advertise that we have it!

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Clay52*:

 

I got this at the end then start of a new round: Otherwise the plugin has been really nice, works great...

 

[10:12:37 98] Error: SQLQuery:System.NullReferenceException: Object reference not set to an instance of an object.

at System.Data.Odbc.OdbcDataReader.GetRowCount()

at System.Data.Odbc.OdbcDataReader.FirstResult()

at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)

at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior behavior, String method, Boolean needReader)

at System.Data.Odbc.OdbcCommand.ExecuteReader(Command Behavior behavior)

at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(C ommandBehavior behavior)

at System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

at PRoConEvents.CChatGUIDStatsLoggerBF3.SQLquery(Odbc Command selectQuery)

[10:12:39 43] Error: SQLQuery:System.NullReferenceException: Object reference not set to an instance of an object.

at System.Data.Odbc.OdbcDataReader.GetRowCount()

at System.Data.Odbc.OdbcDataReader.FirstResult()

at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)

at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(C ommandBehavior behavior, String method, Boolean needReader)

at System.Data.Odbc.OdbcCommand.ExecuteReader(Command Behavior behavior)

at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(C ommandBehavior behavior)

at System.Data.Common.DbCommand.System.Data.IDbComman d.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

at PRoConEvents.CChatGUIDStatsLoggerBF3.SQLquery(Odbc Command selectQuery)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by EBassie*:

 

Hey XpKiller,

 

for some reason I have a new problem.

I think this problem started with version .6 or latest server patch

 

Don't know for sure, I just noticed it. I have no errors in the plugin console:

 

Stats are updated in the DB, new players are added with an incorrect score

 

And the kills & deaths if existing players are bugged: not updating at all.

Not sure about the Headshots.

 

Scores & rounds are updated correctly though.

* Restored post. It could be that the author is no longer active.
Link to comment

I still haven't wrapped my head around that syntax. I added a suspicious players search function which I think is pretty handy.

http://thetacteam.info/stats.php

But I am seeing what you mean about the query slowing down as the data increases. The suspicious players algorithm uses many queries to sift through lots of data.

//BEGIN SUSPICIOUS PLAYER LOGIC

if($_POST['suspicious_players'])
{

//BEGIN TITLE BLOCK

	echo "<table width='100%' class='container' border='0'>";
	echo "<tr><td class='row1'>";
	echo "<br><center><b class='genmed'><font color='EEEEEE'>Suspicious Players</font></b></center><br>";
	echo "</td></tr>";
	echo "</table>";

//END TITLE BLOCK

//BEGIN 16-SLOT RESULTS BLOCK

	echo "<table width='100%' class='container' border='0'>";
	echo "<tr><td class='row1'>";
	echo "<b class='genmed'><font color='EEEEEE'>16-slot server</font></b><br>";
		
	$suspicious_players16_query = "SELECT * FROM tbl_playerstats_16 WHERE 1";
	$suspicious_players16_result = mysql_query($suspicious_players16_query);
		
	while($suspicious_players16_row = mysql_fetch_array($suspicious_players16_result))
	{

		$Kills = $suspicious_players16_row['Kills'];
		$Deaths = $suspicious_players16_row['Deaths'];
		$KDRnumber = ($Kills / $Deaths);
		$KDR = round($KDRnumber, 2);
		$Headshots = $suspicious_players16_row['Headshots'];
		$HSrationumber = ($Headshots / $Kills);
		$HSratio = round($HSrationumber, 2);
		$Rounds = $suspicious_players16_row['Rounds'];
		$Killstreak = $suspicious_players16_row['Killstreak'];
		$StatsID = $suspicious_players16_row['StatsID'];
		
		$suspicious_playerid_16_query  = "SELECT * FROM tbl_server_player_16 WHERE StatsID = '$StatsID'";
		$suspicious_playerid_16_result = mysql_query($suspicious_playerid_16_query);

		while($suspicious_playerid_16_row = mysql_fetch_array($suspicious_playerid_16_result))
		{

			$PlayerID = $suspicious_playerid_16_row['PlayerID'];

			$suspicious_player_data_16_query  = "SELECT * FROM tbl_playerdata_16 WHERE PlayerID = '$PlayerID'";
			$suspicious_player_data_16_result = mysql_query($suspicious_player_data_16_query);

			while($suspicious_player_data_16_row = mysql_fetch_array($suspicious_player_data_16_result))
			{

				$SoldierName_16 = $suspicious_player_data_16_row['SoldierName'];

//BEGIN SUSPICIOUS PLAYER NAME BLOCK

				if (($KDR >= '3') AND ($HSratio >= '0.5') AND ($Killstreak >= '10') AND ($Rounds >= '2'))
				{
					echo "<table width='100%' border='0' class='container'>";
					echo "<tr>";
					echo "<th colspan='3' style='text-align: left;'>";
					echo "<form action='stats.php' method='POST'>";
					echo "<input type='hidden' name='player_name' value='$SoldierName_16'/> ";
					echo "<input type='submit' name='search_player' style='color:#99CCFF;width:140px;text-align:center;font-weight:bold' value='$SoldierName_16' class='button2'/> <font color='#8E8E8E' size='1'>click name for stats</font>";
					echo "</form>";
					echo "</th>";
					echo "<tr>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    KDR: $KDR</td>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    Headshot Ratio: $HSratio</td>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    Kill Streak: $Killstreak</td>";
					echo "</tr>";		
					echo "</table>";

				}

//END SUSPICIOUS PLAYER NAME BLOCK

			}
		}
	}

	echo "</td></tr>";
	echo "</table>";

//END 16-SLOT RESULTS BLOCK

//BEGIN 32-SLOT RESULTS BLOCK

	echo "<table width='100%' class='container' border='0'>";
	echo "<tr><td class='row1'>";
	echo "<b class='genmed'><font color='EEEEEE'>32-slot server</font></b><br>";
		
	$suspicious_players32_query = "SELECT * FROM tbl_playerstats_32 WHERE 1";
	$suspicious_players32_result = mysql_query($suspicious_players32_query);
		
	while($suspicious_players32_row = mysql_fetch_array($suspicious_players32_result))
	{

		$Kills = $suspicious_players32_row['Kills'];
		$Deaths = $suspicious_players32_row['Deaths'];
		$KDRnumber = ($Kills / $Deaths);
		$KDR = round($KDRnumber, 2);
		$Headshots = $suspicious_players32_row['Headshots'];
		$HSrationumber = ($Headshots / $Kills);
		$HSratio = round($HSrationumber, 2);
		$Rounds = $suspicious_players32_row['Rounds'];
		$Killstreak = $suspicious_players32_row['Killstreak'];
		$StatsID = $suspicious_players32_row['StatsID'];
		
		$suspicious_playerid_32_query  = "SELECT * FROM tbl_server_player_32 WHERE StatsID = '$StatsID'";
		$suspicious_playerid_32_result = mysql_query($suspicious_playerid_32_query);

		while($suspicious_playerid_32_row = mysql_fetch_array($suspicious_playerid_32_result))
		{

			$PlayerID = $suspicious_playerid_32_row['PlayerID'];

			$suspicious_player_data_32_query  = "SELECT * FROM tbl_playerdata_32 WHERE PlayerID = '$PlayerID'";
			$suspicious_player_data_32_result = mysql_query($suspicious_player_data_32_query);

			while($suspicious_player_data_32_row = mysql_fetch_array($suspicious_player_data_32_result))
			{

				$SoldierName_32 = $suspicious_player_data_32_row['SoldierName'];

//BEGIN SUSPICIOUS PLAYER NAME BLOCK

				if (($KDR >= '3') AND ($HSratio >= '0.5') AND ($Killstreak >= '10') AND ($Rounds >= '2'))
				{
					echo "<table width='100%' border='0' class='container'>";
					echo "<tr>";
					echo "<th colspan='3' style='text-align: left;'>";
					echo "<form action='stats.php' method='POST'>";
					echo "<input type='hidden' name='player_name' value='$SoldierName_32'/> ";
					echo "<input type='submit' name='search_player' style='color:#99CCFF;width:140px;text-align:center;font-weight:bold' value='$SoldierName_32' class='button2'/> <font color='#8E8E8E' size='1'>click name for stats</font>";
					echo "</form>";
					echo "</th>";
					echo "<tr>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    KDR: $KDR</td>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    Headshot Ratio: $HSratio</td>";
					echo "<td width='33%' style='text-align: left;' class='row1'>    Kill Streak: $Killstreak</td>";
					echo "</tr>";		
					echo "</table>";

				}

//END SUSPICIOUS PLAYER NAME BLOCK

			}
		}
	}

	echo "</td></tr>";
	echo "</table>";

//END 32-SLOT RESULTS BLOCK

//BEGIN SUSPICIOUS EXPLANATION BLOCK

	echo "<table width='100%' class='container' border='0'>";
	echo "<tr>";
	echo "<tr><td class='row1'>";
	echo "<br>";
	echo "<center>";
	echo "<table width='75%' border='0'>";
	echo "<tr><td>";
	echo "<b class='genmed'>A suspicious player is defined as a player who has the following combination:</b>";
	echo "<ul><li> A KDR of greater than or equal to 3.0.</li>";
	echo "<li> A headshot ratio of greater than or equal to 0.50 (50%).</li>";
	echo "<li> A killstreak of greater than or equal to 10.</li>";
	echo "<li> Has played in the server for greater than or equal to 2 rounds.</li></ul>";
	echo "</td></tr>";
	echo "</table>";
	echo "</center>";
	echo "<br>";
	echo "</td></tr>";
	echo "</table>";

//END SUSPICIOUS EXPLANATION BLOCK

}

//END SUSPICIOUS PLAYER LOGIC
Edited by maxdralle
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Waterboyeee*:

 

I am having some issues getting this working and I am not sure why. In my procon I have www.*****.net under my trusted port. Do I need to put 3306 after it? I have a remote procon layer with ODBC enabled.

 

My sql is on dreamhost

 

On my procon settings I have:

 

Host :www.****.net (does this need to be my SPECIFIC location of http://bf3stats.****.net ?

Port: 3306

Database Name: bf3stats

UserName: my username

Pass: my pass

 

more info on my setup

 

Server: bf3stats.*****.net via TCP/IP

Server version: 5.1.56-log

Protocol version: 10

User: *****@nembus.dreamhost.com

MySQL charset: UTF-8 Unicode (utf8)

Web server

 

Apache

MySQL client version: 5.0.51a

PHP extension: mysql

 

here is the error I am getting

 

 

[04:57:52 37] Error in Tablebuilder:

[04:57:52 37] Index #0

[04:57:52 37] Message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

[04:57:52 37] Native: 0

[04:57:52 37] Source:

[04:57:52 37] SQL: IM002

[04:57:52 96] Error in Tablebuilder:

[04:57:52 96] Index #0

[04:57:52 96] Message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

[04:57:52 96] Native: 0

[04:57:52 96] Source:

[04:57:52 96] SQL: IM002

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I am having some issues getting this working and I am not sure why. In my procon I have www.*****.net under my trusted port. Do I need to put 3306 after it? I have a remote procon layer with ODBC enabled.

I don't know if you already did this, but I am pretty sure you have to add the host as a trusted host in your PRoCon layer server, not in your PRoCon client on your computer.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by EBassie*:

 

Hey XpKiller,

 

for some reason I have a new problem.

I think this problem started with version .6 or latest server patch

 

Don't know for sure, I just noticed it. I have no errors in the plugin console:

 

Stats are updated in the DB, new players are added with an incorrect score

 

And the kills & deaths if existing players are bugged: not updating at all.

Not sure about the Headshots.

 

Scores & rounds are updated correctly though.

Update on the problem: Reverted back to .5 and got the same problem.

Kills & Deaths are not correctly saved.

 

EDIT:

Not all scores and rounds are correct updated either with .5

 

Switching back to .6 for further investigation :ohmy:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XpKiller*:

 

New Version 0.0.0.7beta

 

Changelog:

ingame weaponstats now working

SQL Query fixed

Some stability fixes which may help

 

 

@EBastard

Try to use the BF3.def which comes with the plugin in the zip file.

 

@Waterboyeee

Your odbc driver is not setup properly:

www.phogue.net/forumvb/showth...-Configuration*.

 

@ty_ger07

The same result as your code but MUCH faster.

Code:

SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, (tps.Kills/tps.Deaths) AS KDR, tps.Headshots, (tps.Headshots/tps.Kills) AS HSratio ,tps.Suicide, tps.TKs, tps.Playtime, tps.Rounds, tps.Killstreak, tps.Deathstreak  
FROM tbl_playerstats tps 
INNER JOIN tbl_server_player tsp ON tsp.StatsID = tps.StatsID
INNER JOIN tbl_playerdata tpd ON tsp.PlayerID = tpd.PlayerID
WHERE tsp.ServerID = 1 AND (tps.Kills/tps.Deaths) >= 3 AND (tps.Headshots/tps.Kills) >= 0.5 AND tps.Killstreak >= 10 AND tps.Rounds >= 2
ORDER BY Score DESC
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Waterboyeee*:

 

I don't know if you already did this, but I am pretty sure you have to add the host as a trusted host in your PRoCon layer server, not in your PRoCon client on your computer.

That is what I did. It is on the trusted host on my layer.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Waterboyeee*:

 

here is thought - have you enabled your database on dreamhost to accept remote access?

Not sure how to do that. I'll do some digging around.

 

I see this.. but I am not sure what to put in for it. My procon layer is through EOReality. I'll try %.eoreality.net for now.

 

Allowable Hosts

From what hosts (computers) may bfstats connect to these databases?

(One per line, use % as a wildcard.)

Your current computer is:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by GitSum*:

 

Ya - unless you specifically set up that mysql database to allow outside connections, it's not going to work

 

google has a lot of info - here is one http://wiki.dreamhost.com/MySQL

 

usually they want the ip address of what system is going to be connecting to the database - it is a security thing

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Waterboyeee*:

 

Ya - unless you specifically set up that mysql database to allow outside connections, it's not going to work

 

google has a lot of info - here is one http://wiki.dreamhost.com/MySQL

 

usually they want the ip address of what system is going to be connecting to the database - it is a security thing

So what is my best bet right now? Go with the freesql service? If so, what should my settings look like?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by GitSum*:

 

So what is my best bet right now? Go with the freesql service? If so, what should my settings look like?

You pay for that hosting service - call them up and explain you need to have remote access setup to your database, they will probably do it for you, but make sure you have the info handy regarding the ip of your layer server, etc

 

Another option - who hosts your game server and does it come with any web space? If it does, you could probably set up your database there

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Waterboyeee*:

 

You pay for that hosting service - call them up and explain you need to have remote access setup to your database, they will probably do it for you, but make sure you have the info handy regarding the ip of your layer server, etc

 

Another option - who hosts your game server and does it come with any web space? If it does, you could probably set up your database there

It looks like I can already do remote, I just need to add it to the list. EOReality is where my server and Procon layer are on. I just don't know what to put in on my dreamhost sql. This is from Dreamhost.

 

Allowable Hosts

From what hosts (computers) may bfstats connect to these databases?

 

Just put eoreality.net there?

 

In my Procon layer, I can enter in trusted ports. I don't know what to point to on my dreamhost. Do I point to www.*****.net? or do I point to bf3stats.*****.net (includes the name of my DB). On Host, does it need to have a www or http before it?

 

Then on Procon itself, I don't know what to put for "Host"... again, *****.net, or bf3stats.*****.net? If someone could give me an example of their settings with their information edited out, that might be easier.

 

edit- Just created a freesql and it still won't work even after making www.freesql.org a trusted port on my procon layer.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

@ty_ger07

The same result as your code but MUCH faster.

Code:

SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, (tps.Kills/tps.Deaths) AS KDR, tps.Headshots, (tps.Headshots/tps.Kills) AS HSratio ,tps.Suicide, tps.TKs, tps.Playtime, tps.Rounds, tps.Killstreak, tps.Deathstreak  
FROM tbl_playerstats tps 
INNER JOIN tbl_server_player tsp ON tsp.StatsID = tps.StatsID
INNER JOIN tbl_playerdata tpd ON tsp.PlayerID = tpd.PlayerID
WHERE tsp.ServerID = 1 AND (tps.Kills/tps.Deaths) >= 3 AND (tps.Headshots/tps.Kills) >= 0.5 AND tps.Killstreak >= 10 AND tps.Rounds >= 2
ORDER BY Score DESC
Oh yes. Much faster.

 

Thanks!

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by EBassie*:

 

New Version 0.0.0.7beta

 

Changelog:

ingame weaponstats now working

SQL Query fixed

Some stability fixes which may help

 

 

@EBastard

Try to use the BF3.def which comes with the plugin in the zip file.

Using .7 with the supplied BF3.def file, but still the scores, kills and deaths are not counted correctly. :sad:

 

I will set the debuglevel to "trace" and post the results.

 

EDIT: No trace report yet, but a small update:

 

The plugin did not update my personal stats after a round: Rounds, Score, Kills & Deaths not updated.

But somehow "LastSeenOnServer" was updated correctly.

 

 

EDIT 2:

Found out that yesterday my weaponkills were updated though, but not my overall kills / deaths.

 

EDIT 3:

Added 2 traces, of earlier this afternoon.

 

EDIT 4:

Somehow scores are counted correct again....

I did not change anything... I will keep monitoring this situation.

 

Attached Files:

* Restored post. It could be that the author is no longer active.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.