Examples of GameServerInfo


Examples of com.l2client.model.network.GameServerInfo

    int serverCount = readC();
    readC();//lastServer ?!?! what is this for?
    GameServerInfo[] gameServers = new GameServerInfo[serverCount];

    for (int i = 0; i < serverCount; i++) {
      gameServers[i] = new GameServerInfo();
      gameServers[i].id = readC();
      gameServers[i].ip = new StringBuilder().append(readC()).append(".").append(readC()).append(".").append(readC()).append(".").append(readC()).toString();
      gameServers[i].port = readD();
      gameServers[i].ageLimit = readC();
      gameServers[i].pvp = readC() != 0 ? true : false;
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

   */
  public ServerStatus(byte[] decrypt, int serverId)
  {
    super(decrypt);

    GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(serverId);
    if(gsi != null)
    {
      int size = readD();

      for(int i = 0; i < size; i++)
      {
        int type = readD();
        int value = readD();

        switch(type)
        {
          case SERVER_LIST_STATUS:
            gsi.setStatus(value);
            break;
          case SERVER_LIST_CLOCK:
            gsi.setShowingClock(value == ON);
            break;
          case SERVER_LIST_SQUARE_BRACKET:
            gsi.setShowingBrackets(value == ON);
            break;
          case TEST_SERVER:
            gsi.setTestServer(value == ON);
            break;
          case MAX_PLAYERS:
            gsi.setMaxPlayers(value);
            break;
        }
      }
    }

View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

          lc.removeAuthedLoginClient(_user);
        }
        oldClient = null;
        break;
      case ALREADY_ON_GS:
        GameServerInfo gsi;
        if((gsi = lc.getAccountOnGameServer(_user)) != null)
        {
          client.close(LoginFailReason.REASON_ACCOUNT_IN_USE);

          // kick from there
          if(gsi.isAuthed())
          {
            gsi.getGameServerThread().kickPlayer(_user);
          }
        }
        gsi = null;
        break;
    }
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

    GameServerTable gameServerTable = GameServerTable.getInstance();

    int id = gameServerAuth.getDesiredID();
    byte[] hexId = gameServerAuth.getHexID();

    GameServerInfo gsi = gameServerTable.getRegisteredGameServerById(id);
    // is there a gameserver registered with this id?
    if(gsi != null)
    {
      // does the hex id match?
      if(Arrays.equals(gsi.getHexId(), hexId))
      {
        // check to see if this GS is already connected
        synchronized (gsi)
        {
          if(gsi.isAuthed())
          {
            forceClose(LoginServerFail.REASON_ALREADY_LOGGED8IN);
          }
          else
          {
            attachGameServerInfo(gsi, gameServerAuth);
          }
        }
      }
      else
      {
        // there is already a server registered with the desired id and different hex id
        // try to register this one with an alternative id
        if(Config.ACCEPT_NEW_GAMESERVER && gameServerAuth.acceptAlternateID())
        {
          gsi = new GameServerInfo(id, hexId, this);

          if(gameServerTable.registerWithFirstAvaliableId(gsi))
          {
            attachGameServerInfo(gsi, gameServerAuth);
            gameServerTable.registerServerOnDB(gsi);
          }
          else
          {
            forceClose(LoginServerFail.REASON_NO_FREE_ID);
          }
        }
        else
        {
          // server id is already taken, and we cant get a new one for you
          forceClose(LoginServerFail.REASON_WRONG_HEXID);
        }
      }
    }
    else
    {
      // can we register on this id?
      if(Config.ACCEPT_NEW_GAMESERVER)
      {
        gsi = new GameServerInfo(id, hexId, this);

        if(gameServerTable.register(id, gsi))
        {
          attachGameServerInfo(gsi, gameServerAuth);
          gameServerTable.registerServerOnDB(gsi);
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

  public AuthLoginResult tryAuthLogin(String account, String password, L2LoginClient client)
  {
    AuthLoginResult ret = AuthLoginResult.INVALID_PASSWORD;
    int serverId = 1;
        GameServerInfo mt = GameServerTable.getInstance().getRegisteredGameServerById(serverId);
      
        if (loginValid(account, password, client))
        {
      // login was successful, verify presence on Gameservers
      ret = AuthLoginResult.ALREADY_ON_GS;

      if(!isAccountInAnyGameServer(account))
      {
        // account isnt on any GS verify LS itself
        ret = AuthLoginResult.ALREADY_ON_LS;

        // dont allow 2 simultaneous login
        synchronized (_loginServerClients)
        {
          if (!_loginServerClients.containsKey(account))
                    {
                      if (mt.getStatus() == ServerStatus.STATUS_GM_ONLY)
                      {
                        if (client.getAccessLevel() < 1)
                        {
                          return AuthLoginResult.SERVER_MAINTENANCE;
                        }
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

    return null;
  }

  public int getOnlinePlayerCount(int serverId)
  {
    GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(serverId);

    if(gsi != null && gsi.isAuthed())
      return gsi.getCurrentPlayerCount();

    gsi = null;

    return 0;
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

    return total;
  }

  public int getMaxAllowedOnlinePlayers(int id)
  {
    GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(id);

    if(gsi != null)
      return gsi.getMaxPlayers();
   
    return 0;
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.datatables.GameServerTable.GameServerInfo

   * @param serverId
   * @return
   */
  public boolean isLoginPossible(L2LoginClient client, int serverId)
  {
    GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(serverId);
    int access = client.getAccessLevel();

     if (gsi != null && gsi.isAuthed())
          {
           boolean loginOk = gsi.getCurrentPlayerCount() < gsi.getMaxPlayers() || access >= 100;
           if (loginOk && client.getLastServer() != serverId)
      {
        Connection con = null;
       
        try
View Full Code Here

Examples of l2p.loginserver.gameservercon.GameServerInfo

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM gameservers");
      rset = statement.executeQuery();
      GameServerInfo gsi;
      while(rset.next())
      {
        id = rset.getInt("server_id");
        gsi = new GameServerInfo(id, stringToHex(rset.getString("hexid")));
        _gameServerTable.put(id, gsi);
      }
    }
    finally
    {
View Full Code Here

Examples of l2p.loginserver.gameservercon.GameServerInfo

    return null;
  }

  public int getOnlinePlayerCount(int serverId)
  {
    GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(serverId);
    if(gsi != null && gsi.isAuthed())
    {
      return gsi.getCurrentPlayerCount();
    }
    return 0;
  }
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.