Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bcf096584 | ||
|
|
c2b7e2388e | ||
|
|
180ae04b24 | ||
|
|
73efcfb87f | ||
|
|
6ba2ff582a | ||
|
|
d622b5b684 | ||
|
|
2247134daa | ||
|
|
7de7150e41 | ||
|
|
be23989a20 | ||
|
|
8c4bdc8e20 | ||
|
|
f4d507d821 | ||
|
|
43fd338efd | ||
|
|
c51873e7b2 |
No files matched your search
@@ -596,6 +596,8 @@ VoteParty:
|
||||
GiveAllPlayers: false
|
||||
# If true, the vote count will reset each day
|
||||
ResetEachDay: false
|
||||
# Count votes from /av vote?
|
||||
CountFakeVotes: true
|
||||
# Number of user votes that apply to vote party total the user needs to get rewards
|
||||
UserVotesRequired: 0
|
||||
# Broadcast when vote party reached
|
||||
@@ -778,6 +780,9 @@ LogVotesToFile: false
|
||||
# Longer times result in longer wait in stuff updating after a vote, like topvoter
|
||||
DelayBetweenUpdates: 3
|
||||
|
||||
# Clear cache on update, setting to true reduces performance
|
||||
ClearCacheOnUpdate: false
|
||||
|
||||
# Set to true to disable no service site message on voting
|
||||
# You should never have to touch this if everything is setup properly
|
||||
DisableNoServiceSiteMessage: false
|
||||
@@ -785,3 +790,6 @@ DisableNoServiceSiteMessage: false
|
||||
# Used in special cases
|
||||
# Much slower, but may work better
|
||||
AlternateUUIDLookup: false
|
||||
|
||||
# Shouldn't need to change this
|
||||
AutoKillInvs: true
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.9.7</version>
|
||||
<version>5.10.0</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
|
||||
@@ -448,7 +448,7 @@ public class CommandLoader {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
VotiferEvent.playerVote(args[1], args[2]);
|
||||
VotiferEvent.playerVote(args[1], args[2], false);
|
||||
PlayerVoteEvent voteEvent = new PlayerVoteEvent(plugin.getVoteSite(args[2]),
|
||||
UserManager.getInstance().getVotingPluginUser(args[1]));
|
||||
plugin.getServer().getPluginManager().callEvent(voteEvent);
|
||||
@@ -576,6 +576,16 @@ public class CommandLoader {
|
||||
}
|
||||
});
|
||||
|
||||
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "SetVotePartyCount", "(number)" },
|
||||
"VotingPlugin.Commands.AdminVote.SetVotePartyCount|" + adminPerm, "Set voteparty count") {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
plugin.getVoteParty().setTotalVotes(Integer.parseInt(args[1]));
|
||||
sendMessage(sender, "&cSet vote party count to " + args[1]);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "ClearOfflineVotes" },
|
||||
"VotingPlugin.Commands.AdminVote.ClearOfflineVotes|" + adminPerm, "Clear all offline votes") {
|
||||
|
||||
@@ -673,7 +683,8 @@ public class CommandLoader {
|
||||
@Override
|
||||
public void onInput(Player player, String value) {
|
||||
VotiferEvent.playerVote(
|
||||
UserGUI.getInstance().getCurrentPlayer(player), value);
|
||||
UserGUI.getInstance().getCurrentPlayer(player), value,
|
||||
false);
|
||||
|
||||
player.sendMessage("Forced vote for "
|
||||
+ UserGUI.getInstance().getCurrentPlayer(player)
|
||||
|
||||
@@ -467,9 +467,6 @@ public class Commands {
|
||||
return ArrayUtils.getInstance().convert(ArrayUtils.getInstance().colorize(msg));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update vote today.
|
||||
*/
|
||||
public void updateVoteToday(ArrayList<User> users) {
|
||||
plugin.voteToday.clear();
|
||||
|
||||
|
||||
@@ -867,11 +867,19 @@ public class Config extends YMLFile {
|
||||
public int getMysqlMaxSize() {
|
||||
return getData().getInt("MySQL.MaxSize", -1);
|
||||
}
|
||||
|
||||
|
||||
public ConfigurationSection getBackButton() {
|
||||
return getData().getConfigurationSection("BackButton");
|
||||
}
|
||||
|
||||
public boolean getAutoKillInvs() {
|
||||
return getData().getBoolean("AutoKillInvs", true);
|
||||
}
|
||||
|
||||
public boolean getVotePartyCountFakeVotes() {
|
||||
return getData().getBoolean("VoteParty.CountFakeVotes", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the monthly awards enabled.
|
||||
*
|
||||
@@ -881,6 +889,10 @@ public class Config extends YMLFile {
|
||||
return getData().getBoolean("EnableMonthlyAwards");
|
||||
}
|
||||
|
||||
public boolean getClearCacheOnUpdate() {
|
||||
return getData().getBoolean("ClearCacheOnUpdate");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the monthly possible reward places.
|
||||
*
|
||||
|
||||
@@ -34,15 +34,11 @@ public class VotiferEvent implements Listener {
|
||||
/** The plugin. */
|
||||
static Main plugin = Main.plugin;
|
||||
|
||||
/**
|
||||
* Player vote.
|
||||
*
|
||||
* @param playerName
|
||||
* the player name
|
||||
* @param voteSiteURL
|
||||
* the vote site URL
|
||||
*/
|
||||
public static void playerVote(final String playerName, final String voteSiteURL) {
|
||||
playerVote(playerName, voteSiteURL, true);
|
||||
}
|
||||
|
||||
public static void playerVote(final String playerName, final String voteSiteURL, final boolean realVote) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -73,9 +69,11 @@ public class VotiferEvent implements Listener {
|
||||
|
||||
// vote party
|
||||
if (Config.getInstance().getVotePartyEnabled()) {
|
||||
VoteParty.getInstance().addTotal(user);
|
||||
VoteParty.getInstance().addVotePlayer(user);
|
||||
VoteParty.getInstance().check();
|
||||
if (Config.getInstance().getVotePartyCountFakeVotes() || realVote) {
|
||||
VoteParty.getInstance().addTotal(user);
|
||||
VoteParty.getInstance().addVotePlayer(user);
|
||||
VoteParty.getInstance().check();
|
||||
}
|
||||
}
|
||||
|
||||
// broadcast vote if enabled in config
|
||||
@@ -109,6 +107,7 @@ public class VotiferEvent implements Listener {
|
||||
user.closeInv();
|
||||
} else {
|
||||
user.addOfflineVote(voteSite.getKey());
|
||||
// plugin.debug(ArrayUtils.getInstance().makeStringList(user.getOfflineVotes()));
|
||||
plugin.debug("Offline vote set for " + playerName + " on " + voteSite.getKey());
|
||||
}
|
||||
|
||||
@@ -178,7 +177,7 @@ public class VotiferEvent implements Listener {
|
||||
ConfigVoteSites.getInstance().generateVoteSite(voteSiteName);
|
||||
}
|
||||
|
||||
playerVote(voteUsername, voteSite);
|
||||
playerVote(voteUsername, voteSite, true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.TimerTask;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -799,8 +800,10 @@ public class Main extends JavaPlugin {
|
||||
if (AdvancedCoreHook.getInstance().getMysql() == null) {
|
||||
plugin.debug("MySQL not loaded yet");
|
||||
return;
|
||||
} else {
|
||||
} else if (Config.getInstance().getClearCacheOnUpdate()) {
|
||||
AdvancedCoreHook.getInstance().getMysql().clearCache();
|
||||
} else {
|
||||
AdvancedCoreHook.getInstance().getMysql().clearCacheBasic();
|
||||
}
|
||||
}
|
||||
update = false;
|
||||
@@ -817,6 +820,10 @@ public class Main extends JavaPlugin {
|
||||
Commands.getInstance().updateVoteToday(users);
|
||||
ServerData.getInstance().updateValues();
|
||||
Signs.getInstance().updateSigns();
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
UserManager.getInstance().getVotingPluginUser(player).offVote();
|
||||
}
|
||||
plugin.debug("Background task ran");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -829,6 +836,10 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public VoteParty getVoteParty() {
|
||||
return VoteParty.getInstance();
|
||||
}
|
||||
|
||||
public void updateAdvancedCoreHook() {
|
||||
AdvancedCoreHook.getInstance().setMaxMysqlSize(Config.getInstance().getMysqlMaxSize());
|
||||
AdvancedCoreHook.getInstance().setAutoDownload(Config.getInstance().getAutoDownload());
|
||||
@@ -849,6 +860,7 @@ public class Main extends JavaPlugin {
|
||||
AdvancedCoreHook.getInstance().setLogDebugToFile(Config.getInstance().getLogDebugToFile());
|
||||
AdvancedCoreHook.getInstance().setSendScoreboards(Config.getInstance().getSendScoreboards());
|
||||
AdvancedCoreHook.getInstance().setAlternateUUIDLookUp(Config.getInstance().getAlternateUUIDLookup());
|
||||
AdvancedCoreHook.getInstance().setAutoKillInvs(Config.getInstance().getAutoKillInvs());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class User extends com.Ben12345rocks.AdvancedCore.Objects.User {
|
||||
public void addTotal() {
|
||||
addMonthTotal();
|
||||
addAllTimeTotal();
|
||||
setMilestoneCount(getMilestoneCount()+1);
|
||||
setMilestoneCount(getMilestoneCount() + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -559,16 +559,22 @@ public class User extends com.Ben12345rocks.AdvancedCore.Objects.User {
|
||||
if (player != null) {
|
||||
setTopVoterIgnore(player.hasPermission("VotingPlugin.TopVoter.Ignore"));
|
||||
ArrayList<String> offlineVotes = getOfflineVotes();
|
||||
// plugin.debug(ArrayUtils.getInstance().makeStringList(offlineVotes));
|
||||
if (offlineVotes.size() > 0) {
|
||||
sendVoteEffects(true);
|
||||
}
|
||||
|
||||
for (int i = 0; i < offlineVotes.size(); i++) {
|
||||
if (plugin.hasVoteSite(offlineVotes.get(i))) {
|
||||
plugin.debug("Giving offline site reward: " + offlineVotes.get(i));
|
||||
playerVote(plugin.getVoteSite(offlineVotes.get(i)), false, true);
|
||||
} else {
|
||||
plugin.debug("Site doesn't exist: " + offlineVotes.get(i));
|
||||
}
|
||||
}
|
||||
setOfflineVotes(new ArrayList<String>());
|
||||
if (!offlineVotes.isEmpty()) {
|
||||
setOfflineVotes(new ArrayList<String>());
|
||||
}
|
||||
|
||||
giveOfflineOtherRewards();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user