Jump to content

Recommended Posts

Posted

OnlinePlayers.png

 

Index: \java\net\sf\l2j\gameserver

/*
* 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 net.sf.l2j.gameserver;

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

public class OnlinePlayers
{
private static OnlinePlayers _instance;
class AnnounceOnline implements Runnable
{
	public void run()
	{
		System.out.println(L2World.getInstance().getAllPlayers().size()+ " online players");
		ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 300000); //Delay between system.out.printin 300000=5min
	}
}
private OnlinePlayers()
{
	ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 180000); //Schedule load
}
public static OnlinePlayers getInstance()
{
	if (_instance == null)
		_instance = new OnlinePlayers();
	return _instance;
}
}

Posted

a bit useless dont you think? btw thanks for share dude.

I don't think so.

Let see... If you're owner and you want to see how many are online without enter in the game, this is solution :D

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 net.sf.l2j.gameserver;

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

public class OnlinePlayers
{
private static OnlinePlayers _instance;
class AnnounceOnline implements Runnable
{
	public void run()
	{
		System.out.println(L2World.getInstance().getAllPlayers().size()+ " online players");
		ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 300000); //Delay between system.out.printin 300000=5min
	}
}
private OnlinePlayers()
{
	ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 180000); //Schedule load
}
public static OnlinePlayers getInstance()
{
	if (_instance == null)
		_instance = new OnlinePlayers();
	return _instance;
}
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Don't listen to them, they hate us AI coders because we are taking senior engineer jobs. In the company I work, they fired all senior developers, bought claude to all junior developers and promoted them to senior. Since I was the only one junior-mid, I was given claude code max 200 and got promoted to company's Tech Lead.
    • Its always the people who build nothing that have the most to say!  15+ years of development experience with 10+ programming languages and countless completed projects. If your best argument is 'you discovered AI,' I'll assume you couldnt find anything wrong with the launcher.
    • Looks like somebody discovered AI recently
    • Added: Server monitoring has been added to the protection dashboard, available for Premium+ plans. Each entry displays: Account — game login. HWID — hardware ID. GSID — the game server the entry belongs to. IP — the player's address. Country — determined by IP, with flag and name. Useful for SEO promotion, do you know where more players come from Status — "Banned" or "OK". Extra windows — how many additional windows are allowed for this HWID beyond the global limit. Last seen — time of last activity.   At the top — a summary: total entries, number banned, time of the last report, and an Online/Offline indicator (based on how fresh the data from the protection is).   Filters and search Search by account, HWID, or IP. Country — select from countries actually present in the data. Game server (GS) — filter by GSID. Period — by last activity date (from / to). Banned only — quick filter for violators. Grouping — collapse data by HWID, IP, or account: one row per key with counts of accounts/HWIDs/IPs and number of entries. Handy for catching multi-accounters (many accounts from one HWID) and suspicious IPs.   Ban / Unban — banning by HWID blocks all accounts on that hardware. The protection will pick up the command within a minute; until applied, a "Pending…" status is shown. Grant windows — set additional windows (+N) for a specific HWID via a convenient selector. Single token per account to link the protection with the dashboard: Generate / Reissue token in one click. Show token — view the current value at any time. The token is stored encrypted. Don't share it with anyone — if compromised, simply reissue it and the old one stops working immediately. In the protection config, you can enable monitoring, insert the token, and change how often data is sent to the protection dashboard.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..