Обновление протокола для неавторизованных звонков

This commit is contained in:
RoyceDa
2026-04-04 18:31:05 +02:00
parent 3c6b2e0e71
commit 939a4d55f4
10 changed files with 427 additions and 128 deletions

View File

@@ -150,6 +150,7 @@ public class Server extends WebSocketServer {
}
} catch (Exception e) {
client.disconnect(ServerFailures.BAD_PACKET);
e.printStackTrace();
}
}

View File

@@ -239,17 +239,18 @@ public class Client {
* @param client клиент
* @return true если это один и тот же клиент, false если нет
*/
public boolean equals(Client client) {
if(client == null){
return false;
}
if(!(client instanceof Client)){
return false;
}
if(!client.getClientId().equals(this.clientId)){
return false;
}
return true;
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Client client = (Client) obj;
return this.clientId != null && this.clientId.equals(client.clientId);
}
@Override
public int hashCode() {
return this.clientId == null ? 0 : this.clientId.hashCode();
}
}