Jump to content

Recommended Posts

Posted

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jfrozen.gameserver.model.entity;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;



/**
* 
* @author Debian
*
*/

public class AnnounceOnlinePlayers
{
    public static void getInstance()
    {
        ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
        {
            @Override
            public void run()
            {
                Announce();
            }
        }, 0,Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000);
     }
    
    public static void Announce()
    {
        int NumberofPlayers = L2World.getInstance().getAllPlayers().size();

        if (NumberofPlayers == 1)
            Announcements.getInstance().announceToAll(NumberofPlayers + " player is online.");
        else
            Announcements.getInstance().announceToAll(NumberofPlayers + " players are online.");
    }
}

Code Fixed For L2JFrozen

Posted

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jfrozen.gameserver.model.entity;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;



/**
* 
* @author Debian
*
*/

public class AnnounceOnlinePlayers
{
    public static void getInstance()
    {
        ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
        {
            @Override
            public void run()
            {
                Announce();
            }
        }, 0,Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000);
     }
    
    public static void Announce()
    {
        int NumberofPlayers = L2World.getInstance().getAllPlayers().size();

        if (NumberofPlayers == 1)
            Announcements.getInstance().announceToAll(NumberofPlayers + " player is online.");
        else
            Announcements.getInstance().announceToAll(NumberofPlayers + " players are online.");
    }
}

Code Fixed For L2JFrozen

 

Thanks !!!  :gusta:  :gusta:  :gusta:

  • 3 years later...
Posted

AnnounceOnlinePlayers.java

package net.sf.l2j.gameserver.model.entity;

import net.sf.l2j.commons.concurrent.ThreadPool;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.World;
import net.sf.l2j.gameserver.util.Broadcast;

public class AnnounceOnlinePlayers
{
	public static void getInstance()
	{
		ThreadPool.scheduleAtFixedRate(new Runnable()
		{
			@Override
			public void run()
			{
				Announce();
			}
		}, 0, Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000);
	}

	protected static void Announce()
	{
		int NumberofPlayers = World.getInstance().getPlayers().size();
		
		if (NumberofPlayers == 1)
			Broadcast.announceToOnlinePlayers(NumberofPlayers + " player is online.");
		else
			Broadcast.announceToOnlinePlayers(NumberofPlayers + " player are online.");
	}
}
  • 2 months later...
Posted

Can be shortcuted to:

ThreadPool.scheduleAtFixedRate(() -> Broadcast.announceToOnlinePlayers(World.getInstance().getPlayers().size() + " online player(s)."), 0, Config.ANNOUNCE_ONLINE_PLAYERS_DELAY * 1000);

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

    • Keep posting prive messages like 15 years old kid and not answering actually like a grown up man. and yes ill try sue you for this. A chance to get money is always a chance if possible.
    • sell adena l2rebon signature x1 - 1kk = 1 dollars l2reborn x10 - 500kk = 4 dollars E-Global x Lu4 - 1kk = 2 dollars BOHPTS - x20-x500 TOP PRICE DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO Also on sale are Epic jewelry, Clothes at a very good price
    • So few things for this guy:   He asked me to implement a code like EXP, SP, DROP runes in his server that did not work and he paid 27 Euro via Revolut.  He has no idea what compile, source is and he work with ubuntu.  I entered to his PC and using eclipse i add the code and compile as usually, i ask him to replace the jar with the new jar. He did not know how so i did it my self. Later on the ubuntu which im not familiar with could not continue and did not throw any error. I did not know what was happening until i asked Nightwolf who is experienced with Ubuntu and told me probably some error and can't continue. I was surprized since i only added few lines not edit or changed anything so i knew that the Login, Gameserver from source had mismatch with the compiled one. Later on i fix an error he had in raidboss_spawnlist where Long value tried to store inside Int value and explained him:   https://postimg.cc/F1zxMfDW   later on i explained him that source and compiled that he had had many issues and it was not my problem and he said that my code destroyed all his compiled.    In this point i ask @flatronnto post source or compile with my code inside to check the code i made and how he claim it destroyed his source. If he post then all can see what i added and it did not affect the source in an way other than edit the addExperience method - drop method and L2ItemInstance class. If he deny then all his trash talk is fake.   Then i tried contact him to resolve the issue even tho is not my problem, he paid for the code, i did the code, i was done but he ignored me:   https://postimg.cc/ts4RkjXt   I stopped after he claimed i destroyed intentionally his server, that i enter to other's PC to hack / destroy their compiles and when he said he will false advertise my server.    If @Nightw0lf can post he can also verify he don't know compile, server, source, java differences but he also claim fake things that any other person with much money and good knowledge and patience could sue him online. He can't even open a proper report topic, he post in L2 OFF section.    In addition this guy offenses rudeness and treats is on another level, we had appointment at 18:00 GR time i was waiting for him 25 min and then i left PC for a bit, he showed up after 30 minutes and he said you're not here ill false advertisent you e.t.c.    https://postimg.cc/pmKNKcjV   He is mentally unstable and nobody should trade with this person. @Celestine Anyone can request LOG from my discord to see all conversation if he want. I have nothing to hide i worked for the money he paid and i did my job perfectly. I have 4-5 clients a week in last year and nobody had issues. Read the answer i just posted and you see who is right and who is wrong.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock