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
|
|
@ -34,6 +34,7 @@ import java.rmi.registry.Registry;
|
|||
import java.rmi.server.ExportException;
|
||||
import java.rmi.server.RemoteServer;
|
||||
import java.rmi.server.UnicastRemoteObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
@ -220,6 +221,22 @@ public class ServerImpl extends RemoteServer implements Server {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getConnectedPlayers(UUID roomId) throws MageException {
|
||||
try {
|
||||
List<String> players = new ArrayList<String>();
|
||||
for (Session session : SessionManager.getInstance().getSessions().values()) {
|
||||
players.add(session.getUsername());
|
||||
}
|
||||
return players;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableView getTable(UUID roomId, UUID tableId) throws MageException {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue