src/main/java/robocup/server/connection/SoccerServerConnection.java
/**
     * Handle the message string from the soccer server. Basically that means parsing. If the message contains info
     * about the positions of the ball and players (i.e. is a {@link RoboCupShowMessage}), pass that info to the
     * messageHandler. If the message has another type, log it. The method returns the turn number of the observed turn,
     * or -1 if no known message could be received.
     *
     * @param messageString
     */
Handle the message string from the soccer server. Basically that means parsing. If the message contains info
about the positions of the ball and players , pass that info to the
messageHandler. If the message has another type, log it. The method returns the turn number of the observed turn,
or -1 if no known message could be received.

@param messageString
Handle the message string from the soccer server . Basically that means parsing . If the message contains info about the positions of the ball and players pass that info to the messageHandler . If the message has another type log it . The method returns the turn number of the observed turn or - 1 if no known message could be received . @param messageString
private int handleMessage(String messageString) {
        RoboCupMessage message = RoboCupParser.parseMessage(messageString);
        if (message != null) {
            int turn = message.getTurn();
            if (message instanceof RoboCupShowMessage) {
                for (IRoboCupMessageHandler messageHandler : messageHandlers) {
                    messageHandler.handleMessage((RoboCupShowMessage) message);
                }
            } else if (message instanceof RoboCupMsgMessage) {
                log.info(
                        "Received message: " + ((RoboCupMsgMessage) message).getMessage());
            } else {
                log.warn("Received unknown message: " + messageString);
            }
            return turn;
        }
        return -1;
    }
private int handleMessage ( String messageString ) { RoboCupMessage message = RoboCupParser . parseMessage ( messageString ) ; if ( message != null ) { int turn = message . getTurn ( ) ; if ( message instanceof RoboCupShowMessage ) { for ( IRoboCupMessageHandler messageHandler : messageHandlers ) { messageHandler . handleMessage ( ( RoboCupShowMessage ) message ) ; } } else if ( message instanceof RoboCupMsgMessage ) { log . info ( "Received message: " + ( ( RoboCupMsgMessage ) message ) . getMessage ( ) ) ; } else { log . warn ( "Received unknown message: " + messageString ) ; } return turn ; } return - 1 ; }
Handle the message string from the soccer server.
Handle the message string from the soccer server .