25 lines
652 B
Java
25 lines
652 B
Java
package envoy.server.util;
|
|
|
|
import envoy.server.net.ConnectionManager;
|
|
|
|
/**
|
|
* @author Leon Hofmeister
|
|
* @since Envoy Server v0.3-beta
|
|
*/
|
|
public final class UserAuthenticationUtil {
|
|
|
|
private UserAuthenticationUtil() {}
|
|
|
|
/**
|
|
* Checks whether a user is really who he claims to be.
|
|
*
|
|
* @param expectedID the expected user ID
|
|
* @param socketID the socket ID of the user making a request
|
|
* @return whether this user is who he claims to be
|
|
* @since Envoy Server v0.3-beta
|
|
*/
|
|
public static boolean isExpectedUser(long expectedID, long socketID) {
|
|
return ConnectionManager.getInstance().getUserIDBySocketID(socketID) == expectedID;
|
|
}
|
|
}
|