mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-27 09:39:26 +03:00
56 lines
1.6 KiB
Java
56 lines
1.6 KiB
Java
package pro.gravit.launchserver.socket;
|
|
|
|
import pro.gravit.launcher.ClientPermissions;
|
|
import pro.gravit.launcher.profiles.ClientProfile;
|
|
import pro.gravit.launchserver.LaunchServer;
|
|
import pro.gravit.launchserver.auth.AuthProviderPair;
|
|
import pro.gravit.launchserver.socket.response.auth.AuthResponse;
|
|
import pro.gravit.utils.helper.LogHelper;
|
|
|
|
public class Client {
|
|
public long session;
|
|
public String auth_id;
|
|
public long timestamp;
|
|
public AuthResponse.ConnectTypes type;
|
|
public ClientProfile profile;
|
|
public boolean isAuth;
|
|
public boolean checkSign;
|
|
public ClientPermissions permissions;
|
|
public String username;
|
|
public TrustLevel trustLevel;
|
|
public transient LogHelper.OutputEnity logOutput;
|
|
|
|
public transient AuthProviderPair auth;
|
|
|
|
public Client(long session) {
|
|
this.session = session;
|
|
timestamp = System.currentTimeMillis();
|
|
type = null;
|
|
isAuth = false;
|
|
permissions = ClientPermissions.DEFAULT;
|
|
username = "";
|
|
checkSign = false;
|
|
}
|
|
|
|
//Данные авторизации
|
|
public void up() {
|
|
timestamp = System.currentTimeMillis();
|
|
}
|
|
|
|
public void updateAuth(LaunchServer server) {
|
|
if (!isAuth) return;
|
|
if (auth_id.isEmpty()) auth = server.config.getAuthProviderPair();
|
|
else auth = server.config.getAuthProviderPair(auth_id);
|
|
}
|
|
|
|
public enum Type {
|
|
SERVER,
|
|
USER
|
|
}
|
|
public static class TrustLevel
|
|
{
|
|
public byte[] verifySecureKey;
|
|
public boolean keyChecked;
|
|
public byte[] publicKey;
|
|
}
|
|
}
|