Thread: Run Energy Event Manager Error

Results 1 to 3 of 3
  1. #1 Run Energy Event Manager Error 
    Community Veteran


    Join Date
    Jun 2007
    Posts
    1,683
    Thanks given
    298
    Thanks received
    308
    Rep Power
    467
    Ok, I coverted my restore-run energy method to be an event, and am wondering what is wrong.

    My restore run-energy is this:
    Code:
    public void runEnergy() {
    		server.registerEvent(new Event(500) {
    			public void execute() {
    				if (System.currentTimeMillis() - thisone > getAgilityRun()) {
    					if (playerEnergy < 100) {
    						playerEnergy = (playerEnergy + 1);
    					} else {
    						server.deregisterEvent(this);
    					}
    					thisone = System.currentTimeMillis();
    				}
    				server.deregisterEvent(this);
    			}
    		});
    		sendFrame126(playerEnergy + "%", 149);
    	}
    Yet when I go to logout, the server lags for a bit then logs out, but displays this in the cmd:

    Code:
    Loaded clipmap in 63ms.
    [1] <Admin 123>:  has signed in
    [2] <123456>:  has signed in
    java.util.ConcurrentModificationException
            at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:3
    72)
            at java.util.AbstractList$Itr.next(AbstractList.java:343)
            at server.players.client.logout(client.java:8247)
            at server.players.client.parseIncomingPackets(client.java:12853)
            at server.players.client.process(client.java:14697)
            at server.players.PlayerHandler.process(PlayerHandler.java:273)
            at server.world.process.run(process.java:21)
            at java.lang.Thread.run(Thread.java:619)
    Reborn [fatal] - exception
    java.util.ConcurrentModificationException
            at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:3
    72)
            at java.util.AbstractList$Itr.next(AbstractList.java:343)
            at server.players.client.logout(client.java:8247)
            at server.players.PlayerHandler.saveGame(PlayerHandler.java:378)
            at server.players.PlayerHandler.removePlayer(PlayerHandler.java:371)
            at server.players.PlayerHandler.process(PlayerHandler.java:290)
            at server.world.process.run(process.java:21)
            at java.lang.Thread.run(Thread.java:619)
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2009
    Age
    26
    Posts
    2,666
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Try this idk =\

    if the below doesnt help get teamviewer and ill help you then just pm id & pass

    Code:
    		public void runEnergy() {
    			server.registerEvent(new Event(500) {
    				public void execute() {
    				if(!disconnected && outStream != null){
    					if (System.currentTimeMillis() - thisone > getAgilityRun()) {
    						if (playerEnergy < 100)
    							playerEnergy = (playerEnergy + 1);
    						else
    							server.deregisterEvent(this);
    						thisone = System.currentTimeMillis();
    					}
    					server.deregisterEvent(this);
    				}
    				}
    			});
    			sendFrame126(playerEnergy + "%", 149);
    		}
    Reply With Quote  
     

  3. #3  
    Community Veteran


    Join Date
    Jun 2007
    Posts
    1,683
    Thanks given
    298
    Thanks received
    308
    Rep Power
    467
    Nvm I fixed it, my saving and loading names were different
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Tags for this Thread

View Tag Cloud

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