DediStats pages

Moderators: Xymph, NADEO

User avatar
Slig
Posts: 640
Joined: 15 Jun 2010, 11:52
Location: TraXicoLand

Re: DediStats pages

Post by Slig » 26 May 2021, 16:25

Xymph wrote:
26 May 2021, 12:32
In XAseco2, the dedimania.PlayerConnect method does send the player's Path to the master server, but it is not stored in the database -- only Country. Why?
Because i did not find the path so usefull to waste so much space (there are far more players than servers ^^)
And for both MPL player and server tables: why is Country often the continent (2nd field in a Path string), instead of the third, country field?
At least for the server table, this could still be corrected by reprocessing the Path column?
Yes, but the 2nd field is sometime the continent and sometimes the country ; also the last field is sometimes the country and sometimes the department ... or region ! :shock:
If you have some simple idea to process it, i take it :D

Code: Select all

 Path 	
World|
World|Africa|Algeria
World|Africa|Benin
World|Africa|Morocco
World|Africa|Senegal
World|Africa|South Africa
World|Africa|Zimbabwe
World|Algeria
World|Argentina
World|Asia|Bangladesh
World|Asia|China|上海
World|Asia|China|北京
World|Asia|China|四川
World|Asia|China|新疆维吾尔自治区
World|Asia|China|江苏
World|Asia|Japan
World|Asia|Korea
World|Asia|North Korea
World|Asia|South Korea
World|Asia|Sri Lanka
World|Asia|Taiwan
World|Asia|Uzbekistan
World|Australia|Australian Capital Territory
World|Australia|New South Wales
World|Australia|Northern Territory
World|Australia|Queensland
World|Australia|South Australia
World|Australia|Victoria
World|Australia|Western Australia
World|Austria|Burgenland
World|Austria|Carinthia
World|Austria|Lower Austria
World|Austria|Styria
World|Austria|Tyrol
World|Austria|Upper Austria
World|Austria|Vienna
World|Austria|Vorarlberg
World|Belarus
World|Belgium|Brussel Bruxelles
World|Belgium|Hainaut
World|Belgium|Liège
World|Belgium|Luxemburg
World|Belgium|Oost-Vlaanderen
World|Belgium|West-Vlaanderen
World|Brazil|Centro-Oeste
World|Brazil|Nordeste
World|Brazil|Sudeste
World|Brazil|Sul
World|Canada|Ontario
World|Canada|Quebec
World|Croatia
World|Czech republic|Jihoceský kraj
World|Czech republic|Jihomoravský kraj
World|Czech republic|Karlovarský kraj
World|Czech republic|Kraj Vysočina
World|Czech republic|Moravskoslezský kraj
World|Czech republic|Praha
World|Czech republic|Ustecký kraj
World|Czech republic|Zlínský kraj
World|Denmark
World|Europe|Albania
World|Europe|Austria|Burgenland
World|Europe|Austria|Carinthia
World|Europe|Austria|Lower Austria
World|Europe|Austria|Salzburg
World|Europe|Austria|Styria
World|Europe|Austria|Tyrol
World|Europe|Austria|Upper Austria
World|Europe|Austria|Vienna
World|Europe|Austria|Vorarlberg
World|Europe|Belarus
World|Europe|Belgium|Antwerpen
World|Europe|Belgium|Brabant Wallon
World|Europe|Belgium|Brussel Bruxelles
...
...
World|Europe|France|Auvergne|Allier
World|Europe|France|Auvergne|Haute-Loire
World|Europe|France|Auvergne|Puy-de-Dôme
World|Europe|France|Basse-Normandie|Calvados
World|Europe|France|Basse-Normandie|Manche
World|Europe|France|Basse-Normandie|Orne
..
...

User avatar
Xymph
Posts: 1412
Joined: 15 Jun 2010, 20:35
Contact:

Re: DediStats pages

Post by Xymph » 26 May 2021, 17:15

Slig wrote:
26 May 2021, 16:25
Because i did not find the path so usefull to waste so much space (there are far more players than servers ^^)
I see, but that's an unfortunate design choice: discarding the original data doesn't allow re-processing when the derived data has errors.
Slig wrote:
26 May 2021, 16:25
Yes, but the 2nd field is sometime the continent and sometimes the country ; also the last field is sometimes the country and sometimes the department ... or region ! :shock:
If you have some simple idea to process it, i take it :D
This seems to be easy enough:

Code: Select all

#!/usr/bin/php -q
<?php
	if ($argc != 2) {
		echo "usage: {$argv[0]} <path>\n";
		exit(1);
	}
	$path = str_replace('World|', '', $argv[1]);
	if ($path == '') {
		echo "empty country\n";
		exit(0);
	}
	$zones = explode('|', $path);
	switch ($zones[0]) {
	case 'Africa':
	case 'Asia':
	case 'Europe':
	case 'Middle East':
	case 'North America':
	case 'South America':
	case 'Oceania':
		$country = $zones[1];
		break;
	default:
		$country = $zones[0];
	}
	if ($country == 'Czech republic')
		$country = 'Czech Republic';
	if ($country == 'United States')
		$country = 'United States of America';
	echo "country: $country\n";
?>
:mrgreen:
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

HaagseSmurf
Posts: 2289
Joined: 13 Apr 2011, 19:46
Contact:

Re: DediStats pages

Post by HaagseSmurf » 29 May 2021, 09:59

Thx guys for looking into it, even tough its a minor thing!
When things can be improved its always good to try! :thumbsup:

Greetz,
HaagseSmurf

Check Smurfen.net and / or Smurfen.nu for all info.
You can also like our facebookpage at FaceBook Smurfen.net.
Or just visit
our Smurfen.net Canyon servers,
the Smurfen.net Valley and Royalserver.

User avatar
Xymph
Posts: 1412
Joined: 15 Jun 2010, 20:35
Contact:

Re: DediStats pages

Post by Xymph » 01 Jun 2021, 08:03

Xymph wrote:
26 May 2021, 17:15
Slig wrote:
26 May 2021, 16:25
Yes, but the 2nd field is sometime the continent and sometimes the country ; also the last field is sometimes the country and sometimes the department ... or region ! :shock:
If you have some simple idea to process it, i take it :D
This seems to be easy enough:
Slig has implemented the new country routine and ran my expanded script to reprocess the servers table, so at the servers tab in the DediStats 2 page the new country ordering is now visible. As mentioned, this is regrettably not possible for the players table and stats tab.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Post Reply

Return to “General Tools”

Who is online

Users browsing this forum: No registered users and 2 guests