DDNet Statistics as a Download

Read and discuss official announcements, information and news about the DDRaceNetwork.
Forum rules
Please consider wheter there is a more appropiate subforum before creating a new thread here.
This is for offical DDRaceNetwork-related information and discussion only.
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

DDNet Statistics as a Download

Post by deen »

If you want to do your own fun analysis with DDNet ranks and map releases, here's the raw data in CSV format, refreshed once a day: http://ddnet.tw/stats/ddnet-stats.zip

Some more raw data is also available at http://ddnet.tw/stats/
milk
Posts: 207
Joined: Mon May 05, 2014 5:25 pm
Player profile: http://ddnet.tw/players/milk/

Re: DDNet Statistics as a Download

Post by milk »

Thanks! Here are import queries (with table structures) for MySQL. Maybe it will help someone:
SpoilerShow
Note that some maps don't have release date. You may want to replace string

Code: Select all

,\N
in file 'maps' with some default value like

Code: Select all

,"2000-01-01 00:00:00"
before import. Or these maps will have current timestamp as release date. (I tried to change default value in table structure but import query avoid it).

Code: Select all

# db

CREATE SCHEMA `ddnet` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;


# maps

CREATE TABLE IF NOT EXISTS maps (
    Map VARCHAR(128) BINARY NOT NULL, 
    Server VARCHAR(32) BINARY NOT NULL, 
    Points INT DEFAULT 0, 
    Stars INT DEFAULT 0, 
    Mapper VARCHAR(128) BINARY NOT NULL, 
    Released TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY Map (Map)) 
CHARACTER SET utf8 ;

LOAD DATA INFILE '%path%/maps' 
INTO TABLE maps 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n' ;


# race

CREATE TABLE IF NOT EXISTS race (
    Map VARCHAR(128) BINARY NOT NULL, 
    Name VARCHAR(16) BINARY NOT NULL,
    Time FLOAT DEFAULT 0,
    Timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY Name (Name))
CHARACTER SET utf8 ;

LOAD DATA INFILE '%path%/race' 
INTO TABLE race 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n' ;


# teamrace

CREATE TABLE IF NOT EXISTS teamrace (
    Map VARCHAR(128) BINARY NOT NULL, 
    Name VARCHAR(16) BINARY NOT NULL,
    Time FLOAT DEFAULT 0,
    ID VARBINARY(16) NOT NULL,
    Timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY Name (Name))
CHARACTER SET utf8 ;

LOAD DATA INFILE '%path%/teamrace' 
INTO TABLE teamrace 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n' ;
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: DDNet Statistics as a Download

Post by deen »

Hm, if you want to use it in MySQL, I guess I should just do an sql dump. Does this help?: http://ddnet.tw/stats/ddnet-sql.zip
milk
Posts: 207
Joined: Mon May 05, 2014 5:25 pm
Player profile: http://ddnet.tw/players/milk/

Re: DDNet Statistics as a Download

Post by milk »

Hah, yes now better. Thanks!
User avatar
timakro
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: http://ddnet.tw/players/timakro/
Mapper profile: http://ddnet.tw/mappers/timakro/
Clan: unique

Re: DDNet Statistics as a Download

Post by timakro »

Is it save to split the mappernames by ", " and " & "? For example "=CuBe=, Kintaro* & =Typhoon=".
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: DDNet Statistics as a Download

Post by deen »

DoNe wrote:Is it save to split the mappernames by ", " and " & "? For example "=CuBe=, Kintaro* & =Typhoon=".
save in what way? It's what I do to create this for example, so it should work.
User avatar
timakro
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: http://ddnet.tw/players/timakro/
Mapper profile: http://ddnet.tw/mappers/timakro/
Clan: unique

Re: DDNet Statistics as a Download

Post by timakro »

Is there a way to get the time the file was changed last without downloading the entire http://ddnet.tw/stats/ddnet-stats.zip?
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: DDNet Statistics as a Download

Post by deen »

DoNe wrote:Is there a way to get the time the file was changed last without downloading the entire http://ddnet.tw/stats/ddnet-stats.zip?
It's updated daily at 5:30 am.

But in general you can check the timestamp with curl:

Code: Select all

$ curl -I -X HEAD http://ddnet.tw/stats/ddnet-stats.zip
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 25 Jul 2015 10:59:11 GMT
Content-Type: application/zip
Content-Length: 12458395
Last-Modified: Sat, 25 Jul 2015 03:30:29 GMT
Connection: keep-alive
Accept-Ranges: bytes
User avatar
timakro
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: http://ddnet.tw/players/timakro/
Mapper profile: http://ddnet.tw/mappers/timakro/
Clan: unique

Re: DDNet Statistics as a Download

Post by timakro »

Would it be possible to include the server (country) a finish happend on in the csv stats?
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: DDNet Statistics as a Download

Post by deen »

DoNe wrote:Would it be possible to include the server (country) a finish happend on in the csv stats?
Alright, should be in now.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests