forked from upstream/VotingPlugin
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17574f6c50 | ||
|
|
60377deb44 | ||
|
|
34614e13fa | ||
|
|
bc98630388 | ||
|
|
302cc980d8 | ||
|
|
4342fc5458 | ||
|
|
90b981af7b | ||
|
|
32879956ec | ||
|
|
2b166c7760 | ||
|
|
9848172a49 | ||
|
|
9775d06ba9 | ||
|
|
9584bc0e66 | ||
|
|
00ec202140 | ||
|
|
bd57f003dd | ||
|
|
23788be684 | ||
|
|
9b33b1cde7 | ||
|
|
02fb353dac | ||
|
|
a4c470887f | ||
|
|
e844a1eb63 | ||
|
|
1787595ea2 |
No files matched your search
@@ -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"
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-21
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -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);
|
||||
|
||||
+61
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -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);
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
|
||||
####################################################################################
|
||||
|
||||
Reference in new issue
Block a user