forked from upstream/VotingPlugin
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a59a98f8cb | ||
|
|
e62213bfd5 | ||
|
|
61b77c4754 | ||
|
|
758aaa3dd7 | ||
|
|
51389a27fb | ||
|
|
37b94cc36c | ||
|
|
1e4796d418 | ||
|
|
62b0d6012d | ||
|
|
52726c8bb3 | ||
|
|
ede06e0923 | ||
|
|
6eb2c95cc0 | ||
|
|
835dff8620 | ||
|
|
1019b0b83b | ||
|
|
a44070b505 | ||
|
|
58bd4e2d9d | ||
|
|
cff346e6a4 | ||
|
|
0331e34e91 | ||
|
|
26ff8d8588 | ||
|
|
9a38826cf7 | ||
|
|
b854631990 | ||
|
|
5d1cd97ebd | ||
|
|
c21feb74d1 | ||
|
|
052e2f2541 | ||
|
|
1270b57afa | ||
|
|
cf8b219b9d | ||
|
|
689133aab8 | ||
|
|
019c0f01eb | ||
|
|
743cac217b |
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 20
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- Priority
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -454,8 +454,8 @@ GUI:
|
||||
Name: '&3&l%position%: &3%player%'
|
||||
Lore: '&3&lVotes: &3%votes%'
|
||||
SwitchItem:
|
||||
Name: 'Switch TopVoter'
|
||||
Lore: 'Currently: %Top%'
|
||||
Name: '&3Switch TopVoter'
|
||||
Lore: '&bCurrently: %Top%'
|
||||
Material: 'SIGN'
|
||||
Amount: 1
|
||||
# 8 Slots over from the bottom left
|
||||
@@ -561,7 +561,7 @@ GUI:
|
||||
VoteShopName: 'VoteShop'
|
||||
|
||||
BackButton:
|
||||
Material: 'PAPER'
|
||||
Material: 'BARRIER'
|
||||
Data: 0
|
||||
Amount: 1
|
||||
Name: '&8Back to VoteGUI'
|
||||
@@ -608,13 +608,12 @@ Shop:
|
||||
# To disable reward set value to []
|
||||
# Eg:
|
||||
# FirstVote: [] (All in one line)
|
||||
# By default all rewards are disabled
|
||||
# Rewards will be given if there is a reward to give
|
||||
|
||||
# First vote rewards
|
||||
FirstVote:
|
||||
Messages:
|
||||
Player: '&aYou voted for your first time!'
|
||||
Money: 100
|
||||
|
||||
# All vote rewards
|
||||
# Reward for voting on all sites in one day
|
||||
@@ -652,6 +651,8 @@ VoteParty:
|
||||
ResetEachDay: false
|
||||
# Reset at the end of the month
|
||||
ResetMonthly: false
|
||||
# Reset extra votes
|
||||
ResetExtraVotesMonthly: false
|
||||
# Count votes from /av vote?
|
||||
CountFakeVotes: true
|
||||
# Number of user votes that apply to vote party total the user needs to get rewards
|
||||
@@ -886,6 +887,10 @@ CountFakeVotes: true
|
||||
# Requires restart to take affect
|
||||
GiveDefaultPermission: true
|
||||
|
||||
# Permissions given by VotingPlugin.Player by default
|
||||
# Permissions listed here will no be accessible with the default permission
|
||||
DisabledDefaultPermissions: []
|
||||
|
||||
# Remove old player files
|
||||
# Happens on startup or /av purge
|
||||
PurgeOldData: false
|
||||
|
||||
@@ -4,7 +4,7 @@ main: com.Ben12345rocks.VotingPlugin.Main
|
||||
description: Highly Customizable Voting Listener!
|
||||
website: https://www.spigotmc.org/resources/votingplugin.15358/
|
||||
author: Ben12345rocks
|
||||
softdepend: [MVdWPlaceholders, Votifier]
|
||||
softdepend: [MVdWPlaceholders, Votifier, CMI, Vault, PlaceholderAPI]
|
||||
api-version: 1.13
|
||||
commands:
|
||||
vote:
|
||||
@@ -225,4 +225,6 @@ permissions:
|
||||
default: false
|
||||
VotingPlugin.Sign.Create:
|
||||
description: Permission to create sign
|
||||
VotingPlugin.Admin.GenerateServiceSite:
|
||||
description: Permission for generating votesite message
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.20.4</version>
|
||||
<version>5.20.7</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
@@ -259,7 +259,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.Ben12345rocks.VotingPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Encryption.EncryptionHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.ClientHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.SocketHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.SocketReceiver;
|
||||
@@ -27,18 +29,21 @@ public class BungeeHandler {
|
||||
@Getter
|
||||
private ClientHandler clientHandler;
|
||||
|
||||
private EncryptionHandler encryptionHandler;
|
||||
|
||||
public void close() {
|
||||
socketHandler.closeConnection();
|
||||
clientHandler.stopConnection();
|
||||
}
|
||||
|
||||
public void load() {
|
||||
encryptionHandler = new EncryptionHandler(new File(Main.plugin.getDataFolder(), "secretkey.key"));
|
||||
Bukkit.getScheduler().runTask(Main.plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
clientHandler = new ClientHandler(Config.getInstance().getBungeeServerHost(),
|
||||
Config.getInstance().getBungeeServerPort());
|
||||
Config.getInstance().getBungeeServerPort(), encryptionHandler);
|
||||
|
||||
socketHandler.add(new SocketReceiver() {
|
||||
|
||||
@@ -62,7 +67,7 @@ public class BungeeHandler {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
socketHandler.add(new SocketReceiver() {
|
||||
|
||||
@Override
|
||||
@@ -110,7 +115,7 @@ public class BungeeHandler {
|
||||
});
|
||||
|
||||
socketHandler = new SocketHandler(Main.plugin.getVersion(), Config.getInstance().getSpigotServerHost(),
|
||||
Config.getInstance().getSpigotServerPort());
|
||||
Config.getInstance().getSpigotServerPort(), encryptionHandler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1065,6 +1065,18 @@ public class CommandLoader {
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getAdminVoteCommand()
|
||||
.add(new CommandHandler(new String[] { "VotePartyExtraRequired", "(Number)" },
|
||||
"VotingPlugin.Commands.AdminVote.VoteParty.SetExtraRequired|" + adminPerm,
|
||||
"Force a voteparty reward, resets vote count") {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
ServerData.getInstance().setVotePartyExtraRequired(Integer.parseInt(args[1]));
|
||||
sendMessage(sender, "&cSet VotePartyExtraRequired to " + args[1]);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getAdminVoteCommand()
|
||||
.add(new CommandHandler(new String[] { "User", "(player)", "ForceMilestone", "(Number)" },
|
||||
"VotingPlugin.Commands.AdminVote.ForceMilestone|" + adminPerm, "Force a milestone") {
|
||||
@@ -1408,7 +1420,7 @@ public class CommandLoader {
|
||||
}
|
||||
});
|
||||
plugin.getVoteCommand().add(new CommandHandler(new String[] { "URL", "(SiteName)" },
|
||||
"VotingPlugin.Commands.Vote.URL.VoteSite|" + playerPerm, "Open VoteURL GUI", false) {
|
||||
"VotingPlugin.Commands.Vote.URL.VoteSite", "Open VoteURL GUI", false) {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
@@ -2134,6 +2146,20 @@ public class CommandLoader {
|
||||
list.remove(i);
|
||||
}
|
||||
}
|
||||
ArrayList<String> disabledDefaultPerms = config.getDisabledDefaultPermissions();
|
||||
for (CommandHandler cmd : list) {
|
||||
boolean contains = false;
|
||||
for (String dis : disabledDefaultPerms) {
|
||||
if (cmd.getPerm().contains(dis + "|")) {
|
||||
contains = true;
|
||||
}
|
||||
}
|
||||
if (contains) {
|
||||
cmd.setPerm(cmd.getPerm().replace("|" + playerPerm, ""));
|
||||
plugin.debug("Disabling VotingPlugin.Player permission on " + cmd.getPerm());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -598,6 +598,9 @@ public class Commands {
|
||||
if (time > 0) {
|
||||
Date date = new Date(time);
|
||||
String timeString = new SimpleDateFormat(config.getFormatTimeFormat()).format(date);
|
||||
if (StringParser.getInstance().containsIgnorecase(timeString, "YamlConfiguration")) {
|
||||
plugin.getLogger().warning("Detected issue parsing time, check time format");
|
||||
}
|
||||
return timeString;
|
||||
}
|
||||
return "";
|
||||
@@ -921,7 +924,7 @@ public class Commands {
|
||||
MessageBuilder message = new MessageBuilder(config.getFormatCommandsVoteURLS());
|
||||
message.replacePlaceholder("num", Integer.toString(counter)).replacePlaceholder("url", voteURL)
|
||||
.replacePlaceholder("SiteName", voteSite.getDisplayName())
|
||||
.replacePlaceholder("player", user.getPlayerName())
|
||||
.replacePlaceholder("player", "" + user.getPlayerName())
|
||||
.replacePlaceholder("Next", "" + voteCommandNextInfo(user, voteSite)).colorize();
|
||||
sites.add(message.getText());
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PlayerGUIs {
|
||||
if (sec != null) {
|
||||
item = new ItemBuilder(sec);
|
||||
} else {
|
||||
item = new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI");
|
||||
item = new ItemBuilder(Material.BARRIER, 1).setName("&8Back to VoteGUI");
|
||||
}
|
||||
|
||||
BInventoryButton b = new BInventoryButton(item) {
|
||||
@@ -309,6 +309,7 @@ public class PlayerGUIs {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Player player = event.getWhoClicked();
|
||||
event.getButton().getInv().closeInv(player, null);
|
||||
|
||||
User user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
user.clearCache();
|
||||
@@ -704,6 +705,10 @@ public class PlayerGUIs {
|
||||
}
|
||||
|
||||
public void openVoteURL(Player player, String voteSite) {
|
||||
if (!plugin.isVoteSite(voteSite)) {
|
||||
player.sendMessage("Not a valid votesite");
|
||||
return;
|
||||
}
|
||||
User user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
VoteSite site = plugin.getVoteSite(voteSite);
|
||||
BInventory inv = new BInventory(StringParser.getInstance()
|
||||
|
||||
@@ -69,9 +69,9 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private String formatCommandsVoteLastNeverVoted;
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Last.LastVoted", defaultValue = "%times% ago")
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Last.LastVoted")
|
||||
@Getter
|
||||
private String formatCommandsVoteLastLastVoted;
|
||||
private String formatCommandsVoteLastLastVoted = "%times% ago";
|
||||
|
||||
@ConfigDataString(path = "Format.TimeFormats.Days", defaultValue = "Days")
|
||||
@Getter
|
||||
@@ -125,6 +125,10 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean addTotals = true;
|
||||
|
||||
@ConfigDataBoolean(path = "AlterColumns")
|
||||
@Getter
|
||||
private boolean alterColumns = true;
|
||||
|
||||
@Getter
|
||||
private String allSitesRewardPath = "AllSites";
|
||||
|
||||
@@ -227,6 +231,14 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean disableNoServiceSiteMessage = false;
|
||||
|
||||
@ConfigDataListString(path = "DisabledDefaultPermissions")
|
||||
@Getter
|
||||
private ArrayList<String> disabledDefaultPermissions = new ArrayList<String>();
|
||||
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetExtraVotesMonthly")
|
||||
@Getter
|
||||
private boolean votePartyResetExtraVotesMonthly = false;
|
||||
|
||||
@ConfigDataBoolean(path = "DisableAdvancedTab")
|
||||
@Getter
|
||||
private boolean disableAdvancedTab = false;
|
||||
|
||||
@@ -6,11 +6,14 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Messages.StringParser;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Misc.ArrayUtils;
|
||||
import com.Ben12345rocks.AdvancedCore.YML.YMLFile;
|
||||
import com.Ben12345rocks.VotingPlugin.Main;
|
||||
@@ -65,6 +68,13 @@ public class ConfigVoteSites extends YMLFile {
|
||||
set(siteName, "Rewards.Messages.Player", "&aThanks for voting on %ServiceSite%!");
|
||||
|
||||
plugin.loadVoteSites();
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (p.hasPermission("VotingPlugin.Admin.GenerateServiceSite")) {
|
||||
p.sendMessage(StringParser.getInstance().colorize("&cGenerating votesite for service site "
|
||||
+ siteName + ", please check console for details"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class VotiferEvent implements Listener {
|
||||
}
|
||||
|
||||
plugin.getLogger()
|
||||
.info("Recieved a vote from service site '" + voteSite + "' by player '" + voteUsername + "'!");
|
||||
.info("Received a vote from service site '" + voteSite + "' by player '" + voteUsername + "'!");
|
||||
|
||||
plugin.debug("PlayerUsername: " + voteUsername);
|
||||
plugin.debug("VoteSite: " + voteSite);
|
||||
|
||||
@@ -144,8 +144,12 @@ public class Main extends AdvancedCorePlugin {
|
||||
try {
|
||||
Class.forName("com.vexsoftware.votifier.model.VotifierEvent");
|
||||
} catch (ClassNotFoundException e) {
|
||||
plugin.getLogger()
|
||||
.warning("No VotifierEvent found, install Votifier, NuVotifier, or another Votifier plugin");
|
||||
if (!Config.getInstance().isUseBungeeCoord()) {
|
||||
plugin.getLogger()
|
||||
.warning("No VotifierEvent found, install Votifier, NuVotifier, or another Votifier plugin");
|
||||
} else {
|
||||
plugin.debug("No VotifierEvent found, but usebungeecoord enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,6 +288,15 @@ public class Main extends AdvancedCorePlugin {
|
||||
return VoteParty.getInstance();
|
||||
}
|
||||
|
||||
public boolean isVoteSite(String voteSite) {
|
||||
for (VoteSite site : getVoteSites()) {
|
||||
if (site.getKey().equalsIgnoreCase(voteSite)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote site.
|
||||
*
|
||||
@@ -821,7 +834,7 @@ public class Main extends AdvancedCorePlugin {
|
||||
}
|
||||
|
||||
// set columns
|
||||
if (getStorageType().equals(UserStorage.MYSQL)) {
|
||||
if (getStorageType().equals(UserStorage.MYSQL) && Config.getInstance().isAlterColumns()) {
|
||||
getMysql().alterColumnType("TopVoterIgnore", "VARCHAR(5)");
|
||||
getMysql().alterColumnType("CheckWorld", "VARCHAR(5)");
|
||||
getMysql().alterColumnType("Reminded", "VARCHAR(5)");
|
||||
|
||||
@@ -223,26 +223,31 @@ public class User extends com.Ben12345rocks.AdvancedCore.UserManager.User {
|
||||
if (time == 0) {
|
||||
return true;
|
||||
}
|
||||
LocalDateTime now = TimeChecker.getInstance().getTime();
|
||||
LocalDateTime lastVote = LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault())
|
||||
.plusHours(Main.plugin.getOptions().getTimeHourOffSet());
|
||||
try {
|
||||
LocalDateTime now = TimeChecker.getInstance().getTime();
|
||||
LocalDateTime lastVote = LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault())
|
||||
.plusHours(Main.plugin.getOptions().getTimeHourOffSet());
|
||||
|
||||
if (!voteSite.isVoteDelayDaily()) {
|
||||
int votedelay = ConfigVoteSites.getInstance().getVoteDelay(siteName);
|
||||
if (!voteSite.isVoteDelayDaily()) {
|
||||
int votedelay = ConfigVoteSites.getInstance().getVoteDelay(siteName);
|
||||
|
||||
if (votedelay == 0) {
|
||||
if (votedelay == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LocalDateTime nextvote = lastVote.plusHours(votedelay);
|
||||
|
||||
return now.isAfter(nextvote);
|
||||
} else {
|
||||
if (now.getDayOfYear() != lastVote.getDayOfYear() || now.getYear() != lastVote.getYear()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
LocalDateTime nextvote = lastVote.plusHours(votedelay);
|
||||
|
||||
return now.isAfter(nextvote);
|
||||
} else {
|
||||
if (now.getDayOfYear() != lastVote.getDayOfYear() || now.getYear() != lastVote.getYear()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,10 @@ public class VoteParty implements Listener {
|
||||
if (Config.getInstance().getVotePartyResetMontly()) {
|
||||
reset();
|
||||
}
|
||||
|
||||
if (Config.getInstance().isVotePartyResetExtraVotesMonthly()) {
|
||||
ServerData.getInstance().setVotePartyExtraRequired(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.Ben12345rocks.VotingPlugin.bungee;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Encryption.EncryptionHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.ClientHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.SocketHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Sockets.SocketReceiver;
|
||||
@@ -26,6 +28,8 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
|
||||
|
||||
private HashMap<String, ClientHandler> clientHandles;
|
||||
|
||||
private EncryptionHandler encryptionHandler;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getProxy().getPluginManager().registerListener(this, this);
|
||||
@@ -60,9 +64,10 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
|
||||
getMysql().alterColumnType("LastMonthTotal", "INT DEFAULT '0'");
|
||||
|
||||
getProxy().getPluginManager().registerCommand(this, new VotingPluginBungeeCommand(this));
|
||||
encryptionHandler = new EncryptionHandler(new File(getDataFolder(), "secretkey.key"));
|
||||
|
||||
socketHandler = new SocketHandler(getDescription().getVersion(), config.getBungeeHost(),
|
||||
config.getBungeePort());
|
||||
socketHandler = new SocketHandler(getDescription().getVersion(), config.getBungeeHost(), config.getBungeePort(),
|
||||
encryptionHandler);
|
||||
|
||||
socketHandler.add(new SocketReceiver() {
|
||||
|
||||
@@ -81,7 +86,8 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
|
||||
for (String s : config.getSpigotServers()) {
|
||||
if (!l.contains(s)) {
|
||||
Configuration d = config.getSpigotServerConfiguration(s);
|
||||
clientHandles.put(s, new ClientHandler(d.getString("Host", ""), d.getInt("Port", 1298)));
|
||||
clientHandles.put(s,
|
||||
new ClientHandler(d.getString("Host", ""), d.getInt("Port", 1298), encryptionHandler));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +99,7 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
|
||||
public void onVote(VotifierEvent event) {
|
||||
Vote vote = event.getVote();
|
||||
saveVote(vote.getUsername(), vote.getServiceName());
|
||||
getLogger().info("Vote received " + vote.getUsername() + " from service site " + vote.getServiceName());
|
||||
}
|
||||
|
||||
public String getUUID(String playerName) {
|
||||
@@ -134,9 +141,7 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
|
||||
// mysql.update(uuid, "Proxy_Online", finalData, DataType.STRING);
|
||||
sendServerMessageServer(server, "bungeevoteonline", uuid, name, service);
|
||||
if (config.getBroadcast()) {
|
||||
if (getProxy().getPlayer(name).isConnected()) {
|
||||
sendServerMessage("BungeeBroadcast", service, uuid, name);
|
||||
}
|
||||
sendServerMessage("BungeeBroadcast", service, uuid, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-11
@@ -8,24 +8,28 @@ public class VotingPluginBungeeCommand extends Command {
|
||||
private Bungee bungee;
|
||||
|
||||
public VotingPluginBungeeCommand(Bungee bungee) {
|
||||
super("votingpluginbungee", "VotingPlugin.Admin");
|
||||
super("votingpluginbungee", "votingplugin.admin");
|
||||
this.bungee = bungee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
bungee.reload();
|
||||
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee"));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("vote")) {
|
||||
if (args.length >= 2) {
|
||||
String user = args[1];
|
||||
String site = args[2];
|
||||
bungee.saveVote(user, site);
|
||||
if (sender.hasPermission("votingplugin.admin")) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
bungee.reload();
|
||||
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee"));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("vote")) {
|
||||
if (args.length >= 2) {
|
||||
String user = args[1];
|
||||
String site = args[2];
|
||||
bungee.saveVote(user, site);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(new TextComponent("You do not have permission to do this!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user