Jump to content

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


tyger07

Recommended Posts

Originally Posted by EntraVenuS*:

 

Thanks for the info ty_ger07 .. i got 1 more question how do i add/ change the background image for the stats page and what size does it have to be to show fullscreen. Im a bit noobish with this kinda stuff but willing to learn .. heres what it is showing at the moment

 

http://anarchygaming.uk/stats/

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

Originally Posted by BuRockK*:

 

Thanks for the info ty_ger07 .. i got 1 more question how do i add/ change the background image for the stats page and what size does it have to be to show fullscreen. Im a bit noobish with this kinda stuff but willing to learn .. heres what it is showing at the moment

 

http://anarchygaming.uk/stats/

This is how you do it

 

This is where the background image is specified in stats.css:

https://github.com/tyger07/BF4-Serve...mmon/stats.css

Line 49

Code:

background-image: url("./images/BF4back.jpg");
You can put multiple images in "common/images/" folder and change the jpg name in that code to whichever jpg file you want to use

 

Im not sure on image sizes though, i suggest taking BF4back.jpg default image file as an example and set new images the same size

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

Originally Posted by Prophet731*:

 

Since Procon knows who has an admin user account, and AdKats is an admin tool which connects to XpKiller's stats database, I was hoping that there was the possibility that AdKats saved information about admins into the database.

 

Oh well. As I said, your admin control panel webpage is very nice and there is no reason why I should try to compete and duplicate some of the same functionality into my stats page. It just wouldn't make sense.

 

All I needed was an easy way to reliably determine who is an admin using information saved in the stats database in order to enable an option to only show the chat content if the viewer is an admin (having an IP address which matches a known admin). I didn't want to be involved in building that information or creating login pages or admin rights management pages. So, I will simply not pursue it any further. It was a pipe dream to attempt to satisfy the request.

The problem I see happening though would be if the IP changed for the admin but not in the database yet, so they wouldn't be able to see admin actions until that's updated. As far as determining who is an admin in AdKats all we do is based on a person's EAGUID when they join then AdKats checks its roles/permissions for the player.

 

The main tables for the users though are in this gist.

 

https://gist.github.com/Prophet731/1...501bb1a329949f

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

Originally Posted by EntraVenuS*:

 

This is how you do it

 

 

 

You can put multiple images in "common/images/" folder and change the jpg name in that code to whichever jpg file you want to use

 

Im not sure on image sizes though, i suggest taking BF4back.jpg default image file as an example and set new images the same size

got it thanks for your help working like a charm now
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by )RAG()N*:

 

You would have to manually bring your edits into the updated file(s).

thanks for the reply ty_ger07,, now I just have to remember where I done them :tongue:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by BuRockK*:

 

Hi ty_ger07, i was wondering if it is possible to add a table to the right side of "Top player" table in the main stats page of a server. Or does it need the plugin to be upgraded?

 

EDIT: Maybe use the second banner example in "Server Info" tab on the page but just use current map picture and a list of maps in the maplist instead of a list of current players maybe_. I wouldnt know how to do it either way

 

Example:

 

Attached Files:

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

Originally Posted by ty_ger07*:

 

The maplist isn't saved to the database. There would be no way of knowing which maps are in the list nor the number of rounds. The stats page could try to save a list of maps each time it loads and checks the current map, but the list would end up being very full of errors because it wouldn't be able to guess when you change your map list and wouldn't know which maps were played in the gaps when no one loaded the stats page.

 

A historical list of all maps which have ever been played (you can see this in the maps tab) is about as good as you can do.

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

Originally Posted by BuRockK*:

 

I wanna ask what about dealing with "maplist.list" and "mapList.availableMaps" using that somehow to work around this but to be fair i dont even know how those rcons work

 

But can we still do this with manually adding the maplist but fetch to show which map is currently running with map image and maybe highlight the map in the list?

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

Originally Posted by ty_ger07*:

 

The webpage has no access to rcon commands. That functionality would need to be added to XpKiller's plugin before it could be available to the webpage.

 

You could make a custom list of maps for your server and display it somewhere in the stats page, but it isn't functionality I would officially add to the stats page since it would be custom code which would only function if someone manually added that information to their database.

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

Originally Posted by BuRockK*:

 

The webpage has no access to rcon commands. That functionality would need to be added to XpKiller's plugin before it could be available to the webpage.

 

You could make a custom list of maps for your server and display it somewhere in the stats page, but it isn't functionality I would officially add to the stats page since it would be custom code which would only function if someone manually added that information to their database.

The banner examples in Server Info tab on webpage shows the currently active map. I was hoping that would be enough to also highlight the map in the custom made list.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

The banner examples in Server Info tab on webpage shows the currently active map. I was hoping that would be enough to also highlight the map in the custom made list.

Yes. But first you need to add the custom made list and add a place to display it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

PHP is a very forgiving high-level programming language which is quite easy to understand with a little practice. I suggest that you give it a try. It is similar to C languages in construction but usually simpler.

 

Here is an example of the most complex C program I have written. Not very good, huh?

Code:

// Inspirations:
// http://raspberrypi.stackexchange.com/questions/6978/get-pis-temperature-using-c
// http://kernelreloaded.blog385.com/index.php/archives/formatting-output-from-raspberry-pi-temperature-sensors/
// http://kurup87.blogspot.com/2014/09/16x2-lcd-hello-world-using-c-wiringpi.html

#include <wiringPi.h>
#include <lcd.h>
#include <softPwm.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// 16x2 LCD pinout:
// 1   = VSS (GND)
// 2   = VDD (VCC,5V)
// 3   = VE (connect with variable resistor)
// 4   = RS, Register Select
// 5   = RW, Read/Write
// 6   = E, Enable
// 7   = Data0, D0
// 8   = Data1, D1
// 9   = Data2, D2
// 10 = Data3, D3
// 11 = Data4, D4
// 12 = Data5, D5
// 13 = Data6, D6
// 14 = Data7, D7
// 15 = Backlight Anode (VCC)
// 16 = Backlight Cathode (GND)

// Define which Raspberry Pi pins are connected to which LCD pin.
#define LCD_RS  29				//Register select pin
#define LCD_E   28				//Enable Pin
#define LCD_D4  0				//Data pin 4
#define LCD_D5  1				//Data pin 5
#define LCD_D6  2				//Data pin 6
#define LCD_D7  3				//Data pin 7

// Use 'gpio readall' in Terminal to read Raspberry Pi pin assignments.

// Main function
int main()
{
	int lcd;
	int line;
	FILE *fp;
	char path[50];
	char CPUtemperature[3];
	char CPUfrequency[4];
	char GPUtemperature[3];
	char Memusage[4];
	double V;

	// Initialize LCD
	wiringPiSetup();
	if(lcd = lcdInit(2, 16, 4, LCD_RS, LCD_E,LCD_D4, LCD_D5, LCD_D6, LCD_D7, 0, 0, 0, 0))
	{
		lcdClear(lcd);
		printf("lcd init failed! \n");
		return -1;
    }

	// set up fan
	softPwmCreate(4, 0, 500);

	lcdClear(lcd);
	printf("\n LCD System Monitor \n View values on LCD display. \n");

	// Loop
	while(1)
	{
		
		line = 0;

		// Check the GPU temp.
		fp = popen("/opt/vc/bin/vcgencmd measure_temp|cut -c6-9", "r");
		if(fp == NULL)
		{
			lcdClear(lcd);
			printf("GPU command failed! \n");
	            	return -1;
		}
		// Read the output a line at a time.
		while(fgets(path, sizeof(path)-1, fp) != NULL)
		{
			V = snprintf(GPUtemperature,3,"%f", path);
			break;
		}
		// close file
		pclose(fp);

		// Check the memory usage.
		fp = popen("free -h|cut -c26-28", "r");
		if(fp == NULL)
		{
			lcdClear(lcd);
			printf("Memory command failed! \n");
	            	return -1;
		}
		// Read the output a line at a time.
		while(fgets(path, sizeof(path)-1, fp) != NULL)
		{
			line++;
			if(line == 3)
			{
				V = snprintf(Memusage,4,"%s", path);
				break;
			}
		}
		// close file
		pclose(fp);

		// Read CPU frequency from existing file
		fp = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
		if(fp == NULL)
		{
			lcdClear(lcd);
			printf("Opening CPU frequency file failed! \n");
            		return -1;
		}
		fscanf(fp, "%lf", &V);
		V /= 1000000;
		snprintf(CPUfrequency,4,"%1.1f",V);
		fclose(fp);

		// Read CPU temp from existing file
		fp = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
		if(fp == NULL)
		{
			lcdClear(lcd);
			printf("Opening CPU temp file failed! \n");
            		return -1;
		}
		fscanf(fp, "%lf", &V);
		V /= 1000;
		snprintf(CPUtemperature,3,"%2.0f",V);
		fclose(fp);

		// make a fan speed ratio between 34 and 44 degrees
		V = V - 34;
		if(V < 0)
		{
			V = 0;
		}
		if(V > 10)
		{
			V = 10;
		}
		V = (V/10)*500;

		// turn fan on amount calculated
		softPwmWrite(4, V);

		// Display values on LCD screen
		lcdPosition(lcd,0,0);
		lcdPuts(lcd, "CPU ");
		lcdPosition(lcd,4,0);
		lcdPuts(lcd, CPUtemperature);
		lcdPosition(lcd,6,0);
		lcdPuts(lcd, ".C");
		lcdPosition(lcd,8,0);
		lcdPuts(lcd, " ");
		lcdPosition(lcd,9,0);
		lcdPuts(lcd, CPUfrequency);
		lcdPosition(lcd,12,0);
		lcdPuts(lcd, " ");
		lcdPosition(lcd,13,0);
		lcdPuts(lcd, "GHz");
		lcdPosition(lcd,0,1);
		lcdPuts(lcd, "GPU ");
		lcdPosition(lcd,4,1);
		lcdPuts(lcd, GPUtemperature);
		lcdPosition(lcd,6,1);
		lcdPuts(lcd, ".C");
		lcdPosition(lcd,8,1);
		lcdPuts(lcd, " ");
		lcdPosition(lcd,9,1);
		lcdPuts(lcd, "   ");
		lcdPosition(lcd,9,1);
		lcdPuts(lcd, Memusage);
		lcdPosition(lcd,12,1);
		lcdPuts(lcd, " ");
		lcdPosition(lcd,13,1);
		lcdPuts(lcd, "MB ");

		// Pause 2 second before repeating loop
		sleep(2);
	}
}

// compile:
// gcc -o monitor monitor.c -lwiringPi -lwiringPiDev -lpthread  -march=armv7ve -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv3-d16 -mtune=native
But I can write thousands and thousands of lines of PHP just fine. If I can do it, you can do it.

 

This will get you started for sure (if you are interested and have the time).

https://www.youtube.com/watch_v=iCUV...2FA2C127377F07

 

That playlist will teach you everything you need to know about getting a php webserver started, MySQL, and programming php webpages. Very helpful.

 

 

Yes, you could echo out standard static HTML in my stats pages to generate a static map list.

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

Originally Posted by BuRockK*:

 

Thanks man ill definitelly check that out. Also i might need to delete one of the servers player stats from the database and and the server itself from the stats page. is there an easy way for this?

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

Originally Posted by ty_ger07*:

 

Is there a way to add Accuracy to the weapons stats ?

No, it is not possible to do using the information available to Procon through DICE's Rcon system. Procon doesn't know what bullets are nor how many were fired. All Procon knows is that player A killed player B with weapon W.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by aceventura81*:

 

may I ask why I getting this error on my hosting ?

 

 

Unable to access stats database. Please notify this website's administrator.

 

If you are the administrator, please seek assistance here.

 

Error: Connection timed out

 

all database setting is same as in Plugin.

 

thanks

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

Originally Posted by aceventura81*:

 

may I ask why I getting this error on my hosting ?

 

 

Unable to access stats database. Please notify this website's administrator.

 

If you are the administrator, please seek assistance here.

 

Error: Connection timed out

 

all database setting is same as in Plugin.

 

thanks

Small update, my hosting provided information that port 3306 is blocked so I am unable to get mapstats on my website. Any ideas where to go ? Thank you.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Small update, my hosting provided information that port 3306 is blocked so I am unable to get mapstats on my website. Any ideas where to go ? Thank you.

The problem is most likely that your webserver and your database are on different machines and therefore the database needs to allow external connections if the webserver is going to be allowed to talk to the database. If you can't convince your database host to allow external connections to access through port 3306, you are pretty much stuck.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by aceventura81*:

 

The problem is most likely that your webserver and your database are on different machines and therefore the database needs to allow external connections if the webserver is going to be allowed to talk to the database. If you can't convince your database host to allow external connections to access through port 3306, you are pretty much stuck.

Thanks for answer. Yeah, I stuck. Webhosting provider blocking port 3306. So now I have to found provider where to move my web or get VPS and there is no problem at all.

 

Thank you again.

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

Originally Posted by Dete96*:

 

Thanks for answer. Yeah, I stuck. Webhosting provider blocking port 3306. So now I have to found provider where to move my web or get VPS and there is no problem at all.

 

Thank you again.

I had exactly the same problem a few month ago. I chose another provider (https://byet.host/free-hosting/news) just for the stats page and linked it from our clan homepage. The provider is free and has open port 3306. I never had a problem nor heard of them since I installed the stats page.
* Restored post. It could be that the author is no longer active.
Link to comment
  • 3 weeks later...
  • 4 weeks later...

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.