Bug - Fixed Relay browser has a broken combat action bar.

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I spoke to CDM and he confirmed that the new URL is intended to be stable.
 

PeKaJe

Member
OK, so I did some more digging to find out why mafia wasn't getting images down and cached, and I found some ... odd code in utilities/FileUtilities.java in the function localImageName. Seems like it's looking for where to do some substitution and is doing that by looking for the substring ".com". Which was fine with the original game image servers and the Amazon image server used so far. But it fails on the new cloudfront.net. On a hunch I tried building a version with both the image server replaced in KoLmafia.java and with localImageName patched to look for both .net and .com, and now I have a working CAB and images that were broken before now show up. Probably someone more familiar with that code should investigate this further.

Edit: Hmm, for some reason not getting the replaced images for island war sidequests shown. No time to dig into that right now, though.
 
Last edited:

VladYvhuce

Member
14675d1a55d172c58b53cdb37e3462ac.png

This is what happens if you do something like using multiple gathered meat clips after combat. so, it's not just the action bar that's in the wrong place. Things that should be posting above the action bar are posting on top of the lowered images.
 

katyarn

Member
It's not just the combat action bar page that's no longer working. The functionality for multi-using items in inventory, filtering/sorting in inventory, right-clicking items in inventory and right-clicking items in results are also broken now. There may be other things as well but those are just what I observed so far.
 

fronobulax

Developer
Staff member
It's not just the combat action bar page that's no longer working. The functionality for multi-using items in inventory, filtering/sorting in inventory, right-clicking items in inventory and right-clicking items in results are also broken now. There may be other things as well but those are just what I observed so far.

Could you elaborate, perhaps making a new report? I can filter, sort and right click which suggests we are doing something different. You could make a report that spells out:
  • What you did (in enough detail so someone else can try and do the same thing)
  • What you expected to happen
  • What actually happened
 

VladYvhuce

Member
It's not just the combat action bar page that's no longer working. The functionality for multi-using items in inventory, filtering/sorting in inventory, right-clicking items in inventory and right-clicking items in results are also broken now. There may be other things as well but those are just what I observed so far.
Hmm... I've been playing after you posted that, and I'm not having any problems beyond images being broken if an item is right-clicked from within KOL. I'm having no issues with inventory in the relay browser.
 

yakatz

New member
I also did not notice any other issues besides the bar being in the wrong place and not clickable. I do most of my actions on the keyboard and that is still working fine, but it is super annoying when I want to do anything else.
 

PeKaJe

Member
Digging in a little more, it now looks like parts of the game are using the old amazon image server, while parts are using the new one at cloudfront. I don't know if this is a transient issue until the devs work through the game code, so not sure how much effort should be made to be able to handle 3 potential image server locations. The island war decoration I mentioned is because some search/replace on images doesn't work with the new server, because the island HTML still uses the old server. In webui/IslandDecorator.java it's fairly trivial to add another server to the list of replacements. Other parts mafia HTML editing uses KoLmafia.imageServerPath(), which may make replacements not work if the game HTML still uses the old server. Now, I haven't actually noticed any other things being broken after applying the fixes mentioned in #23, but I'm sure there is something. I doubt anything's as bad as a broken CAB, though, which is a real showstopper for me and about half the clannies I spoke to yesterday.
 

heeheehee

Developer
Staff member
3 potential image server locations.
Which 3? Before this change, we used an S3 bucket, although now it's sometimes served by cloudfront instead.

I tested a few URLs and cloudfront served all of them, so I suspect it's configured to point directly at the S3 bucket. So, we might be able to do the following:

- rewrite both S3 and cloudfront URLs to /images/...
- fetch URLs from cloudfront unilaterally (since I expect this change means that direct S3 access will be locked down at some point).
 

PeKaJe

Member
Hmm, I assumed based on some of the code that the game's original image server were still being used somewhere. Anyway, I was thinking if it was possible to do a global rewrite of the S3 to cloudfront before any other processing happens, though not sure how that would be done.
 

heeheehee

Developer
Staff member
Anyways -- try r25971? That should support all three URLs (images.kingdomofloathing.com, S3, cloudfront) and always fetch from cloudfront, although it's possible I missed something.

(Marking as fixed, but I'll reopen if there are any issues with that fix.)
 

Veracity

Developer
Staff member
I noticed some broken monster images.

This HTML:
Code:
<img  id='monpic'  crossorigin="anonymous"  src="/iii/adventureimages/bishop.gif?a=1638729277" width=100 height=100>
was transformed into this HTML:
Code:
<img  id='monpic'  crossorigin="anonymous"  src="/images//adventureimages/bishop.gif?a=1638729277" width=100 height=100>
resulting in this request from the browser:
Code:
GET /images//adventureimages/bishop.gif?a=1638729277 HTTP/1.1

I made a one line change and it works now:
Code:
diff --git a/src/net/sourceforge/kolmafia/webui/RelayAgent.java b/src/net/sourceforge/kolmafia/webui/RelayAgent.java
index 57bbe41f3e..16e43e7fbd 100644
--- a/src/net/sourceforge/kolmafia/webui/RelayAgent.java
+++ b/src/net/sourceforge/kolmafia/webui/RelayAgent.java
@@ -463,7 +463,7 @@ public class RelayAgent extends Thread {
           "("
               + String.join("|", KoLmafia.IMAGE_SERVER_PATHS)
               + "|"
-              + "/iii"
+              + "/iii/"
               + "|"
               + "//images.kingdomofloathing.com/"
               + "|"

With that fix, this:
Code:
<img  id='monpic'  crossorigin="anonymous"  src="/iii/adventureimages/mobcapo.gif?a=1638730912" width=100 height=100
became this:
Code:
<img  id='monpic'  crossorigin="anonymous"  src="/images/adventureimages/mobcapo.gif?a=1638730912" width=100 height=100>

(I'm not set up to submit my own pull requests on github, yet. If someone who IS set up to do that wants to give this a try and see how it works for them, I'd be obliged. Thank you.)
 

PeKaJe

Member
I think the mine decorator might be broken. I don't manually mine very often, so I kinda forgot how it used to look, but I think mafia replaces the twinkly spots with more visibly twinkling images and that appeared not to be the case for me last night.
 

fronobulax

Developer
Staff member
There is a preference, mineLayout that AFAIK has images locations in it. I'd consider clearing it.
 

PeKaJe

Member
The mine layout seems to work fine, and was also cleared beforehand, as I'd just ascended. It's the twinkly image replacement in webui/MineDecorator.java that I think might not be replacing the right server.

Edit: Attached patch fixed it for me.
 

Attachments

  • minetwinkle.patch
    911 bytes · Views: 4
Last edited:
Top