Skip to content

Commit

Permalink
remove protocolsupport workaround, cleanup a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Jan 25, 2018
1 parent ad09705 commit af64508
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* The token is included within the player's profile properties, but removed during the handshake.
*/
public class BackendPlugin extends JavaPlugin implements Listener {
public class BungeeGuardBackendPlugin extends JavaPlugin implements Listener {
private static final Type PROPERTY_LIST_TYPE = new TypeToken<List<Property>>(){}.getType();

@Getter
Expand All @@ -41,18 +41,8 @@ public class BackendPlugin extends JavaPlugin implements Listener {

@Override
public void onEnable() {

if (getServer().getPluginManager().isPluginEnabled("ProtocolSupport")) {
getLogger().info("Using ProtocolSupport hack");
try {
ProtocolSupportHack.hook(this);
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
getLogger().info("Using Paper PlayerHandshakeEvent");
getServer().getPluginManager().registerEvents(this, this);
}
getLogger().info("Using Paper PlayerHandshakeEvent");
getServer().getPluginManager().registerEvents(this, this);

saveDefaultConfig();
FileConfiguration config = getConfig();
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions bungeeguard-backend/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: BungeeGuard
version: ${project.version}
main: me.lucko.bungeeguard.backend.BackendPlugin
softdepend: [ProtocolSupport]
main: me.lucko.bungeeguard.backend.BungeeGuardBackendPlugin
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* BungeeCord plugin which injects a special authentication token into a players
* profile properties when they connect to a backend server.
*/
public class ProxyPlugin extends Plugin implements Listener {
public class BungeeGuardProxyPlugin extends Plugin implements Listener {

// characters to use to build our token
// characters to use to build a token
private static final String TOKEN_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public Property[] getProperties() {
}

private Property[] getSpoofedProperties(Property[] properties) {
LoginResult.Property[] newProperties = Arrays.copyOf(properties, properties.length + 1);
newProperties[properties.length] = new LoginResult.Property("bungeeguard-token", extraToken, "");
Property[] newProperties = Arrays.copyOf(properties, properties.length + 1);
newProperties[properties.length] = new Property("bungeeguard-token", extraToken, "");
return newProperties;
}

Expand Down
2 changes: 1 addition & 1 deletion bungeeguard-proxy/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: BungeeGuard
version: ${project.version}
main: me.lucko.bungeeguard.proxy.ProxyPlugin
main: me.lucko.bungeeguard.proxy.BungeeGuardProxyPlugin

0 comments on commit af64508

Please sign in to comment.