Jump to content

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


tyger07

Recommended Posts

  • Replies 1.7k
  • Created
  • Last Reply

Originally Posted by ty_ger07*:

 

Whats posted should have commanders, I'm UTC +11 so it will be about 12 hours before the servers are full again, will capture then.

It doesn't appear to have any players in the server. Commander stats aren't saved to the database. I am hoping they will at least show up on the scoreboard though when they are in the server.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Right now I am working on overhauling it and making it look like BF4 and no longer like BF3.

http://open-web-community.com/bf4sta...tats/index.php

 

I hope to work out whether or not commanders can show on the scoreboard when I get that new copy of the database. That is when I will also focus on adding up server stats on the index page and work on weapon top rankings and that sort of stuff.

 

EDIT: Code linked in first page has been updated (php files, images, and CSS). Now the page looks like BF4.

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

Originally Posted by ty_ger07*:

 

Heres sql with server 2 full, battlelog was showing commanders at the time.

Cool, cool, cool! Thanks a lot. I will take a look at it when I can. I am celebrating Thanksgiving this weekend with my family early, so it will probably be Monday when I take a look at it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

It doesn't look like there is any reliable commander data.

 

If there are commanders listed in that data, I can't tell which ones are commanders. They are either the ones who say they are still joining the server, or they are the ones with no kills or deaths. There's nothing to reliably tell who is a commander.

 

You haven't updated your stats page yet. :sad: It should look like this:

proto.jpg

 

It looks like US is always team 1 and team 2 can be RU or CN depending on the current map. I haven't played BF4 yet enough to know which maps have CN and which maps have RU. Anyone able to offer some insight?

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

Originally Posted by Cermit*:

 

What if I run 2 Servers, with 2 separate DBs? Can I use the StatsMain.php only if both Servers are using the same database?

I can only set a different server_ID, but cannot set a second Database...

Is there any solution I just didn´t find yet?

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

Originally Posted by ty_ger07*:

 

What if I run 2 Servers, with 2 separate DBs? Can I use the StatsMain.php only if both Servers are using the same database?

I can only set a different server_ID, but cannot set a second Database...

Is there any solution I just didn´t find yet?

It would be possible to modify it to use different databases. Right now it assumes that the servers will all be in the same database. Do you need help with the php to edit the code for creating a second database connection link?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Thanks for this ty_ger07!

 

I wanted to share a little edit for the server name in the index file:

Add this on line 149:

Code:

// get servername
	$server_name = @mysql_query("SELECT ServerName FROM tbl_server WHERE `ServerID` = '$sid'");
	if(@mysql_num_rows($server_name)!=0)
	{
		$current_row = @mysql_fetch_assoc($server_name);
		$server_name = $current_row['ServerName'];
	}
Then on line 190:

Change this:

Code:

<a href="' . $link . '"><font size="4">' . $server . '</font></a>
To:

Code:

<a href="' . $link . '"><font size="4">' . $server_name . '</font></a>
Then delete line 18-19.

Code:

// SERVER NAME
$server_name	= array('Your servername','Your servername2','Your servername3'); // Enter each server name to display.
For each server page, just delete line 16:

Code:

//$server_name	= 'Your servername'; // server name to display
Now you have dynamic server names. :ohmy:

 

http://www.nbfc.no/bf4stats/index.php

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

Originally Posted by CptChaos*:

 

Keep in mind that the search is capable of SQL injection as far as I can see. This is a bad idea, because someone can search for something and add a query to do something evil, like erasing all the stats. I'd like to develop and help, but I actually don't understand this code, I can't see what's doing what, otherwise I would've uploaded a patched version myself.

 

Other tips and / or ideas:

The database has the servername stored already; why not fetch it from there? And why isn't there something like a configuration file? One file, with most settings and thus setting it once and/or changing it once.

 

Don't mind the looks though, I really like them a lot! But hey, I am a developer, not a designer, lol! :ohmy:

 

Another tip: use numbers as integers, don't typecast them into text. Numbers are way faster than their alphanummeric character, $server_ID is a number, but the variable is used as text.

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

Originally Posted by Cermit*:

 

It would be possible to modify it to use different databases. Right now it assumes that the servers will all be in the same database. Do you need help with the php to edit the code for creating a second database connection link?

Thanks for the fast reply.

Some help on that would be awesome, as I´m not too familiar on php editing.

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

Originally Posted by ty_ger07*:

 

Edit: not to disagree with your input, but more to rationalize my choices:

 

Yes, you could inject additional SQL into the URL if you wished. I guess I was never very concerned because I don't see why anyone would be malicious with a stats database. I guess they could do it to be a troll if they really wanted to. There isn't much motive and I assume that most people who are technically capable of SQL injection would have little incentive. This wouldn't provide you access to personal information or accounts. All you would be able to do is access or destroy publicly available information. But like you say, this could be fixed by filtering the URL input designing it to only accept expected inputs and ignore unexpected data.

 

The page does already use the server's name in the database if an empty or NULL value is provided by the user. Adding a server name manually is optional.

 

I'm not a designer either. I try my best.

 

The page did/does use one setting file in a way. The stats index page I guess has turned into a second file, but originally the stats index page didn't exist and this was all one file. The user just needs to enter the server info for THIS server in the top of its associated stats file and that is it. This allows people to create as many copies of the same file as they want and connect each one to a different domain host or different database or use any combination of databases and server IDs. This decentralized settings system allows more options which a single settings file may restrict. With a single file, you run into issues if multiple databases are used and some servers connect to one database and another to another database and that sort of issue.

 

The page does use numbers as integers already. It is only the configurable input at the top of the file which type cast the integer as a string simply for providing a consistent easy field insertion method for users using the file. Some may not know the difference between strings and integers and I decided to make them all strings so the user enters them all in the same way. But users are free to enter the server ID as 1; instead of '1'; if they wish. Edit 2: I think I will need to look through the file again though as it is possible that I made comparisons such as != '0' instead of != 0.

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

Originally Posted by Kinsman*:

 

Some good input, I haven't updated as I was waiting for the server totals in Index, but will update now to keep up. :-)

 

Our DB gets larger daily if you need more stats.

 

Agreed about calling a config file, it would make updating faster.

 

Just on the server name thing, the ability to manually enter server names is handy to make the page look nicer if you happen to have insanely long server names.

 

By Server Totals this is what I mean here.

 

http://jw.servegame.org/test/

 

Total Players, Total Scores, Total Dogtags, Total Kills, Total Headshot, and Total Deaths all work there.

 

I've been plugging away at it still, but no joy getting it working on the index here yet.

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

Originally Posted by MorpheusX(AUT)*:

 

Nice small section for our front page

 

Red blocks to hide server names. Happy to share if someone wants something very similar

I'd be quite interested in something like this :smile:

Looks great!

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

Originally Posted by Kinsman*:

 

I plan to add the server totals to the index page monday. I am sorry I have taken so long to fulfill this request.

No problem, that's why I was waiting to update it all at once, as every update I need to make a lot of edits to all six pages, so it takes awhile.

 

And yes those server displays look great t0p8uzz please do post the edits.

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

Originally Posted by Berndel*:

 

Nice small section for our front page

 

Red blocks to hide server names. Happy to share if someone wants something very similar

Nice work thanks for share this can you upload the code ?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Porthos1973*:

 

Nice small section for our front page

 

Posted Image

 

Red blocks to hide server names. Happy to share if someone wants something very similar

Very interested in this. You should just send it to ty_ger07 so he can add it to the next update.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CptChaos*:

 

Is it maybe an idea to create a 'repository' for this on github? Thay way users can contribute to this statpage and I'd be happy to help develop!

 

The page does already use the server's name in the database if an empty or NULL value is provided by the user. Adding a server name manually is optional.

Maybe I need to update the files then, I tried to make them '' or an emtpy array, but then the names just disappear.

 

And a feature request:

Are player statistics coming? I know I can see the stats from a player per-server, but I'd like to also see the stats from multiple servers counted together, when a user has played on more than 1 server in the 'network'.

 

Hmmm... Overwrited the files, I have to reconfigure everything now, would be awesome if someone wouldn't have to do that every time when an update has been released.

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

Originally Posted by CptChaos*:

 

Another tip, use valid HTML-code. The -tag has been deprecated for years now.

Don't get me wrong, I may be picky and jerky, I like this stats page a lot and I really appreciate the time you've spend on it. I really would like to help out, even on coding and such. But the code could be much better and better readable, rewriting it would cost me too much time.

 

EDIT:

With how many tables did you build this? Damn, I hardly can't find a thing if I want to change a thing.

Building a webpage with tables is sooo 1995... :/ (Sorry to put it that way)

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

Originally Posted by TMiland*:

 

I added map images as backgrounds, pretty satisfied! :smile:

 

Let me know if interested, and i'll share the edits. :smile:

 

*Edit

I'll share them anyways. :biggrin:

 

Download the map images maps.zip, then do the following in index.php(or whatever your index file is called):

 

Add a new line on line 137:

Code:

	$image_map = str_replace(' ', '%20', $map_name) . '.jpg'; // CHANGE SPACES FOR A VALID URL
Then add new line on line 142:

Code:

	<div style="border:none; background-image: url(' . $image_map . '); background-repeat:no-repeat; background-position:left; margin-left: 10px;">
And closing div on line 174:

Code:

	</div>
That's it! :smile:

 

*Edit2

Forgot to add the alignment of the tables! Just replace from line 139 to 179 with this:

 

Code:

	echo '
	<tr>
	<td width="100%" style="text-align: left;">
	<div class="middlecontent">
	<div style="border:none; background-image: url(' . $image_map . '); background-repeat:no-repeat; background-position:left; margin-left: 10px;">
	<table width="95%" align="center" border="0">
	<tr>
	<td width="45%">
	<a href="' . $link . '"><font size="4">' . $server_name . '</font></a>
	</td>
	<td width="12%">
	<font class="information">Current Players In Server:</font> ' . $players . '
	</td>
	<td width="12%">
	<font class="information">Current Map:</font> ' . $map_name . '
	</td>
	<td width="11%">
	<font class="information">Users Viewing Stats:</font> ' . $ses . '
	</td>
	</tr>
	<tr>
	<td width="45%">
	<a href="' . $battlelink . '" target="_blank"><img src="./joinbtn.png" alt="join"/></a>
	</td>
	<td width="12%">
	<font class="information">Players Logged:</font> ' . $total_players . '
	</td>
	<td width="12%">
	<font class="information">Total Score:</font> ' . $score . '
	</td>
	<td width="11%">
	<font class="information">Total Kills:</font> ' . $kills . '
	</td>
	</tr>
	</table>
	</div>
	</div>
	
	</td>
	</tr>
	';
Attached Files:
* 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.