Thread: [508] Fix Missing Map Data Crashing

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [508] Fix Missing Map Data Crashing 
    Registered Member
    Gravediggah's Avatar
    Join Date
    Nov 2008
    Age
    31
    Posts
    202
    Thanks given
    0
    Thanks received
    5
    Rep Power
    265
    This small tutorial helps stopping client crashes due to missing map data.

    Credits:
    -Palidino76 for the original methods.
    -Me for fixing the crashes.

    Step 1. Open up Player.java

    Add this import:

    Code:
    import java.util.LinkedList;
    Add these 2 methods:

    Code:
    	public void noMapdata() {
            //Missing Map Data fix by Gravediggah
    		setCoords(3222,3222,0); // Lumbridge
    		Engine.playerMovement.getNextPlayerMovement(this);
            this.frames.setMapRegion(this);
            this.frames.sendMessage(this, "Missing map data for your location, your location has been changed to Lumbridge.");
    	}
    	
    	public LinkedList<Integer> getRegion() {
            //Missing Map Data fix by Gravediggah
    		 LinkedList<Integer> regions = new LinkedList<Integer>();
    		 boolean forceSend = true;
    		 if ((((mapRegionX / 8) == 48) || ((mapRegionX / 8) == 49)) && ((mapRegionY / 8) == 48)) {
    	            forceSend = false;
    	     }
    		 
            if (((mapRegionX / 8) == 48) && ((mapRegionY / 8) == 148)) {
                forceSend = false;
            }
            
            for (int xCalc = (mapRegionX - 6) / 8; xCalc <= ((mapRegionX + 6) / 8); xCalc++) {
                for (int yCalc = (mapRegionY - 6) / 8; yCalc <= ((mapRegionY + 6) / 8); yCalc++) {
                    if (forceSend || ((yCalc != 49) && (yCalc != 149) && (yCalc != 147) && (xCalc != 50) && ((xCalc != 49) || (yCalc != 47)))) {
                    	regions.add(yCalc + (xCalc << 1786653352));
                    }
                }
            }
            return regions;
    	}

    Step 2. Open up MapData.java in palidino76.rs2.world.mapdata

    Replace your getData(int myRegion) method with this one:

    Code:
        public int[] getData(int myRegion) {
    
            //Missing Map Data fix by Gravediggah
    
            for (MapList list : mapLists) {
                if (list == null) {
                    continue;
                }
                if (list.region == myRegion) 
                {
                    return list.data;
                }
            }
    
            Misc.println("Missing map data: " + myRegion);
            return new int[5];
        }
    Step 3. Open up Frames.java

    Add this import:

    Code:
    import java.util.LinkedList;
    Replace your setMapRegion(Player p) method with this one:

    Code:
        public void setMapRegion(Player p) {
            if (p == null || p.stream == null || p.disconnected[0]) {
                return;
            }
            
            LinkedList<Integer> regions = p.getRegion();
            
            //Missing Map Data fix by Gravediggah
           
            if(regions.size()==0) {
            	p.noMapdata();
            	return;
            }
            
            for(int region : regions) {
    	        int[] mapData = Engine.mapData.getData(region);
    	        
    	        if(mapData.length==5) { // MISSING
    	        	p.noMapdata();
    	        	return;
    	        }
            }
            
            p.stream.createFrameVarSizeWord(142);
            p.stream.writeWordA(p.mapRegionX);
            p.stream.writeWordBigEndianA(p.currentY);
            p.stream.writeWordA(p.currentX);
            p.rebuildNPCList = true;
            
            for(int region : regions) {
    	        int[] mapData = Engine.mapData.getData(region);
    	        p.stream.writeDWord(mapData[0]);
    	        p.stream.writeDWord(mapData[1]);
    	        p.stream.writeDWord(mapData[2]);
    	        p.stream.writeDWord(mapData[3]);
            }
                    
            p.stream.writeByteC(p.heightLevel);
            p.stream.writeWord(p.mapRegionY);
            p.stream.endFrameVarSizeWord();
        }
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Dec 2007
    Posts
    848
    Thanks given
    27
    Thanks received
    61
    Rep Power
    848
    basically this is like the one in rs2hd but for pali o.o?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Gravediggah's Avatar
    Join Date
    Nov 2008
    Age
    31
    Posts
    202
    Thanks given
    0
    Thanks received
    5
    Rep Power
    265
    Quote Originally Posted by Itz Matt ♥ View Post
    basically this is like the one in rs2hd but for pali o.o?
    I don't know, I've never checked out rs2hd completely
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Dec 2007
    Posts
    848
    Thanks given
    27
    Thanks received
    61
    Rep Power
    848
    i think in rs2hd its much much smaller >.<
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Feb 2009
    Posts
    1,533
    Thanks given
    4
    Thanks received
    34
    Rep Power
    0
    Why not just disable object loading if the xtea keys aren't correct? Works better than teleporting to lumbridge...
    Reply With Quote  
     

  6. #6  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,264
    Thanks given
    405
    Thanks received
    432
    Discord
    View profile
    Rep Power
    1684
    Summoning pkz got this already.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2009
    Posts
    160
    Thanks given
    1
    Thanks received
    0
    Rep Power
    68
    So many methods for a 5 line fix, sorry gravediggah but this failz


    Reply With Quote  
     

  8. #8  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    26
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    This is great and all but... MapLists isn't defined nor do I know how I should define it. same with list.region.

    Reply With Quote  
     

  9. #9  
    Registered Member
    ¤~W.I.L.L~¤'s Avatar
    Join Date
    Jun 2008
    Age
    26
    Posts
    390
    Thanks given
    3
    Thanks received
    12
    Rep Power
    300
    Thank you for this, GraveDiggah. I was starting to get tired of looking for something like this.
    [Only registered and activated users can see links. ] [Only registered and activated users can see links. ]
    ^ Learn them. Live them. Love them. ^

    Quote Originally Posted by Jerkin View Post
    Sorry for Gravedigging, but I was wondering what do i do if i'm using delta and don't have a filemanager, thanks.
    Quote Originally Posted by Sydney View Post
    Everything wrong started with your first three words. Also, if you're using Delta, I advise you get out of the 508+ sections.
    /facepalm
    Reply With Quote  
     

  10. #10  
    Registered Member the323909's Avatar
    Join Date
    Jul 2008
    Posts
    945
    Thanks given
    80
    Thanks received
    111
    Rep Power
    40
    I added all the MapData

    Just get the "Interfaces" that crash me on login now

    [Only registered and activated users can see links. ]
    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

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