forked from External/mage
Getting information about connected players in Mage Client (without gui part at the moment, only logging to console).
This commit is contained in:
parent
f55e3a88dd
commit
54adc043ec
5 changed files with 47 additions and 1 deletions
|
|
@ -28,6 +28,9 @@
|
|||
|
||||
package mage.server;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import mage.interfaces.MageException;
|
||||
|
|
@ -74,5 +77,12 @@ public class SessionManager {
|
|||
public void removeSession(UUID sessionId) {
|
||||
sessions.remove(sessionId);
|
||||
}
|
||||
|
||||
|
||||
public Map<UUID, Session> getSessions() {
|
||||
Map<UUID, Session> map = new HashMap<UUID, Session>();
|
||||
for (Map.Entry<UUID, Session> entry : sessions.entrySet()) {
|
||||
map.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue