MapleAtMorning / 8800-blue-lick

https://mapleatmorning.github.io/8800-blue-lick/
1 stars 0 forks source link

Malformed URI #1

Open MapleAtMorning opened 1 year ago

MapleAtMorning commented 1 year ago

I genuinely have zero clue how to fix the malformed URI issue that plagues some tiles. trying to load their images locks you in place unable to move. image

Pelumo64 commented 9 months ago

The error URIError: The URI is malformed indicates that you are trying to encode or decode a URI component that has an invalid format. This could be due to several reasons:

To resolve this issue, you should:

  1. Ensure that any characters that are not valid in a URI are properly percent-encoded. This includes characters such as spaces, which should be encoded as %20.
  2. Check for any incorrectly percent-encoded sequences in the URI and correct them. For example, a percent sign should be encoded as %25.
  3. If you are manually constructing the URI, ensure that any surrogate pairs in the URI are complete and properly sequenced.

Here's an example of how you can replace a standalone percent character with its encoded form:

var str = "60% completed";
var uri_encoded = str.replace(/%/g, "%25");
console.log(uri_encoded); // "60%25 completed"
var decoded = decodeURIComponent(uri_encoded);
console.log(decoded); // "60% completed"

And if you're working with high and low surrogate pairs, make sure they are used correctly:

// Correct usage of surrogate pairs
encodeURI("\uD800\uDFFF"); // "%F0%90%8F%BF"

If you're using a function to decode, such as decodeURIComponent, ensure that the input is a valid percent-encoded string:

// Correctly encoded URI component
decodeURIComponent("JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"); // "JavaScript_шеллы"

If you're unsure about the validity of the URI or URI component you're working with, you can validate it before encoding or decoding. If the issue persists and you're getting this error in a context where the URI is provided by a third-party service or user input, it may be necessary to add error handling to catch the exception and deal with it appropriately, such as by logging the error or providing user feedback.

Source: AI - So take it with a grain of salt.

I know nothing about coding except that 8800 Blue Lick Rd should be protected.

MapleAtMorning commented 9 months ago

Unfortunately this isn't my top priority right now and I really can't be bothered to work with this extremely jank ripped and modified code anymore. Hopefully someone with more experience and time is willing to fork it and continue it some day.

Pelumo64 commented 9 months ago

Unfortunately this isn't my top priority right now and I really can't be bothered to work with this extremely jank ripped and modified code anymore. Hopefully someone with more experience and time is willing to fork it and continue it some day.

Fair enough. I could give it a shot, although I don't know shit either, sadly. It can work. One day perhaps...

Estr0gen commented 5 months ago

The fix for this is really simple. It has nothing to do with the malformed URI, it is just because the refresh request fails and the script does not know how to handle it. Go to showcase.js and comment out line 53404 and 53405. The downside is it will stop loading in the higher quality textures but that can be fixed as long as you return literally anything when it calls the API.

Pelumo64 commented 5 months ago

I see. Thanks.

MapleAtMorning commented 5 months ago

The fix for this is really simple. It has nothing to do with the malformed URI, it is just because the refresh request fails and the script does not know how to handle it. Go to showcase.js and comment out line 53404 and 53405. The downside is it will stop loading in the higher quality textures but that can be fixed as long as you return literally anything when it calls the API.

Even after doing this it still occasionally has its moments where it locks the user in place and you can't move anymore unfortunately.

Estr0gen commented 5 months ago

Watch the console when that happens. Once you find it, click the source and set a breakpoint. Then move around until it happens again. Once it happens again go up the stack until you find the function that called whatever broke and just remove it if its not important. If it is important you can add an override with the expected data and return it.