Package org.ggp.base.player.request.grammar

Examples of org.ggp.base.player.request.grammar.Request


        }

        notifyObservers(new PlayerReceivedMessageEvent(in));
        GamerLogger.log("GamePlayer", "[Received at " + System.currentTimeMillis() + "] " + in, GamerLogger.LOG_LEVEL_DATA_DUMP);

        Request request = new RequestFactory().create(gamer, in);
        String out = request.process(System.currentTimeMillis());

        HttpWriter.writeAsServer(connection, out);
        connection.close();
        notifyObservers(new PlayerSentMessageEvent(out));
        GamerLogger.log("GamePlayer", "[Sent at " + System.currentTimeMillis() + "] " + out, GamerLogger.LOG_LEVEL_DATA_DUMP);
View Full Code Here


        notifyObservers(new PlayerReceivedMessageEvent(in));
        GamerLogger.log("Proxy", "[PROXY] Got incoming message:" + in);

        // Formulate a request, and see how the legal gamer responds.
        String legalProxiedResponse;
        Request request = new RequestFactory().create(theDefaultGamer, in);
        try {
            legalProxiedResponse = request.process(receptionTime);
        } catch(OutOfMemoryError e) {
            // Something went horribly wrong -- our baseline prover failed.
            System.gc();
            GamerLogger.logStackTrace("Proxy", e);
            legalProxiedResponse = "SORRY";
View Full Code Here

          String in = theMessage.theMessage;
          theCode = theMessage.messageCode;
          long receptionTime = theMessage.receptionTime;
        notifyObservers(new PlayerReceivedMessageEvent(in));

        Request request = new RequestFactory().create(gamer, in);
        if(request instanceof StartRequest) {
            RandomGamer theDefaultGamer = new RandomGamer();
            new RequestFactory().create(theDefaultGamer, in).process(1);
            GamerLogger.startFileLogging(theDefaultGamer.getMatch(), theDefaultGamer.getRoleName().toString());
            GamerLogger.log("Proxy", "[ProxyClient] Got message: " + theMessage);
        }
        String out = request.process(receptionTime);

        ProxyMessage outMessage = new ProxyMessage("DONE:" + out, theCode, 0L);
        outMessage.writeTo(theOutput);
        GamerLogger.log("Proxy", "[ProxyClient] Sent message: " + outMessage);
        notifyObservers(new PlayerSentMessageEvent(out));
View Full Code Here

TOP

Related Classes of org.ggp.base.player.request.grammar.Request

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.