Skip to content

adding stats to API - #42

Merged
AMgr8 merged 3 commits into
developfrom
Update-API-stats
Sep 11, 2026
Merged

adding stats to API#42
AMgr8 merged 3 commits into
developfrom
Update-API-stats

Conversation

@AMgr8

@AMgr8 AMgr8 commented Aug 20, 2026

Copy link
Copy Markdown
Member

Added API endpoints getPlayerStats and getTotalStats
these query the database and send a combined object with all stats needed by the progress map in one object. One corresponds to the stats on the home page and the other to the profile page.

@AMgr8
AMgr8 requested review from LM-Wolfert and george112n August 20, 2026 21:41
@AMgr8 AMgr8 self-assigned this Aug 20, 2026
@AMgr8 AMgr8 linked an issue Aug 20, 2026 that may be closed by this pull request

this.discord.addJDAEventListeners(chatManager, coreUserManager, tabManager, plotSQL);
this.proxyApi = new ProxyApi(config.getBoolean("api.enabled"), config.getInt("api.port"), globalSQL, chatManager);
this.proxyApi = new ProxyApi(config.getBoolean("api.enabled"), config.getInt("api.port"), globalSQL, chatManager,plotSQL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random space missing after the comma.

} catch (SQLException e) {
log.severe("Failed to fetch total base stats: " + e.getMessage());
}
return new TotalBaseStats(0, 0,0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space missing after 2nd comma.

public record PlayerBaseStats(
int buildings,
int tplls,
int timePlayed,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timePlayer should probably be a long, I believe you only fit 24 days into an int when storing time in milliseconds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed here d1ffb79

@AMgr8
AMgr8 merged commit 9e3a86d into develop Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Users should be able to see more detailed statistics

2 participants