Rebrand : remplace le package/groupId fr.northblue par fr.votenetwork
Projet destine a etre open source, plus aucune reference a "NorthBlue" dans le code, les artifactId Maven ou les config par defaut. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8c69a0dc9a
commit
394267ca5a
@@ -130,11 +130,11 @@ Testez la connexion/l'accès au stockage configuré côté Spigot avec :
|
|||||||
|
|
||||||
## API publique (scoreboard / GUI)
|
## API publique (scoreboard / GUI)
|
||||||
|
|
||||||
Un autre plugin sur le même serveur Spigot peut lire l'état du vote via `fr.northblue.vote.spigot.api.NorthBlueVoteAPI` :
|
Un autre plugin sur le même serveur Spigot peut lire l'état du vote via `fr.votenetwork.spigot.api.VoteNetworkAPI` :
|
||||||
|
|
||||||
```java
|
```java
|
||||||
NorthBlueVoteAPI api = NorthBlueVoteAPI.get();
|
VoteNetworkAPI api = VoteNetworkAPI.get();
|
||||||
// ou : Bukkit.getServicesManager().getRegistration(NorthBlueVoteAPI.class).getProvider();
|
// ou : Bukkit.getServicesManager().getRegistration(VoteNetworkAPI.class).getProvider();
|
||||||
|
|
||||||
int current = api.getVotePartyCurrentVotes();
|
int current = api.getVotePartyCurrentVotes();
|
||||||
int required = api.getVotePartyRequiredVotes();
|
int required = api.getVotePartyRequiredVotes();
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>fr.northblue</groupId>
|
<groupId>fr.votenetwork</groupId>
|
||||||
<artifactId>northblue-vote-parent</artifactId>
|
<artifactId>votenetwork-parent</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -5,12 +5,12 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>fr.northblue</groupId>
|
<groupId>fr.votenetwork</groupId>
|
||||||
<artifactId>northblue-vote-parent</artifactId>
|
<artifactId>votenetwork-parent</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>northblue-vote-spigot</artifactId>
|
<artifactId>votenetwork-spigot</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -71,11 +71,11 @@
|
|||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.zaxxer.hikari</pattern>
|
<pattern>com.zaxxer.hikari</pattern>
|
||||||
<shadedPattern>fr.northblue.vote.libs.hikari</shadedPattern>
|
<shadedPattern>fr.votenetwork.libs.hikari</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.mysql</pattern>
|
<pattern>com.mysql</pattern>
|
||||||
<shadedPattern>fr.northblue.vote.libs.mysql</shadedPattern>
|
<shadedPattern>fr.votenetwork.libs.mysql</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
<transformers>
|
<transformers>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package fr.northblue.vote.spigot.api;
|
|
||||||
|
|
||||||
public final class NorthBlueVoteAPIHolder {
|
|
||||||
|
|
||||||
static volatile NorthBlueVoteAPI INSTANCE;
|
|
||||||
|
|
||||||
private NorthBlueVoteAPIHolder() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void set(NorthBlueVoteAPI api) {
|
|
||||||
INSTANCE = api;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void clear() {
|
|
||||||
INSTANCE = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.spigot;
|
package fr.votenetwork.spigot;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.spigot;
|
package fr.votenetwork.spigot;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
@@ -8,9 +8,9 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class VoteConfig {
|
public class VoteConfig {
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
|
|
||||||
public VoteConfig(NorthBlueVoteSpigot plugin) {
|
public VoteConfig(VoteNetworkSpigot plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class VoteConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getMysqlDatabase() {
|
public String getMysqlDatabase() {
|
||||||
return cfg().getString("mysql.database", "northblue");
|
return cfg().getString("mysql.database", "votenetwork");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMysqlUser() {
|
public String getMysqlUser() {
|
||||||
+16
-16
@@ -1,19 +1,19 @@
|
|||||||
package fr.northblue.vote.spigot;
|
package fr.votenetwork.spigot;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPI;
|
import fr.votenetwork.spigot.api.VoteNetworkAPI;
|
||||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPIHolder;
|
import fr.votenetwork.spigot.api.VoteNetworkAPIHolder;
|
||||||
import fr.northblue.vote.spigot.api.NorthBlueVoteAPIImpl;
|
import fr.votenetwork.spigot.api.VoteNetworkAPIImpl;
|
||||||
import fr.northblue.vote.spigot.command.ClaimCommand;
|
import fr.votenetwork.spigot.command.ClaimCommand;
|
||||||
import fr.northblue.vote.spigot.command.VoteAdminCommand;
|
import fr.votenetwork.spigot.command.VoteAdminCommand;
|
||||||
import fr.northblue.vote.spigot.listener.VoteMessageListener;
|
import fr.votenetwork.spigot.listener.VoteMessageListener;
|
||||||
import fr.northblue.vote.spigot.storage.MySqlPendingVoteStore;
|
import fr.votenetwork.spigot.storage.MySqlPendingVoteStore;
|
||||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||||
import fr.northblue.vote.spigot.storage.YamlPendingVoteStore;
|
import fr.votenetwork.spigot.storage.YamlPendingVoteStore;
|
||||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||||
import org.bukkit.plugin.ServicePriority;
|
import org.bukkit.plugin.ServicePriority;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class NorthBlueVoteSpigot extends JavaPlugin {
|
public class VoteNetworkSpigot extends JavaPlugin {
|
||||||
|
|
||||||
public static final String CHANNEL = "votenetwork:vote";
|
public static final String CHANNEL = "votenetwork:vote";
|
||||||
|
|
||||||
@@ -48,9 +48,9 @@ public class NorthBlueVoteSpigot extends JavaPlugin {
|
|||||||
getCommand("claim").setExecutor(new ClaimCommand(this, voteConfig, pendingVoteStore, voteParty, maintenanceState));
|
getCommand("claim").setExecutor(new ClaimCommand(this, voteConfig, pendingVoteStore, voteParty, maintenanceState));
|
||||||
getCommand("vote").setExecutor(new VoteAdminCommand(this, voteConfig, pendingVoteStore, maintenanceState));
|
getCommand("vote").setExecutor(new VoteAdminCommand(this, voteConfig, pendingVoteStore, maintenanceState));
|
||||||
|
|
||||||
NorthBlueVoteAPI api = new NorthBlueVoteAPIImpl(this, voteConfig, pendingVoteStore, voteParty, maintenanceState);
|
VoteNetworkAPI api = new VoteNetworkAPIImpl(this, voteConfig, pendingVoteStore, voteParty, maintenanceState);
|
||||||
NorthBlueVoteAPIHolder.set(api);
|
VoteNetworkAPIHolder.set(api);
|
||||||
getServer().getServicesManager().register(NorthBlueVoteAPI.class, api, this, ServicePriority.Normal);
|
getServer().getServicesManager().register(VoteNetworkAPI.class, api, this, ServicePriority.Normal);
|
||||||
|
|
||||||
getLogger().info("VoteNetwork (Spigot) demarre.");
|
getLogger().info("VoteNetwork (Spigot) demarre.");
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public class NorthBlueVoteSpigot extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
getServer().getServicesManager().unregisterAll(this);
|
getServer().getServicesManager().unregisterAll(this);
|
||||||
NorthBlueVoteAPIHolder.clear();
|
VoteNetworkAPIHolder.clear();
|
||||||
|
|
||||||
if (voteParty != null) {
|
if (voteParty != null) {
|
||||||
voteParty.save();
|
voteParty.save();
|
||||||
+7
-7
@@ -1,17 +1,17 @@
|
|||||||
package fr.northblue.vote.spigot.api;
|
package fr.votenetwork.spigot.api;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API publique NorthBlueVote, pour affichage scoreboard / GUI par d'autres plugins.
|
* API publique VoteNetwork, pour affichage scoreboard / GUI par d'autres plugins.
|
||||||
*
|
*
|
||||||
* Recuperation :
|
* Recuperation :
|
||||||
* NorthBlueVoteAPI api = NorthBlueVoteAPI.get();
|
* VoteNetworkAPI api = VoteNetworkAPI.get();
|
||||||
* ou via le ServicesManager Bukkit :
|
* ou via le ServicesManager Bukkit :
|
||||||
* RegisteredServiceProvider<NorthBlueVoteAPI> rsp = Bukkit.getServicesManager().getRegistration(NorthBlueVoteAPI.class);
|
* RegisteredServiceProvider<VoteNetworkAPI> rsp = Bukkit.getServicesManager().getRegistration(VoteNetworkAPI.class);
|
||||||
*/
|
*/
|
||||||
public interface NorthBlueVoteAPI {
|
public interface VoteNetworkAPI {
|
||||||
|
|
||||||
/** Compteur VoteParty actuel sur CE serveur (thread principal uniquement). */
|
/** Compteur VoteParty actuel sur CE serveur (thread principal uniquement). */
|
||||||
int getVotePartyCurrentVotes();
|
int getVotePartyCurrentVotes();
|
||||||
@@ -28,7 +28,7 @@ public interface NorthBlueVoteAPI {
|
|||||||
*/
|
*/
|
||||||
void getPendingVotes(UUID playerUuid, Consumer<Integer> callback);
|
void getPendingVotes(UUID playerUuid, Consumer<Integer> callback);
|
||||||
|
|
||||||
static NorthBlueVoteAPI get() {
|
static VoteNetworkAPI get() {
|
||||||
return NorthBlueVoteAPIHolder.INSTANCE;
|
return VoteNetworkAPIHolder.INSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package fr.votenetwork.spigot.api;
|
||||||
|
|
||||||
|
public final class VoteNetworkAPIHolder {
|
||||||
|
|
||||||
|
static volatile VoteNetworkAPI INSTANCE;
|
||||||
|
|
||||||
|
private VoteNetworkAPIHolder() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(VoteNetworkAPI api) {
|
||||||
|
INSTANCE = api;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clear() {
|
||||||
|
INSTANCE = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-9
@@ -1,24 +1,24 @@
|
|||||||
package fr.northblue.vote.spigot.api;
|
package fr.votenetwork.spigot.api;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.MaintenanceState;
|
import fr.votenetwork.spigot.MaintenanceState;
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class NorthBlueVoteAPIImpl implements NorthBlueVoteAPI {
|
public class VoteNetworkAPIImpl implements VoteNetworkAPI {
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
private final VoteConfig config;
|
private final VoteConfig config;
|
||||||
private final PendingVoteStore pendingVoteStore;
|
private final PendingVoteStore pendingVoteStore;
|
||||||
private final VoteParty voteParty;
|
private final VoteParty voteParty;
|
||||||
private final MaintenanceState maintenanceState;
|
private final MaintenanceState maintenanceState;
|
||||||
|
|
||||||
public NorthBlueVoteAPIImpl(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
public VoteNetworkAPIImpl(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||||
VoteParty voteParty, MaintenanceState maintenanceState) {
|
VoteParty voteParty, MaintenanceState maintenanceState) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
+8
-8
@@ -1,10 +1,10 @@
|
|||||||
package fr.northblue.vote.spigot.command;
|
package fr.votenetwork.spigot.command;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.MaintenanceState;
|
import fr.votenetwork.spigot.MaintenanceState;
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@@ -13,13 +13,13 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class ClaimCommand implements CommandExecutor {
|
public class ClaimCommand implements CommandExecutor {
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
private final VoteConfig config;
|
private final VoteConfig config;
|
||||||
private final PendingVoteStore pendingVoteStore;
|
private final PendingVoteStore pendingVoteStore;
|
||||||
private final VoteParty voteParty;
|
private final VoteParty voteParty;
|
||||||
private final MaintenanceState maintenanceState;
|
private final MaintenanceState maintenanceState;
|
||||||
|
|
||||||
public ClaimCommand(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
public ClaimCommand(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore,
|
||||||
VoteParty voteParty, MaintenanceState maintenanceState) {
|
VoteParty voteParty, MaintenanceState maintenanceState) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
+7
-7
@@ -1,9 +1,9 @@
|
|||||||
package fr.northblue.vote.spigot.command;
|
package fr.votenetwork.spigot.command;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.MaintenanceState;
|
import fr.votenetwork.spigot.MaintenanceState;
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
import fr.northblue.vote.spigot.storage.PendingVoteStore;
|
import fr.votenetwork.spigot.storage.PendingVoteStore;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@@ -12,12 +12,12 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class VoteAdminCommand implements CommandExecutor {
|
public class VoteAdminCommand implements CommandExecutor {
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
private final VoteConfig config;
|
private final VoteConfig config;
|
||||||
private final PendingVoteStore pendingVoteStore;
|
private final PendingVoteStore pendingVoteStore;
|
||||||
private final MaintenanceState maintenanceState;
|
private final MaintenanceState maintenanceState;
|
||||||
|
|
||||||
public VoteAdminCommand(NorthBlueVoteSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore, MaintenanceState maintenanceState) {
|
public VoteAdminCommand(VoteNetworkSpigot plugin, VoteConfig config, PendingVoteStore pendingVoteStore, MaintenanceState maintenanceState) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.pendingVoteStore = pendingVoteStore;
|
this.pendingVoteStore = pendingVoteStore;
|
||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
package fr.northblue.vote.spigot.listener;
|
package fr.votenetwork.spigot.listener;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
import fr.northblue.vote.spigot.voteparty.VoteParty;
|
import fr.votenetwork.spigot.voteparty.VoteParty;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
@@ -23,7 +23,7 @@ public class VoteMessageListener implements PluginMessageListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPluginMessageReceived(String channel, Player receivingPlayer, byte[] message) {
|
public void onPluginMessageReceived(String channel, Player receivingPlayer, byte[] message) {
|
||||||
if (!channel.equals(NorthBlueVoteSpigot.CHANNEL)) {
|
if (!channel.equals(VoteNetworkSpigot.CHANNEL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
package fr.northblue.vote.spigot.storage;
|
package fr.votenetwork.spigot.storage;
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@@ -18,13 +18,13 @@ import java.util.function.IntConsumer;
|
|||||||
|
|
||||||
public class MySqlPendingVoteStore implements PendingVoteStore {
|
public class MySqlPendingVoteStore implements PendingVoteStore {
|
||||||
|
|
||||||
private static final String DRIVER_CLASS = "fr.northblue.vote.libs.mysql.cj.jdbc.Driver";
|
private static final String DRIVER_CLASS = "fr.votenetwork.libs.mysql.cj.jdbc.Driver";
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
private final VoteConfig config;
|
private final VoteConfig config;
|
||||||
private HikariDataSource dataSource;
|
private HikariDataSource dataSource;
|
||||||
|
|
||||||
public MySqlPendingVoteStore(NorthBlueVoteSpigot plugin, VoteConfig config) {
|
public MySqlPendingVoteStore(VoteNetworkSpigot plugin, VoteConfig config) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.spigot.storage;
|
package fr.votenetwork.spigot.storage;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
package fr.northblue.vote.spigot.storage;
|
package fr.votenetwork.spigot.storage;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -26,7 +26,7 @@ public class YamlPendingVoteStore implements PendingVoteStore {
|
|||||||
private final File file;
|
private final File file;
|
||||||
private final ReentrantLock lock = new ReentrantLock();
|
private final ReentrantLock lock = new ReentrantLock();
|
||||||
|
|
||||||
public YamlPendingVoteStore(NorthBlueVoteSpigot plugin) {
|
public YamlPendingVoteStore(VoteNetworkSpigot plugin) {
|
||||||
this.file = new File(plugin.getDataFolder(), "pending-votes.yml");
|
this.file = new File(plugin.getDataFolder(), "pending-votes.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
package fr.northblue.vote.spigot.voteparty;
|
package fr.votenetwork.spigot.voteparty;
|
||||||
|
|
||||||
import fr.northblue.vote.spigot.NorthBlueVoteSpigot;
|
import fr.votenetwork.spigot.VoteNetworkSpigot;
|
||||||
import fr.northblue.vote.spigot.VoteConfig;
|
import fr.votenetwork.spigot.VoteConfig;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
@@ -11,12 +11,12 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
public class VoteParty {
|
public class VoteParty {
|
||||||
|
|
||||||
private final NorthBlueVoteSpigot plugin;
|
private final VoteNetworkSpigot plugin;
|
||||||
private final VoteConfig config;
|
private final VoteConfig config;
|
||||||
private final File storageFile;
|
private final File storageFile;
|
||||||
private final AtomicInteger currentVotes = new AtomicInteger(0);
|
private final AtomicInteger currentVotes = new AtomicInteger(0);
|
||||||
|
|
||||||
public VoteParty(NorthBlueVoteSpigot plugin, VoteConfig config) {
|
public VoteParty(VoteNetworkSpigot plugin, VoteConfig config) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.storageFile = new File(plugin.getDataFolder(), "voteparty.yml");
|
this.storageFile = new File(plugin.getDataFolder(), "voteparty.yml");
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: votenetwork
|
name: votenetwork
|
||||||
main: fr.northblue.vote.spigot.NorthBlueVoteSpigot
|
main: fr.votenetwork.spigot.VoteNetworkSpigot
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
api-version: 1.18
|
api-version: 1.18
|
||||||
author: VoteNetwork
|
author: VoteNetwork
|
||||||
|
|||||||
+5
-5
@@ -5,12 +5,12 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>fr.northblue</groupId>
|
<groupId>fr.votenetwork</groupId>
|
||||||
<artifactId>northblue-vote-parent</artifactId>
|
<artifactId>votenetwork-parent</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>northblue-vote-velocity</artifactId>
|
<artifactId>votenetwork-velocity</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -74,11 +74,11 @@
|
|||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.zaxxer.hikari</pattern>
|
<pattern>com.zaxxer.hikari</pattern>
|
||||||
<shadedPattern>fr.northblue.vote.libs.hikari</shadedPattern>
|
<shadedPattern>fr.votenetwork.libs.hikari</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.mysql</pattern>
|
<pattern>com.mysql</pattern>
|
||||||
<shadedPattern>fr.northblue.vote.libs.mysql</shadedPattern>
|
<shadedPattern>fr.votenetwork.libs.mysql</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
<transformers>
|
<transformers>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
@@ -38,7 +38,7 @@ public class MySqlPendingVoteStore implements PendingVoteStore {
|
|||||||
hikariConfig.setPassword(config.getPassword());
|
hikariConfig.setPassword(config.getPassword());
|
||||||
hikariConfig.setMaximumPoolSize(config.getPoolSize());
|
hikariConfig.setMaximumPoolSize(config.getPoolSize());
|
||||||
hikariConfig.setPoolName("VoteNetwork-Velocity-Pool");
|
hikariConfig.setPoolName("VoteNetwork-Velocity-Pool");
|
||||||
hikariConfig.setDriverClassName("fr.northblue.vote.libs.mysql.cj.jdbc.Driver");
|
hikariConfig.setDriverClassName("fr.votenetwork.libs.mysql.cj.jdbc.Driver");
|
||||||
hikariConfig.setInitializationFailTimeout(-1);
|
hikariConfig.setInitializationFailTimeout(-1);
|
||||||
hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
|
hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
|
||||||
hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
|
hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import com.velocitypowered.api.command.CommandSource;
|
import com.velocitypowered.api.command.CommandSource;
|
||||||
import com.velocitypowered.api.command.SimpleCommand;
|
import com.velocitypowered.api.command.SimpleCommand;
|
||||||
@@ -72,7 +72,7 @@ public class VoteCommand implements SimpleCommand {
|
|||||||
logger.error("Erreur lors de la construction du message de vote", e);
|
logger.error("Erreur lors de la construction du message de vote", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sink.sendPluginMessage(NorthBlueVoteVelocity.VOTE_CHANNEL, byteArray.toByteArray());
|
sink.sendPluginMessage(VoteNetworkVelocity.VOTE_CHANNEL, byteArray.toByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public class VoteConfig {
|
|||||||
this.storageType = properties.getProperty("storage.type", "mysql");
|
this.storageType = properties.getProperty("storage.type", "mysql");
|
||||||
this.host = properties.getProperty("mysql.host", "127.0.0.1");
|
this.host = properties.getProperty("mysql.host", "127.0.0.1");
|
||||||
this.port = Integer.parseInt(properties.getProperty("mysql.port", "3306"));
|
this.port = Integer.parseInt(properties.getProperty("mysql.port", "3306"));
|
||||||
this.database = properties.getProperty("mysql.database", "northblue");
|
this.database = properties.getProperty("mysql.database", "votenetwork");
|
||||||
this.user = properties.getProperty("mysql.user", "root");
|
this.user = properties.getProperty("mysql.user", "root");
|
||||||
this.password = properties.getProperty("mysql.password", "");
|
this.password = properties.getProperty("mysql.password", "");
|
||||||
this.poolSize = Integer.parseInt(properties.getProperty("mysql.pool-size", "5"));
|
this.poolSize = Integer.parseInt(properties.getProperty("mysql.pool-size", "5"));
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
@@ -18,7 +18,7 @@ import java.nio.file.Path;
|
|||||||
description = "Systeme de vote reseau Velocity <-> Spigot",
|
description = "Systeme de vote reseau Velocity <-> Spigot",
|
||||||
authors = {"VoteNetwork"}
|
authors = {"VoteNetwork"}
|
||||||
)
|
)
|
||||||
public class NorthBlueVoteVelocity {
|
public class VoteNetworkVelocity {
|
||||||
|
|
||||||
public static final MinecraftChannelIdentifier VOTE_CHANNEL =
|
public static final MinecraftChannelIdentifier VOTE_CHANNEL =
|
||||||
MinecraftChannelIdentifier.create("votenetwork", "vote");
|
MinecraftChannelIdentifier.create("votenetwork", "vote");
|
||||||
@@ -31,7 +31,7 @@ public class NorthBlueVoteVelocity {
|
|||||||
private PendingVoteStore pendingVoteStore;
|
private PendingVoteStore pendingVoteStore;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NorthBlueVoteVelocity(ProxyServer proxy, Logger logger, @com.velocitypowered.api.plugin.annotation.DataDirectory Path dataDirectory) {
|
public VoteNetworkVelocity(ProxyServer proxy, Logger logger, @com.velocitypowered.api.plugin.annotation.DataDirectory Path dataDirectory) {
|
||||||
this.proxy = proxy;
|
this.proxy = proxy;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.dataDirectory = dataDirectory;
|
this.dataDirectory = dataDirectory;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package fr.northblue.vote.velocity;
|
package fr.votenetwork.velocity;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
Reference in New Issue
Block a user