@Override
    public void run() {

        final IdFactory _id = IdFactory.getInstance();
        _idConection = _id.newId();
        getLogger().log(Level.INFO, "Client Thread Started ...");

        try {
            _connection.sendPacket(new SHello(_idConection, "09928"));
            boolean _while = true;
            while (_while) {

                // System.out.println("czekam na odpowiedz");
                final byte[] decrypt = _connection.getPacket();
                if (decrypt != null) {
                    _handler.handlePacket(decrypt);
                } else {
                    _while = false;
                }
                // System.out.println("odebralem");

            }
        } catch (final IOException ex) {
            getLogger().log(Level.SEVERE, null, ex);
        } catch (final Throwable ex) {
            getLogger().log(Level.SEVERE, null, ex);

        } finally {
            try {

                try {
                } catch (final Exception e2) {
                    // ignore any problems here
                }

                // _connection.close();
            } catch (final Exception e1) {
                getLogger().log(Level.WARNING, e1.getMessage());
            } finally {

                try {
                    if (_activeChar != null) // this should only happen on
                    // connection loss
                    {
                        // notify the world about our disconnect
                        _activeChar.deleteMe();

                        try {
                            saveCharToDataBase(_activeChar);
                        } catch (final Exception e2) {
                            // ignore any problems here
                        }
                    }

                    _connection.close();
                } catch (final Exception e1) {
                } finally {
                    // remove the account
                }
            }
            // remove the account
        }
        IdFactory.getInstance().deleteId(_idConection);
        getLogger().log(Level.INFO, "gameserver thread[C] stopped");
    }