Improved ban disconnect handling

Signed-off-by: WolverinDEV <git@teaspeak.de>
canary
WolverinDEV 2019-12-21 16:23:35 +01:00
parent a842cffd74
commit cd01b9d89e
No known key found for this signature in database
GPG Key ID: 77A6C15085150EEB
2 changed files with 4 additions and 13 deletions

View File

@ -554,17 +554,8 @@ class ConnectionHandler {
auto_reconnect = false;
break;
case DisconnectReason.HANDSHAKE_BANNED:
this.log.log(log.server.Type.SERVER_BANNED, {
invoker: {
client_name: data["invokername"],
client_id: parseInt(data["invokerid"]),
client_unique_id: data["invokeruid"]
},
message: data["reasonmsg"],
time: parseInt(data["time"])
});
this.sound.play(Sound.CONNECTION_BANNED); //TODO findout if it was a disconnect or a connect refuse
//Reason message already printed because of the command error handling
this.sound.play(Sound.CONNECTION_BANNED);
break;
case DisconnectReason.CLIENT_BANNED:
this.log.log(log.server.Type.SERVER_BANNED, {
@ -577,7 +568,7 @@ class ConnectionHandler {
message: data["reasonmsg"],
time: parseInt(data["time"])
});
this.sound.play(Sound.CONNECTION_BANNED); //TODO findout if it was a disconnect or a connect refuse
this.sound.play(Sound.CONNECTION_BANNED);
break;
default:
log.error(LogCategory.CLIENT, tr("Got uncaught disconnect!"));

View File

@ -131,7 +131,7 @@ namespace connection {
if(error.id == 1028) {
this.connection.client.handleDisconnect(DisconnectReason.SERVER_REQUIRES_PASSWORD);
} else if(error.id == 783 || error.id == 519) {
error.extra_message = parseInt(error.extra_message) == NaN ? "8" : error.extra_message;
error.extra_message = isNaN(parseInt(error.extra_message)) ? "8" : error.extra_message;
this.connection.client.handleDisconnect(DisconnectReason.IDENTITY_TOO_LOW, error);
} else if(error.id == 3329) {
this.connection.client.handleDisconnect(DisconnectReason.HANDSHAKE_BANNED, error);