This is version 2.1

This commit is contained in:
Jaime Martínez Rincón 2017-09-17 21:40:19 +02:00
parent 1538f48159
commit dc69839366
4 changed files with 7 additions and 21 deletions

View File

@ -6,15 +6,4 @@
### Build
* Clone this repository
* Run the appropriate setup script according to your OS
* Build with maven
### Things to do:
- [ ] Create a spigot addon that adds connector signs and placeholders
- [ ] Separate the types of connections in classes instead of being in ConnectionIntent
- [x] Make the plugin API be not so dependent on a instance of PlayerBalancer
- [ ] Separate connection providers in classes instead of being hardcoded in an enum
- [ ] Implement fast connect (dimension change)
- [ ] Implement a way to redirect premium players to a section and cracked ones to other section (not sure how this works)
- [x] Unify the code that loads serverName into a section (duplicated at SectionManager and ServerSection)
- [x] Unify some of the code used in the FallbackCommand and SectionCommand
- [x] Make the section initialization work in stages instead of being hardcoded
* Build with maven

View File

@ -6,7 +6,7 @@
<groupId>com.jaimemartz</groupId>
<artifactId>playerbalancer</artifactId>
<version>2.1-dev</version>
<version>2.1</version>
<name>PlayerBalancer</name>
<properties>
@ -18,10 +18,6 @@
<id>inventive-repo</id>
<url>https://repo.inventivetalent.org/content/groups/public/</url>
</repository>
<repository>
<id>xephi-repo</id>
<url>http://ci.xephi.fr/plugin/repository/everything/</url>
</repository>
<repository>
<id>bstats-repo</id>
<url>http://repo.bstats.org/content/repositories/releases/</url>

View File

@ -42,7 +42,7 @@ public abstract class ConnectionIntent {
}
if (section.getImplicitProvider() != ProviderType.NONE) {
ServerInfo target = this.fetchServer(plugin, player, section, provider, servers);
ServerInfo target = this.fetchServer(player, section, provider, servers);
if (target != null) {
this.connect(target, (response, throwable) -> {
if (response) { //only if the connect has been executed correctly
@ -69,7 +69,7 @@ public abstract class ConnectionIntent {
this(plugin, player, section.getImplicitProvider(), section, servers);
}
private ServerInfo fetchServer(PlayerBalancer plugin, ProxiedPlayer player, ServerSection section, ProviderType provider, List<ServerInfo> servers) {
private ServerInfo fetchServer(ProxiedPlayer player, ServerSection section, ProviderType provider, List<ServerInfo> servers) {
if (plugin.getSectionManager().isReiterative(section)) {
if (ServerAssignRegistry.hasAssignedServer(player, section)) {
ServerInfo target = ServerAssignRegistry.getAssignedServer(player, section);

View File

@ -24,8 +24,8 @@ general {
# Effectively remove (i.e comment) a message to disable it
# Supported variables are shown in the default messages
messages {
# connecting-server="&aConnecting to a {section} server" # this message is disabled by default!
connected-server="&aConnected to {server}"
connecting-server="&aConnecting to a {section} server"
invalid-input="&cThis is an invalid input type for this command"
misc-failure="&cCould not find a server to get connected to"
player-bypass="&cYou have not been moved because you have the playerbalancer.bypass permission"
@ -42,6 +42,8 @@ features {
# If a section does not have a provider it will be inherit from the parent
# The best way to understand this is to play around with it
# You can use regex to match a set of servers instead of adding each server
# You can have as many sections as you want, there is no limit here
# When connecting to a server in a section, you get redirected
# Providers you can use:
# NONE: Returns no server (no one will be able to connect to this section)
@ -63,7 +65,6 @@ features {
general-lobbies {
parent="auth-lobbies"
provider=RANDOM
servers=[
"Lobby1",
"Lobby2",