Thread: Start Server Error

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Start Server Error 
    Registered Member Matheus_Silva's Avatar
    Join Date
    Oct 2014
    Posts
    11
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Wanted to know why this is happening


    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Most likely have an invalid line in your object/npc spawning text file.
    Reply With Quote  
     

  3. #3  
    Registered Member Matheus_Silva's Avatar
    Join Date
    Oct 2014
    Posts
    11
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Mayne View Post
    Most likely have an invalid line in your object/npc spawning text file.
    well I did not do any alteration made ​​only the server compiler with eclipse
    Reply With Quote  
     

  4. #4  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    1,666
    Thanks given
    253
    Thanks received
    407
    Rep Power
    296
    Can you copy and paste that, it is a bit unclear in the picture.
    Reply With Quote  
     

  5. #5  
    Registered Member Matheus_Silva's Avatar
    Join Date
    Oct 2014
    Posts
    11
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by bobismyname View Post
    Can you copy and paste that, it is a bit unclear in the picture.

    Code:
    ERROR! THREAD NAME: main
    Starting...
    ERROR! THREAD NAME: main
    java.lang.NumberFormatException: For input string: ""
            at java.lang.NumberFormatException.forInputString(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at com.rs.utils.NPCSpawns.loadSpawns(NPCSpawns.java:40)
            at com.rs.Launcher.main(Launcher.java:90)
    Legendary Is Now Online (Port: 43595, Launch Time: 3.978s)
    Errors were no different I have done absolutely nothing, just restarted the computer
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    1,666
    Thanks given
    253
    Thanks received
    407
    Rep Power
    296
    One of the lines in your unpacked spawns is messed up I'm assuming, there is either a number missing or a space placed accidently where it is not supposed to be. Look at your most recently added spawns
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Ignorance is always an excuse

    Mikee's Avatar
    Join Date
    Nov 2009
    Posts
    2,370
    Thanks given
    732
    Thanks received
    490
    Rep Power
    656
    It's saying the input string is ""

    It's trying to format that line as a number, even though it is not one.

    Remove the empty line(s) or make it so when the spawns are being loaded you have a line in the loop like:

    Code:
    if (line.equals("") continue;



    The day Aj repped me, my life changed forever
    Quote Originally Posted by Aj View Post
    Rep++ for you
    Reply With Quote  
     

  9. Thankful user:


  10. #8  
    Registered Member Matheus_Silva's Avatar
    Join Date
    Oct 2014
    Posts
    11
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    My NPCSpawns.java

    Code:
    package com.rs.utils;
    
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    
    import com.rs.cache.loaders.ItemDefinitions;
    import com.rs.cache.loaders.NPCDefinitions;
    import com.rs.database.DatabasePool;
    import com.rs.game.World;
    import com.rs.game.WorldTile;
    import com.rs.game.player.Player;
    
    public final class NPCSpawns {
    	
    	public static void loadSpawns() {
    		if (!new File("data/npcs/CustomSpawns.txt").exists())
    			throw new RuntimeException("Couldn't find Spawn data");
    		try {
    			BufferedReader in = new BufferedReader(new FileReader("data/npcs/CustomSpawns.txt"));
    			while (true) {
    				String line = in.readLine();
    				if (line == null) {
    					break;
    				}
    				
    				if (line.startsWith("//"))
    					continue;
    				
    				line = line.replace("\t\t", "\t");
    				String[] split = line.split("\t");
    				
    				int id = Integer.parseInt(split[0]); //Line 40
    				int x = Integer.parseInt(split[1]);
    				int y = Integer.parseInt(split[2]);
    				int plane = Integer.parseInt(split[3]);
    				int hash = Integer.parseInt(split[4]);
    				boolean canAttack = Boolean.parseBoolean(split[5]);
    				NPCDefinitions defs = NPCDefinitions.getNPCDefinitions(id);
    				if (defs.getName() == "null") {
    					continue;
    				}
    				World.spawnNPC(id, new WorldTile(x, y, plane), hash, canAttack, false);
    			}
    			in.close();
    		} catch (Throwable e) {
    			Logger.handle(e);
    		}
    	}
    	
    	public static boolean writeSpawn(Player player, int npcId, int x, int y, int z, int mapHash, boolean aooa) {
    		try {
    			PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("data/npcs/CustomSpawns.txt", true)));
    			String tab = "\t", npcName = NPCDefinitions.getNPCDefinitions(npcId).getName();
    		    out.println(npcId + tab + x + tab + y + tab + z + tab + mapHash + tab + aooa + tab + npcName);
    		    out.close();
    		} catch (IOException e) {
    		    player.sendMessage("Error writing file.");
    		    System.err.println(e);
    		    return false;
    		}
    		return true;
    	}
    	
    	private NPCSpawns() {
    	}
    }
    Reply With Quote  
     

  11. #9  
    Registered Member
    Join Date
    Aug 2007
    Posts
    248
    Thanks given
    28
    Thanks received
    25
    Rep Power
    5
    When they said unpacked spawns, they didnt mean NPCSpawn.java.

    You have a rogue line in your Server\data\npcs\UnpackedSpawnsList.txt

    This means you probably have a space somewhere, remove it delete packed spawns (Server\data\npcs\PackedSpawns) and reboot. Problem = solved.
    Elite Lurker
    Reply With Quote  
     

  12. Thankful user:


  13. #10  
    Registered Member Matheus_Silva's Avatar
    Join Date
    Oct 2014
    Posts
    11
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Aexious View Post
    When they said unpacked spawns, they didnt mean NPCSpawn.java.

    You have a rogue line in your Server\data\npcs\UnpackedSpawnsList.txt

    This means you probably have a space somewhere, remove it delete packed spawns (Server\data\npcs\PackedSpawns) and reboot. Problem = solved.
    I put the code of NPCSpawns.Java since the start I kind of understood that it was error
    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: 3
    Last Post: 01-14-2012, 03:17 PM
  2. trying to start server error plz help
    By izaazkothawala in forum Help
    Replies: 5
    Last Post: 08-25-2011, 12:13 AM
  3. [PI] error when starting server [PI]
    By Sillhouette in forum Help
    Replies: 6
    Last Post: 04-22-2011, 05:17 AM
  4. Error when starting Server?
    By Continue in forum Help
    Replies: 0
    Last Post: 12-31-2009, 05:22 PM
  5. Error Starting Server?
    By SilentZPrO in forum Help
    Replies: 3
    Last Post: 10-15-2009, 02:10 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
  •