• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Public API or data export

CidFR

Member
Mar 22, 2019
9
0
39
Hello,

I wanted to know what would be the fastest way for a friend and me to level up.

At the end of a game, I could have write on some paper the time of the game and the exp earn, along with the difficulty level and calculate the average of Exp per second per difficulty level.

But because I'm lazy (and because SQL is cool), I prefered to develop an application with a database to store and handle such informations. Although it's ugly, the application is working pretty nice, I'll give some informations about it below.

I am really lazy. And I'm bored to use the application to add entries for each games I'm playing.

I was wondering if there is a way to automatically get stats when a game ends, such as a log file in any format (JSON, XML, Whatever) generated locally on my computer, or even better, if you are providing REST API for such stats.

my DB :

Code:
DROP TABLE IF EXISTS perk ;
CREATE TABLE perk
(
    id_Perk INT AUTO_INCREMENT NOT NULL,
    name_Perk VARCHAR(255),
    PRIMARY KEY (id_Perk)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS difficulty ;
CREATE TABLE difficulty
(
    id_Difficulty INT AUTO_INCREMENT NOT NULL,
    name_Difficulty VARCHAR(255),
    PRIMARY KEY (id_Difficulty)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS map ;
CREATE TABLE map
(
    id_Map INT AUTO_INCREMENT NOT NULL,
    name_Map VARCHAR(255),
    PRIMARY KEY (id_Map)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS player ;
CREATE TABLE player
(
    id_player INT AUTO_INCREMENT NOT NULL,
    name_player VARCHAR(255),
    PRIMARY KEY (id_player)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS game ;
CREATE TABLE game
(
    id_Game INT AUTO_INCREMENT NOT NULL,
    id_Perk INT NOT NULL,
    id_Difficulty INT NOT NULL,
    id_player INT NOT NULL,
    id_Map INT NOT NULL,
    duration_Game TIME,
    death_Game TINYINT,
    victory_Game BOOL,
    prestige_Game TINYINT,
    exp_Game INTEGER,
    PRIMARY KEY (id_Game)
) ENGINE=InnoDB;

ALTER TABLE game ADD CONSTRAINT FK_game_id_Perk FOREIGN KEY (id_Perk) REFERENCES perk (id_Perk);
ALTER TABLE game ADD CONSTRAINT FK_game_id_Difficulty FOREIGN KEY (id_Difficulty) REFERENCES difficulty (id_Difficulty);
ALTER TABLE game ADD CONSTRAINT FK_game_id_player FOREIGN KEY (id_player) REFERENCES player (id_player);
ALTER TABLE game ADD CONSTRAINT FK_game_id_Map FOREIGN KEY (id_Map) REFERENCES map (id_Map);





Actually developping others feature to get more stats, such as :