Skip to content

Commit 58e9819

Browse files
committed
fix webhook with ipv6
1 parent 6e1d5d1 commit 58e9819

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99

1010
group = 'dev.colbster937'
11-
version = '1.1.0'
11+
version = '1.1.1'
1212
description = 'A reimplementation of OriginBlacklist for EaglerXServer'
1313
def targetJavaVersion = 17
1414

src/main/java/dev/colbster937/originblacklist/base/Base.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ public static void webhook(IEaglerLoginConnection plr, String origin, String bra
256256
}
257257

258258
public static String getAddr(IEaglerLoginConnection plr) {
259-
return (plr.getPlayerAddress() != null ? plr.getPlayerAddress().toString().substring(1) : "undefined:undefined").split(":")[0];
259+
var addr1 = plr.getPlayerAddress() != null ? plr.getPlayerAddress().toString().substring(1) : "undefined:undefined";
260+
var addr2 = addr1.lastIndexOf(':') != -1 ? addr1.substring(0, addr1.lastIndexOf(':')) : addr1;
261+
return addr2;
260262
}
261263

262264
public static void init() {

0 commit comments

Comments
 (0)