Compare commits

...
20 Commits
Author SHA1 Message Date
BenCodez 17574f6c50 Bump version number to 6.19.1 2025-11-09 18:46:27 -06:00
BenCodez 60377deb44 Improve configuration comments for MySQL settings 2025-11-09 16:00:35 -06:00
Ben 34614e13fa Merge pull request #1469 from BoredManCodes/patch-1
Removed color codes from DiscordSRV messages
2025-11-03 16:17:07 -06:00
Trent Buckley bc98630388 Removed color codes from config yml 2025-11-04 09:12:04 +11:00
Trent Buckley 302cc980d8 Remove color codes from DiscordSRV messages 2025-11-04 09:10:46 +11:00
BenCodez 4342fc5458 Implement monthly reset for milestone data in proxy
Should reduce rare cases with counts being out of sync
2025-11-01 19:14:19 -06:00
BenCodez 90b981af7b Improve VoteCache null checks 2025-10-28 18:43:37 -06:00
BenCodez 32879956ec Refactor PlayerVoteListener to resolve Bedrock player names 2025-10-18 19:57:57 -06:00
Ben 2b166c7760 Update Maven CI workflow with permissions and comments 2025-10-13 08:10:14 -06:00
Ben 9848172a49 Update Maven workflow for JDK setup and build 2025-10-12 20:53:22 -06:00
BenCodez 9775d06ba9 Bump version number to 1.21.10-R0.1-SNAPSHOT 2025-10-12 20:51:10 -06:00
BenCodez 9584bc0e66 Prevent broadcasting for hidden vote sites 2025-10-10 21:05:25 -06:00
Ben 00ec202140 Merge pull request #1465 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-javadoc-plugin-3.12.0
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.3 to 3.12.0 in /VotingPlugin
2025-10-04 20:45:47 -06:00
Ben bd57f003dd Merge pull request #1463 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-shade-plugin-3.6.1
Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.0 to 3.6.1 in /VotingPlugin
2025-10-04 20:45:39 -06:00
Ben 23788be684 Merge pull request #1462 from BenCodez/dependabot/maven/VotingPlugin/com.discordsrv-discordsrv-1.30.1
Bump com.discordsrv:discordsrv from 1.30.0 to 1.30.1 in /VotingPlugin
2025-10-04 20:45:27 -06:00
BenCodez 9b33b1cde7 Bump version numbers to 1.21.9-R0.1-SNAPSHOT and 1.21-R0.4 2025-10-04 20:32:53 -06:00
BenCodez 02fb353dac Fixed proxy votecache not using existing connection unless debug is on 2025-09-28 13:42:20 -06:00
dependabot[bot] a4c470887f Bump org.apache.maven.plugins:maven-javadoc-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.3 to 3.12.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.3...maven-javadoc-plugin-3.12.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-version: 3.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 06:09:54 +00:00
dependabot[bot] e844a1eb63 Bump org.apache.maven.plugins:maven-shade-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.6.0...v3.6.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-version: 3.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 06:38:19 +00:00
dependabot[bot] 1787595ea2 Bump com.discordsrv:discordsrv from 1.30.0 to 1.30.1 in /VotingPlugin
Bumps com.discordsrv:discordsrv from 1.30.0 to 1.30.1.

---
updated-dependencies:
- dependency-name: com.discordsrv:discordsrv
  dependency-version: 1.30.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 06:28:59 +00:00
13 changed files with 300 additions and 88 deletions

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
name: Java CI with Maven
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write # required for dependency submission
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B -f VotingPlugin/pom.xml package
# Only submit dependency snapshot on push (not on pull_request)
- name: Submit Dependency Snapshot
if: github.event_name == 'push'
uses: advanced-security/maven-dependency-submission-action@v5
with:
directory: VotingPlugin # path to pom.xml
# optional: maven-args: "-DskipTests"
+9 -9
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.bencodez</groupId>
<artifactId>votingplugin</artifactId>
<version>6.19.1-SNAPSHOT</version>
<version>6.19.1</version>
<packaging>jar</packaging>
<name>VotingPlugin</name>
<properties>
@@ -84,7 +84,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<minimizeJar>false</minimizeJar>
@@ -223,7 +223,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.8-R0.1-SNAPSHOT</version>
<version>1.21.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -235,7 +235,7 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.21-R0.3</version>
<version>1.21-R0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -271,7 +271,7 @@
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>3.7.19-SNAPSHOT</version>
<version>3.7.19</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -289,7 +289,7 @@
<dependency>
<groupId>com.discordsrv</groupId>
<artifactId>discordsrv</artifactId>
<version>1.30.0</version>
<version>1.30.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -374,7 +374,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -449,7 +449,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -591,7 +591,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -86,7 +86,7 @@ public class Config extends YMLFile {
@ConfigDataString(path = "DiscordSRV.TopVoter.AllTime.RankDisplay")
@Getter
private String discordSRVTopVoterAllTimeRankDisplay = "%rank%: &6%player% - %votes% Votes";
private String discordSRVTopVoterAllTimeRankDisplay = "%rank%: %player% - %votes% Votes";
@ConfigDataBoolean(path = "DiscordSRV.TopVoter.Monthly.Enabled")
@Getter
@@ -102,7 +102,7 @@ public class Config extends YMLFile {
@ConfigDataString(path = "DiscordSRV.TopVoter.Monthly.RankDisplay")
@Getter
private String discordSRVTopVoterMonthlyRankDisplay = "%rank%: &6%player% - %votes% Votes";
private String discordSRVTopVoterMonthlyRankDisplay = "%rank%: %player% - %votes% Votes";
@ConfigDataBoolean(path = "DiscordSRV.TopVoter.Weekly.Enabled")
@Getter
@@ -118,7 +118,7 @@ public class Config extends YMLFile {
@ConfigDataString(path = "DiscordSRV.TopVoter.Weekly.RankDisplay")
@Getter
private String discordSRVTopVoterWeeklyRankDisplay = "%rank%: &6%player% - %votes% Votes";
private String discordSRVTopVoterWeeklyRankDisplay = "%rank%: %player% - %votes% Votes";
@ConfigDataBoolean(path = "DiscordSRV.TopVoter.Daily.Enabled")
@Getter
@@ -134,7 +134,7 @@ public class Config extends YMLFile {
@ConfigDataString(path = "DiscordSRV.TopVoter.Daily.RankDisplay")
@Getter
private String discordSRVTopVoterDailyRankDisplay = "%rank%: &6%player% - %votes% Votes";
private String discordSRVTopVoterDailyRankDisplay = "%rank%: %player% - %votes% Votes";
public boolean isDiscordSRVTopVoterEnabled(TopVoter topVoter) {
switch (topVoter) {
@@ -867,3 +867,4 @@ public class Config extends YMLFile {
}
}
@@ -11,6 +11,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import com.bencodez.advancedcore.api.bedrock.BedrockNameResolver;
import com.bencodez.advancedcore.api.misc.PlayerManager;
import com.bencodez.simpleapi.array.ArrayUtils;
import com.bencodez.votingplugin.VotingPluginMain;
@@ -52,36 +53,33 @@ public class PlayerVoteListener implements Listener {
plugin.debug("Processing PlayerVoteEvent: " + playerName + "/" + event.getServiceSite());
// check for name casing
playerName = plugin.getUserManager().getProperName(playerName);
final String properName = plugin.getUserManager().getProperName(playerName);
boolean notValid = false;
if (!PlayerManager.getInstance().isValidUser(playerName, plugin.getConfigFile().isAllowUnJoinedCheckServer())) {
if (!playerName.startsWith(plugin.getOptions().getBedrockPlayerPrefix())
&& !plugin.getOptions().getBedrockPlayerPrefix().isEmpty()) {
if (!event.isBungee() && PlayerManager.getInstance().isValidUser(
plugin.getOptions().getBedrockPlayerPrefix() + playerName,
plugin.getConfigFile().isAllowUnJoinedCheckServer())) {
plugin.debug("Detected a bedrock user without bedrock prefix, adjusting");
playerName = plugin.getOptions().getBedrockPlayerPrefix() + playerName;
} else {
notValid = true;
}
} else {
notValid = true;
}
}
// Resolve Bedrock/Java + add prefix only when appropriate
BedrockNameResolver.Result rn = plugin.getBedrockHandle().resolve(properName);
String creditedName = rn.finalName;
if (notValid) {
plugin.debug("Vote name resolved: " + properName + " -> " + creditedName + " (" + rn.rationale + ")");
// Single validity check on the final name
boolean allowUnJoinedCheckServer = plugin.getConfigFile().isAllowUnJoinedCheckServer();
boolean isValid = PlayerManager.getInstance().isValidUser(creditedName, allowUnJoinedCheckServer);
// Handle not-valid the same way you did before
if (!isValid) {
if (!plugin.getConfigFile().isAllowUnjoined()) {
plugin.getLogger().warning("Player " + playerName
+ " has not joined before, disregarding vote, set AllowUnjoined to true to prevent this");
plugin.getLogger().warning("Player " + creditedName + " has not joined before, disregarding vote. "
+ "Set AllowUnjoined to true to accept.");
if (event.isBungee() && plugin.getBungeeSettings().isRemoveInvalidUsers()) {
plugin.getVotingPluginUserManager().getVotingPluginUser(playerName).remove();
plugin.getVotingPluginUserManager().getVotingPluginUser(creditedName).remove();
}
return;
}
}
// If we get here, use the resolved/possibly-prefixed name going forward
playerName = creditedName;
if (playerName.isEmpty()) {
plugin.getLogger().warning("Empty player name from vote, ignoring");
return;
@@ -109,6 +109,11 @@ public class VoteSite {
if (plugin.getConfigFile().isFormatAlternateBroadcastEnabled()) {
return;
}
if (isHidden()) {
plugin.debug("Not broadcasting for " + user.getPlayerName() + ", site is hidden");
return;
}
if (!user.isVanished()) {
String playerName = user.getPlayerName();
if (plugin.getConfigFile().getVotingBroadcastBlacklist().contains(playerName)) {
@@ -59,6 +59,9 @@ public abstract class ProxyMysqlUserTable {
if (config.getTablePrefix() != null) {
name = config.getTablePrefix() + tableName;
}
if (config.getPoolName().isEmpty()) {
config.setPoolName("VotingPlugin" + "-" + tableName);
}
mysql = new com.bencodez.simpleapi.sql.mysql.MySQL(config.getMaxThreads()) {
@Override
@@ -482,9 +482,8 @@ public abstract class VotingPluginProxy {
bungeeTimeChecker.setTimeChangeFailSafeBypass(getConfig().getTimeChangeFailSafeBypass());
bungeeTimeChecker.loadTimer();
// todo mysql
voteCacheHandler = new VoteCacheHandler(getVoteCacheMySQLConfig(), getConfig().getVoteCacheUseMySQL(),
getConfig().getDebug(), getProxyMySQL().getMysql(), getConfig().getVoteCacheUseMainMySQL(),
getConfig().getVoteCacheUseMainMySQL(), getProxyMySQL().getMysql(), getConfig().getDebug(),
jsonStorage) {
@Override
@@ -139,9 +139,22 @@ public class VoteCache extends BungeeJsonFile implements IVoteCache {
@Override
public void removeServerVote(String server, String uuid) {
Collection<String> votes = getServerVotes(server);
if (votes == null) {
return;
}
// search for vote with uuid and remove it
for (String num : getServerVotes(server)) {
if (getServerVotes(server, num).get("UUID").asString().equals(uuid)) {
for (String num : votes) {
GsonDataNode node = getServerVotes(server, num);
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
if (uuidNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
if (nodeUuid != null && nodeUuid.equals(uuid)) {
setString("VoteCache." + server + "." + num, null);
}
}
@@ -149,11 +162,26 @@ public class VoteCache extends BungeeJsonFile implements IVoteCache {
@Override
public void removeVote(String server, OfflineBungeeVote vote) {
for (String num : getServerVotes(server)) {
Collection<String> votes = getServerVotes(server);
if (votes == null) {
return;
}
for (String num : votes) {
GsonDataNode node = getServerVotes(server, num);
if (node.get("UUID").asString().equals(vote.getUuid())
&& node.get("Service").asString().equals(vote.getService())
&& node.get("Time").asLong() == vote.getTime()) {
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
DataNode serviceNode = node.get("Service");
DataNode timeNode = node.get("Time");
if (uuidNode == null || serviceNode == null || timeNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
String nodeService = serviceNode.asString();
Long nodeTime = timeNode.asLong();
if (nodeUuid != null && nodeService != null && nodeTime != null && nodeUuid.equals(vote.getUuid())
&& nodeService.equals(vote.getService()) && nodeTime.longValue() == vote.getTime()) {
setString("VoteCache." + server + "." + num, null);
}
}
@@ -161,12 +189,31 @@ public class VoteCache extends BungeeJsonFile implements IVoteCache {
@Override
public void removeOnlineVote(OfflineBungeeVote vote) {
for (String player : getPlayers()) {
for (String num : getOnlineVotes(player)) {
Collection<String> players = getPlayers();
if (players == null) {
return;
}
for (String player : players) {
Collection<String> onlineVotes = getOnlineVotes(player);
if (onlineVotes == null) {
continue;
}
for (String num : onlineVotes) {
GsonDataNode node = getOnlineVotes(player, num);
if (node.get("UUID").asString().equals(vote.getUuid())
&& node.get("Service").asString().equals(vote.getService())
&& node.get("Time").asLong() == vote.getTime()) {
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
DataNode serviceNode = node.get("Service");
DataNode timeNode = node.get("Time");
if (uuidNode == null || serviceNode == null || timeNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
String nodeService = serviceNode.asString();
Long nodeTime = timeNode.asLong();
if (nodeUuid != null && nodeService != null && nodeTime != null && nodeUuid.equals(vote.getUuid())
&& nodeService.equals(vote.getService()) && nodeTime.longValue() == vote.getTime()) {
setString("OnlineCache." + player + "." + num, null);
}
}
@@ -216,6 +216,12 @@ public class VotingPluginBungee extends Plugin implements Listener {
if (type.equals(TimeType.MONTH)) {
getVotingPluginProxy().getProxyMySQL().copyColumnData(TopVoter.Monthly.getColumnName(),
"LastMonthTotal");
if (getVotingPluginProxy().getConfig().getResetMilestonesMonthly()) {
getVotingPluginProxy().getProxyMySQL().wipeColumnData("MilestoneCount",
DataType.INTEGER);
getVotingPluginProxy().getProxyMySQL().wipeColumnData("GottenMileStones",
DataType.STRING);
}
}
getVotingPluginProxy().getProxyMySQL().wipeColumnData(TopVoter.of(type).getColumnName(),
DataType.INTEGER);
@@ -281,6 +287,12 @@ public class VotingPluginBungee extends Plugin implements Listener {
if (type.equals(TimeType.MONTH)) {
getVotingPluginProxy().getProxyMySQL()
.copyColumnData(TopVoter.Monthly.getColumnName(), "LastMonthTotal");
if (getVotingPluginProxy().getConfig().getResetMilestonesMonthly()) {
getVotingPluginProxy().getProxyMySQL().wipeColumnData("MilestoneCount",
DataType.INTEGER);
getVotingPluginProxy().getProxyMySQL().wipeColumnData("GottenMileStones",
DataType.STRING);
}
}
getVotingPluginProxy().getProxyMySQL().wipeColumnData(TopVoter.of(type).getColumnName(),
DataType.INTEGER);
@@ -6,6 +6,7 @@ import java.util.Collection;
import com.bencodez.simpleapi.file.velocity.VelocityJSONFile;
import com.bencodez.votingplugin.proxy.OfflineBungeeVote;
import com.bencodez.votingplugin.proxy.cache.ConfigDataNode;
import com.bencodez.votingplugin.proxy.cache.DataNode;
import com.bencodez.votingplugin.proxy.cache.IVoteCache;
import com.bencodez.votingplugin.timequeue.VoteTimeQueue;
@@ -132,9 +133,22 @@ public class VoteCache extends VelocityJSONFile implements IVoteCache {
@Override
public void removeServerVote(String server, String uuid) {
Collection<String> votes = getServerVotes(server);
if (votes == null) {
return;
}
// search for vote with uuid and remove it
for (String num : getServerVotes(server)) {
if (getServerVotes(server, num).get("UUID").asString().equals(uuid)) {
for (String num : votes) {
ConfigDataNode node = getServerVotes(server, num);
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
if (uuidNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
if (nodeUuid != null && nodeUuid.equals(uuid)) {
getNode("VoteCache", server, num).setValue(null);
}
}
@@ -143,11 +157,27 @@ public class VoteCache extends VelocityJSONFile implements IVoteCache {
@Override
public void removeVote(String server, OfflineBungeeVote vote) {
for (String num : getServerVotes(server)) {
Collection<String> votes = getServerVotes(server);
if (votes == null) {
return;
}
for (String num : votes) {
ConfigDataNode node = getServerVotes(server, num);
if (node.get("UUID").asString().equals(vote.getUuid())
&& node.get("Service").asString().equals(vote.getService())
&& node.get("Time").asLong() == vote.getTime()) {
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
DataNode serviceNode = node.get("Service");
DataNode timeNode = node.get("Time");
if (uuidNode == null || serviceNode == null || timeNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
String nodeService = serviceNode.asString();
Long nodeTime = timeNode.asLong();
if (nodeUuid != null && nodeService != null && nodeTime != null && nodeUuid.equals(vote.getUuid())
&& nodeService.equals(vote.getService()) && nodeTime.longValue() == vote.getTime()) {
getNode("VoteCache", server, num).setValue(null);
}
}
@@ -155,12 +185,32 @@ public class VoteCache extends VelocityJSONFile implements IVoteCache {
@Override
public void removeOnlineVote(OfflineBungeeVote vote) {
for (String player : getPlayers()) {
for (String num : getOnlineVotes(player)) {
Collection<String> players = getPlayers();
if (players == null) {
return;
}
for (String player : players) {
Collection<String> onlineVotes = getOnlineVotes(player);
if (onlineVotes == null) {
continue;
}
for (String num : onlineVotes) {
ConfigDataNode node = getOnlineVotes(player, num);
if (node.get("UUID").asString().equals(vote.getUuid())
&& node.get("Service").asString().equals(vote.getService())
&& node.get("Time").asLong() == vote.getTime()) {
if (node == null) {
continue;
}
DataNode uuidNode = node.get("UUID");
DataNode serviceNode = node.get("Service");
DataNode timeNode = node.get("Time");
if (uuidNode == null || serviceNode == null || timeNode == null) {
continue;
}
String nodeUuid = uuidNode.asString();
String nodeService = serviceNode.asString();
Long nodeTime = timeNode.asLong();
if (nodeUuid != null && nodeService != null && nodeTime != null && nodeUuid.equals(vote.getUuid())
&& nodeService.equals(vote.getService()) && nodeTime.longValue() == vote.getTime()) {
getNode("OnlineCache", player, num).setValue(null);
}
}
@@ -266,6 +266,12 @@ public class VotingPluginVelocity {
if (type.equals(TimeType.MONTH)) {
getVotingPluginProxy().getProxyMySQL().copyColumnData(TopVoter.Monthly.getColumnName(),
"LastMonthTotal");
if (getVotingPluginProxy().getConfig().getResetMilestonesMonthly()) {
getVotingPluginProxy().getProxyMySQL().wipeColumnData("MilestoneCount",
DataType.INTEGER);
getVotingPluginProxy().getProxyMySQL().wipeColumnData("GottenMileStones",
DataType.STRING);
}
}
getVotingPluginProxy().getProxyMySQL().wipeColumnData(TopVoter.of(type).getColumnName(),
DataType.INTEGER);
@@ -326,6 +332,12 @@ public class VotingPluginVelocity {
if (type.equals(TimeType.MONTH)) {
getVotingPluginProxy().getProxyMySQL().copyColumnData(TopVoter.Monthly.getColumnName(),
"LastMonthTotal");
if (getVotingPluginProxy().getConfig().getResetMilestonesMonthly()) {
getVotingPluginProxy().getProxyMySQL().wipeColumnData("MilestoneCount",
DataType.INTEGER);
getVotingPluginProxy().getProxyMySQL().wipeColumnData("GottenMileStones",
DataType.STRING);
}
}
getVotingPluginProxy().getProxyMySQL().wipeColumnData(TopVoter.of(type).getColumnName(),
DataType.INTEGER);
+42 -22
View File
@@ -15,26 +15,45 @@
DataStorage: SQLITE
# Information for mysql
# See the end of the config for cache options
MySQL:
Host: ''
# Default port is 3306
Port: 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
# Max number of connections in the pool
MaxConnections: 1
# Table name prefix, for use with mutliple servers
# Don't use with PLUGINMESSAGING bungee setup
# Optional explicit table name override (leave empty to let the plugin choose)
#Name: ''
# Table name prefix (useful when multiple servers share one DB)
# Don't use with proxy setups
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#MaxLifeTime: -1
#Additional info on connection string
# --- Driver / security options ---
# UseSSL: false
# PublicKeyRetrieval: false # Needed on some MySQL setups with caching_sha2_password
# UseMariaDB: false # Attempt to use MariaDB driver instead of MySQL
# --- Connection / lifecycle tuning ---
# MaxLifeTime: -1 # ms; <=0 uses plugin's safe default (e.g., 25m)
# MinimumIdle: 2 # keep a small warm pool (2 is a good starting point)
# IdleTimeoutMs: 600000 # 10 minutes; retire idle connections before server kills them
# KeepaliveMs: 300000 # 5 minutes; lightweight ping to prevent NAT/idle drops
# ValidationMs: 5000 # 5 seconds; timeout for connection validation
# LeakDetectMs: 20000 # 20 seconds; logs if a connection is held too long (0 disables)
# ConnectionTimeout: 50000 # 50 seconds; wait for a free connection before failing
# --- Additional JDBC parameters appended to the URL ---
# Example: "&connectionCollation=utf8mb4_unicode_ci"
#Line: ''
#Attempt to use mariadb driver
#UseMariaDB: false
# Optional pool name (useful if you run multiple DB pools)
# PoolName: 'VotingPlugin-Hikari'
###########################################
@@ -618,23 +637,23 @@ UseMonthDateTotalsAsPrimaryTotal: false
# DiscordSRV settings
###########################################
DiscordSRV:
DiscordSRV:
# Enable DiscordSRV support
# Also enables using rewards in discord
# Also enables using rewards in discord
Enabled: false
# Show live top voter counts in discord
TopVoter:
AllTime:
AllTime:
# If true, will send top voter messages to discord
# Will send a message show top 10 voters
Enabled: false
# DiscordSRV channel to send messages to
# Will send a message show top 10 voters
Enabled: false
# DiscordSRV channel to send messages to
Channel: 1234565 # Replace with your channel ID
Title: 'All Time Top Voters'
RankDisplay: '%rank%: &6%player% - %votes% Votes'
RankDisplay: '%rank%: %player% - %votes% Votes'
Monthly:
# If true, will send top voter messages to discord
@@ -645,7 +664,7 @@ DiscordSRV:
Channel: 1234565 # Replace with your channel ID
Title: 'Top Voters of the Month'
RankDisplay: '%rank%: &6%player% - %votes% Votes'
RankDisplay: '%rank%: %player% - %votes% Votes'
Weekly:
# If true, will send top voter messages to discord
@@ -656,7 +675,7 @@ DiscordSRV:
Channel: 1234565 # Replace with your channel ID
Title: 'Top Voters of the Week'
RankDisplay: '%rank%: &6%player% - %votes% Votes'
RankDisplay: '%rank%: %player% - %votes% Votes'
Daily:
# If true, will send top voter messages to discord
@@ -667,7 +686,7 @@ DiscordSRV:
Channel: 1234565 # Replace with your channel ID
Title: 'Top Voters of the Day'
RankDisplay: '%rank%: &6%player% - %votes% Votes'
RankDisplay: '%rank%: %player% - %votes% Votes'
@@ -869,3 +888,4 @@ RequestAPI:
DefaultMethod: 'Anvil'
DisabledMethods: []
@@ -3,21 +3,45 @@
#
# MYSQL Required on all setups
# MYSQL INFO --------------------------
# MYSQL INFO --------------------------
Host: ''
# Default port is 3306
Port: 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
# Max number of connections in the pool
MaxConnections: 1
# Table name prefix, for use with mutliple servers
# Don't use with PLUGINMESSAGING bungee setup
# Optional explicit table name override (leave empty to let the plugin choose)
# Name: ''
# Table name prefix, for use with multiple servers
# Don't use with proxy setups unless you know what you're doing
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#Attempt to use mariadb driver
#UseMariaDB: false
# --- Driver / security options ---
# UseSSL: false
# PublicKeyRetrieval: false # Needed on some MySQL setups with caching_sha2_password
# UseMariaDB: false # Attempt to use MariaDB driver instead of MySQL
# --- Connection / lifecycle tuning ---
# MaxLifeTime: -1 # ms; <=0 uses plugin's safe default (e.g., 25m)
# MinimumIdle: 2 # keep a small warm pool (2 is a good starting point)
# IdleTimeoutMs: 600000 # 10 minutes; retire idle connections before server kills them
# KeepaliveMs: 300000 # 5 minutes; lightweight ping to prevent NAT/idle drops
# ValidationMs: 5000 # 5 seconds; timeout for connection validation
# LeakDetectMs: 20000 # 20 seconds; logs if a connection is held too long (0 disables)
# ConnectionTimeout: 50000 # 50 seconds; wait for a free connection before failing
# --- Additional JDBC parameters appended to the URL ---
# Example: "&connectionCollation=utf8mb4_unicode_ci"
# Line: ''
# Optional pool name (useful if you run multiple DB pools)
# PoolName: 'VotingPlugin-Hikari'
####################################################################################