Обновление протокола для неавторизованных звонков
This commit is contained in:
@@ -150,6 +150,7 @@ public class Server extends WebSocketServer {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
client.disconnect(ServerFailures.BAD_PACKET);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user