Thread: Loading 474 map files

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Loading 474 map files 
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Fixed.
    Reply With Quote  
     

  2. #2  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by V i c t o r View Post
    ....
    search ur source for "Error loading map region:"

    and paste the code that causes that to be printed cos then we can find the error
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Quote Originally Posted by Shadowy View Post
    search ur source for "Error loading map region:"

    and paste the code that causes that to be printed cos then we can find the error
    It was in the ObjectDef I posted.

    Code:
    public static void load() {
        	try {
    		File f = new File("./Data/world/map_index");
    		byte[] buffer = new byte[(int) f.length()];
    		DataInputStream dis = new DataInputStream(new FileInputStream(f));
    		dis.readFully(buffer);
    		dis.close();
            ByteStream in = new ByteStream(buffer);
            int size = in.length() / 7;
            regions = new Region[size];
            int[] regionIds = new int[size];
            int[] mapGroundFileIds = new int[size];
            int[] mapObjectsFileIds = new int[size];
    		boolean[] isMembers = new boolean[size];
            for (int i = 0; i < size; i++) {
                regionIds[i] = in.getUShort();
                mapGroundFileIds[i] = in.getUShort();
                mapObjectsFileIds[i] = in.getUShort();
                isMembers[i] = in.getUByte() == 0;
            }
            for (int i = 0; i < size; i++) {
                regions[i] = new Region(regionIds[i], isMembers[i]);
            }
            for (int i = 0; i < size; i++) {
                byte[] file1 = getBuffer(new File("./Data/world/map/" + mapObjectsFileIds[i] + ".gz"));
                byte[] file2 = getBuffer(new File("./Data/world/map/" + mapGroundFileIds[i] + ".gz"));
                if (file1 == null || file2 == null) {
                    continue;
                }
    			try {
    				loadMaps(regionIds[i], new ByteStream(file1), new ByteStream(file2));
    			} catch(Exception e) {
    				System.out.println("Error loading map region: " + regionIds[i]);
    			}
            }
    		System.out.println("Region has been loaded succesfully, by: Ardi Rizal");
        	} catch (Exception e) {
        		e.printStackTrace();
        	}
        }
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Bump
    Reply With Quote  
     

  5. #5  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    try { loadMaps(regionIds[i], new ByteStream(file1), new ByteStream(file2)); } catch(Exception e) { System.out.println("Error loading map region: " + regionIds[i]); }


    add e.printstacktrace() under the catch() block same place as println
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Quote Originally Posted by Shadowy View Post
    try { loadMaps(regionIds[i], new ByteStream(file1), new ByteStream(file2)); } catch(Exception e) { System.out.println("Error loading map region: " + regionIds[i]); }


    add e.printstacktrace() under the catch() block same place as println
    Code:
    [06/05/15 11:26]: 	at rs2.clip.region.ObjectDef.getObjectDef(ObjectDef.java:6)
    [06/05/15 11:26]: 	at rs2.clip.region.Region.addObject(Region.java:188)
    [06/05/15 11:26]: 	at rs2.clip.region.Region.loadMaps(Region.java:371)
    [06/05/15 11:26]: 	at rs2.clip.region.Region.load(Region.java:300)
    [06/05/15 11:26]: 	at rs2.Server.main(Server.java:143)
    Line 6 of ObjectDef is
    Code:
    public static ObjectDef getObjectDef(int i) {
    		if (i > streamIndices.length)
    			i = streamIndices.length - 1;
    		for (int j = 0; j < 20; j++)
    			if (cache[j].type == i)
    				return cache[j];
    		cacheIndex = (cacheIndex + 1) % 20;
    		ObjectDef class46 = cache[cacheIndex];
    		class46.type = i;
    		class46.setDefaults();
            byte[] buffer = archive.get(i);
    		class46.readValues(new ByteStreamExt(buffer));
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2012
    Posts
    900
    Thanks given
    66
    Thanks received
    85
    Rep Power
    0
    make sure the files are .GZ
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Quote Originally Posted by Raverz View Post
    make sure the files are .GZ
    They are.
    Reply With Quote  
     

  9. #9  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    1,499
    Thanks given
    490
    Thanks received
    241
    Rep Power
    307
    Quote Originally Posted by V i c t o r View Post
    Code:
    [06/05/15 11:26]:     at rs2.clip.region.ObjectDef.getObjectDef(ObjectDef.java:6)
    [06/05/15 11:26]:     at rs2.clip.region.Region.addObject(Region.java:188)
    [06/05/15 11:26]:     at rs2.clip.region.Region.loadMaps(Region.java:371)
    [06/05/15 11:26]:     at rs2.clip.region.Region.load(Region.java:300)
    [06/05/15 11:26]:     at rs2.Server.main(Server.java:143)
    Line 6 of ObjectDef is
    Code:
    public static ObjectDef getObjectDef(int i) {
            if (i > streamIndices.length)
                i = streamIndices.length - 1;
            for (int j = 0; j < 20; j++)
                if (cache[j].type == i)
                    return cache[j];
            cacheIndex = (cacheIndex + 1) % 20;
            ObjectDef class46 = cache[cacheIndex];
            class46.type = i;
            class46.setDefaults();
            byte[] buffer = archive.get(i);
            class46.readValues(new ByteStreamExt(buffer));
    whats the exception name. trace it mate.. guessing its arrayindexexception - maybe the object id is too big for the server code array
    Owner of OS-RSPS, the first Oldschool RuneScape Server (2014)
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jan 2012
    Posts
    561
    Thanks given
    43
    Thanks received
    53
    Rep Power
    72
    Quote Originally Posted by Shadowy View Post
    whats the exception name. trace it mate.. guessing its arrayindexexception - maybe the object id is too big for the server code array
    Code:
    java.lang.NullPointerException
    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. #498 Deob (Loading #474 maps).
    By Sir Tom in forum Downloads
    Replies: 4
    Last Post: 05-21-2012, 08:37 AM
  2. Loading 474 maps
    By Huey in forum Help
    Replies: 6
    Last Post: 08-11-2010, 08:53 PM
  3. 474 Client loading 474 Maps.
    By Andy in forum Downloads
    Replies: 39
    Last Post: 07-10-2010, 06:40 AM
  4. What's the 474 map file for wildy ditch?
    By Jon_ in forum Requests
    Replies: 0
    Last Post: 08-25-2009, 05:52 AM
  5. 474 map files
    By Harley in forum Requests
    Replies: 2
    Last Post: 05-10-2009, 09:45 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
  •