Jump to content

Recommended Posts

Posted
System.out.println(L2World.getInstance().getAllPlayers().size()+ " online players");
+Announcements.getInstance().announceToAll(L2World.getInstance().getAllPlayers().size()+ " online players");

  • 4 months later...
  • 2 weeks later...
Posted

Greetings guys, i am newbie in l2j so be patient with me please, if i write this code into java/com/l2jserver/gameserver/gameserver.java i cannot save it and i get an error : "The public type OnlinePlayers must be defined in its own file"

package com.l2jserver.gameserver;

import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.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;
}
}

 

what's the problem please ?

-and then, after i will compile it through build.xml I need just to copy l2jserver.jar from "build" folder to gameserver folder ?

Thanks.

 

  • 2 weeks later...
Posted

Greetings guys, i am newbie in l2j so be patient with me please, if i write this code into java/com/l2jserver/gameserver/gameserver.java i cannot save it and i get an error : "The public type OnlinePlayers must be defined in its own file"

...

 

what's the problem please ?

-and then, after i will compile it through build.xml I need just to copy l2jserver.jar from "build" folder to gameserver folder ?

Thanks.

You must put at java/com/l2jserver/gameserver and create a new java file with name OnlinePlayers.java and write inside the code that xAddytzu shared.

 

About upgrade your pack with the fix,you will copy paste from build.xml of gameserver the l2jserver.jar and paste at your pack gameserver/libs

  • 4 weeks later...

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



×
×
  • 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