This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
516 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/quest/ender/Matchmaker/command/ReloadCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package quest.ender.Matchmaker.command; | ||
|
||
import net.md_5.bungee.api.ChatColor; | ||
import net.md_5.bungee.api.CommandSender; | ||
import net.md_5.bungee.api.chat.ComponentBuilder; | ||
import net.md_5.bungee.api.plugin.Command; | ||
import org.jetbrains.annotations.NotNull; | ||
import quest.ender.Matchmaker.Matchmaker; | ||
|
||
public class ReloadCommand extends Command { | ||
private final @NotNull Matchmaker matchmaker; | ||
|
||
public ReloadCommand(@NotNull Matchmaker matchmaker, String name) { | ||
super(name); | ||
this.matchmaker = matchmaker; | ||
} | ||
|
||
public ReloadCommand(@NotNull Matchmaker matchmaker, String name, String permission, String... aliases) { | ||
super(name, permission, aliases); | ||
this.matchmaker = matchmaker; | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String[] args) { | ||
this.matchmaker.reloadConfig(); | ||
sender.sendMessage(new ComponentBuilder("Reloaded configuration.").color(ChatColor.GREEN).create()); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/quest/ender/Matchmaker/handler/ForcedServerReconnectHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package quest.ender.Matchmaker.handler; | ||
|
||
import net.md_5.bungee.api.ReconnectHandler; | ||
import net.md_5.bungee.api.config.ServerInfo; | ||
import net.md_5.bungee.api.connection.ProxiedPlayer; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ForcedServerReconnectHandler implements ReconnectHandler { | ||
private final @NotNull ServerInfo targetServerInfo; | ||
|
||
public ForcedServerReconnectHandler(@NotNull ServerInfo targetServerInfo) { | ||
this.targetServerInfo = targetServerInfo; | ||
} | ||
|
||
@Override | ||
public ServerInfo getServer(ProxiedPlayer player) { | ||
return targetServerInfo; | ||
} | ||
|
||
@Override | ||
public void setServer(ProxiedPlayer player) { | ||
/* no-op, we don't implement this */ | ||
} | ||
|
||
@Override | ||
public void save() { | ||
/* no-op, we don't implement this */ | ||
} | ||
|
||
@Override | ||
public void close() { | ||
/* no-op, we don't implement this */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.