Search in sources :

Example 11 with GUID

use of games.strategy.net.GUID in project triplea by triplea-game.

the class UnifiedMessenger method messengerInvalid.

private void messengerInvalid() {
    synchronized (pendingLock) {
        for (final GUID id : pendingInvocations.keySet()) {
            final CountDownLatch latch = pendingInvocations.remove(id);
            latch.countDown();
            results.put(id, new RemoteMethodCallResults(new ConnectionLostException("Connection Lost")));
        }
    }
}
Also used : ConnectionLostException(games.strategy.engine.message.ConnectionLostException) RemoteMethodCallResults(games.strategy.engine.message.RemoteMethodCallResults) GUID(games.strategy.net.GUID) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 12 with GUID

use of games.strategy.net.GUID in project triplea by triplea-game.

the class LobbyGameController method connectionLost.

private void connectionLost(final INode to) {
    final List<GUID> removed = new ArrayList<>();
    synchronized (mutex) {
        final Iterator<GUID> keys = allGames.keySet().iterator();
        while (keys.hasNext()) {
            final GUID key = keys.next();
            final GameDescription game = allGames.get(key);
            if (game.getHostedBy().equals(to)) {
                keys.remove();
                removed.add(key);
            }
        }
    }
    for (final GUID guid : removed) {
        broadcaster.gameRemoved(guid);
    }
}
Also used : GUID(games.strategy.net.GUID) ArrayList(java.util.ArrayList)

Aggregations

GUID (games.strategy.net.GUID)12 RemoteMethodCallResults (games.strategy.engine.message.RemoteMethodCallResults)4 PlayerID (games.strategy.engine.data.PlayerID)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 SpokeInvoke (games.strategy.engine.message.SpokeInvoke)2 Test (org.junit.jupiter.api.Test)2 Unit (games.strategy.engine.data.Unit)1 GameDescription (games.strategy.engine.lobby.server.GameDescription)1 ConnectionLostException (games.strategy.engine.message.ConnectionLostException)1 HubInvocationResults (games.strategy.engine.message.HubInvocationResults)1 HubInvoke (games.strategy.engine.message.HubInvoke)1 RemoteNotFoundException (games.strategy.engine.message.RemoteNotFoundException)1 SpokeInvocationResults (games.strategy.engine.message.SpokeInvocationResults)1 ArrayList (java.util.ArrayList)1