SHA256
API: добавить online-флаг для ListSessions
This commit is contained in:
+2
@@ -2,6 +2,7 @@ package server.logic.ws_protocol.JSON.handlers.auth;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.logic.ws_protocol.JSON.ActiveConnectionsRegistry;
|
||||
import server.logic.ws_protocol.JSON.ConnectionContext;
|
||||
import server.logic.ws_protocol.JSON.entyties.Net_Request;
|
||||
import server.logic.ws_protocol.JSON.entyties.Net_Response;
|
||||
@@ -68,6 +69,7 @@ public class Net_ListSessions_Handler implements JsonMessageHandler {
|
||||
info.setClientInfoFromRequest(s.getClientInfoFromRequest());
|
||||
info.setSessionType(s.getSessionType());
|
||||
info.setClientPlatform(s.getClientPlatform());
|
||||
info.setOnlineOnThisServer(ActiveConnectionsRegistry.getInstance().getBySessionId(s.getSessionId()) != null);
|
||||
info.setLastAuthenticatedAtMs(s.getLastAuthirificatedAtMs());
|
||||
|
||||
String ip = s.getClientIp();
|
||||
|
||||
+11
@@ -58,6 +58,9 @@ public class Net_ListSessions_Response extends Net_Response {
|
||||
/** Свободная строка платформы, как её прислал клиент. */
|
||||
private String clientPlatform;
|
||||
|
||||
/** Подключена ли эта сессия прямо сейчас к данному серверу. */
|
||||
private boolean onlineOnThisServer;
|
||||
|
||||
/** Строка геолокации вида "Country, City" или "unknown". */
|
||||
private String geo;
|
||||
|
||||
@@ -106,6 +109,14 @@ public class Net_ListSessions_Response extends Net_Response {
|
||||
this.clientPlatform = clientPlatform;
|
||||
}
|
||||
|
||||
public boolean isOnlineOnThisServer() {
|
||||
return onlineOnThisServer;
|
||||
}
|
||||
|
||||
public void setOnlineOnThisServer(boolean onlineOnThisServer) {
|
||||
this.onlineOnThisServer = onlineOnThisServer;
|
||||
}
|
||||
|
||||
public String getGeo() {
|
||||
return geo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user