Jump to content

MySQL leader table not populated

Pending 2.3.1

HunterZ
HunterZ

Posted

I have this set in my playerranks.json config file:

  "MySQL": {
    "useMySQL": true,
    "autoWipe": true,
    "sql_port": 3306,
    "sql_host": "REDACTED",
    "sql_db": "playerranks_hzcr",
    "sql_user": "REDACTED",
    "sql_pass": "REDACTED",
    "tablename": "playerranksdb",
    "LBtableName": "playerranksleaderdb"
  }

`playerranksdb` gets populated with current detailed stats as expected.

BUG: `playerranksleaderdb` gets created with proper columns but no rows.

HunterZ

Posted (edited)

After poking at the code, it seems the problem is that the leaderboard data within Player Ranks itself never gets populated unless I manually take a snapshot using admin commands/GUI?

I was hoping it would just save the latest leaders to SQL whenever it saves the main stats, so that I can figure out who Player Ranks has given a title when there's a tie.

Might also be nice for it to save a "last wipe's leaders" row/table when a wipe happens.

Edited by HunterZ
  • Administrator
Steenamaroo

Posted

Hey,
There's no bug. The leaderboard table is there to hold leader board snapshots that you take.
It serves no function in the plugin. It's just there as an optional tool allowing you to keep records of player stats at a specific time - Say the end of some event you're running, for example.

If you use SaveLeaderboard console command, it will record down the #1 player for every category into that table.

HunterZ

Posted (edited)

Right, I mentioned in my post that I figured that out l but that it doesn't suit either of the use cases that I had in mind for it: 

- determine current title holders (as of time of last primary stats table update)

- determine title holders at time of wipe 

Support for one or both of these use cases would be super helpful.

Edited by HunterZ
  • Administrator
Steenamaroo

Posted

I can't see having it save a snapshot every time the main table is updated, because that's very frequent.
That could be a few hundred entries a day, depending on your save settings.

Making it automatically save a leaderboard snapshot at wipe time would be easy enough to do, though.

HunterZ

Posted

2 hours ago, Steenamaroo said:

I can't see having it save a snapshot every time the main table is updated, because that's very frequent.
That could be a few hundred entries a day, depending on your save settings.

Making it automatically save a leaderboard snapshot at wipe time would be easy enough to do, though.

Exactly: I'm saying it would be nice to have a single row that always contains the latest leaders, because the current feature only supporting addition of a new row on every snapshot isn't helpful.

For me (and I'm obviously not everyone) the best solution would be for the table to only ever have two rows: One for current stats and one for last wipe's end-of-wipe stats.

  • Administrator
Steenamaroo

Posted

I hear what you're saying although if what you're really looking for is a way to see the current leaders, couldn't you just use the UI to show you that?
I know that means you have to have the client open but it's better than sifting through a json, no?

HunterZ

Posted (edited)

1 hour ago, Steenamaroo said:

I hear what you're saying although if what you're really looking for is a way to see the current leaders, couldn't you just use the UI to show you that?
I know that means you have to have the client open but it's better than sifting through a json, no?

I have written a custom C++ application that reads from the MySQL database every 5 minutes and uses webhooks to maintain embeds on Discord.

Currently it has to guess who the leader is in the case of a tie, because there's no way to get that from the database.

image.png.9ebe4697db4096f256809c1bff9f9aab.png

Edited by HunterZ
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

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.