Skip to content

Conversation

@SenaxxZz
Copy link

@SenaxxZz SenaxxZz commented Jul 9, 2025

βœ… Verified Placeholders

These placeholders have been tested and return correct data from the database:

πŸ“Š General Vote Info

  • %azlink_vote_total_sites% β€” Total number of configured vote sites.
  • %azlink_vote_total_available% β€” Number of vote sites available to the player (False if none).

πŸ—³οΈ Vote Site Specific (by Site ID)

  • %azlink_vote_{ID}_available% β€” Whether the player can vote on the site (True/False).
  • %azlink_vote_site_{ID}_name% β€” Name of the vote site.
  • %azlink_vote_site_{ID}_available% β€” Availability of the site.
  • %azlink_vote_site_{ID}_url% β€” Vote site URL.

πŸ† Vote Rankings

  • %azlink_vote_position% β€” Current player position in the monthly ranking.
  • %azlink_vote_name_{POSITION}% β€” Name of the player in the Xth position.
  • %azlink_vote_count_position_{POSITION}% β€” Vote count of the player in the Xth position.
  • %azlink_vote_position_user_{PSEUDO}% β€” Position of a player by username.
  • %azlink_vote_user_{USER_ID}% β€” Position of a player by user ID.
  • %azlink_vote_position_{POSITION}% β€” (FIXED): Now correctly returns the vote count at position X instead of just returning X.

⚠️ Known Issue β€” Cooldown Placeholders

The following placeholders are not yet working correctly:

  • %azlink_vote_{ID}_cooldown%
  • %azlink_vote_site_{ID}_cooldown%

Problem:

These currently return a static value or something similar to %available%, instead of returning the real-time cooldown left based on the vote delay and last_vote.

Suggested fix:

Update the logic to calculate and return either:

  • "Cooldown 1h 24m 20s" (if still in cooldown)
  • Or True (if vote is available again)

This would make them much more useful for players and frontend integrations.


πŸ”§ Notes

Tests were conducted on a fresh Azuriom test setup, using direct vote data and verified through SQL queries.

Let me know if you'd like SQL query examples or additional screenshots!


# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,

Choose a reason for hiding this comment

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

JAVA_OPTS has been put here twice

@MrMicky-FR
Copy link
Member

Hello, thank you for your pull request and contributing to Azuriom!

Before considering merging this, I made a small check list of important point to consider. This is also open to discussion and collaboration :)

For the smaller details:

  • The build is failing because of the hard-coded Java path C:\Program Files\Java\jdk-22
  • Please avoid unrelated arbitrary code changes, for example combining multiple lines into a single >150 chars line
  • The build path is now duplicated in the .gitignore as it was already present in the line just above

Also the preferred way to fetch such placeholders would be to use an API rather than a direct SQL database connection for multiple reasons:

  • Azuriom supports 4 databases types (MySQL/MariaDB, PostgreSQL, SQLite and SQLServer), so supporting only MySQL/MariaDB does not really makes sense
  • Is it generally considered as a bad practice to allow external connections on the database (and is also blocked by default). By using an API instead of raw SQL queries, external access can be avoided, improving security
  • It creates a strong and undesirable coupling with the Azuriom database schema, potentially blocking (or slowing) down new features. Unlike an API, it's not possible (or at least way more complicated) to maintain compatibility with legacy applications with raw SQL queries

Thank you again, and looking forward to it!

@MrMicky-FR MrMicky-FR marked this pull request as draft July 10, 2025 06:21
@MrMicky-FR MrMicky-FR changed the title Add real vote cooldown and fix vote position placeholder Add vote placeholders Jul 15, 2025
@MrMicky-FR
Copy link
Member

Thanks again, I've added these placeholders with the above commit πŸš€

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.

3 participants