Jump to content

[BF4] Stats webpage for XpKiller's Stats Logger Plugin


tyger07

Recommended Posts

Originally Posted by ty_ger07*:

 

Thats just the database name, used a spare one I had for DayZ.

And it worked XpKiller, restarting the layer.

 

Now here comes the fun part again, some of the stats wont show up - like kills, total deaths, K/D, headshots etc. Its all at 0.

 

http://bf4stats.battlefield.no/

Since you just created the database, a lot of stuff will be zero at first.

 

It also looks like you have some stuff disabled in you stats logger plugin.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.7k
  • Created
  • Last Reply

Originally Posted by Porthos1973*:

 

Ok quick question. I currently have two separate databases for two servers which means two different stats pages. We are probably going to be moving our servers over to a dedicated box so servers will move. If I point the new servers all to the same database, does server id automatically get assigned or do I have to do it manually?

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

Originally Posted by ty_ger07*:

 

Ok quick question. I currently have two separate databases for two servers which means two different stats pages. We are probably going to be moving our servers over to a dedicated box so servers will move. If I point the new servers all to the same database, does server id automatically get assigned or do I have to do it manually?

You should put your servers all in the same database. Xpkiller's plugin automatically assigns them different server ids.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by bFe*:

 

To have the new maps show up on the stats page, change your $map_array(found in index.php | around line 130) to this:

 

$map_array = array('Zavod 311'=>'MP_Abandoned','Lancang Dam'=>'MP_Damage','Flood Zone'=>'MP_Flooded','Golmud Railway'=>'MP_Journey','Paracel Storm'=>'MP_Naval','Operation Locker'=>'MP_Prison','Hainan Resort'=>'MP_Resort','Siege of Shanghai'=>'MP_Siege','Rogue Transmission'=>'MP_TheDish','Dawnbreaker'=>'MP_Tre mors','Silk Road'=>'XP1_001','Altai Range'=>'XP1_002','Guilin Peaks'=>'XP1_003','Dragon Pass'=>'XP1_004');

 

 

And another thing, how can I make the leaderboards global and not show individual stats from each server?

I have seven servers all having the same server group and all having overall ranking turned on, but the leaderboards are different.

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

Originally Posted by ty_ger07*:

 

To have the new maps show up on the stats page, change your $map_array(found in index.php | around line 130) to this:

 

$map_array = array('Zavod 311'=>'MP_Abandoned','Lancang Dam'=>'MP_Damage','Flood Zone'=>'MP_Flooded','Golmud Railway'=>'MP_Journey','Paracel Storm'=>'MP_Naval','Operation Locker'=>'MP_Prison','Hainan Resort'=>'MP_Resort','Siege of Shanghai'=>'MP_Siege','Rogue Transmission'=>'MP_TheDish','Dawnbreaker'=>'MP_Tre mors','Silk Road'=>'XP1_001','Altai Range'=>'XP1_002','Guilin Peaks'=>'XP1_003','Dragon Pass'=>'XP1_004');

 

 

And another thing, how can I make the leaderboards global and not show individual stats from each server?

I have seven servers all having the same server group and all having overall ranking turned on, but the leaderboards are different.

I am busy with work so I can't update this code for the expansion pack right now.

An expansion pack came out already and I haven't even had a chance to play much. :sad:

 

For global stats, the server ID needs to be removed from the SQL queries. The stats pages at present are designed to show stats for each server individually. You would have to remove WHERE serverID = '{$server_ID}' or whatever (off the top of my head) from the queries and replace it with WHERE 1 in the code to not filter the stats for each server individually.

 

For example, to show top players in all servers on 'home' page, change this:

 

$sql = @mysql_query("SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, tps.Rounds, tps.Headshots 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 = '$server_ID' ORDER BY $rankin $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

 

To this:

 

$sql = @mysql_query("SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, tps.Rounds, tps.Headshots 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 1 ORDER BY $rankin $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

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

Originally Posted by ty_ger07*:

 

I should clarify that I have not tested that query.

 

I don't think it will do exactly what you want because I think it will show the same player on the list in multiple places (one for their ranking on each server). To add up each player's stats on all servers, I think you would need to sum the stats and group by soldier name.

 

But that query I gave should at least show the top players on all your servers grouped by their best stats in any one server.

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

Originally Posted by XpKiller*:

 

I am busy with work so I can't update this code for the expansion pack right now.

An expansion pack came out already and I haven't even had a chance to play much. :sad:

 

For global stats, the server ID needs to be removed from the SQL queries. The stats pages at present are designed to show stats for each server individually. You would have to remove WHERE serverID = '{$server_ID}' or whatever (off the top of my head) from the queries and replace it with WHERE 1 in the code to not filter the stats for each server individually.

 

For example, to show top players in all servers on 'home' page, change this:

 

$sql = @mysql_query("SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, tps.Rounds, tps.Headshots 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 = '$server_ID' ORDER BY $rankin $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

 

To this:

 

$sql = @mysql_query("SELECT tpd.SoldierName, tps.Score, tps.Kills, tps.Deaths, tps.Rounds, tps.Headshots 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 1 ORDER BY $rankin $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

Use this one:

$sql = @mysql_query("SELECT tpd.SoldierName,SUM( tps.Score), SUM(tps.Kills), SUM(tps.Deaths), SUM(tps.Rounds), SUM(tps.Headshots) 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.ServerGroup = $ServerGroup GROUP BY tpd.PlayerID ORDER BY SUM($rankin) $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

 

not tested may soe variables are wrong.

 

edit:

forgot a group by :-(

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

Originally Posted by Kinsman*:

 

I think this line above to get the playername stops it working? I guess it now needs to get playernames from all servers?

 

$sql = @mysql_query("SELECT COUNT(tpd.SoldierName) 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 = '$server_ID' ORDER BY Score DESC, SoldierName ASC");

 

Also how do I add all 5 server groups to your query XPKiller? (yes we have 1 server per group, dumb i guess!)

 

$sql = @mysql_query("SELECT tpd.SoldierName,SUM( tps.Score), SUM(tps.Kills), SUM(tps.Deaths), SUM(tps.Rounds), SUM(tps.Headshots) 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.ServerGroup = $ServerGroup GROUP BY tpd.PlayerID ORDER BY SUM($rankin) $order, SoldierName $nextorder LIMIT $offset, $rowsperpage");

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

Originally Posted by ty_ger07*:

 

What are you attempting to do in the first query?

 

Oh... yeah. The first query is there to find the total number of players and figure out how many pages of pagination to provide. With the wrong number of players detected, it would just not show the very last pages of worst ranking players.

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

Originally Posted by ty_ger07*:

 

I tried to get the plugin connected to my remote DB, however I keep getting this error.

Please ask in xpkiller's plugin thread. This is not the place to ask questions about his plugin.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

this Stats page is for BF 4 only ?

It is for xpkiller's latest version of his plugin. If xpkiller's latest plugin version works for bf3, then this code will work for BF3 also.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Kinsman*:

 

Done.

 

add gamemode to the query here.

 

Code:

// query for maps
    $map_result = @mysql_query("SELECT ServerID, MapName, Gamemode, SUM(NumberofRounds) AS NumberofRounds, AVG(AvgPlayers) AS AveragePlayers, AvgPlayers, AVG(PlayersLeftServer) AS AveragePlayersLeftServer, PlayersLeftServer FROM tbl_mapstats WHERE ServerID = '$server_ID' GROUP BY MapName ORDER BY $rankin $order");
    if(@mysql_num_rows($map_result)==0)
    {
then arrange how you like.

 

Code:

<th width="20%" style="text-align:left">Map Name</th>
        ';
        if($rank != 'MapName')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=MapName&order=ASC"><span class="orderheader">Map Code</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=MapName&order=' . $nextorder . '"><span class="orderheader">Map Code</span></a></th>';
        }
        if($rank != 'Gamemode')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=Gamemode&order=ASC"><span class="orderheader">Game Mode</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=Gamemode&order=' . $nextorder . '"><span class="orderheader">Game Mode</span></a></th>';
        }
        
        if($rank != 'NumberofRounds')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=NumberofRounds&order=DESC"><span class="orderheader">Rounds Played</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=NumberofRounds&order=' . $nextorder . '"><span class="orderheader">Rounds Played</span></a></th>';
        }
        if($rank != 'AVGPop')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=AVGPop&order=DESC"><span class="orderheader">Average Popularity</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=AVGPop&order=' . $nextorder . '"><span class="orderheader">Average Popularity</span></a></th>';
        }
        echo '</tr>';
        // initialize value
        $count = 0;
        while($map_row = @mysql_fetch_assoc($map_result))
        {
            $MapName = $map_row['MapName'];
            $NumberofRounds = $map_row['NumberofRounds'];
            $map_stats = array_search($MapName,$map_array);
            // convert mode to friendly name
          $mode = $map_row['Gamemode'];
          $mode_name = array_search($mode,$mode_array);
        
            $AveragePlayers = $map_row['AveragePlayers'];
            $AveragePlayersLeftServer = $map_row['AveragePlayersLeftServer'];
            // avoid dividing by zero
            if(($AveragePlayers >= 1) AND ($AveragePlayersLeftServer >= 1))
            {
                $AveragePopularity = round(($AveragePlayers/$AveragePlayersLeftServer),2);
            }
            else
            {
                $AveragePopularity = 'Not enough data';
            }
            // only display the map in the list if it has been played
            if($MapName!=null)
            {
                $count++;
                echo '
                <tr>
                <td width="5%" class="tablecontents" style="text-align: left;"><font size="2">' . $count . ':</font></td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $map_stats . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $MapName . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $mode_name . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $NumberofRounds . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $AveragePopularity . '</td>
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Done.

 

add gamemode to the query here.

 

Code:

// query for maps
    $map_result = @mysql_query("SELECT ServerID, MapName, Gamemode, SUM(NumberofRounds) AS NumberofRounds, AVG(AvgPlayers) AS AveragePlayers, AvgPlayers, AVG(PlayersLeftServer) AS AveragePlayersLeftServer, PlayersLeftServer FROM tbl_mapstats WHERE ServerID = '$server_ID' GROUP BY MapName ORDER BY $rankin $order");
    if(@mysql_num_rows($map_result)==0)
    {
then arrange how you like.

 

Code:

<th width="20%" style="text-align:left">Map Name</th>
        ';
        if($rank != 'MapName')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=MapName&order=ASC"><span class="orderheader">Map Code</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=MapName&order=' . $nextorder . '"><span class="orderheader">Map Code</span></a></th>';
        }
        if($rank != 'Gamemode')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=Gamemode&order=ASC"><span class="orderheader">Game Mode</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=Gamemode&order=' . $nextorder . '"><span class="orderheader">Game Mode</span></a></th>';
        }
        
        if($rank != 'NumberofRounds')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=NumberofRounds&order=DESC"><span class="orderheader">Rounds Played</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=NumberofRounds&order=' . $nextorder . '"><span class="orderheader">Rounds Played</span></a></th>';
        }
        if($rank != 'AVGPop')
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=AVGPop&order=DESC"><span class="orderheader">Average Popularity</span></a></th>';
        }
        else
        {
            echo'<th width="20%" style="text-align:left;"><a href="' . $_SERVER['PHP_SELF'] . '_mapstats=View&rank=AVGPop&order=' . $nextorder . '"><span class="orderheader">Average Popularity</span></a></th>';
        }
        echo '</tr>';
        // initialize value
        $count = 0;
        while($map_row = @mysql_fetch_assoc($map_result))
        {
            $MapName = $map_row['MapName'];
            $NumberofRounds = $map_row['NumberofRounds'];
            $map_stats = array_search($MapName,$map_array);
            // convert mode to friendly name
          $mode = $map_row['Gamemode'];
          $mode_name = array_search($mode,$mode_array);
        
            $AveragePlayers = $map_row['AveragePlayers'];
            $AveragePlayersLeftServer = $map_row['AveragePlayersLeftServer'];
            // avoid dividing by zero
            if(($AveragePlayers >= 1) AND ($AveragePlayersLeftServer >= 1))
            {
                $AveragePopularity = round(($AveragePlayers/$AveragePlayersLeftServer),2);
            }
            else
            {
                $AveragePopularity = 'Not enough data';
            }
            // only display the map in the list if it has been played
            if($MapName!=null)
            {
                $count++;
                echo '
                <tr>
                <td width="5%" class="tablecontents" style="text-align: left;"><font size="2">' . $count . ':</font></td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $map_stats . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $MapName . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $mode_name . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $NumberofRounds . '</td>
                <td width="20%" class="tablecontents" style="text-align: left;">' . $AveragePopularity . '</td>
That won't really work. That will just show the last gamemode played by that map but won't display how many times that map has been played in other game modes.

 

Unless that is the goal in mind. I am not really sure what the goal is since the request was vague.

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

Originally Posted by Cedbru57*:

 

Yes, it would be possible, but how would you like it organized? Each map listed for each game mode played?

Yes, each map for each game mode.

1: Siege of Shanghai MP_Siege Domination 34 1.42

2: Siege of Shanghai MP_Siege SmallConquest 20 1.10

 

Other question, why the first seen and last seen are no longer appear in player statistics ?

 

Thank for your reply :smile:

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

Archived

This topic is now archived and is closed to further replies.




  • 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.