Thread: [PI] EMERGENCY: Server disconnects when something happens, bu t i don't know what

Results 1 to 7 of 7
  1. #1 [PI] EMERGENCY: Server disconnects when something happens, bu t i don't know what 
    Registered Member
    Join Date
    Feb 2011
    Posts
    30
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Getting this in the box, btw no compile errors

    Code:
     [4/25/11 12:00 AM]: java.lang.NumberFormatException: For input string: "rj"
    [4/25/11 12:00 AM]:     at java.lang.NumberFormatException.forInputString(Unknow
    n Source)
    [4/25/11 12:00 AM]:     at java.lang.Integer.parseInt(Unknown Source)
    [4/25/11 12:00 AM]:     at java.lang.Integer.parseInt(Unknown Source)
    [4/25/11 12:00 AM]:     at server.model.players.packets.Commands.processPacket(C
    ommands.java:496)
    [4/25/11 12:00 AM]:     at server.model.players.PacketHandler.processPacket(Pack
    etHandler.java:137)
    [4/25/11 12:00 AM]:     at server.model.players.Client.processQueuedPackets(Clie
    nt.java:1087)
    [4/25/11 12:00 AM]:     at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:165)
    [4/25/11 12:00 AM]:     at server.task.impl.ProcessPlayerHandler$1.run(ProcessPl
    ayerHandler.java:15)
    [4/25/11 12:00 AM]:     at server.GameEngine$4.run(GameEngine.java:161)
    [4/25/11 12:00 AM]:     at java.util.concurrent.Executors$RunnableAdapter.call(U
    nknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
     Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.FutureTask.run(Unknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.ThreadPoolExecutor$Worker.runTas
    k(Unknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
    known Source)
    what could be causing it and how do i fix?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Mr.Client's Avatar
    Join Date
    Jun 2010
    Posts
    2,094
    Thanks given
    100
    Thanks received
    317
    Rep Power
    251
    Quote Originally Posted by Majora View Post
    Getting this in the box, btw no compile errors

    Code:
     [4/25/11 12:00 AM]: java.lang.NumberFormatException: For input string: "rj"
    [4/25/11 12:00 AM]:     at java.lang.NumberFormatException.forInputString(Unknow
    n Source)
    [4/25/11 12:00 AM]:     at java.lang.Integer.parseInt(Unknown Source)
    [4/25/11 12:00 AM]:     at java.lang.Integer.parseInt(Unknown Source)
    [4/25/11 12:00 AM]:     at server.model.players.packets.Commands.processPacket(C
    ommands.java:496)
    [4/25/11 12:00 AM]:     at server.model.players.PacketHandler.processPacket(Pack
    etHandler.java:137)
    [4/25/11 12:00 AM]:     at server.model.players.Client.processQueuedPackets(Clie
    nt.java:1087)
    [4/25/11 12:00 AM]:     at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:165)
    [4/25/11 12:00 AM]:     at server.task.impl.ProcessPlayerHandler$1.run(ProcessPl
    ayerHandler.java:15)
    [4/25/11 12:00 AM]:     at server.GameEngine$4.run(GameEngine.java:161)
    [4/25/11 12:00 AM]:     at java.util.concurrent.Executors$RunnableAdapter.call(U
    nknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
     Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.FutureTask.run(Unknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.ThreadPoolExecutor$Worker.runTas
    k(Unknown Source)
    [4/25/11 12:00 AM]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
    known Source)
    what could be causing it and how do i fix?
    Hint: Commands
    Reply With Quote  
     

  3. #3  
    Donator

    Robgob69's Avatar
    Join Date
    Oct 2010
    Age
    31
    Posts
    749
    Thanks given
    71
    Thanks received
    139
    Discord
    View profile
    Rep Power
    117
    lol it tells you whats wrong. It has a problem parsing the string to an int in one of your commands. Post your command that the line 496 is in.
    potatoes.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Feb 2011
    Posts
    30
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Quote Originally Posted by Robgob69 View Post
    lol it tells you whats wrong. It has a problem parsing the string to an int in one of your commands.java. Post your command that the line 496 is in.

    I know but I didn't edit this command at all


    Code:
    if (playerCommand.startsWith("tele")) {
    				String[] arg = playerCommand.split(" ");
    				if (arg.length > 3)
    					c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
    				else if (arg.length == 3)
    					c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); //this is line 496
    			}
    edit: and whats the first line mean? input string rj? what's that?
    Reply With Quote  
     

  5. #5  
    Registered Member
    gomomo11's Avatar
    Join Date
    May 2010
    Posts
    2,383
    Thanks given
    268
    Thanks received
    196
    Rep Power
    177
    Replace with

    Code:
    if (playerCommand.startsWith("tele")) {
    	try {
    		String[] arg = playerCommand.split(" ");
    			if (arg.length > 3)
    				c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
    			else if (arg.length == 3)
    				c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); //this is line 496
    	} catch(Exception e) {
    					
    				}
    }
    Should fix your problem

    no external links without affiliate
    Reply With Quote  
     

  6. #6  
    Donator

    Robgob69's Avatar
    Join Date
    Oct 2010
    Age
    31
    Posts
    749
    Thanks given
    71
    Thanks received
    139
    Discord
    View profile
    Rep Power
    117
    Quote Originally Posted by gomomo11 View Post
    Replace with

    Code:
    if (playerCommand.startsWith("tele")) {
    	try {
    		String[] arg = playerCommand.split(" ");
    			if (arg.length > 3)
    				c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3]));
    			else if (arg.length == 3)
    				c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); //this is line 496
    	} catch(Exception e) {
    					
    				}
    }
    Should fix your problem
    was just about to post that ;]
    potatoes.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    Lol, pretty funny that you were allowing everyone in the server to use this command that could cause an exception that shuts down the server.

    If I were you I'd make sure my other commands were okay as well..
    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

Similar Threads

  1. rep if you help! [emergency]
    By pkersworld in forum Help
    Replies: 1
    Last Post: 04-18-2011, 06:27 PM
  2. Replies: 12
    Last Post: 04-16-2011, 11:20 AM
  3. [pi] {$} emergency! Need immediate help!
    By Crispytoast in forum Help
    Replies: 5
    Last Post: 03-14-2011, 08:48 AM
  4. [PI]Server randomly disconnects
    By Arithium in forum Help
    Replies: 13
    Last Post: 02-09-2011, 03:09 AM
  5. Replies: 11
    Last Post: 02-11-2010, 07:05 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •