geforkt von Mirrors/Velocity
Fix plugin message forwarding from server to client.
Dieser Commit ist enthalten in:
Ursprung
73e3e1752a
Commit
762d9a3efb
@ -84,11 +84,6 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(PluginMessage packet) {
|
public boolean handle(PluginMessage packet) {
|
||||||
MinecraftConnection smc = serverConn.getConnection();
|
|
||||||
if (smc == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!canForwardPluginMessage(packet)) {
|
if (!canForwardPluginMessage(packet)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -117,14 +112,15 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MinecraftConnection clientConn = serverConn.getPlayer().getConnection();
|
||||||
PluginMessageEvent event = new PluginMessageEvent(serverConn, serverConn.getPlayer(), id,
|
PluginMessageEvent event = new PluginMessageEvent(serverConn, serverConn.getPlayer(), id,
|
||||||
packet.getData());
|
packet.getData());
|
||||||
server.getEventManager().fire(event)
|
server.getEventManager().fire(event)
|
||||||
.thenAcceptAsync(pme -> {
|
.thenAcceptAsync(pme -> {
|
||||||
if (pme.getResult().isAllowed() && serverConn.isActive()) {
|
if (pme.getResult().isAllowed() && !clientConn.isClosed()) {
|
||||||
smc.write(packet);
|
clientConn.write(packet);
|
||||||
}
|
}
|
||||||
}, smc.eventLoop());
|
}, clientConn.eventLoop());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren