mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-02-04 02:57:41 +00:00
fix ipv6 bug
This commit is contained in:
BIN
bin/main/blacklisted.png
Normal file
BIN
bin/main/blacklisted.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
10
bin/main/bungee.yml
Normal file
10
bin/main/bungee.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
name: ${plugin_name}
|
||||||
|
version: ${plugin_vers}
|
||||||
|
main: xyz.webmc.${plugin_iden}.bungee.${plugin_name}Bungee
|
||||||
|
description: ${plugin_desc}
|
||||||
|
website: ${plugin_site}
|
||||||
|
author: [${plugin_athr}]
|
||||||
|
contributors: [${plugin_ctbr}]
|
||||||
|
depends: [${plugin_depb}]
|
||||||
|
provides: [${plugin_prov}]
|
||||||
|
softdepend: [${plugin_sdpb}]
|
||||||
12
bin/main/plugin.yml
Normal file
12
bin/main/plugin.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
name: ${plugin_name}
|
||||||
|
version: ${plugin_vers}
|
||||||
|
main: xyz.webmc.${plugin_iden}.bukkit.${plugin_name}Bukkit
|
||||||
|
description: ${plugin_desc}
|
||||||
|
website: ${plugin_site}
|
||||||
|
authors: [${plugin_athr}]
|
||||||
|
contributors: [${plugin_ctbr}]
|
||||||
|
depend: [${plugin_depa}]
|
||||||
|
provides: [${plugin_prov}]
|
||||||
|
softdepend: [${plugin_sdpa}]
|
||||||
|
commands:
|
||||||
|
originblacklist:
|
||||||
10
bin/main/velocity-plugin.json
Normal file
10
bin/main/velocity-plugin.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"id": "${plugin_iden}",
|
||||||
|
"name": "${plugin_name}",
|
||||||
|
"version": "${plugin_vers}",
|
||||||
|
"description": "${plugin_desc}",
|
||||||
|
"website": "${plugin_site}",
|
||||||
|
"main": "xyz.webmc.${plugin_iden}.velocity.${plugin_name}Velocity",
|
||||||
|
"authors": [${plugin_athr}],
|
||||||
|
"dependencies": [${plugin_depc}]
|
||||||
|
}
|
||||||
BIN
bin/main/xyz/webmc/originblacklist/base/OriginBlacklist.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/OriginBlacklist.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/main/xyz/webmc/originblacklist/base/command/ICommand.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/command/ICommand.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/xyz/webmc/originblacklist/base/enums/EnumLogLevel.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/enums/EnumLogLevel.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/xyz/webmc/originblacklist/base/util/ChatFormat.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/util/ChatFormat.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/xyz/webmc/originblacklist/base/util/OPlayer.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/util/OPlayer.class
Normal file
Binary file not shown.
BIN
bin/main/xyz/webmc/originblacklist/base/util/UpdateChecker.class
Normal file
BIN
bin/main/xyz/webmc/originblacklist/base/util/UpdateChecker.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -78,25 +78,42 @@ public final class OPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final String formatIPAddress(String addr) {
|
private static final String formatIPAddress(String addr) {
|
||||||
if (addr.startsWith("/")) {
|
if (addr == null) {
|
||||||
addr = addr.substring(1);
|
addr = OriginBlacklist.UNKNOWN_STR;
|
||||||
}
|
} else {
|
||||||
|
if (addr.startsWith("/")) {
|
||||||
|
addr = addr.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
int i = addr.lastIndexOf('/');
|
int i = addr.lastIndexOf('/');
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
addr = addr.substring(i + 1);
|
addr = addr.substring(i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addr.startsWith("[")) {
|
if (addr.startsWith("[")) {
|
||||||
i = addr.indexOf(']');
|
i = addr.indexOf(']');
|
||||||
if (i != -1)
|
if (i != -1) {
|
||||||
return addr.substring(1, i);
|
addr = addr.substring(1, i);
|
||||||
return addr.substring(1);
|
} else {
|
||||||
}
|
addr = addr.substring(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i = addr.lastIndexOf(':');
|
||||||
|
if (i != -1) {
|
||||||
|
String a = addr.substring(0, i);
|
||||||
|
String p = addr.substring(i + 1);
|
||||||
|
|
||||||
i = addr.lastIndexOf(':');
|
boolean port = !p.isEmpty();
|
||||||
if (i != -1) {
|
for (int j = 0; j < p.length() && port; j++) {
|
||||||
addr = addr.substring(0, i);
|
char c = p.charAt(j);
|
||||||
|
port = (c >= '0' && c <= '9');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port && a.indexOf('.') != -1) {
|
||||||
|
addr = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user