Examples of GameClient


Examples of ca.vanzeben.game.net.GameClient

            if (JOptionPane.showConfirmDialog(this, "Do you want to run the server") == 0) {
                socketServer = new GameServer(this);
                socketServer.start();
            }

            socketClient = new GameClient(this, "localhost");
            socketClient.start();
        }
    }
View Full Code Here

Examples of core.GameClient

            if (player == null) {
                responseLogin.setStatus((short) 1);//Username/password is wrong.
                System.out.println("User '" + user_id + "' has failed to log in.");
            } else {
                if (client.getPlayer() == null || player.getID() != client.getPlayer().getID()) {
                    GameClient thread = client.getServer().getThreadByPlayerID(player.getID());

                    if (thread != null) {
                        responseLogin.setStatus((short) 2);//Account is being used.
                        thread.stopClient();
                    } else {
                        PlayerDAO.updateLogin(player.getID(), client.getIP());
                        GameServer.getInstance().setActivePlayer(player);
                        player.setClient(client);
                        player.setLastSaved(System.currentTimeMillis());
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = getClient();
    if (Config.SECOND_AUTH_ENABLED && !client.getSecondaryAuth().isAuthed())
    {
      client.getSecondaryAuth().openDialog();
      return;
    }
    if (client.getActiveChar() != null)
    {
      return;
    }
    int objId = client.getObjectIdForSlot(_charSlot);
    if (AutoBan.isBanned(objId))
    {
      sendPacket(ActionFail.STATIC);
      return;
    }
    Player activeChar = client.loadCharFromDisk(_charSlot);
    if (activeChar == null)
    {
      sendPacket(ActionFail.STATIC);
      return;
    }
    if (activeChar.getAccessLevel() < 0)
    {
      activeChar.setAccessLevel(0);
    }
    client.setState(GameClientState.IN_GAME);
    sendPacket(new CharSelected(activeChar, client.getSessionKey().playOkID1));
  }
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = getClient();
    Player activeChar = client.getActiveChar();
    if (activeChar == null)
    {
      client.closeNow(false);
      return;
    }
    int MyObjectId = activeChar.getObjectId();
    Long MyStoreId = activeChar.getStoredId();
    for(Castle castle : ResidenceHolder.getInstance().getResidenceList(Castle.class))
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = LoginServerCommunication.getInstance().removeWaitingClient(account);
    if (client == null)
    {
      return;
    }
    Player activeChar = client.getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    if (changed)
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   */
  @Override
  protected void runImpl()
  {
    SessionKey skey = new SessionKey(loginOkId1, loginOkId2, playOkId1, playOkId2);
    GameClient client = LoginServerCommunication.getInstance().removeWaitingClient(account);
    if (client == null)
    {
      return;
    }
    if (authed && client.getSessionKey().equals(skey))
    {
      client.setAuthed(true);
      client.setState(GameClient.GameClientState.AUTHED);
      switch (Config.SERVICES_RATE_TYPE)
      {
        case Bonus.NO_BONUS:
          bonus = 1.;
          bonusExpire = 0;
          break;
        case Bonus.BONUS_GLOBAL_ON_GAMESERVER:
          double[] bonuses = AccountBonusDAO.getInstance().select(account);
          bonus = bonuses[0];
          bonusExpire = (int) bonuses[1];
          break;
      }
      client.setBonus(bonus);
      client.setBonusExpire(bonusExpire);
      if (Config.SECOND_AUTH_ENABLED)
      {
        client.setSecondaryAuth(new SecondaryPasswordAuth(client, _2ndPassword, _2ndWrongAttempts, _2ndUnbanTime));
      }
      GameClient oldClient = LoginServerCommunication.getInstance().addAuthedClient(client);
      if (oldClient != null)
      {
        oldClient.setAuthed(false);
        Player activeChar = oldClient.getActiveChar();
        if (activeChar != null)
        {
          activeChar.sendPacket(Msg.ANOTHER_PERSON_HAS_LOGGED_IN_WITH_THE_SAME_ACCOUNT);
          activeChar.logout();
        }
        else
        {
          oldClient.close(ServerClose.STATIC);
        }
      }
      sendPacket(new PlayerInGame(client.getLogin()));
      CharacterSelectionInfo csi = new CharacterSelectionInfo(client.getLogin(), client.getSessionKey().playOkID1);
      ExLoginVitalityEffectInfo vl = new ExLoginVitalityEffectInfo(csi.getCharInfo());
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = LoginServerCommunication.getInstance().removeWaitingClient(account);
    if (client == null)
    {
      client = LoginServerCommunication.getInstance().removeAuthedClient(account);
    }
    if (client == null)
    {
      return;
    }
    Player activeChar = client.getActiveChar();
    if (activeChar != null)
    {
      activeChar.sendPacket(Msg.ANOTHER_PERSON_HAS_LOGGED_IN_WITH_THE_SAME_ACCOUNT);
      activeChar.kick();
    }
    else
    {
      client.close(ServerClose.STATIC);
    }
  }
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

      {
        sendPacket(new CharacterDeleteFail(CharacterDeleteFail.REASON_DELETION_FAILED));
      }
      return;
    }
    GameClient client = getClient();
    try
    {
      if (Config.DELETE_DAYS == 0)
      {
        client.deleteChar(_charSlot);
      }
      else
      {
        client.markToDeleteChar(_charSlot);
      }
    }
    catch (Exception e)
    {
      _log.error("Error:", e);
    }
    sendPacket(new CharacterDeleteSuccess());
    CharacterSelectionInfo cl = new CharacterSelectionInfo(client.getLogin(), client.getSessionKey().playOkID1);
    ExLoginVitalityEffectInfo vl = new ExLoginVitalityEffectInfo(cl.getCharInfo());
    sendPacket(cl, vl);
    client.setCharSelection(cl.getCharInfo());
  }
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = getClient();
    try
    {
      client.markRestoredChar(_charSlot);
    }
    catch (Exception e)
    {
    }
    CharacterSelectionInfo cl = new CharacterSelectionInfo(client.getLogin(), client.getSessionKey().playOkID1);
    ExLoginVitalityEffectInfo vl = new ExLoginVitalityEffectInfo(cl.getCharInfo());
    sendPacket(cl, vl);
    client.setCharSelection(cl.getCharInfo());
  }
View Full Code Here

Examples of lineage2.gameserver.network.GameClient

   * Method runImpl.
   */
  @Override
  protected void runImpl()
  {
    GameClient client = getClient();
    Player activeChar = client.getActiveChar();
    Player newMentee = World.getPlayer(_newMentee);
    if (newMentee == null)
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.THAT_PLAYER_IS_NOT_ONLINE));
      return;
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.