Jump to content

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


tyger07

Recommended Posts

Originally Posted by ty_ger07*:

 

My only concern is that APIs change. Sometimes, as popularity and their server load increases, they change their service to a paid service or require the request URL to be changed to include an API key obtained after creating an account with their service.

 

I will probably do a two-factor solution where the less accurate query of the database for players with IPs similar to the game server's IP address is used if the GeoLocation API service returns an unexpected result.

Code:

$location = '';
$s_explode = explode(":",$ip);
$server_ip = $s_explode[0];

$json = @file_get_contents('http://ip-api.com/json/' . $server_ip);
$data = @json_decode($json,true);
$location = $data['countryCode'];

if($location == '')
{
	while(@mysqli_num_rows($Location_q) == 0 && strlen($server_ip) > 1)
	{
		$Location_q = @mysqli_query($BF4stats,"
			SELECT `CountryCode`
			FROM `tbl_playerdata`
			WHERE `IP_Address` LIKE '{$server_ip}%'
			LIMIT 1
		");
		$server_ip = substr($server_ip, 0, -1);
		$Location_r = @mysqli_fetch_assoc($Location_q);
		$location = strtoupper($Location_r['CountryCode']);
	}
}
* 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*:

 

That looks very nice sir! Good job! :biggrin:

 

It it too much to ask to get the country flag too?

 

And maybe place the Players: Previous 24 hrs above the graph not inside? :ohmy:

How is this?

http://open-web-community.com/bf4stats/player-stats/banner/banner.png_sid=2&onomatopoeia=supercalifragilisticexpialidocious

http://open-web-community.com/bf4sta...expialidocious

 

 

 

You will probably need to urlencode the source into your image resizer page (if you haven't already):

 

http://www.nbfc.no/gtimg/gtimg.php_q=100&h=62&src=http://open-web-community.com/bf4sta...nner.png_sid=1

 

... because of the query string inside a query string

 

http://www.nbfc.no/gtimg/gtimg.php_q...ner/banner.png?sid%3D1

 

 

Another cool thing you can do is this:

 

If you are calling /banner/banner.png_sid=1 from within a php file on your site, you can append a junk query string containing the current timestamp to the end. If you do that, you guarantee that users always see a current version of the banner and never see a cached version.

 

Like so:

 

Code:

<_php

$timestamp = time();

echo '<img src="./banner/banner.png_sid=1&t=' . $timestamp . '" />';

_>
This would cause the URL to always be a slightly different random "image" and never an image cached on the client's computer.

 

But of course, this trick only works if the timestamp is being generated at the same time the image is being called. Otherwise, you are calling a static timestamp and run into the same old problem.

 

In a previous post, I placed the image in bbCode into a post as "http://open-web-community.com/bf4stats/player-stats/banner/banner.png_sid=3&dummy" just to make sure that I was having you critique something which was "new" to your computer.

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

Originally Posted by ty_ger07*:

 

Should the map image and "Battlefield 4" on the left be swapped top to bottom to have similar text to image orientation as on the right of the image? In other words, as it is now, the map and the graph are on opposite diagonals of the image. Is it good to have them on opposite diagonals -- as it is currently -- or should the "Battlefield 4" text be above the map image?

 

swap.png

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

Originally Posted by Prophet731*:

 

How is this?

http://open-web-community.com/bf4stats/player-stats/banner/banner.png_sid=2&onomatopoeia=supercalifragilisticexpialidocious

http://open-web-community.com/bf4sta...expialidocious

 

 

 

You will probably need to urlencode the source into your image resizer page (if you haven't already):

 

http://www.nbfc.no/gtimg/gtimg.php_q=100&h=62&src=http://open-web-community.com/bf4sta...nner.png_sid=1

 

... because of the query string inside a query string

 

http://www.nbfc.no/gtimg/gtimg.php_q...ner/banner.png?sid%3D1

 

 

Another cool thing you can do is this:

 

If you are calling /banner/banner.png_sid=1 from within a php file on your site, you can append a junk query string containing the current timestamp to the end. If you do that, you guarantee that users always see a current version of the banner and never see a cached version.

 

Like so:

 

Code:

<_php

$timestamp = time();

echo '<img src="./banner/banner.png_sid=1&t=' . $timestamp . '" />';

_>
This would cause the URL to always be a slightly different random "image" and never an image cached on the client's computer.

 

But of course, this trick only works if the timestamp is being generated at the same time the image is being called. Otherwise, you are calling a static timestamp and run into the same old problem.

 

In a previous post, I placed the image in bbCode into a post as "http://open-web-community.com/bf4stats/player-stats/banner/banner.png_sid=3&dummy" just to make sure that I was having you critique something which was "new" to your computer.

You could also send a no-cache header and set the expiration date to something in the past. That way you wouldn't have to append a timestamp to the URL.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

You could also send a no-cache header and set the expiration date to something in the past. That way you wouldn't have to append a timestamp to the URL.

Can an image have such a header?

Code:

?PNG
... Cache-Control ...
... Expires ...

IHDR0_???? IDATx???y?%Iv????=????Zz?^??3=g?,??
^^ of course that isn't how it would really appear. ... only a representation

 

 

The banner output header is PNG not HTML.

 

Perhaps I am wrong? Can you specify the cache control from within a PNG header?

 

I guess I will do some testing.

 

EDIT:

 

Code:

// start outputting the image
header('Pragma: public');
header('Cache-Control: max-age=0');
header('Expires: 0');
header("Content-type: image/png");
Ah hah! Simple enough. It works! I had no idea that you could specify that sort of information inside an image header. I thought that was an HTML-only thing.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Prophet731*:

 

Can an image have such a header?

Code:

?PNG
... Cache-Control ...
... Expires ...

IHDR0_???? IDATx???y?%Iv????=????Zz?^??3=g?,??
^^ of course that isn't how it would really appear. ... only a representation

 

 

The banner output header is PNG not HTML.

 

Perhaps I am wrong? Can you specify the cache control from within a PNG header?

 

I guess I will do some testing.

 

EDIT:

 

Code:

// start outputting the image
header('Pragma: public');
header('Cache-Control: max-age=0');
header('Expires: 0');
header("Content-type: image/png");
Ah hah! Simple enough. It works! I had no idea that you could specify that sort of information inside an image header. I thought that was an HTML-only thing.
I was confused when I read the email notification. I was asking myself why couldn't you add the header. That doesn't make sense. Glad you figured it out. It's the simple things that make your job 10x easier. :smile: Now no more timestamp matching for a fresh image. :biggrin:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I was confused when I read the email notification. I was asking myself why couldn't you add the header. That doesn't make sense. Glad you figured it out. It's the simple things that make your job 10x easier. :smile: Now no more timestamp matching for a fresh image. :biggrin:

Email notification?
* 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:

- Added Final Stand maps and ranks

- Added GameTracker style server banner signature images to the Server Info page Banners tab

- Added Soldier Name search on Leaderboard

 

 

I don't know the codes for the Final Stand weapons and vehicles, so you may see those missing. Please feel free to point out the displayed weapon name if you find one of the missing ones.

 

Code:

// final stand
// 'Rorsch Mk-1'			=>	'',
// 'Phantom'				=>	'',
...
// Final Stand Vehicles
// 'Snowmobile'				=>	'',
// 'HT-95 Levkov'			=>	'',
// 'Shipunov 42'			=>	'',
// 'Pod Launcher'			=>	'',
// 'XD-1 Accipiter'			=>	''
* 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:

- Made alignment changes to banner image and fixed graph going off the chart in some cases in banner image

- Added optional "&cc=.." URL query string variable to change the country flag displayed in the banner image

 

https://github.com/tyger07/BF4-Serve...e9059eab75cfd4

 

 

http://nbfc.no/bf4stats/banner/banner.png_sid=1&cc=no

Code:

http://nbfc.no/bf4stats/banner/banner.png_sid=1&cc=no
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

What must I change to get in German Battlelog out, when I press Join Server ?

 

Join.png

 

-----

 

Battlelog URL without DE

 

BL.png

 

 

Battlelog URL with DE

 

BL DE.png

In index.php, look for these lines:

Code:

$battlelog = 'http://battlelog.battlefield.com/bf4/servers/pc/_filtered=1&expand=0&useAdvanced=1&q=' . urlencode($ServerName);
There are two lines like that (line 95 and line 188). Change those lines to include bf4/de/servers.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Level*:

 

In index.php, look for these lines:

Code:

$battlelog = 'http://battlelog.battlefield.com/bf4/servers/pc/_filtered=1&expand=0&useAdvanced=1&q=' . urlencode($ServerName);
There are two lines like that (line 95 and line 188). Change those lines to include bf4/de/servers.
Thank you for your help @ty_ger07
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I wonder why TonyGun's text in the banner image graph is so fuzzy. It must be his php gd extension version or something along those lines.

http://www.fws-gaming.com/bf4serverstats/banner/banner.png_sid=2

0, 50, and 100 all look like the same blobs. Apparently, I need to increase the text size for those in similar situations.

 

I am also rethinking my choice to calculate combined ranks on player stats pages. I had it disabled previously due to page load time, but enabled it in combined stats player pages after I made it asynchronous. It's no longer an issue with page load time, but it is a huge database load.

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

Originally Posted by Ruger*:

 

Hey ty_ger07,

 

Really like this stats page. Thanks for all your work on it. Just wanted to let you know that on the Server Info page, Banners tab the html iframe link is showing /banner/serverbanner.php_sid=1 but found it needed to be /common/serverbanner.php_sid=1. Just FYI.

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

Originally Posted by ty_ger07*:

 

Hey ty_ger07,

 

Really like this stats page. Thanks for all your work on it. Just wanted to let you know that on the Server Info page, Banners tab the html iframe link is showing /banner/serverbanner.php_sid=1 but found it needed to be /common/serverbanner.php_sid=1. Just FYI.

Thanks for the heads up!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

It should be fine.

 

It has room for 100 characters. 20 servers times 2 characters per server id equals 40 characters; plus 18 more characters for commas equals 58 characters.

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

Originally Posted by ty_ger07*:

 

Update released!

 

Changes:

- Increased font size in banner graph for better visibility for those with wonky php GD extension

- Fixed serverbanner.php directory location in server info tab

- Removed combined rank calculation from combined player stats pages due to large database load for those with many combined players

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

Originally Posted by Ruger*:

 

Update released!

 

Changes:

- Increased font size in banner graph for better visibility for those with wonky php GD extension

- Fixed serverbanner.php directory location in server info tab

- Removed combined rank calculation from combined player stats pages due to large database load for those with many combined players

Hey ty_ger07, I noticed after this update that my server graph is no longer showing past 24 hours info.

 

http://stats.redriversyndicate.com/banner/banner.png_sid=1

 

Any ideas?

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

Originally Posted by ty_ger07*:

 

Hey ty_ger07, I noticed after this update that my server graph is no longer showing past 24 hours info.

 

http://stats.redriversyndicate.com/banner/banner.png_sid=1

 

Any ideas?

For some reason, GitHub removed the /banner/banner_cache folder in this latest git push.

 

https://github.com/tyger07/BF4-Serve.master/banner

 

If you create the missing folder on your server, the graph should start working again.

 

I guess I will need to put a dummy file in that folder in the next release so that github doesn't remove the folder.

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