Jump to content

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


tyger07

Recommended Posts

Originally Posted by ty_ger07*:

 

Bummer, as that's really all I wanted.

 

maybe you could post the query and I can work it out from there?

The day is not over. I will when I publish the update today. I will try github again too.

 

EDIT: The issue is that I am remodeling a house and have another full time job. This is only a hobby and I cannot provide dedicated support.

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

Originally Posted by CptChaos*:

 

A detailed log of maps could get quite out of hand. There could be thousands of lines of information. And is it information people are really interested in? I would suggest that if such a thing were implemented, that pagination would be used to scroll through pages of of data.

 

This is where I am currently:

http://open-web-community.com/bf4sta...erverStats.php

 

No, I have not worked on the index page yet. :sad: Adding total server stats on the index page should be simple and I am not worried about whether or not I will have time to do so when I release my update tomorrow (err... later today).

Ah, I limited it to the last 50 rounds (but it's configurable). Why would someone see ALL the rounds from the past? :ohmy:

 

If you like, I can create an e-mail forwarder for you, something like [email protected], to any emailaddress you'd like, let me know if you want something like that. :smile:

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

Sorry for asking once again, but is there already some solution for running 2 servers on 2 different databases?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Sorry for asking once again, but is there already some solution for running 2 servers on 2 different databases?

Each stats page could run on its own database currently if you wished. Your issue is that you want the index page to show contents from two different databases which it currently doesn't. Yes, it is possible, but no, it has not been implemented yet. I would say that your solution would not be implemented as a normal release but would be something custom for you particularly since it is circumstance which is not common and the code would become unnecessarily complex to suit this uncommon issue.

 

I am in the process of releasing a final update for the near future and am hoping that this project will branch out and others will do well with it.

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

Originally Posted by Cermit*:

 

@Cermit

how about run both server in the same db?

 

The plugin is supporting up tp 65000 servers in one db.

 

And please DONT use a table suffix.

Yes running both in the same DB would be the easiest solution, but using that way causes one of the 2 servers to lose all stats (collected so far) when moving it to the DB on which one of the servers is running.

That would not be the best thing in my interest, as both servers have been full almost 24/7 since release.

That´s why I asked if it could be possible to simply read 2 different databases, and maybe not be forced to move everything to 1 DB...

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

Originally Posted by p19blo*:

 

Yes running both in the same DB would be the easiest solution, but using that way causes one of the 2 servers to lose all stats (collected so far) when moving it to the DB on which one of the servers is running.

That would not be the best thing in my interest, as both servers have been full almost 24/7 since release.

That´s why I asked if it could be possible to simply read 2 different databases, and maybe not be forced to move everything to 1 DB...

im a mysql noob but cant you export 1 of the servers tables import the information into the "communal database" ?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Cermit*:

 

I also thought about that already, but as both databases are separate each server has ID 1, and so all players only were playing on the server with the ID 1. I think that won´t work without mixing everything up...

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

Originally Posted by Kinsman*:

 

Its feasible, you would prob need to edit the sql first so they are not both server1 though, so a bit of work. Do an sql dump, look for all instances of serverid 1 and replace with 2 perhaps.

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

Originally Posted by ty_ger07*:

 

Yes running both in the same DB would be the easiest solution, but using that way causes one of the 2 servers to lose all stats (collected so far) when moving it to the DB on which one of the servers is running.

That would not be the best thing in my interest, as both servers have been full almost 24/7 since release.

That´s why I asked if it could be possible to simply read 2 different databases, and maybe not be forced to move everything to 1 DB...

EDIT: It would be REALLY hard to combine the servers together I think since not only would the server IDs need to be changed, but all the player stats IDs would have to be reconstructed because stats IDs would need to be offset depending on which server ID they are referencing.

 

But if you want to edit the code in StatsMain.php instead...

 

In the database connection info area, replace:

 

// DATABASE INFORMATION

$db_host = ''; // database host

$db_port = '3306'; // database port. default is 3306

$db_name = ''; // database name

$db_uname = ''; // database user name

$db_pass = ''; // database password

With:

 

// DATABASE 1 INFORMATION

$db_host1 = ''; // database host

$db_port1 = '3306'; // database port. default is 3306

$db_name1 = ''; // database name

$db_uname1 = ''; // database user name

$db_pass1 = ''; // database password

$db1_connect = $db_host1 . ':' . $db_port1;

$db1 = @mysql_connect($db1_connect, $db_uname1, $db_pass1, true);

 

// DATABASE 2 INFORMATION

$db_host2 = ''; // database host

$db_port2 = '3306'; // database port. default is 3306

$db_name2 = ''; // database name

$db_uname2 = ''; // database user name

$db_pass2 = ''; // database password

$db2_connect = $db_host2 . ':' . $db_port2;

$db2 = @mysql_connect($db2_connect, $db_uname2, $db_pass2, true);

 

 

$db_number = array("$db1","$db2");

Then, on Line 107 through 109, delete this (no longer necessary):

 

// connect to the database if not already done

@mysql_connect($db_connect, $db_uname, $db_pass);

@mysql_select_db($db_name) or die ("Unable to access stats database. Please notify this website's administrator.If you are the administrator, please seek assistance http://www.phogue.net/forumvb/showthread.php_3756-BF3-Server-Stats-page-for-XpKiller-s-BF3-Chat-GUID-Stats-and-Mapstats-Logger'>here.

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

Originally Posted by ty_ger07*:

 

Looks really good. Would this be classified as server info or map stats (will map names be added)?

 

I will get this on github soon and let you guys do as you wish. I am just finishing up an update.

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

Originally Posted by CptChaos*:

 

Looks really good. Would this be classified as server info or map stats (will map names be added)?

I am actually not quite sure what I'll do with it, but I plan on making more graphs. I use pChart for it btw, so I actually generate and grab the code for it. I am doing the SQL part on my own.

 

I'll also think I've tweaked it enough for the looks now:

Posted Image

I will get this on github soon and let you guys do as you wish. I am just finishing up an update.

Can't wait to do some additions! :smile:

I could add mapnames as well, but problem is, there isn't much space for text.

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

Originally Posted by ty_ger07*:

 

A lot of the code is not showing up for me, Not sure if its because im using the latest version found here*, or if it is something do do with my settings in procon. No matter what the case hoping someone can take a look at the page and help me figure out why nothing else is logging, Would love to modify the site but want to get all the queries working first. Below is a link to my site so you can see from the first page whats going on.

 

On the main page it does not show the Players Logged, Total Score or Total Kills then on the next page it doesn't show Top Players, Country Stats or Map Stats

 

http://stats.thedecoy.net

 

help me please i'm begging on my knees... not really but sounded good.

What are your plugin settings in PRoCon? Are you using table suffixes? Do you have a lot of logging options disabled in the plugin?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I added this project to GitHub.

 

https://github.com/tyger07/BF4-Server-Stats

 

I hope that this will help the project moving forward, solve issues and poor implementations, and keep things less fragmented.

 

I am new to GitHub, so please feel free to offer suggestions if I am doing something wrong or should be doing something better in a different way.

 

Thanks!

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

Originally Posted by lordicon*:

 

Too bad Dice didn't release a webkit or something like that, lol!

 

I've also modded the country flags in the player stats from a server. :smile:

 

Code:

// search the country array for the country code of interest and assign the full name to a variable
			$country = array_search($CountryCode,$country_array);
			
			if(empty($CountryCode))
			{
				$country_img = 'none.png';
				$country = 'Undetermined';
			}
			else
			{
				$country_img = strtolower($CountryCode) .'.png';	
			}
and Code:
<td width="30%" style="text-align: left;"> <font class="information">Country: <img src="flags/'. strtolower($CountryCode) .'.png" /> </font>' . $country . '
is the code I used for it, around line 1330, somewhere there, not sure where exactly as I didn't track the exact line.

 

Posted Image

I just added two new images to the flag folder called ".png" and "--.png" with this image .png seemed to have worked as well and less coding :P
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I just added two new images to the flag folder called ".png" and "--.png" with this image .png seemed to have worked as well and less coding :P

This is the method I used for slightly less code and less size:

if(($country == '') OR ($country == '--'))

{

$country_img = './images/flags/none.png';

}

else

{

$country_img = './images/flags/' . strtolower($country) . '.png';

}

https://github.com/tyger07/BF4-Serve...erverStats.php
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Because many divs use multiple backgrounds...

 

background-image: url("images/50.png"), linear-gradient(170deg, rgba(100,000,000,0.5), rgba(000,000,100,0.3), rgba(000,000,100,0.1));

The page looks all screwed up in old browsers which don't support multiple backgrounds in the same element / IE compatibility view. Maybe someone wants to work on splitting these up into separate layered divs.

 

Alright, have fun guys!

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

Originally Posted by ty_ger07*:

 

Another late update:

 

More directory changes.

A common.php file in the common folder has the shared stats page info so less info has to be changed on each individual stats page.

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