Package server.common

Examples of server.common.GameException


        Message response = null;
        try {
            response = game.exchangeTile(playerID, tiles);

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


        Message response = null;
        try {
            response = game.switchTile(playerID, position);

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

            } catch (JDOMException jdome) {
                System.out.println(jdome.getMessage());
            }
        } else {
            System.out.println("Games file doesn't exist!");
            throw new GameException(GameException.typeErr.XML_FILE_NOT_EXISTS);
        }
        return null;
    }
View Full Code Here

            } catch (JDOMException jdome) {
                System.out.println(jdome.getMessage());
            }
        } else {
            System.out.println("Game file doesn't exist!");
            throw new GameException(GameException.typeErr.XML_FILE_NOT_EXISTS);
        }
        return result;
    }
View Full Code Here

        Message response = createAccount(pl_name, pl_pwd);
        switch (response.getHeader()) {
            case Message.NEW_ACCOUNT_SUCCESS:
                return response;
            case Message.NEW_ACCOUNT_ERROR:
                throw new GameException(GameException.typeErr.PLAYER_EXISTS);
        }
        return null;
    }
View Full Code Here

        Message response = loginProcess(pl_name, pl_pwd);
        switch (response.getHeader()) {
            case Message.LOGIN_SUCCESS:
                return response;
            case Message.LOGIN_ERROR:
                throw new GameException(GameException.typeErr.LOGIN_ERROR);
            case Message.PLAYER_NOT_EXISTS:
                throw new GameException(GameException.typeErr.PLAYER_NOT_EXISTS);
        }
        return null;
    }
View Full Code Here

        Message response = logoutProcess(pl_id);
        switch (response.getHeader()) {
            case Message.LOGOUT_SUCCESS:
                return response;
            case Message.LOGOUT_ERROR:
                throw new GameException(GameException.typeErr.LOGOUT_ERROR);
        }
        return null;
    }
View Full Code Here

        Message response = createNewGame(pl_id);
        switch (response.getHeader()) {
            case Message.NEW_GAME_SUCCESS:
                return response;
            case Message.PLAYER_NOT_LOGGED:
                throw new GameException(GameException.typeErr.PLAYER_NOT_LOGGED);
        }
        return null;
    }
View Full Code Here

        Message response = createNewAnonymGame(pl_id);
        switch (response.getHeader()) {
            case Message.NEW_GAME_ANONYM_SUCCESS:
                return response;
            case Message.NEW_GAME_ANONYM_ERROR:
                throw new GameException(GameException.typeErr.NEW_GAME_ANONYM_ERROR);
        }
        return null;
    }
View Full Code Here

        Message response = loadPlayLister(pl_id);
        switch (response.getHeader()) {
            case Message.LOAD_GAME_LIST_SUCCESS:
                return response;
            case Message.LOAD_GAME_LIST_ERROR:
                throw new GameException(GameException.typeErr.LOAD_GAME_LIST_ERROR);
            case Message.PLAYER_NOT_LOGGED:
                throw new GameException(GameException.typeErr.PLAYER_NOT_LOGGED);
            case Message.XML_FILE_NOT_EXISTS:
                throw new GameException(GameException.typeErr.LOAD_GAME_LIST_ERROR);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of server.common.GameException

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.