-
August 20th, 2021, 07:50 #11
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
oops ... I copied that from a pre-query version of the code ... it does have an end in the code.
So that is definitely not the problem.
Can you answer this question, however ... can a User send an OOB message in an onClose() event of an extension?Last edited by UrsaTeddy; August 20th, 2021 at 07:54.
Thanks In Advance,
D
-
August 20th, 2021, 07:56 #12
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
You aren’t going to be able to capture and replace other onUserLogin handlers. Once a handler is registered, it will be called, and if any handler returns true, then some handlers could be skipped.
If you want to replace a handler in another script; you will need to replace that script fully.
(Ie Multiple handlers can be registered for every handler API; and they are each called independently)
JPG
-
August 20th, 2021, 07:57 #13
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
So I cannot store User.onLogin in a variable and then call it before/after I call my own?
Thanks In Advance,
D
-
August 20th, 2021, 07:58 #14Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
August 20th, 2021, 08:00 #15
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
Any object really ... I have an object (LUA file) that deals with connections to and from the game. In the onClose() event for that file, I try to send an OOB message to the Host ... will the client "shutdown" before this message is sent? Or does every bit of code execute before the closing down of the application is completed?
Thanks In Advance,
D
-
August 20th, 2021, 15:42 #16
- Join Date
- May 2016
- Posts
- 521
I suspect my test was faulty.
Last edited by jharp; August 20th, 2021 at 15:50.
-
August 20th, 2021, 20:09 #17
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
There are no triggers that will fire on the player client "before" the connection is shut down. Those events "do" trigger on the GM client for players connecting/disconnecting, which is what the onUserLogin event is for (GM clients).
You'll have to probably rethink your approach to work within the events available.
If the all the windows you mentioned in the first post are open on the GM client, why wouldn't you just close the windows on the GM client based on the onUserLogin event that is triggered on the GM client?
If the windows you mentioned in the first post are open on the GM and connected clients, I still don't see why you can't have the GM client trigger based on the onUserLogin event (on the GM client) to close the local window, and send OOB messages to any other connected clients.
Regards,
JPG
-
August 21st, 2021, 01:41 #18
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
Firstly, I got the onLogin events working 100%. The issue was the order of flag checking I was using ... there was a situation (which I was invariable testing) that was dropping out of the checking quietly.
I had to move to onLogin because the OOB message was not sending out on the Client shutting down. I was trying to keep everything in OOB format so that I did not have to override any inbuilt code or events, thus 100% avoiding interference with anyone else and any extensions they may have loaded or written.
So unless there is a way (without taking over another function like onLogin) to ensure the OOB message gets sent when the Client shuts down, then I am stuck with overriding onLogin.Thanks In Advance,
D
-
August 24th, 2021, 22:06 #19
- Join Date
- Jan 2017
- Posts
- 76
well, you can insure a very high level of compatibility by SAVING the "current" onLogin function, doing Your processing, then calling the SAVED version..
I have seen many other Devs start to do this recently, and from all reports it works VERY well. (as long as someone with a later prioroty Extention doesn't just overrwite YOU, but that is a simply extention priority order problem).
function onInit()
ActionSkill.onRollOriginal = ActionSkill.onRoll -- saves any pre-existing override
ActionSkill.onRoll = onRollSkill
ActionsManager.registerResultHandler("skill", onRollSkill)
end
function onRollSkill(rSource, rTarget, rRoll)
-- do your things here.
ActionSkill.onRollOriginal(rSource, rTarget, rRoll) -- now do what ever anyone else had overridden (or return to the base ruleset for this action)
end
but then again, i am new enough at this that i coudl just be talking out my *output port*Last edited by FyreM; August 24th, 2021 at 22:38.
-
August 25th, 2021, 00:09 #20
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
@FyreM
This I know. I have always saved functions that I override whenever I use any scripting system.
The problem as you have pointed out is always the risk that someone later on in the chain does not do this.
Therefore OOB messaging is much more useful because it bypasses the eventuality that someone makes that decision that they do not want to store/execute someone else's functionality before overriding it.
Right now, since what I am working on is for private use until I am 100% confident that it is ready for sharing with others, so I know what is going on with my code.Last edited by UrsaTeddy; August 25th, 2021 at 00:26. Reason: Removal of self aggrandisement
Thanks In Advance,
D
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks