@Override
    public void onPacketReceived(NetworkPacket pPacket) {
        switch (pPacket.getHeader()) {
            case REGISTER_RESULT_REP:
                if (pPacket.getReqResult() == true) {
                    ScreenManager.getInstance().showLoginLayer();
                } else {
                    final BaseDialog.IOnButtonClickedEvent event = new BaseDialog.IOnButtonClickedEvent() {
                        @Override
                        public void onButtonClicked() {
                            ScreenManager.getInstance().showRegistryLayer();
                        }
                    };
                    switch (Integer.parseInt(pPacket.getMessage())) {
                        case 1:
                            ScreenManager.getInstance().showDialog(Constants.DIALOG_REGISTER_ACCOUNT_EXISTED_TEXT, event);
                            break;
                        case 2:
                            ScreenManager.getInstance().showDialog(Constants.DIALOG_REGISTER_FAILED_TEXT, event);
                            break;
                        default:
                            break;
                    }
                    
                }
                break;
            case LOGIN_RESULT_REP:
                ScreenManager.getInstance().hideLoadingLayer();
                if (pPacket.getReqResult() == true) {
                    ScreenManager.getInstance().showOnlineScene();
                    GameManager.getInstance().setCurrentGameMode(GameMode.ONLINE);
                    // TODO: Hide Login Layer and show Online Scene

                    ScreenManager.getInstance().showOnlineScene();
                } else {
                    final BaseDialog.IOnButtonClickedEvent event = new BaseDialog.IOnButtonClickedEvent() {
                        @Override
                        public void onButtonClicked() {
                            ScreenManager.getInstance().showLoginLayer();
                        }
                    };
                    switch (Integer.parseInt(pPacket.getMessage())) {
                        case 1:
                            ScreenManager.getInstance().showDialog(Constants.DIALOG_LOGIN_FAILED_TEXT, event);
                            break;
                        case 2:
                            ScreenManager.getInstance().showDialog(Constants.DIALOG_LOGIN_ACCOUNT_LOGGED_TEXT, event);
                            break;
                        default:
                            break;
                    }
                }

                break;
            default:
                break;
        }
    }