Package org.ggp.base.server.event

Examples of org.ggp.base.server.event.ServerTimeoutEvent


        // Add error events to mostRecentErrors for recording.
        if (event instanceof ServerIllegalMoveEvent) {
            ServerIllegalMoveEvent sEvent = (ServerIllegalMoveEvent)event;
            mostRecentErrors.put(sEvent.getRole(), "IL " + sEvent.getMove());
        } else if (event instanceof ServerTimeoutEvent) {
            ServerTimeoutEvent sEvent = (ServerTimeoutEvent)event;
            mostRecentErrors.put(sEvent.getRole(), "TO");
        } else if (event instanceof ServerConnectionErrorEvent) {
            ServerConnectionErrorEvent sEvent = (ServerConnectionErrorEvent)event;
            mostRecentErrors.put(sEvent.getRole(), "CE");
        }
    }
View Full Code Here


  {
    try {
      String response = HttpRequest.issueRequest(host, port, playerName, request, timeout);
      handleResponse(response);
    } catch (SocketTimeoutException e) {
      gameServer.notifyObservers(new ServerTimeoutEvent(role));
    } catch (UnknownHostException e) {
      gameServer.notifyObservers(new ServerConnectionErrorEvent(role));
    } catch (IOException e) {
      gameServer.notifyObservers(new ServerConnectionErrorEvent(role));
    }
View Full Code Here

    public void observe(Event event) {
        if(event instanceof ServerIllegalMoveEvent) {
            ServerIllegalMoveEvent x = (ServerIllegalMoveEvent)event;
            System.err.println("Got illegal move [" + x.getMove() + "] by role [" + x.getRole() + "].");
        } else if (event instanceof ServerTimeoutEvent) {
            ServerTimeoutEvent x = (ServerTimeoutEvent)event;
            System.err.println("Timeout when communicating with role [" + x.getRole() + "].");
        } else if (event instanceof ServerConnectionErrorEvent) {
            ServerConnectionErrorEvent x = (ServerConnectionErrorEvent)event;
            System.err.println("Connection error when communicating with role [" + x.getRole() + "].");
        }
    }
View Full Code Here

TOP

Related Classes of org.ggp.base.server.event.ServerTimeoutEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.