Thread: 317 PI InsidiaX no errors when compiling but outofboundsexception: 25

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 317 PI InsidiaX no errors when compiling but outofboundsexception: 25 
    Registered Member

    Join Date
    Oct 2016
    Posts
    136
    Thanks given
    70
    Thanks received
    37
    Rep Power
    105
    So, the base had construction removed and replaced with pking skill, changed that to construction. tried adding a costum skill for pking and have the level read in quest tab (for now) and I get this error and all the client says is logging in over and over

    Code:
    [6/15/19 3:34 AM]: Launching InsidiaX...
    [6/15/19 3:34 AM]: Loaded clipmap in 40ms.
    [6/15/19 3:34 AM]: Server listening on port 127.0.0.1:43594
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.process(Client.java:1873)
    
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:151)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.initialize(Client.java:91
    2)
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:195)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.process(Client.java:1873)
    
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:151)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.initialize(Client.java:91
    2)
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:195)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.process(Client.java:1873)
    
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:151)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: java.lang.ArrayIndexOutOfBoundsException: 25
    [6/15/19 3:34 AM]:      at server.model.players.Client.initialize(Client.java:91
    2)
    [6/15/19 3:34 AM]:      at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:195)
    [6/15/19 3:34 AM]:      at server.Server.main(Server.java:192)
    [6/15/19 3:34 AM]: Game saved for player donovan
    [6/15/19 3:34 AM]: [DEREGISTERED]: donovan
    any help is much apperciated


    Client error area
    Code:
    	int totalz = (getLevelForXP(playerXP[0]) + getLevelForXP(playerXP[1]) + getLevelForXP(playerXP[2]) + getLevelForXP(playerXP[3]) + getLevelForXP(playerXP[4]) + getLevelForXP(playerXP[5]) + getLevelForXP(playerXP[6]) + getLevelForXP(playerXP[7]) + getLevelForXP(playerXP[8]) + getLevelForXP(playerXP[9]) + getLevelForXP(playerXP[10]) + getLevelForXP(playerXP[11]) + getLevelForXP(playerXP[12]) + getLevelForXP(playerXP[13]) + getLevelForXP(playerXP[14]) + getLevelForXP(playerXP[15]) + getLevelForXP(playerXP[16]) + getLevelForXP(playerXP[17]) + getLevelForXP(playerXP[18]) + getLevelForXP(playerXP[19]) + getLevelForXP(playerXP[20]) + getLevelForXP(playerXP[21]) + getLevelForXP(playerXP[22]) + getLevelForXP(playerXP[23]) + getLevelForXP(playerXP[24]) + getLevelForXP(playerXP[25]));;
    	for (int d = 0; d <= 10; d++) {
    		if (totalz >= ranks[d]) {
    			if (d == 0) {
    			if (d == 0) {
    				playerRank = d+1;
    				ranks[d] = totalz;
    				rankPpl[d] = playerName;
    			}else if (d < 10){
    				if (totalz < ranks[d-1]) {
    					playerRank = d+1;
    					ranks[d] = totalz;
    					rankPpl[d] = playerName;
    				}
    			}else{
    				if (totalz < ranks[d-1]) {
    					playerRank = 0;
    				}
    			}
    		}
    	}
    }
    Playerhandler error
    Code:
    players[i].process();

    Server error
    Code:
    playerHandler.process();
    Any suggestions
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,712
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    in your Client.java file at line 1873 is where your ArrayIndexOutOfBoundsException starts.
    This then follow up by PlayerHandler.java at line 151 and end at Server.java at line 192.
    Check these out and you will figure out a fix.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member

    Join Date
    Oct 2016
    Posts
    136
    Thanks given
    70
    Thanks received
    37
    Rep Power
    105
    Quote Originally Posted by arch337 View Post
    in your Client.java file at line 1873 is where your ArrayIndexOutOfBoundsException starts.
    This then follow up by PlayerHandler.java at line 151 and end at Server.java at line 192.
    Check these out and you will figure out a fix.
    best way to view line numbers? notepad doesnt have them, cant find them on eclipse

    Client error area
    Code:
    	int totalz = (getLevelForXP(playerXP[0]) + getLevelForXP(playerXP[1]) + getLevelForXP(playerXP[2]) + getLevelForXP(playerXP[3]) + getLevelForXP(playerXP[4]) + getLevelForXP(playerXP[5]) + getLevelForXP(playerXP[6]) + getLevelForXP(playerXP[7]) + getLevelForXP(playerXP[8]) + getLevelForXP(playerXP[9]) + getLevelForXP(playerXP[10]) + getLevelForXP(playerXP[11]) + getLevelForXP(playerXP[12]) + getLevelForXP(playerXP[13]) + getLevelForXP(playerXP[14]) + getLevelForXP(playerXP[15]) + getLevelForXP(playerXP[16]) + getLevelForXP(playerXP[17]) + getLevelForXP(playerXP[18]) + getLevelForXP(playerXP[19]) + getLevelForXP(playerXP[20]) + getLevelForXP(playerXP[21]) + getLevelForXP(playerXP[22]) + getLevelForXP(playerXP[23]) + getLevelForXP(playerXP[24]) + getLevelForXP(playerXP[25]));;
    	for (int d = 0; d <= 10; d++) {
    		if (totalz >= ranks[d]) {
    			if (d == 0) {
    			if (d == 0) {
    				playerRank = d+1;
    				ranks[d] = totalz;
    				rankPpl[d] = playerName;
    			}else if (d < 10){
    				if (totalz < ranks[d-1]) {
    					playerRank = d+1;
    					ranks[d] = totalz;
    					rankPpl[d] = playerName;
    				}
    			}else{
    				if (totalz < ranks[d-1]) {
    					playerRank = 0;
    				}
    			}
    		}
    	}
    }
    Playerhandler error
    Code:
    players[i].process();


    Server error
    Code:
    playerHandler.process();
    Any suggestions
    Reply With Quote  
     

  6. Thankful user:


  7. #4  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,712
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    Quote Originally Posted by Jrage View Post
    best way to view line numbers? notepad doesnt have them, cant find them on eclipse

    Client error area
    Code:
    	int totalz = (getLevelForXP(playerXP[0]) + getLevelForXP(playerXP[1]) + getLevelForXP(playerXP[2]) + getLevelForXP(playerXP[3]) + getLevelForXP(playerXP[4]) + getLevelForXP(playerXP[5]) + getLevelForXP(playerXP[6]) + getLevelForXP(playerXP[7]) + getLevelForXP(playerXP[8]) + getLevelForXP(playerXP[9]) + getLevelForXP(playerXP[10]) + getLevelForXP(playerXP[11]) + getLevelForXP(playerXP[12]) + getLevelForXP(playerXP[13]) + getLevelForXP(playerXP[14]) + getLevelForXP(playerXP[15]) + getLevelForXP(playerXP[16]) + getLevelForXP(playerXP[17]) + getLevelForXP(playerXP[18]) + getLevelForXP(playerXP[19]) + getLevelForXP(playerXP[20]) + getLevelForXP(playerXP[21]) + getLevelForXP(playerXP[22]) + getLevelForXP(playerXP[23]) + getLevelForXP(playerXP[24]) + getLevelForXP(playerXP[25]));;
    	for (int d = 0; d <= 10; d++) {
    		if (totalz >= ranks[d]) {
    			if (d == 0) {
    			if (d == 0) {
    				playerRank = d+1;
    				ranks[d] = totalz;
    				rankPpl[d] = playerName;
    			}else if (d < 10){
    				if (totalz < ranks[d-1]) {
    					playerRank = d+1;
    					ranks[d] = totalz;
    					rankPpl[d] = playerName;
    				}
    			}else{
    				if (totalz < ranks[d-1]) {
    					playerRank = 0;
    				}
    			}
    		}
    	}
    }
    Playerhandler error
    Code:
    players[i].process();


    Server error
    Code:
    playerHandler.process();
    Any suggestions
    Use an ide, notepad++ or press ctrl + g then enter the line number. The last one do not display line number but you can go directly to it.
    Either remove getLevelForXP(playerXP[25]) or add extra slot for playerXP array (you might need to do this for level aswell).


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  8. Thankful user:


  9. #5  
    Registered Member

    Join Date
    Oct 2016
    Posts
    136
    Thanks given
    70
    Thanks received
    37
    Rep Power
    105
    Either remove getLevelForXP(playerXP[25]) or add extra slot for playerXP array (you might need to do this for level aswell).
    Cant very well remove it, How else am I supposed to make the level show? No matter how I try to make it show the level, its gonna require me to grab the levelxp eventually

    Could this be where it lies?

    public int[] playerLevel = new int[25];
    public int[] playerXP = new int[25];
    Cant figure out what the two 25s are for
    Reply With Quote  
     

  10. Thankful user:


  11. #6  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,712
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    Quote Originally Posted by Jrage View Post
    Cant very well remove it, How else am I supposed to make the level show? No matter how I try to make it show the level, its gonna require me to grab the levelxp eventually

    Could this be where it lies?



    Cant figure out what the two 25s are for
    Change them to 26 as you are using 25 in your values.
    Arrays start at 0 so 25 slots are 0 - 24 and since you tried to use 25 you were out of it's bound. If you change it to 26, you can use 0 - 25.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  12. Thankful users:


  13. #7  
    Registered Member

    Join Date
    Oct 2016
    Posts
    136
    Thanks given
    70
    Thanks received
    37
    Rep Power
    105
    Quote Originally Posted by arch337 View Post
    Change them to 26 as you are using 25 in your values.
    Arrays start at 0 so 25 slots are 0 - 24 and since you tried to use 25 you were out of it's bound. If you change it to 26, you can use 0 - 25.
    See, thats how I learn. Thank you for helping me.

    I have to go to bed, everything works so far, I'll test xp gain later. only gonna have about 4 hours sleep for work lol
    Reply With Quote  
     

  14. Thankful user:


  15. #8  
    PHP Developer

    Join Date
    Oct 2017
    Posts
    40
    Thanks given
    1
    Thanks received
    7
    Rep Power
    14
    Quote Originally Posted by Jrage View Post
    Cant very well remove it, How else am I supposed to make the level show? No matter how I try to make it show the level, its gonna require me to grab the levelxp eventually

    Could this be where it lies?



    Cant figure out what the two 25s are for
    To better explain what the 25s are, they're the size of the arrays within those variables. In this case, the 25 tells us that there are 25 skills in the game. As someone else mentioned, your server has 26 skills, that's where the error occurs. It's looking for a place that doesn't exist.
    Reply With Quote  
     

  16. #9  
    Wut can u say when theres nothin to tell

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    20
    Posts
    1,520
    Thanks given
    636
    Thanks received
    381
    Rep Power
    930
    Wtf insidiax?




    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  17. #10  
    I Like Chicken Nuggets :]

    Join Date
    Aug 2014
    Posts
    314
    Thanks given
    4
    Thanks received
    56
    Rep Power
    54
    LOL. Don't use this garbage source. it's filled with bugs, exploits, dupes, and more... It's from a different era. Seriously don't use this lol.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. Replies: 5
    Last Post: 10-02-2018, 05:34 PM
  2. PI 74 Signlink Errors When Compiling
    By samxdesigns in forum Help
    Replies: 2
    Last Post: 08-25-2012, 07:34 PM
  3. [PI]Javac error when compiling?
    By imurdernubs in forum Help
    Replies: 11
    Last Post: 04-18-2012, 09:30 PM
  4. Replies: 0
    Last Post: 05-20-2011, 05:11 AM
  5. Replies: 10
    Last Post: 01-04-2010, 10:53 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •