Launcher/LaunchServer/src/main/java/ru/gravit/launchserver/socket/Client.java

52 lines
1.4 KiB
Java
Raw Normal View History

2018-09-17 10:07:32 +03:00
package ru.gravit.launchserver.socket;
import ru.gravit.launcher.ClientPermissions;
import ru.gravit.launcher.profiles.ClientProfile;
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.auth.AuthProviderPair;
2019-02-17 10:24:20 +03:00
import ru.gravit.utils.helper.LogHelper;
2018-09-27 00:18:26 +03:00
2018-09-17 10:07:32 +03:00
public class Client {
public long session;
public boolean proxy;
public String auth_id;
2018-09-17 10:07:32 +03:00
public long timestamp;
2018-09-27 00:18:26 +03:00
public Type type;
public ClientProfile profile;
public boolean isAuth;
public boolean checkSign;
2019-04-12 00:58:45 +03:00
public boolean isSecure;
2018-10-01 13:08:16 +03:00
public ClientPermissions permissions;
public String username;
2019-04-13 17:29:12 +03:00
public String verifyToken;
public transient LogHelper.OutputEnity logOutput;
2018-09-22 17:33:00 +03:00
public transient AuthProviderPair auth;
2018-09-17 10:07:32 +03:00
public Client(long session) {
this.session = session;
timestamp = System.currentTimeMillis();
2018-09-27 00:18:26 +03:00
type = Type.USER;
isAuth = false;
2018-10-01 13:08:16 +03:00
permissions = ClientPermissions.DEFAULT;
username = "";
checkSign = false;
2018-09-17 10:07:32 +03:00
}
2018-11-08 15:30:16 +03:00
//Данные авторизации
2018-09-17 10:07:32 +03:00
public void up() {
timestamp = System.currentTimeMillis();
}
2019-04-03 16:27:40 +03:00
public void updateAuth() {
if (!isAuth) return;
if (auth_id.isEmpty()) auth = LaunchServer.server.config.getAuthProviderPair();
else auth = LaunchServer.server.config.getAuthProviderPair(auth_id);
}
2018-11-08 15:30:16 +03:00
public enum Type {
2018-09-27 00:18:26 +03:00
SERVER,
USER
}
2018-09-17 10:07:32 +03:00
}