forked from External/mage
Added connection speed information per user (milliseconds the ping needs). Some minor changes to server console.
This commit is contained in:
parent
1285df5da3
commit
b98c16f061
20 changed files with 166 additions and 54 deletions
|
|
@ -330,8 +330,8 @@ public class MageServerImpl implements MageServer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean ping(String sessionId) {
|
||||
return SessionManager.getInstance().extendUserSession(sessionId);
|
||||
public boolean ping(String sessionId, String pingInfo) {
|
||||
return SessionManager.getInstance().extendUserSession(sessionId, pingInfo);
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
|
@ -959,6 +959,13 @@ public class MageServerImpl implements MageServer {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user data for admin console
|
||||
*
|
||||
* @param sessionId
|
||||
* @return
|
||||
* @throws MageException
|
||||
*/
|
||||
@Override
|
||||
public List<UserView> getUsers(String sessionId) throws MageException {
|
||||
return executeWithResult("getUsers", sessionId, new ActionWithNullNegativeResult<List<UserView>>() {
|
||||
|
|
@ -966,7 +973,8 @@ public class MageServerImpl implements MageServer {
|
|||
public List<UserView> execute() throws MageException {
|
||||
List<UserView> users = new ArrayList<>();
|
||||
for (User user : UserManager.getInstance().getUsers()) {
|
||||
users.add(new UserView(user.getName(), user.getHost(), user.getSessionId(), user.getConnectionTime()));
|
||||
|
||||
users.add(new UserView(user.getName(), user.getHost(), user.getSessionId(), user.getConnectionTime(), user.getGameInfo()));
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue