Advertisement
VANPER

Announcer Record Online

Mar 21st, 2020
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.44 KB | None | 0 0
  1. Index: net.sf.l2j;Config.JAVA
  2. ===================================================================
  3. --- net.sf.l2j;Config.JAVA (revision)
  4. +++ net.sf.l2j;Config.JAVA (working copy)
  5.  
  6.  
  7. +   /** Announce Online Players */
  8. +   public static boolean ALLOW_ANNOUNCE_ONLINE_PLAYERS;
  9. +   public static int ANNOUNCE_ONLINE_PLAYERS_DELAY;
  10. +  
  11. +   ALLOW_ANNOUNCE_ONLINE_PLAYERS = Boolean.parseBoolean(aCis.getProperty("AllowAnnounceOnlinePlayers", "True"));
  12. +   ANNOUNCE_ONLINE_PLAYERS_DELAY = Integer.parseInt(aCis.getProperty("AnnounceOnlinePlayersDelay", "300"));
  13.    
  14.    
  15. Index: Dev.announcerTopPlayer;AnnounceOnlinePlayers.JAVA
  16. ===================================================================
  17. --- Dev.announcerTopPlayer;AnnounceOnlinePlayers.JAVA (revision)
  18. +++ Dev.announcerTopPlayer;AnnounceOnlinePlayers.JAVA (working copy)
  19.  
  20. +package Dev.announcerTopPlayer;
  21. +
  22. +import net.sf.l2j.commons.concurrent.ThreadPool;
  23. +
  24. +import net.sf.l2j.Config;
  25. +
  26. +import net.sf.l2j.gameserver.model.World;
  27. +
  28. +/**
  29. + *
  30. + * @author Juvenil Walker
  31. + *
  32. + */
  33. +
  34. +public class AnnounceOnlinePlayers
  35. +{
  36. +    public static void getInstance()
  37. +    {
  38. +        ThreadPool.scheduleAtFixedRate(new Runnable()
  39. +        {
  40. +            @Override
  41. +            public void run()
  42. +            {
  43. +                Announce();
  44. +            }
  45. +        }, 0,Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000);
  46. +     }
  47. +    
  48. +   protected static void Announce()
  49. +   {
  50. +       int NumberofPlayers = World.getInstance().getAllPlayers().size();
  51. +      
  52. +       if (NumberofPlayers == 1)
  53. +           World.announceToOnlinePlayers("Record " + NumberofPlayers + " player is online.");
  54. +       else
  55. +           World.announceToOnlinePlayers("Record " + NumberofPlayers + " player are online.");
  56. +   }
  57. +    
  58. +    
  59. +
  60. +    }
  61. +
  62.  
  63. Index: net.sf.l2j.gameserver;GameServer.JAVA
  64. ===================================================================
  65. --- net.sf.l2j.gameserver;GameServer.JAVA (revision)
  66. +++ net.sf.l2j.gameserver;GameServer.JAVA (working copy)
  67.  
  68. +   import Dev.announcerTopPlayer.AnnounceOnlinePlayers;
  69.  
  70.  
  71.  
  72. +   if (Config.ALLOW_ANNOUNCE_ONLINE_PLAYERS)
  73. +       AnnounceOnlinePlayers.getInstance();
  74.  
  75. Index: gameserver.config.aCis.aCis.properties
  76. ===================================================================
  77. --- gameserver.config.aCis.aCis.properties (revision)
  78. +++ gameserver.config.aCis.aCis.properties (working copy)
  79. +#Announcer all player online
  80. +AllowAnnounceOnlinePlayers = true
  81. +#Defalt 300 = 5 Minutos
  82. +AnnounceOnlinePlayersDelay = 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement