Jump to content

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


tyger07

Recommended Posts

Originally Posted by ty_ger07*:

 

One optimization I can do is grab the player score rank of the top 20 players and show that rank on the player stats page if you view the player page of one of those top 20 players. I don't know why I didn't think of that already. That would decrease the rank function load by 1/4 if one of the top 20 player pages are viewed.

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

Originally Posted by ty_ger07*:

 

Will it be possible to add a server signature like the ones in my sig from gametracker?

 

Gametracker is down all the time, and it would be nice to have our own sigs. :cool:

I am sure that you have seen the player stats signatures on the player stats page.

http://open-web-community.com/bf4stats/player-stats/signature/signature.php_pid=27546&gid=1&fav=0

 

I am also sure that you have seen the gametracker style server banners on the server info page.

http://open-web-community.com/bf4sta...nner.php_sid=3

 

Basically, you want something similar to the existing server banner, except as an image instead of html and squashed down, correct?

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

Originally Posted by TMiland*:

 

I am sure that you have seen the player stats signatures on the player stats page.

http://open-web-community.com/bf4stats/player-stats/signature/signature.php_pid=27546&gid=1&fav=0

 

I am also sure that you have seen the gametracker style server banners on the server info page.

http://open-web-community.com/bf4sta...nner.php_sid=3

 

Basically, you want something similar to the existing server banner, except as an image instead of html and squashed down, correct?

I have seen them yes, that's why i am asking. Using the server banner on http://nbfc.no/forums/ :smile:

 

Well, i was thinking something along the line of the gametracker server signature, just like this: Posted Image

 

Attached Files:

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

Originally Posted by ty_ger07*:

 

Update Released!

http://tyger07.github.io/BF4-Server-Stats

 

Changes:

- Fixed error which sometimes caused duplicates in Top 20 players cache

- Performance enhancement of rank function

- Added missing country Montenegro

 

An issue occured if two people triggered a Top 20 recache within seconds of eachother which caused duplicated lines in the Top 20 list.

Screenshot_2014-11-11-12-48-21.jpg

Rank query was sped up by using Top 20 cache for player score rank if that player is a Top 20 player. Also HS/Kill rank was removed in order to reduce rank function load by 1/4.

Server banner page was sped up by using Top 20 cache for Top 10 player display instead of querying the entire database.

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

Originally Posted by ty_ger07*:

 

I plan to add a player search box to the leaderboard so that a specific player's rank can be found on the leaderboard without going to that player's stats page.

 

I also plan to create gametracker style server banner signature images as requested.

 

In the more distant future, I consider releasing a stats database maintenance/cleanup page probably in a different thread and as a different GitHub project.

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

Originally Posted by ty_ger07*:

 

Cool!

 

Using your stats page as a comparison, TMiland, the rank function is still incredibly slow for you in that one server with lots of players. Waiting so long to load a player's page is pathetic. I should just jquery the ranks into that page later after the rest of the page loads. Waiting time could be cut down from 6 - 10 seconds down to less than one second in your case.

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

Originally Posted by ty_ger07*:

 

can i use this for my bf3 server stats? i run the old plugin (1.1.0.1) on my server.

Yes, you can use it with your BF3 server if you change BF4 to BF3 in the /common/connect.php file. But you will see lots of issues with missing maps and maps images and missing weapons and weapons images.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Cool!

 

Using your stats page as a comparison, TMiland, the rank function is still incredibly slow for you in that one server with lots of players. Waiting so long to load a player's page is pathetic. I should just jquery the ranks into that page later after the rest of the page loads. Waiting time could be cut down from 6 - 10 seconds down to less than one second in your case.

What page is it, i experience no slow loading times on my end.

 

I was also thinking if you want to, i have a dev database you could get access to if you want, it's approximately 2GB of data in that db you could use. :smile:

 

It's just a copy of the production db, but it's loaded with data you can fiddle with. :smile:

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

Originally Posted by ty_ger07*:

 

What page is it, i experience no slow loading times on my end.

 

I was also thinking if you want to, i have a dev database you could get access to if you want, it's approximately 2GB of data in that db you could use. :smile:

 

It's just a copy of the production db, but it's loaded with data you can fiddle with. :smile:

I can't click on the link, otherwise you will see a fast load time due to me cacheing it. Someone else might click the link and cache it before you visit it as well. But, for example, any player stats page in Server 1 is slow to load due to calculating their ranks.

http://nbfc.no/bf4stats/index.php_si...29054&p=player

If that player's rank is cached by the time you click it, try some other random player's stats page. It seems like your database takes around 9 seconds to calculate those three ranks for Server 1 for a non-top 20 player and around 5 seconds to calculate those three ranks for a top 20 player.

 

A larger database would be nice for testing purposes. The problem though is that it's hard for me to get a copy due to its size and difficulty in creating a backup, uploading the backup, downloading the backup, and restoring the backup.

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

Originally Posted by ty_ger07*:

 

I see this is pretty ugly until a round is completed and player stats are saved:

Screenshot_2014-11-12-05-18-15.jpg

"Image missing" "error" "error" "unknown..."

 

The live scoreboard of that server doesn't display the same ugly blank information though because it ignores the fact that there are not yet any stored players or stats. It simply doesn't need to know that fact because it isn't counting the total number of players at the same time.

Screenshot_2014-11-12-05-18-34.jpg

 

In index-displayer-servers.php and index-display-servers-live.php, this query is also counting the number of players and since there are none, failed query.

Code:

$Basic_q = @mysqli_query($BF4stats,"
	SELECT ts.`mapName`, ts.`Gamemode`, ts.`maxSlots`, ts.`usedSlots`, ts.`ServerName`, tss.`CountPlayers`
	FROM `tbl_server` ts
	INNER JOIN `tbl_server_stats` tss ON tss.`ServerID` = ts.`ServerID`
	WHERE ts.`ServerID` = {$this_ServerID}
	AND ts.`GameID` = {$GameID}
");
I guess I should split that query into two queries so that most of the information can be displayed and only the players will be "error".
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Yes +1

Works for me.

http://battlelog.battlefield.com/bf4...7C+Nitrado.net

 

It's probably because you are logged into battlelog and have a custom filter set. I will change the link back to how it was.

 

Does this one work for you?

http://battlelog.battlefield.com/bf4...7C+Nitrado.net

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

Originally Posted by ty_ger07*:

 

Hi :smile:

 

I've a problem with the new version. The combined stats doesn't works :sad: Look : http://www.fws-gaming.com/bf4serverstats/index.php And on the home page, in Combined Stats, the number of players is not good :/ On the previous version it work :sad:

You've an idea ?

I think it is because you have a ton of servers which causes the number of available server ids to exceed the text length limit of that collumn of the cache table. I will have to increase the character length limit.

 

But, I am only guessing because I can't look at your database. If you PMed me your database connection details, it would be much easier for me to diagnose.

 

What do you mean "in Combined Stats, the number of players is not good :/". What is "no good" about it?

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

Originally Posted by ty_ger07*:

 

The old version added up the players too high. The new number may be correct. I haven't checked yours yet. Think of it this way: if you visit every one of your servers, you are only 1 person, not 8 people. You can't add up all the numbers because many players visit more than one of your servers and can't be counted multiple times.

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

Originally Posted by ty_ger07*:

 

I've sent you a message with the access :smile:

The number of player is not good because if you add all servers, it makes more 600 000 players and on the old version it works :/

Thank you!

 

Regarding Combined Player Page Issue you Reported with "No stats...":

 

I did some testing and, yes, the problem was that the Server IDs (1,2,3,4,5,6,7,8,9,10,11,12,13,14) were more than 20 characters and therefore did not fit in the column in database table which truncated its value to (1,2,3,4,5,6,7,8,9,10) and caused a mismatch.

 

I have extended the column in your database to 50 characters which solved the issue.

 

I will release an update for other people like you who have many many servers.

 

Here are the queries to fix that issue:

Code:

ALTER TABLE `tyger_stats_count_cache` CHANGE `SID` `SID` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `tyger_stats_rank_cache` CHANGE `SID` `SID` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `tyger_stats_top_twenty_cache` CHANGE `SID` `SID` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
I already fixed yours, so there is nothing more you need to do.

 

Regarding "Combined Stats, the number of players is not good :/" you Reported:

 

I verified that the count is now correct. Before, the count was too high.

 

This is the query it is using to count your players:

Code:

SELECT COUNT(DISTINCT tpd.`PlayerID`) AS count
FROM  `tbl_playerdata` tpd
INNER JOIN `tbl_server_player` tsp ON tsp.`PlayerID` = tpd.`PlayerID`
INNER JOIN `tbl_playerstats` tps ON tps.`StatsID` = tsp.`StatsID`
WHERE tpd.`GameID` = 1
AND tsp.`ServerID` IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14)
The result is: 402862 currently

 

The reason why it is lower than it used to be is because it used to be incorrect. I fixed it a handful of updates ago by adding "COUNT(DISTINCT tpd.`PlayerID`)" (in bold) because it was counting players multiple times if they were in multiple servers.

 

Think of it this way (simplified):

If you only had two servers and you were the only 1 player who played in each of those servers, the total combined players who have played in those servers is 1, not 2.

 

Server 1: 1 total player (you)

Server 2: 1 total player (you)

Combined Servers: total players: 1

 

You can't just add up the number of players in each server to figure out the combined total number of players.

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

Originally Posted by TonyGun38*:

 

Hum ok, thank you for your help :smile:

 

Another question, you know how I can change the order of the servers in the list ?

 

And in the server selector, how I can add "Home" option ?

 

Thank you

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

Originally Posted by ty_ger07*:

 

Hum ok, thank you for your help :smile:

 

Another question, you know how I can change the order of the servers in the list ?

 

And in the server selector, how I can add "Home" option ?

 

Thank you

Changing the order... that is something you would have to do custom. It orders them in order of when they were added to the database. It's hard to predict which is the "correct" order for everyone.

 

It orders the server in /common/connect.php in this query:

Code:

// find all servers in this database which have the BF4 game id
$ServerID_q = @mysqli_query($BF4stats,"
	SELECT `ServerID`
	FROM `tbl_server`
	WHERE `GameID` = {$GameID}
	AND (`ConnectionState` IS NULL OR `ConnectionState` = 'on')
");
If you tried to order them by ServerName, you would use this query:

Code:

// find all servers in this database which have the BF4 game id
$ServerID_q = @mysqli_query($BF4stats,"
	SELECT `ServerID`
	FROM `tbl_server`
	WHERE `GameID` = {$GameID}
	AND (`ConnectionState` IS NULL OR `ConnectionState` = 'on')
	ORDER  BY `ServerName` ASC
");
But then you would get this order which is probably actually worse:

FwS Gaming.com # 11 | Dragon's Teeth - ChainLink |...

FwS Gaming.com #1 | All Maps - Classic Conquest | ...

FwS Gaming.com #10 | Dragon's Teeth - Chainlink | ...

FwS Gaming.com #10 | Naval Strik - Carrier Assaut ...

FwS Gaming.com #12 | Capture The Flag - All Maps |...

FwS Gaming.com #2 | All Maps - Conquest | Nitrado....

FwS Gaming.com #3 | Infantry - Conquest | Nitrado....

FwS Gaming.com #4 | All Maps - Rush | Nitrado.net

FwS Gaming.com #5 | All Maps - Obliteration | Nitr...

FwS Gaming.com #6 | All Maps - Domination | Nitrad...

FwS Gaming.com #7 | All Maps - Rush HC | Nitrado.n...

FwS Gaming.com #8 | All Maps - Conquest HC | Nitra...

FwS Gaming.com #9 | Defuse - All maps | Nitrado.ne...

There is a link back to the index "home".

Index • FwS Gaming.com #1 | All Maps - Classic Conquest | Nitrado.net

HOME PAGE

Statistics data presented is not from all BF4 servers. These are the statistics of players only in this server.

index.png

 

But if you want to also add it to the drop-down menu, it is in /common/display-servers.php. It is a simple HTML form but difficult to do what you want since the input 'p' is set to 'home' to specify the page for each option and it is hard to retrospectively change 'p' back to '' (NULL) later in the form in order to make it bring you back to the index page.

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

Originally Posted by ty_ger07*:

 

Update Released!

http://tyger07.github.io/BF4-Server-Stats

 

Changes:

- Fixed error caused while caching combined server stats of databases with many servers

- Added a couple database indexes to speed up certain queries

- Fixed issue with server join button link

- Updated to new Battlelog background image

 

 

Note: initially you will see a very slow page load time while changes are made. After that, performance should return to what it was previously. Then, after that, you should see some pages gradually get faster than previously.

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

Originally Posted by Tealavenger*:

 

Hey Ty_ger07,

 

Just have a quick questions. I apologize if this has already been answered. Any plans to implement a "Total Playtime" time field on the live scoreboard or when you click on the player?

 

Great work!!!!

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




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