ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 Originally Posted by Legate*: I need this settings: Ranking by Score (yes/no) overall Ranking (yes/no) Determinate the broken query. Ranking by Score: nooverall Ranking: no Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 Originally Posted by XpKiller*: XP, thanks for the queries once again! 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"@Legatedo you use a tbalesuffix? Will look at this. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 (edited) I made a stats page for a phpBB forum based off the data collected by this plugin.Example:http://thetacteam.info/stats.phpIf 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 August 7, 2019 by maxdralle Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 Originally Posted by ty_ger07*: I've never done a query in that sort of syntax. Does php support it? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 Originally Posted by Legate*: @Legate do you use a tbalesuffix? Will look at this. Nope Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 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"@Legatedo 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2011 Author Share Posted December 3, 2011 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! Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 4, 2011 Author Share Posted December 4, 2011 Originally Posted by CptChaos*: I'm not sure if it's a bug or not: but I see people having deaths with the medkit, but I don't see users with kills with it... Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 4, 2011 Author Share Posted December 4, 2011 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) Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 Originally Posted by XpKiller*: I will properly release a new version on monday which contains some fixed an working ingame weaponstats Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 (edited) 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.phpBut 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 August 7, 2019 by maxdralle Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 Originally Posted by EBassie*: Removed the error, nothing to see here people... Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 5, 2011 Author Share Posted December 5, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 Originally Posted by GitSum*: My sql is on dreamhosthere is thought - have you enabled your database on dreamhost to accept remote access? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 Originally Posted by Clay52*: Thanks for the update XpKillah Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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: Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 Originally Posted by ty_ger07*: My layer host won't let me update BF3.def. The file has read-only attributes. Is this a big issue? So far it is working, but weapon stats doesn't doesn't seem to be working. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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 Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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! Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2011 Author Share Posted December 6, 2011 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. 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: Trace_Stats_32RUSH.zip Trace_Stats_64CQ.zip Quote * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.