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
42 changed files
with
442 additions
and
795 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
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> | ||
|
||
<groupId>net.ME1312.SubServers</groupId> | ||
<artifactId>SubServers.Bungee.Common</artifactId> | ||
<version>-PLACEHOLDER</version> | ||
<packaging>jar</packaging> | ||
|
||
<repositories> | ||
<repository> | ||
<id>md_5-repo</id> | ||
<url>http://repo.md-5.net/content/repositories/snapshots/</url> | ||
</repository> | ||
<repository> | ||
<id>me1312-repo</id> | ||
<url>https://dev.me1312.net/maven</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>net.md_5</groupId> | ||
<artifactId>bungeecord-internal</artifactId> | ||
<version>1.15-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>net.ME1312.Galaxi</groupId> | ||
<artifactId>GalaxiUtil</artifactId> | ||
<version>20w33a</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>net.ME1312.Galaxi</groupId> | ||
<artifactId>GalaxiEngine</artifactId> | ||
<version>20w33a</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<directory>../../out/compile/target/SubServers.Bungee.Common</directory> | ||
<sourceDirectory>src</sourceDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src</directory> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.7.0</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
126 changes: 126 additions & 0 deletions
126
SubServers.Bungee/common/src/net/ME1312/SubServers/Bungee/BungeeAPI.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,126 @@ | ||
package net.ME1312.SubServers.Bungee; | ||
|
||
import net.ME1312.Galaxi.Library.UniversalFile; | ||
import net.ME1312.Galaxi.Library.Util; | ||
import net.ME1312.Galaxi.Library.Version.Version; | ||
import net.ME1312.SubServers.Bungee.Library.Compatibility.RemotePlayer; | ||
import net.md_5.bungee.api.ProxyServer; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* SubAPI BungeeCord Common Class | ||
*/ | ||
public interface BungeeAPI { | ||
|
||
/** | ||
* Gets the SubAPI BungeeCord Common Methods | ||
* | ||
* @return SubAPI BungeeCord Common | ||
*/ | ||
static BungeeAPI getInstance() { | ||
return ((BungeeCommon) ProxyServer.getInstance()).api.run(); | ||
} | ||
|
||
/** | ||
* Adds a SubAPI Listener | ||
* | ||
* @param enable An Event that will be called when SubAPI is ready | ||
* @param disable An Event that will be called before SubAPI is disabled (your plugin should reset it's values in case this is a hard-reset instead of a shutdown) | ||
*/ | ||
void addListener(Runnable enable, Runnable disable); | ||
|
||
/** | ||
* Get the number of players on this network across all known proxies | ||
* | ||
* @return Remote Player Collection | ||
*/ | ||
default int getRemotePlayerCount() { | ||
return getGlobalPlayers().size(); | ||
} | ||
|
||
/** | ||
* Get players on this network across all known proxies | ||
* | ||
* @return Remote Player Collection | ||
*/ | ||
Map<UUID, ? extends RemotePlayer> getGlobalPlayers(); | ||
|
||
/** | ||
* Get a player on this network by searching across all known proxies | ||
* | ||
* @param name Player name | ||
* @return Remote Player | ||
*/ | ||
RemotePlayer getGlobalPlayer(String name); | ||
|
||
/** | ||
* Get a player on this network by searching across all known proxies | ||
* | ||
* @param id Player UUID | ||
* @return Remote Player | ||
*/ | ||
RemotePlayer getGlobalPlayer(UUID id); | ||
|
||
/** | ||
* Gets the current SubServers Lang Channels | ||
* | ||
* @return SubServers Lang Channel list | ||
*/ | ||
Collection<String> getLangChannels(); | ||
|
||
/** | ||
* Gets values from the SubServers Lang | ||
* | ||
* @param channel Lang Channel | ||
* @return Lang Value | ||
*/ | ||
Map<String, String> getLang(String channel); | ||
|
||
/** | ||
* Gets a value from the SubServers Lang | ||
* | ||
* @param channel Lang Channel | ||
* @param key Key | ||
* @return Lang Values | ||
*/ | ||
default String getLang(String channel, String key) { | ||
if (Util.isNull(channel, key)) throw new NullPointerException(); | ||
return getLang(channel).get(key); | ||
} | ||
|
||
/** | ||
* Gets the Runtime Directory | ||
* | ||
* @return Directory | ||
*/ | ||
UniversalFile getRuntimeDirectory(); | ||
|
||
/** | ||
* Gets the SubServers Version | ||
* | ||
* @return SubServers Version | ||
*/ | ||
Version getWrapperVersion(); | ||
|
||
/** | ||
* Gets the SubServers Build Signature | ||
* | ||
* @return SubServers Build Signature (or null if unsigned) | ||
*/ | ||
Version getWrapperBuild(); | ||
|
||
/** | ||
* Gets the BungeeCord Version | ||
* | ||
* @return BungeeCord Version | ||
*/ | ||
Version getProxyVersion(); | ||
|
||
/** | ||
* Get an array of compatible Minecraft Versions | ||
* | ||
* @return Minecraft Versions | ||
*/ | ||
Version[] getGameVersion(); | ||
} |
33 changes: 33 additions & 0 deletions
33
SubServers.Bungee/common/src/net/ME1312/SubServers/Bungee/BungeeCommon.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,33 @@ | ||
package net.ME1312.SubServers.Bungee; | ||
|
||
import net.ME1312.Galaxi.Library.Callback.ReturnRunnable; | ||
import net.md_5.bungee.BungeeCord; | ||
import net.md_5.bungee.api.config.ServerInfo; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
/** | ||
* BungeeCord Common Layout Class | ||
*/ | ||
public abstract class BungeeCommon extends BungeeCord { | ||
final ReturnRunnable<BungeeAPI> api; | ||
|
||
protected BungeeCommon(ReturnRunnable<BungeeAPI> api) throws IOException { | ||
this.api = api; | ||
} | ||
|
||
/** | ||
* Get the name from BungeeCord's original signature (for determining which fork is being used) | ||
* | ||
* @return BungeeCord Software Name | ||
*/ | ||
public abstract String getBungeeName(); | ||
|
||
/** | ||
* Waterfall's getServersCopy() | ||
* | ||
* @return Server Map Copy | ||
*/ | ||
public abstract Map<String, ServerInfo> getServersCopy(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
45 changes: 45 additions & 0 deletions
45
...rs.Bungee/common/src/net/ME1312/SubServers/Bungee/Library/Compatibility/RemotePlayer.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,45 @@ | ||
package net.ME1312.SubServers.Bungee.Library.Compatibility; | ||
|
||
import java.net.InetSocketAddress; | ||
import java.util.UUID; | ||
|
||
/** | ||
* RemotePlayer Layout Class | ||
*/ | ||
public interface RemotePlayer { | ||
|
||
/** | ||
* Get the UUID of this player. | ||
* | ||
* @return the UUID | ||
*/ | ||
UUID getUniqueId(); | ||
|
||
/** | ||
* Get the unique name of this player. | ||
* | ||
* @return the players username | ||
*/ | ||
String getName(); | ||
|
||
/** | ||
* Gets the remote address of this connection. | ||
* | ||
* @return the remote address | ||
*/ | ||
InetSocketAddress getAddress(); | ||
|
||
/** | ||
* Gets the name of the proxy this player is connected to. | ||
* | ||
* @return the name of the proxy this player is connected to | ||
*/ | ||
String getProxyName(); | ||
|
||
/** | ||
* Gets the name of the server this player is connected to. | ||
* | ||
* @return the name of the server this player is connected to | ||
*/ | ||
String getServerName(); | ||
} |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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.