mirror of
https://github.com/BenCodez/VotingPlugin.git
synced 2026-11-05 09:20:16 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5618d4b479 | ||
|
|
898b2985e5 | ||
|
|
cd7fa2cd39 | ||
|
|
62afcfc820 | ||
|
|
12233d1061 | ||
|
|
c2b3178f2e | ||
|
|
2e01c1eafd | ||
|
|
384ace3013 |
No files matched your search
@@ -798,6 +798,11 @@ DelayBetweenUpdates: 3
|
||||
# Clear cache on update, setting to true reduces performance
|
||||
ClearCacheOnUpdate: false
|
||||
|
||||
# Clears cache for the player who voted only
|
||||
# Only effects if using mysql
|
||||
# Would recommend for some bungee setups
|
||||
ClearCacheOnVote: false
|
||||
|
||||
# Set to true to disable no service site message on voting
|
||||
# You should never have to touch this if everything is setup properly
|
||||
# Will also disable a few other warnings about vote sites
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.12.1</version>
|
||||
<version>5.12.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
|
||||
@@ -1478,4 +1478,8 @@ public class Config extends YMLFile {
|
||||
saveData();
|
||||
}
|
||||
|
||||
public boolean getClearCacheOnVote() {
|
||||
return getData().getBoolean("ClearCacheOnVote");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class PlayerJoinEvent implements Listener {
|
||||
// run remind
|
||||
user.loginMessage();
|
||||
|
||||
if (UserManager.getInstance().getAllUUIDs().contains(player.getUniqueId().toString())) {
|
||||
if (user.getData().hasData()) {
|
||||
// give offline vote (if they voted
|
||||
// offline)
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.AdvancedCoreHook;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.UserStorage;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Misc.ArrayUtils;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Misc.PlayerUtils;
|
||||
import com.Ben12345rocks.VotingPlugin.Main;
|
||||
@@ -115,6 +117,12 @@ public class VotiferEvent implements Listener {
|
||||
OtherVoteReward.getInstance().checkAllSites(user);
|
||||
OtherVoteReward.getInstance().checkCumualativeVotes(user);
|
||||
OtherVoteReward.getInstance().checkMilestone(user);
|
||||
|
||||
if (Config.getInstance().getClearCacheOnVote()) {
|
||||
if (AdvancedCoreHook.getInstance().getStorageType().equals(UserStorage.MYSQL)) {
|
||||
AdvancedCoreHook.getInstance().getMysql().removePlayer(user.getUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugin.setUpdate(true);
|
||||
@@ -177,6 +185,7 @@ public class VotiferEvent implements Listener {
|
||||
plugin.getServer().getPluginManager().callEvent(voteEvent);
|
||||
|
||||
if (voteEvent.isCancelled()) {
|
||||
plugin.debug("Vote cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ public class Main extends JavaPlugin {
|
||||
values.put(key, user.getData().getString(key));
|
||||
}
|
||||
data.put(user, values);
|
||||
debug("[Convert] Added " + uuid);
|
||||
} catch (Exception e) {
|
||||
AdvancedCoreHook.getInstance().debug(e);
|
||||
plugin.getLogger().warning("Exception occoured for '" + uuid + "': " + e.getMessage()
|
||||
@@ -149,6 +150,8 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getLogger().info("Finished getting data from " + from.toString());
|
||||
|
||||
AdvancedCoreHook.getInstance().setStorageType(to);
|
||||
loadMySQL();
|
||||
|
||||
@@ -164,6 +167,8 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
AdvancedCoreHook.getInstance().setStorageType(cur);
|
||||
|
||||
plugin.getLogger().info("Finished convertting");
|
||||
}
|
||||
|
||||
public ArrayList<User> convertSet(Set<User> set) {
|
||||
@@ -281,13 +286,20 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
|
||||
private void loadTimer() {
|
||||
AdvancedCoreHook.getInstance().getTimer().schedule(new TimerTask() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
update();
|
||||
AdvancedCoreHook.getInstance().getTimer().schedule(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
update();
|
||||
}
|
||||
}, 1000, 1000 * 60 * Config.getInstance().getDelayBetweenUpdates());
|
||||
}
|
||||
}, 1000, 1000 * 60 * Config.getInstance().getDelayBetweenUpdates());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -699,14 +711,22 @@ public class Main extends JavaPlugin {
|
||||
|
||||
loadTimer();
|
||||
|
||||
plugin.getLogger().info("Enabled VotingPlgin " + plugin.getDescription().getVersion());
|
||||
plugin.getLogger().info("Enabled VotingPlugin " + plugin.getDescription().getVersion());
|
||||
|
||||
ArrayList<String> services = ServerData.getInstance().getServiceSites();
|
||||
for (VoteSite site : getVoteSites()) {
|
||||
if (!site.hasRewards()) {
|
||||
plugin.getLogger().warning("No rewards detected for the site: " + site.getKey()
|
||||
+ ". See https://github.com/Ben12345rocks/AdvancedCore/wiki/Rewards on how to add rewards");
|
||||
}
|
||||
if (!ServerData.getInstance().getServiceSites().contains(site.getServiceSite())) {
|
||||
|
||||
boolean contains = false;
|
||||
for (String service : services) {
|
||||
if (service.equalsIgnoreCase(site.getServiceSite())) {
|
||||
contains = true;
|
||||
}
|
||||
}
|
||||
if (!contains) {
|
||||
plugin.getLogger().warning("No vote has been recieved from " + site.getServiceSite()
|
||||
+ ", may be an invalid service site. Vote on the site and look in console for a service site, if you get nothing then there is an issue with votifier");
|
||||
}
|
||||
@@ -825,7 +845,7 @@ public class Main extends JavaPlugin {
|
||||
updateAdvancedCoreHook();
|
||||
plugin.loadVoteSites();
|
||||
AdvancedCoreHook.getInstance().reload();
|
||||
loadTimer();
|
||||
// loadTimer();
|
||||
|
||||
}
|
||||
|
||||
@@ -900,6 +920,8 @@ public class Main extends JavaPlugin {
|
||||
if (uuid != null && !uuid.isEmpty()) {
|
||||
User user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
|
||||
users.add(user);
|
||||
// AdvancedCoreHook.getInstance().extraDebug("Loading " + uuid);
|
||||
// java.lang.Thread.sleep(5000);
|
||||
}
|
||||
}
|
||||
update = false;
|
||||
|
||||
Reference in new issue
Block a user