Jump to content

Recommended Posts

Posted

i searched and i didnt find it so this will help,so

it shows in game when logging in number of player online and is configurable often it should autoanounce this status...is better to use when new CB is fixed..

 

CommunityBoard (Alt+B) is causing high CPU using (lags)!!

 

Index: config/altsettings.properties

===================================================================

--- config/altsettings.properties      (revision 2073)

+++ config/altsettings.properties      (working copy)

-115,3 +115,8 @@

 

# Maximum contribution per player during festival

AltMaxPlayerContrib = 1000000

+

+#Show Online Players number at startup

+ShowOnlinePlayersAtStartup = True

+#Set time interval to announce online players number (0 - don't announce)

+OnlinePlayersAnnounceInterval = 900000

Index: net/sf/l2j/Config.java

===================================================================

--- net/sf/l2j/Config.java      (revision 2073)

+++ net/sf/l2j/Config.java      (working copy)

-809,8 +809,11 @@

    /** Recipebook limits */

    public static int DWARF_RECIPE_LIMIT;

    public static int COMMON_RECIPE_LIMIT; 

-

   

+    /** Show Online Players announce */

+    public static boolean ONLINE_PLAYERS_AT_STARTUP;

+    public static int  ONLINE_PLAYERS_ANNOUNCE_INTERVAL;

+   

    /**

      * This class initializes all global variables for configuration.<br>

      * If key doesn't appear in properties file, a default value is setting on by this class.

-1250,6 +1253,8 @@

                ALT_GAME_REQUIRE_CLAN_CASTLE                        = Boolean.parseBoolean(altSettings.getProperty("AltRequireClanCastle", "False"));

                ALT_FESTIVAL_MIN_PLAYER                            = Integer.parseInt(altSettings.getProperty("AltFestivalMinPlayer", "5"));

                ALT_MAXIMUM_PLAYER_CONTRIB                          = Integer.parseInt(altSettings.getProperty("AltMaxPlayerContrib", "1000000"));

+                ONLINE_PLAYERS_AT_STARTUP = Boolean.parseBoolean(altSettings.getProperty("ShowOnlinePlayersAtStartup","True"));

+                ONLINE_PLAYERS_ANNOUNCE_INTERVAL = Integer.parseInt(altSettings.getProperty("OnlinePlayersAnnounceInterval","900000"));

               

                ALT_CLAN_MEMBERS_FOR_WAR    = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));

                }

Index: net/sf/l2j/gameserver/clientpackets/EnterWorld.java

===================================================================

--- net/sf/l2j/gameserver/clientpackets/EnterWorld.java (revision 2073)

+++ net/sf/l2j/gameserver/clientpackets/EnterWorld.java (working copy)

-207,7 +207,14 @@

       

        Announcements.getInstance().showAnnouncements(activeChar);

        SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);

-

+       

+        if(Config.ONLINE_PLAYERS_AT_STARTUP)

+        {

+            sm = new SystemMessage(SystemMessage.S1_S2);

+            sm.addString("Players online: ");

+            sm.addNumber(L2World.getInstance().getAllPlayers().size());

+            sendPacket(sm);

+        }

              Quest.playerEnter(activeChar);

 

              String serverNews = HtmCache.getInstance().getHtm("data/html/servnews.htm");

Index: net/sf/l2j/gameserver/GameServer.java

===================================================================

--- net/sf/l2j/gameserver/GameServer.java      (revision 2073)

+++ net/sf/l2j/gameserver/GameServer.java      (working copy)

-312,8 +312,12 @@

 

        // Spawn the Orators/Preachers if in the Seal Validation period.

        _sevenSignsEngine.spawnSevenSignsNPC();

+       

+        // Start to announce online players number

+        if(Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL > 0)

+        OnlinePlayers.getInstance();

 

-              _log.config("AutoChatHandler: Loaded " + _autoChatHandler.size() + " handlers in total.");

+        _log.config("AutoChatHandler: Loaded " + _autoChatHandler.size() + " handlers in total.");

              _log.config("AutoSpawnHandler: Loaded " + _autoSpawnHandler.size() + " handlers in total.");

 

              _itemHandler = ItemHandler.getInstance();

Index: net/sf/l2j/gameserver/OnlinePlayers.java

===================================================================

--- net/sf/l2j/gameserver/OnlinePlayers.java    (revision 0)

+++ net/sf/l2j/gameserver/OnlinePlayers.java    (revision 0)

-0,0 +1,30 @@

+package net.sf.l2j.gameserver;

+

+

+import net.sf.l2j.gameserver.model.L2World;

+import net.sf.l2j.Config;

+

+public class OnlinePlayers

+{

+    private static OnlinePlayers _instance;

+

+    class AnnounceOnline implements Runnable

+    {

+        public void run()

+        {

+            Announcements.getInstance().announceToAll("There is: "+L2World.getInstance().getAllPlayers().size()+" online players");

+            ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL);

+        }       

+    }

+   

+    public static OnlinePlayers getInstance()

+    {

+        if ( _instance == null )

+            _instance = new OnlinePlayers();

+        return _instance;

+    }

+    private OnlinePlayers()

+    {

+        ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL);

+    }

+}

\ No newline at end of file

 

then go:

 

OnlinePlayers.java

 

package net.sf.l2j.gameserver;

 

 

import net.sf.l2j.gameserver.model.L2World;

import net.sf.l2j.Config;

 

public class OnlinePlayers

{

    private static OnlinePlayers _instance;

 

    class AnnounceOnline implements Runnable

    {

        public void run()

        {

            Announcements.getInstance().announceToAll("There is: "+L2World.getInstance().getAllPlayers().size()+" online players");

            ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL);

        }       

    }

   

    public static OnlinePlayers getInstance()

    {

        if ( _instance == null )

            _instance = new OnlinePlayers();

        return _instance;

    }

    private OnlinePlayers()

    {

        ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), Config.ONLINE_PLAYERS_ANNOUNCE_INTERVAL);

    }

}

 

if u find any errors post here thanks

Posted

if i understand what u mean first u go:

Index: config/altsettings.properties

then

Index: net/sf/l2j/Config.java

then

Index: net/sf/l2j/gameserver/clientpackets/EnterWorld.java

then

Index: net/sf/l2j/gameserver/GameServer.java

then

Index: net/sf/l2j/gameserver/OnlinePlayers.java

 

and u are done;)

  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 2 months later...
Posted

if (L2World.getInstance().getAllPlayers().size() < 2)

Announcements.getInstance().announceToAll("There is: "+L2World.getInstance().getAllPlayers().size()+" online player");

else

Announcements.getInstance().announceToAll("There are: "+L2World.getInstance().getAllPlayers().size()+" online players");

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt
    • Why adena in this sever so expensive 🙂
  • Topics

×
×
  • Create New...