Bug - Fixed relay_ scripts and charpane.php overrides

slyz

Developer
I use a charpane.php override (Lost's charpane.ash), and when I use a "relay_" script (FamiliarFeeder) where I can switch my familiar, the new charpane.php (with the new familiar image) is shown in the main pane instead of my "relay_" script.

What happens is:

- I select FamiliarFeeder from the top pane drop-down
- I press the "switch familiar" button on the page created by FamiliarFeeder
- FamiliarFeeder reloads, notices the button has been pressed, calls use_familiar(), and re-creates the page
- the charpane.php override is shown in the main pane instead of the page created by FamiliarFeeder.

After the "switch familiar" button is pressed, I think this is what happens in KoLmafiaASH.getClientHTML() :

- FamiliarFeeder is executed, launches the familiar switch, then generates the page, which is stored in KoLmafiaASH.serverReplyBuffer.
- the familiar switch causes a refresh of charpane.php
- the charpane.php override is executed, causing KoLmafiaASH.getClientHTML() to wipe KoLmafiaASH.serverReplyBuffer, which is then filled by the page generated by charpane.ash.
- KoLmafiaASH.serverReplyBuffer is send to the relay browser, with the contents of charpane.ash instead of the expected relay_FamiliarFeeder.ash

I'm only guessing this is how it goes: I have no idea of what synchronized() does.

I also have no idea of how to prevent this.
 

roippi

Developer
Interestingly, this doesn't happen 100% of the time. Those are my absolute favorite kind of thing to debug.

I have no idea of what synchronized() does.

It prevents ConcurrentModificationExceptions by preventing thread interference.
 

slyz

Developer
With FamiliarFeeder and charpane.ash, it happens any time I switch my familiar.

I guess the relay_ script has to do something that causes a CharpaneRequest to run, such as switching equipment, refreshing the session, using a skill, or doing anything that sets request.containsUpdate to true.
 

Sentrion

Member
Working on my own relay script at the moment which uses skills, and noticed this happen. Has anyone made progress on this, or has anyone figured out a solution (other than disabling the charpane relay...)?
 

heeheehee

Developer
Staff member
Relay script conflicts

When running a charpane override, using items in a different relay override (in this case, pyramid.ash) before calling visit_url() in said script causes the charpane override to take over, i.e. the charpane is displayed instead of the proper page. The call to visit_url() in the original script returns an empty string.

Everything works just fine when I disable said charpane override (by renaming/moving/whatever).
 

Veracity

Developer
Staff member
When running a charpane override, using items in a different relay override (in this case, pyramid.ash) before calling visit_url() in said script causes the charpane override to take over.
What does "using items" mean in this context? Which script is "said script" and which is "a different relay override"?

I'm afraid that I cannot understand exactly what script is doing what to end up with the wrong thing, from your explanation.
Please give me simple instructions on how to reproduce:

Install charpane.php relay override
Install pyramid.php relay override
Visit pyramid.php
pyramid.php override does such-and-such

...and so on.

Thanks.
 
Top