Message to the player when the voice/mobile phone connection is terminated

master
Alex 2022-03-13 21:40:59 +01:00
parent c102ed96d3
commit 4c282110ce
1 changed files with 9 additions and 6 deletions

View File

@ -161,22 +161,25 @@ public class SocketClientMessageListener implements KraSocketClientEventInterfac
"cmdNumber 53874 answered back to uuid:" + kraProtocolMessage.getUuid()
+ " cmdIDByBackend:"
+ kraProtocolMessage.getCmdID());
break;
}
case 64247: // mobile connection closed
case 22348: { // voice connection closed
ProxyServer.getInstance().getScheduler().runAsync(ProxySystem.getInstance(), () -> {
ProxiedPlayer proxiedPlayer = ProxySystem.getInstance().getProxy()
.getPlayer(UUID.fromString(kraProtocolMessage.getUuid()));
ProxyServer.getInstance().getLogger()
.info("mobile connection closed " + kraProtocolMessage.getUuid() + ":"
+ "player " + proxiedPlayer);
if (proxiedPlayer != null) {
proxiedPlayer.sendMessage(new TextComponent("§5Mobile §8» §cConnection lost!"));
if (kraProtocolMessage.getCmdNumber() == 64247) {
proxiedPlayer.sendMessage(new TextComponent("§5Mobile §8» §cConnection closed!"));
} else {
proxiedPlayer.sendMessage(new TextComponent("§5Voice §8» §cConnection closed!"));
}
}
});
break;
}// voice connection closed
default:
break;