bump
|
Can somebody possibly post a method that sends out global messages at a certain time to the whole server using cycle event handler by pixelthis?
bump
bump
Anywhere in :Code:public void sendGlobalMessage() { if (this == null) return; CycleEventHandler.getSingleton().addEvent(this, new CycleEvent() { @Override public void execute(CycleEventContainer container) { sendMessage("UPDATE"); } @Override public void stop() { // TODO Auto-generated method stub } }, 4); }
addCode:public void initialize() {
Code:sendGlobalMessage();
bump
bump..
bump
Add that anywhere in Server.java in the main void.Code:CycleEventHandler.getSingleton().addEvent(this, new CycleEvent() { @Override public void execute(CycleEventContainer container) { if (PlayerHandler.playerCount > 0) { for(Player p : PlayerHandler.players) { if(p == null) continue; Client c = (Client)p; p.sendMessage("Cycled announcement"); } } } }, 4); // change the 4 to how ever many cycles you want it to execute on
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |