Thread: DeltaClean - Walking Lag Fix

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38
  1. #1 DeltaClean - Walking Lag Fix 
    Banned

    Join Date
    Jul 2008
    Posts
    2,056
    Thanks given
    26
    Thanks received
    98
    Rep Power
    0
    Purpose: To remove the 'Walking lag' problem in DeltaClean

    Difficulty: 1

    Explanation: For those using my 'DeltaClean' Base located [Only registered and activated users can see links. ], Most of you notice there is a problem with walking and it is laggy, Follow the steps below to fix this and continue learning good habits.



    Step 1:

    Open up 'Process.java',


    Step 2:

    Replace EVERYTHING in there with the following:

    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;
    	}
    }


    Step 3:

    Save, compile, and test it out.






    Note: I havn't tested this, but it should work, so if somebody could test and confirm this would be much appreciated.

    Also, depending on the success of this tutorial and overall use of DeltaClean i may release a crash patched version to stop the crashing. Thanks
     

  2. #2  
    Retired. Stop PMing me.

    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,528
    Thanks given
    1,783
    Thanks received
    2,822
    Discord
    View profile
    Rep Power
    5000
    Nice Jonny, sure it'll be useful .
    [Only registered and activated users can see links. ]
     

  3. #3  
    Registered Member
    DaraX's Avatar
    Join Date
    Apr 2009
    Posts
    1,183
    Thanks given
    18
    Thanks received
    29
    Rep Power
    262
    Nice Jonny, but I don't think many people used DeltaClean in the first place.
     

  4. #4  
    Registered Member

    Join Date
    Jan 2008
    Posts
    1,338
    Thanks given
    243
    Thanks received
    85
    Rep Power
    250
    nicely done mate : ) thanks for this eventhought i dont use that
    [Only registered and activated users can see links. ]
     

  5. #5  
    Banned

    Join Date
    Jul 2008
    Posts
    2,056
    Thanks given
    26
    Thanks received
    98
    Rep Power
    0
    Last time i checked it had almost 5k downloads. so meh some1 will find it usefull
     

  6. #6  
    Registered Member
    DaraX's Avatar
    Join Date
    Apr 2009
    Posts
    1,183
    Thanks given
    18
    Thanks received
    29
    Rep Power
    262
    Quote Originally Posted by ẨřЌαdĩαņ View Post
    Last time i checked it had almost 5k downloads. so meh some1 will find it usefull
    I mean, a lot of people downloaded it, but not many people used it, its still nice btw, I'm not trying to flame.
     

  7. #7  
    Banned

    Join Date
    Nov 2009
    Posts
    4,222
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    Nice. You should also replace your current download link with this problem fixed so people don't have to search.
     

  8. #8  
    Registered Member
    Pilldom's Avatar
    Join Date
    Sep 2007
    Posts
    1,298
    Thanks given
    23
    Thanks received
    221
    Rep Power
    164
    O I kept looking at the walking packets and player.java to find what was going on >,<
    [Only registered and activated users can see links. ]
     

  9. #9  
    Registered Member
    Pilldom's Avatar
    Join Date
    Sep 2007
    Posts
    1,298
    Thanks given
    23
    Thanks received
    221
    Rep Power
    164
    Quote Originally Posted by ddu devin View Post
    Lmao..
    Sorry I forgot that usually when there is a problem with walking you dont look in where walking is handled rather where the process is handled. Cause thats every ones first instinct.
    [Only registered and activated users can see links. ]
     

  10. #10  
    Banned

    Join Date
    Jul 2008
    Posts
    2,056
    Thanks given
    26
    Thanks received
    98
    Rep Power
    0
    Quote Originally Posted by qualala View Post
    Sorry I forgot that usually when there is a problem with walking you dont look in where walking is handled rather where the process is handled. Cause thats every ones first instinct.
    Do you use DeltaClean / Have you tested this? Does it work?
     

Page 1 of 4 123 ... LastLast

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
  •