Examples of Announcements


Examples of com.l2jfrozen.gameserver.model.entity.Announcements

   * @param restart true if the server will restart after shutdown
   */

  public void startTelnetShutdown(String IP, int seconds, boolean restart)
  {
    Announcements _an = Announcements.getInstance();
    _log.log(Level.WARNING,"IP: " + IP + " issued shutdown command. " + MODE_TEXT[_shutdownMode] + " in " + seconds + " seconds!");

    if(restart)
    {
      _shutdownMode = TELL_RESTART;
    }
    else
    {
      _shutdownMode = TELL_SHUTDOWN;
    }

    if(_shutdownMode > 0)
    {
      _an.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " in " + seconds + " seconds!");
      _an.announceToAll("Please exit game now!!");
    }

    if(_counterInstance != null)
    {
      _counterInstance._abort();
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.Announcements

   *
   * @param IP IP Which Issued shutdown command
   */
  public void telnetAbort(String IP)
  {
    Announcements _an = Announcements.getInstance();
    _log.log(Level.WARNING,"IP: " + IP + " issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
    _an.announceToAll("Server aborts " + MODE_TEXT[_shutdownMode] + " and continues normal operation!");
    _an = null;

    if(_counterInstance != null)
    {
      _counterInstance._abort();
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.Announcements

   *
   * @param activeChar GM who issued the abort command
   */
  public void abort(L2PcInstance activeChar)
  {
    Announcements _an = Announcements.getInstance();
    _log.log(Level.WARNING,"GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
    _an.announceToAll("Server aborts " + MODE_TEXT[_shutdownMode] + " and continues normal operation!");
    _an = null;

    if(_counterInstance != null)
    {
      _counterInstance._abort();
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.Announcements

  /**
   * this sends a last byebye, disconnects all players and saves data
   */
  private synchronized void saveData()
  {
    Announcements _an = Announcements.getInstance();
    switch(_shutdownMode)
    {
      case SIGTERM:
        System.err.println("SIGTERM received. Shutting down NOW!");
        break;

      case GM_SHUTDOWN:
        System.err.println("GM shutdown received. Shutting down NOW!");
        break;

      case GM_RESTART:
        System.err.println("GM restart received. Restarting NOW!");
        break;

      case TASK_SHUTDOWN:
        System.err.println("Auto task shutdown received. Shutting down NOW!");
        break;

      case TASK_RESTART:
        System.err.println("Auto task restart received. Restarting NOW!");
        break;

      case TELL_SHUTDOWN:
        System.err.println("Telnet shutdown received. Shutting down NOW!");
        break;

      case TELL_RESTART:
        System.err.println("Telnet restart received. Restarting NOW!");
        break;

    }
    try
    {
      _an.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
      _an = null;
    }
    catch(Throwable t)
    {
      if(Config.ENABLE_ALL_EXCEPTIONS)
View Full Code Here

Examples of l2p.gameserver.Announcements

    Commands command = (Commands) comm;
    if(!activeChar.getPlayerAccess().CanAnnounce)
    {
      return false;
    }
    Announcements a = Announcements.getInstance();
    switch(command)
    {
      case admin_list_announcements:
        a.listAnnouncements(activeChar);
        break;
      case admin_announce_menu:
        a.handleAnnounce(fullString, 20);
        a.listAnnouncements(activeChar);
        break;
      case admin_announce_announcements:
        for(L2Player player : L2ObjectsStorage.getAllPlayersForIterate())
        {
          a.showAnnouncements(player);
        }
        a.listAnnouncements(activeChar);
        break;
      case admin_add_announcement:
        if(wordList.length < 2)
        {
          return false;
        }
        try
        {
          String val = fullString.substring(23);
          a.addAnnouncement(val);
          a.listAnnouncements(activeChar);
        }
        catch(StringIndexOutOfBoundsException e)
        {
        }
        break;
      case admin_del_announcement:
        if(wordList.length < 2)
        {
          return false;
        }
        try
        {
          int val = new Integer(fullString.substring(23));
          a.delAnnouncement(val);
          a.listAnnouncements(activeChar);
        }
        catch(StringIndexOutOfBoundsException e)
        {
        }
        break;
      case admin_announce:
        a.handleAnnounce(fullString, 15);
        break;
      case admin_a:
        a.handleAnnounce(fullString, 8);
        break;
      case admin_crit_announce:
      case admin_c:
        if(wordList.length < 2)
        {
View Full Code Here

Examples of net.sf.l2j.gameserver.Announcements

          {
            CastleManager.getInstance().removeCirclet(_formerOwner,getCastleId());
          }
        }
        oldOwner.setHasCastle(0);                        // Unset has castle flag for old owner
            new Announcements().announceToAll(oldOwner.getName() + " has lost " + getName() + " castle!");
      }
      }

      updateOwnerInDB(clan);                              // Update in database
View Full Code Here

Examples of net.sf.l2j.gameserver.Announcements

      if (Config.REMOVE_CASTLE_CIRCLETS)
      {
        CastleManager.getInstance().removeCirclet(_formerOwner,getCastleId());
      }
      clan.setHasCastle(0);
      new Announcements().announceToAll(clan.getName() + " has lost " +getName() + " castle");
      clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
    }

    updateOwnerInDB(null);
    if (getSiege().getIsInProgress())
View Full Code Here

Examples of net.sf.l2j.gameserver.Announcements

            // Announce to clan memebers
            if (clan != null)
            {
            clan.setHasCastle(getCastleId()); // Set has castle flag for new owner
            new Announcements().announceToAll(clan.getName() + " has taken " + getName() + " castle!");
            clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));

            ThreadPoolManager.getInstance().scheduleGeneral(new CastleUpdater(clan, 1), 3600000)// Schedule owner tasks to start running
            }
        }
View Full Code Here

Examples of net.sf.l2j.gameserver.Announcements

      Announcements.getInstance().loadAnnouncements();
      Announcements.getInstance().listAnnouncements(activeChar);
    }
    else if (command.startsWith("admin_announce_menu"))
    {
      Announcements sys = new Announcements();
      sys.handleAnnounce(command, 20);
      Announcements.getInstance().listAnnouncements(activeChar);
    }
    else if (command.equals("admin_announce_announcements"))
    {
      for (L2PcInstance player : L2World.getInstance().getAllPlayers())
      {
        Announcements.getInstance().showAnnouncements(player);
      }
      Announcements.getInstance().listAnnouncements(activeChar);
    }
    else if (command.startsWith("admin_add_announcement"))
    {
      //FIXME the player can send only 16 chars (if you try to send more it sends null), remove this function or not?
      if (!command.equals("admin_add_announcement"))
      {
       try{
        String val = command.substring(23);
        Announcements.getInstance().addAnnouncement(val);
        Announcements.getInstance().listAnnouncements(activeChar);
       } catch(StringIndexOutOfBoundsException e){}//ignore errors
      }
    }
    else if (command.startsWith("admin_del_announcement"))
    {
            try
            {
          int val = new Integer(command.substring(23)).intValue();
          Announcements.getInstance().delAnnouncement(val);
          Announcements.getInstance().listAnnouncements(activeChar);
            }
            catch (StringIndexOutOfBoundsException e)
            { }
    }

    // Command is admin announce
    else if (command.startsWith("admin_announce"))
    {
      // Call method from another class
      Announcements sys = new Announcements();
      sys.handleAnnounce(command, 15);
    }

    return true;
  }
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.