Feature - Implemented Master Relay Override

bumcheekcity

Active member
I think it would be a good idea to have a relay override that's called on literally all page visits, to literally all pages visited in the mafia browser. Perhaps a second option under the allow browser scripted overrides to permit a master override. Then the script could switch() on the url of the page or something similar. Would it be possible for this functionality to be added?
 

Bale

Minion
So you can modify the entire UI with a single script instead of the half-dozen or so that you are currently using? I could see the reason for it. It would be convenient for KoL skinning.

I wonder how tricky it would be to add such a feature. It seems there should be some significant con to the idea, but I cannot think of it right now.
 

Theraze

Active member
Con would likely be that if the override is done poorly (or even may be the only way to do it), it'll fire on every panel, not just the one you need things to change on, making it a lot easier for people to accidentally reload data from the server 4* as much as they really want to... As well, if they make their override spawn another panel, which spawns another panel, which spawns another panel, it could end up accidentally running a DoS attack against the server.
 

bumcheekcity

Active member
Anyone daft/malicious enough to run a DDoS on the server using a master override could easily run one using a single override and just hitting the specified page. In short, I'd like it to do EXACTLY what the current set of 12-ish do, but just with one script. I can see that updating bUMRATS is going to get tricky quickly, and I can see that other people could easily want this functionality.
 

Theraze

Active member
True enough. Long as people do their override scripts well, a master would be a great thing. Though since there's still the charpane override bugs, I'd be worried about what a single master would affect...

Not saying I wouldn't like it, saying I think it'd take a lot of debugging to make work properly. :)
 

slyz

Developer
This. Although any problem with a specific override doesn't have anything to do with this feature request. It would simply be an general override script preference to which Mafia could pass any page visited through the relay browser, instead of looking for specific <pagename>.ash file in the /relay folder.

How would the script recognize the original URL being passed through though? Can Mafia pass along a string containing the URL? Or can that be retrieved in the visit_url() call?
 

Bale

Minion
How would the script recognize the original URL being passed through though? Can Mafia pass along a string containing the URL?

It cannot. That would need to be added as part of this feature request.
 

jasonharper

Developer
How would this work if there was both a master override, and an ordinary relay override on some page? Which of the two scripts would receive a page that had already been modified in some arbitrary way, causing the script's attempted modifications to fail miserably?
 

slyz

Developer
I would guess that the master override would take precedence and bypass the specific page override? Does that make more sense?
 

bumcheekcity

Active member
How would this work if there was both a master override, and an ordinary relay override on some page? Which of the two scripts would receive a page that had already been modified in some arbitrary way, causing the script's attempted modifications to fail miserably?

I suggest master first, then specific override. There seems no sense in making it impossible for people to FURTHER override pages already overriden by a master script, but because individual scripts will be easier to modify, it makes sense for them to happen second.

Of course, willing to hear input on that, but it seems like a pretty sensible way of handling it.
 

Theraze

Active member
I'd probably go the other way than slyz... if you have a specific override for that page, and you can only do one or the other, do the specific one. You made the effort to do EXACTLY that. If you want a more generic change with the master override, remove your specific changes. If you're going to allow to both, the argument can go either way. BCC's idea probably does make more sense, though it means that override authors are going to get screwed by the bug reports that people are going to make...
 
Last edited:

bumcheekcity

Active member
I gave it a try and failed miserably :(

Jason/Veracity, any word on whether this is in the pipeline? I'd really like it.
 

Theraze

Active member
So, the goal is just to have a page that gets called on every relay browser one, in addition to any specific lookups, first?
 

Grotfang

Developer
The only thing I can see that they all have in common is being inside mainpane. The only other method I can think of to produce this effect would be to produce a list of php pages that the generic script would override.

Even then, how many override scripts would be desired to override adventure.php as well as, let's say, the arcade?

EDIT: Just occurred to me... what if it were possible to extract which page you were on. Could a generic override allow for the script writer to specify in ASH which pages were overwritten with the script being applied universally? Poor code would end up producing weird results, but it would mean that a script writer might only need to update a single source.
 
Last edited:

icon315

Member
Yes i would love this feature.
I was actually trying to find some way to this a while back for a script i wanted to make, but i couldn't.
Thumbs up from me
 

Theraze

Active member
Hmmm... was just looking in request/RelayRequest and it looks sort of like there's already a master override using 'main.html' or 'main_c.html' as the file name... lines 587-591 call handleMain function, lines 552-572.
 
Top