Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83c43331a9 | ||
|
|
afe68ef229 | ||
|
|
7eec56ee2a | ||
|
|
2ed462b61c | ||
|
|
dd142d20fe | ||
|
|
8a340dc292 | ||
|
|
e77201613e |
No files matched your search
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>6.1.1</version>
|
||||
<version>6.1.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
|
||||
@@ -36,6 +36,7 @@ import lombok.Getter;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.event.ServerConnectedEvent;
|
||||
@@ -379,6 +380,12 @@ public class VotingPluginBungee extends Plugin implements net.md_5.bungee.api.pl
|
||||
if (!ev.getTag().equals("vp:vp".toLowerCase())) {
|
||||
return;
|
||||
}
|
||||
|
||||
ev.setCancelled(true);
|
||||
|
||||
if (!(ev.getSender() instanceof Server))
|
||||
return;
|
||||
|
||||
ByteArrayInputStream instream = new ByteArrayInputStream(ev.getData());
|
||||
DataInputStream in = new DataInputStream(instream);
|
||||
try {
|
||||
|
||||
@@ -128,7 +128,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @return the vote delay
|
||||
*/
|
||||
public int getVoteDelay(String siteName) {
|
||||
return getData(siteName).getInt("VoteDelay");
|
||||
return getData(siteName).getInt("VoteDelay", 24);
|
||||
}
|
||||
|
||||
public int getVoteDelayMin(String siteName) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.bukkit.event.Listener;
|
||||
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.time.TimeType;
|
||||
import com.bencodez.advancedcore.api.time.events.DateChangedEvent;
|
||||
import com.bencodez.advancedcore.api.time.events.DayChangeEvent;
|
||||
import com.bencodez.advancedcore.api.time.events.MonthChangeEvent;
|
||||
@@ -105,7 +106,9 @@ public class TopVoterHandler implements Listener {
|
||||
public void onDateChanged(DateChangedEvent event) {
|
||||
plugin.setUpdate(true);
|
||||
plugin.update();
|
||||
loadLastMonth();
|
||||
if (event.getTimeType().equals(TimeType.MONTH)) {
|
||||
loadLastMonth();
|
||||
}
|
||||
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
plugin.getMysql().clearCache();
|
||||
}
|
||||
@@ -171,7 +174,7 @@ public class TopVoterHandler implements Listener {
|
||||
}
|
||||
|
||||
resetTotals(TopVoter.Daily);
|
||||
|
||||
|
||||
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
plugin.getMysql().clearCache();
|
||||
}
|
||||
@@ -259,7 +262,7 @@ public class TopVoterHandler implements Listener {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
plugin.getMysql().clearCache();
|
||||
}
|
||||
@@ -337,7 +340,7 @@ public class TopVoterHandler implements Listener {
|
||||
e.printStackTrace();
|
||||
}
|
||||
resetTotals(TopVoter.Weekly);
|
||||
|
||||
|
||||
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
plugin.getMysql().clearCache();
|
||||
}
|
||||
@@ -402,7 +405,7 @@ public class TopVoterHandler implements Listener {
|
||||
} else if (top.equals(TopVoter.Weekly)) {
|
||||
fileName += "_" + week;
|
||||
}
|
||||
fileName += ".yml";
|
||||
fileName += "_" + System.currentTimeMillis() + ".yml";
|
||||
|
||||
YMLFileHandler file = new YMLFileHandler(plugin, new File(plugin.getDataFolder(), fileName));
|
||||
file.setup();
|
||||
|
||||
Reference in new issue
Block a user