Examples of GameException


Examples of org.scotlandyard.engine.GameException

    email = request.getParameter("email");
    name  = request.getParameter("name");

    if(email==null || "".equals(email.trim())){
      throw new GameException("email is not provided");
    }

    if(name==null || "".equals(name.trim())){
      throw new GameException("name is not provided");
    }

    user = engine.getUsers().get(getSessionId());

    if(user!=null){
      throw new GameException("user name is not null");
    }

    user = engine.getUser(email);

    if(user!=null){
      throw new GameException("this email is already in use now, try to login by another email");
    }


  }
View Full Code Here

Examples of org.scotlandyard.engine.GameException

    final String transportationMethod=request.getParameter("transportationMethod");

    final Game game = engine.getLobby().getGame(gameId);

    if(game.isPlayable()==false){
      throw new GameException("the game is still not playable.");
    }

    String position = game.getPlayerPosition(playerEmail);
    Player player=game.getPlayer(playerEmail);
View Full Code Here

Examples of server.common.GameException

        Message response = null;
        try {
            // Try to create a new player acount
            response = game.newAccount(pl_name, pl_pwd);
            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to log the current player
            response = game.login(pl_name, pl_pwd);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to log the current player
            response = game.logout(pl_id);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to create a new game for the current player
            response = game.createNewPlay(playerID);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to create a new game for the current anonymous player
            response = game.createNewAnonymPlay(pl_id);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to load the plays list for the current player
            response = game.loadPlayList(playerID);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to load an existed play for the current player
            response = game.loadSavedPlay(playerID, playID);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here

Examples of server.common.GameException

        try {
            // Try to save current play for the current player
            response = game.SavePlay(type, playerID, playID, ga_infos);

            if (response == null) {
                throw new GameException(GameException.typeErr.SYSKO);
            }
        } catch (GameException e) {
            response = processError(e);
        }
        return response;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.