Package server.common

Examples of server.common.Message


    }

    private void login() {
        String[] argsTab = new String(request.getBody()).split("_");
        outputPrint("Current player is trying to login");
        Message response;

        // Try to log the current player
        response = HAL.login(argsTab[0], argsTab[1]);
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here


        Thread.currentThread().interrupt();
    }

    private void logout() {
        outputPrint("Current player is trying to logout");
        Message response;

        // Try to log the current player
        response = HAL.logout(new String(request.getBody()));
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    }

    private void newGame() {
        String playerID = new String(request.getBody());
        outputPrint("Current player is trying to create a new game");
        Message response;

        // Try to create a new game for the current player
        response = HAL.createNewPlay(playerID);
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

        Thread.currentThread().interrupt();
    }

    private void newAnonymGame() {
        outputPrint("Current anonymous player is trying to create a new game");
        Message response;

        // Try to create a new play for the current anonymous player
        response = HAL.newAnonymGame(new String(request.getBody()));
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    }

    private void loadGameList() {
        String playerID = new String(request.getBody());
        outputPrint("Current player is trying to load list of games");
        Message response;

        // Try to load the plays list for the current player
        response = HAL.loadPlayList(playerID);
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    }

    private void loadGame() {
        String[] argsTab = new String(request.getBody()).split("_");
        outputPrint("Current player is trying to load an existed game - game ID : " + argsTab[1]);
        Message response;

        // Try to load an existed play for the current player
        response = HAL.loadGame(argsTab[0], argsTab[1]);
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    }

    private void saveGame(int type) {
        String[] argsTab = new String(request.getBody()).split("_");
        outputPrint("Current player is trying to save an existed game - game ID : " + argsTab[1]);
        Message response;

        // Try to load an existed play for the current player
        String blankTiles = (argsTab.length > 2) ? argsTab[2] : "";
        response = HAL.saveGame(type, argsTab[0], argsTab[1], blankTiles);
        outputPrint("Send Response");
View Full Code Here

    }

    private void deleteAnonym() {
        String playerID = new String(request.getBody());
        outputPrint("Try to delete the play for this anonymous player");
        Message response;

        // Try to load an existed play for the current player
        response = HAL.deleteAnonym(playerID);
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    private void gameTreatment() {
        // Structure of args to recieve : pl_id+"_"+ga_id+"_"+orientation@@[tile 1]##[ tile 2 ]##...
        System.out.println(new String(request.getBody()));
        String[] argsTab = new String(request.getBody()).split("_");
        outputPrint("Start game treatment for the current player");
        Message response;

        // Check if the player's game is correct.
        response = HAL.gameTreatment(argsTab[0], argsTab[1], argsTab[2]); // playerID, playID, gameInformations
        outputPrint("Send Response");
        sProto.sendResponse(response);
View Full Code Here

    }

    private void exchangeTile() {
        String[] argsTab = new String(request.getBody()).split("##");
        outputPrint("Current player is trying to exchange tiles");
        Message response;
        String playerID = argsTab[0];
        String position = argsTab[1];
        response = HAL.exchangeTile(playerID, position);

        outputPrint("Send Response");
View Full Code Here

TOP

Related Classes of server.common.Message

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.