Thread: walking lag will pay

Results 1 to 4 of 4
  1. #1 walking lag will pay 
    Registered Member

    Join Date
    Sep 2009
    Posts
    1,723
    Thanks given
    45
    Thanks received
    81
    Rep Power
    269
    i got this walking lag on my delta server after 15 hours of running

    i dont have event manager


    Web Hosting | VPS | CDN | DDoS Protected Solutions
    Reply With Quote  
     

  2. #2  
    Extreme Donator


    Join Date
    Nov 2009
    Posts
    1,421
    Thanks given
    559
    Thanks received
    266
    Rep Power
    236
    I'm sure there's a tutorial on fixing this problem.
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Sep 2009
    Posts
    1,723
    Thanks given
    45
    Thanks received
    81
    Rep Power
    269
    Quote Originally Posted by Rapidshare View Post
    I'm sure there's a tutorial on fixing this problem.
    thats for delta cleaned


    Web Hosting | VPS | CDN | DDoS Protected Solutions
    Reply With Quote  
     

  4. #4  
    Registered Member [Mash]'s Avatar
    Join Date
    Jul 2010
    Posts
    40
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Try this:

    Code:
    public class Process extends Thread {
    	public static int cycleTime = 500;
    
    	@Override
    	public void run() {
    		int waitFails = 0;
    		long lastTicks = System.currentTimeMillis();
    		long totalTimeSpentProcessing = 0;
    		int cycle = 0;
    		while (!Server.shutdownServer) {
    			try {
    				if (Server.updateServer)
    					Server.calcTime();
    				Server.playerHandler.process();
    				Server.npcHandler.process();
    				Server.itemHandler.process();
    				Server.shopHandler.process();
    				long timeSpent = System.currentTimeMillis() - lastTicks;
    				totalTimeSpentProcessing += timeSpent;
    				if (timeSpent >= cycleTime) {
    					timeSpent = cycleTime;
    				}
    				try {
    					Thread.sleep(cycleTime - timeSpent);
    				} catch (java.lang.Exception _ex) {
    				}
    				lastTicks = System.currentTimeMillis();
    				cycle++;
    				if (cycle % 100 == 0) {
    				float time = ((float) totalTimeSpentProcessing) / cycle;
    				}
    				if (Server.ShutDown == true) {
    					if (Server.ShutDownCounter >= 100) {
    						Server.shutdownServer = true;
    					}
    					Server.ShutDownCounter++;
    				}
    			} catch (Exception e) {
    				e.printStackTrace();
    			}
    		}
    
    		// shut down the server
    		EventManager.getSingleton().shutdown();
    		Server.playerHandler.destruct();
    		Server.clientHandler.killServer();
    		Server.clientHandler = null;
    	}
    }
    I take NO CREDIT for this.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •