Gameserver Show OnlinePlayers
Posted: Wed Jan 12, 2011 7:25 am
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.
Code: Select all
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; }}
-and then, after i will compile it through build.xml I need just to copy l2jserver.jar from "build" folder to gameserver folder ?
Thanks.