Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: New parental block feature?  (Read 6940 times)

0 Members and 1 Guest are viewing this topic.

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
New parental block feature?
« on: January 23, 2011, 10:40:49 pm »
First of all I'd like to say Mala is IMO the best front end out there.  Very configurable, simple implementation, and best of all, great support.  I'm in the process of my first cabinet build and can't wait to get Mala running in it's "home" environment.  Once I'm finished I'll post some pics and will make a nice donation to Mala as well, to help ensure its future development.

Per the title of my thread, my idea is for a mature/parental block on certain roms.  I know that there are listers out there for this, but my setup I plan on having one list with all the (mame) games available in my cabinet (All games list hidden).  I don't want to have to create different lists for each "genre".  The ones out there are not as seamless as I think this could be.  My target audience for this feature is obviously someone that has kids and wants to let them play games, but not have to worry about them playing games they necessarily shouldn't.  I.E. Mortal Kombat, etc.

Implementation
The way I envisioned this being implemented was to have an optional flag set at the ROM level within MalaGamelist.  This way any game could be flagged with a "parental block", regardless of its genre category.  Then, somewhere within Mala have the ability to set this parental "password"/"passmove", whatever you want to call it.  Also have a checkbox with the ability to disable the feature.  This "passmove" would be a series of button presses/joystick moves.  Then when a game is launched, if the flag is set for the current game, a message would pop asking to enter the passmove.

I understand if you were able to get into the menu, you could easily disable this feature.  On my cab I will have a way to lock the keyboard drawer.  So for me that will not be a problem keeping the kids out of there.  But maybe a possible option to "passmove" the right click menu as well?  Just a thought.

So, fellow Mala-neers, let me know your thoughts on this.  I saw that this idea has come up before, but that was quite a few years ago so I wanted to give my spin on it and bring the idea back into the light.  Don't know how difficult this would be from a development perspective, but I think it would be pretty darn slick.  I don't know of any existing FEs that can do this.  This is my first post here so be gentle :)

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #1 on: January 23, 2011, 11:00:08 pm »
I could've sworn I've seen posts about this very things on the forums here, but I can't seem to find them now.

Some of the other front end's DO have parental controls, but, I don't believe mala has anything like that out of the box.

Loadman could weigh in more on that.

It'd be a pretty straightforward plugin to write, though. The only trick would be configuring the games xml (or flagging the games you want "locked" somewhere so the plugin could be aware of that info)

It'd be a nice little workout for my Engine18 "meta-plugin", actually.... hmmm.....

I might take a quick gander at that.

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: New parental block feature?
« Reply #2 on: January 24, 2011, 06:15:30 am »
Hi.  ;D

I'm gonna hang back for now on this and let others comment  ;)

No apposed to the concept at all but it would be a bit of work so if it can be a plug-in that would be great (No work for me)

I think that would be the best way

The Plugin could have a list of Blocked games that required passmove

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #3 on: January 24, 2011, 04:59:28 pm »
Thanks for the responses!  The concept of adding this as a plugin is a great idea.  drventure, would the plugin then readup the available game lists and from there, for each list, allow you to flag the games you want to be "passmoved".  If you are able to put something together and need any help testing this please let me know.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #4 on: January 24, 2011, 09:55:18 pm »
Well, I'm thinking of piggybacking on the INI files that are already available.

For instance, any game rom listed in MATURE.INI would automatically require a password. (i'm leaning toward something that could key off plain ol' keyboard button presses, like from an IPAC, anything requiring joystick monitoring, trackball monitoring etc would add significantly to the time required and plugin complexity.)

If you wanted to flag additional games as requiring a password, you'd just add their rom names to Mature.ini

Is that too simplistic? It may not be super user friendly, but it'd get the job done....

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #5 on: January 24, 2011, 11:48:14 pm »
I wasn't familiar with mature.ini so I looked it up.  You're talking this correct? http://www.kutek.net/mame_roms_pinball/mame32_config_files/Mature.ini  If so, yeah I think that would work fine.  And keyboard presses from an ipac is exactly what I meant.  For example, assuming the standard mame mapping for P1, if you enter UP, UP, SW1, SW2, SW3....the "passmove" would be stored as Up arrow, Uparrow, L-CTRL, L-ALT, SPACE.

I don't think its too simplistic.  I think the setup on the backend would be fine in what you're suggesting, as that would be minimally tinkered with, as long as the result on the frontend looked and functioned properly.  For the dialog that comes up asking for the passmove, through the API are you about to call the same dialog that displays when Mala is asking if you want to exit?  ("Quit Mala?")  With the same fade effect?  If so I think that would look very slick.  Also I think through the plugin there should be some kind of settable timeout value (in seconds), so if the user doesn't enter the correct passmove within the alloted number of seconds, the dialog is closed and they are taken back to the list they were on.  (Default 4 or 5 seconds?) But as soon as the correct passmove is entered the game is launched.  Or something along those lines.

I'm getting excited!  Both for this plugin and my cabinet.  I just finished prepping it for painting tonight.  Hopefully In the next day or 2 I can get it primed up!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #6 on: January 25, 2011, 12:28:07 am »
Yeah, i'm thinking a skinnable Window would pop up basically indicating "This game is locked", you'd be ableto put whatever graphic you want on it.

It'd wait for about 5 seconds, and automatically drop back to Mala

If you pressed a button in that 5 seconds, you'd have 5 more seconds to press the next key in the Passmove.

Continue until you've pressed the entire passmove and then the game would fire up as normal.

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: New parental block feature?
« Reply #7 on: January 25, 2011, 04:39:38 am »
It'd wait for about 5 seconds, and automatically drop back to Mala

Let me know if you need something else in the MaLa API to make that work.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #8 on: January 25, 2011, 07:22:34 am »
I hadn't looked yet, but you can "stop" a game launch via the GameStart Event right? Or is it just a signal that a game is starting.

that's the only thing I can see that Mala would have to have that I'm not sure of.

Hmmm, I just checked the Mala API guide and it looks like MalaGameStart is just a Void function, so there doesn't appear to be any way to "feed back" to mala to NOT start the game.

Any thoughts on if that would be tough to add?

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: New parental block feature?
« Reply #9 on: January 25, 2011, 07:13:11 pm »
I hadn't looked yet, but you can "stop" a game launch via the GameStart Event right? Or is it just a signal that a game is starting.

that's the only thing I can see that Mala would have to have that I'm not sure of.

Hmmm, I just checked the Mala API guide and it looks like MalaGameStart is just a Void function, so there doesn't appear to be any way to "feed back" to mala to NOT start the game.

Any thoughts on if that would be tough to add?

Yeah in Delphi terms it's a 'Procedure' rather than a 'Function' so there is no feedback

It should not be hard to add a new one or try and change (as long as it's backward compatible) ..  ;D

Let me know when you commit to do some serious work on it and I will do the same then
« Last Edit: January 25, 2011, 11:09:12 pm by loadman »

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #10 on: February 01, 2011, 05:39:26 pm »
Hey guys,

Been away for a couple days, wondering what the status is on this?  It sounds like loadman will have to change the API a bit to make this work.  But drventure, you think you're going to go ahead with this plugin?  Hopefully its something that you think you can do.  Again if you need any help testing, please let me know.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #11 on: February 01, 2011, 06:13:44 pm »
It may be a bit before I can dedicate any time to it.

I'm still looking things over to see exactly how I might structure things. No point in making any changes to the api just yet.

When/If we get there, I could see it being quite useful to structure almost all the API event notifications to be "cancellable" so the plugin could theoretically do something ELSE and cancel Mala's handling of the action.

For instance, when a MAME game is selected and launched, a plugin could intercept the event, launch something else, and tell mala not to do anything.

Of course, then there's the whole "do you send notifications to all the other plugins or stop notifications at that point" problem to consider, but.....

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #12 on: February 03, 2011, 06:07:51 pm »
Well, with all the ice around here the last few days, I ended up with some time to kill

Here's a few screenshots of the progress thus far.

I'm calling this addin "Inappropriate for Mala", because, well, it has to do with a suggestion from my 7yo  :)

Engine18 Running in Mala (that's the "Plugin for .net engine")


The Engine18 Config page (all engine18 addins would have their config as part of the tree on this page.


You can see the only two options for this plugin here.

I added Ribbit to my "Inappropriate.ini" file located in MAME's INI folder. (no, it's not a standard file, I just copied the format of the "Mature.INI" file that was already there


When I choose Ribbit now, I'm presented with the password page.


Don't fret, the dialog is skinnable. You don't have to share my ridiculously over the top style sensibilities  ;D

You can't see what you're entering, just a steady progress bar as you enter keystrokes/button presses.

If you get the password right, you're immediately taken to the game (no pressing enter, etc).

If you miss it.... Well, right now, there's no indication that you missed it, you just press ESCAPE and try again. You can keep entering keystrokes as long as you want but once you've missed it, you have to start all over.

If you get the password wrong and you have to press escape to exit the password screen, you get this


Ok, that's not pretty, but I didn't have time to skin that form today.


It's all controlled by 2 INI Files.

The first is MATURE.INI, a common file found in the mame\INI folder
here's the first few lines
==============================
[FOLDER_SETTINGS]
RootFolderIcon = cust1.ico
SubFolderIcon = cust2.ico

[* Mature *]
7jigen
abunai
mjapinky
apparel
hnageman
....
==============================


I also read an INAPPROPRIATE.INI file, same location
Here's mine (for testing purposes)
==============================
[FOLDER_SETTINGS]
RootFolderIcon = cust1.ico
SubFolderIcon = cust2.ico

[* Inappropriate *]
ribbit
==============================

I didn't want to necessarily go mucking around with the Mame file, so I added support for reading this secondary file, you you can easily add additional games that might not be mature, but that would definitely be considered inappropriate" for youngsters.

If the selected game isn't in either of those two files, none of this plugin has any effect and the game just starts as it normally would.



The configuration for the plugin itself goes in:

Inappropriate.ini

in the \Mala\Plugins folder (right beside the plugin dll).

It doesn't contain much right now
================================
[Options]
UseMatureINI=1
Password=Ggr4BihLBLiQVnELFOFuog==
================================

that's just the hashed password.


And last but not least, currently, because I can't actually STOP Mala from launching the game, this plugin won't have a whole lot of effect. I'll defer to Loadman about adding that ability to Mala.

Hence, I'm not posting any actual code at this point as it'd be rather silly.

Any thoughts? Suggestions? Lambastements?

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #13 on: February 03, 2011, 08:49:24 pm »
Wow great job so far!  "Inappropriate for Mala"...I like it :)  I do have a few suggestions.

1) In your configuration/options dialog, to add to the user friendliness, maybe read up the mame list (from somewhere) and then display it in a listbox.  Then you can check the files you want flagged as inappropriate.  When you saved it would then write these check games out to the inappropriate.ini  This would just make it so the user wouldn't have to manually edit the file.  Just a thought.

2) I wouldn't make it required at least, to have to press escape to quit once a wrong password was entered or the time ran out.  I would just have it drop back to mala.  Maybe make this a config setting, to have to press a "cancel key" or not.  And although I'm sure 95% of people have ESC mapped to quit/exit, not everyone may.

Question:  How is the "password entry" done?  Will you click a button and it then captures the keystrokes?  And then have some key to signify you're finished entering?  Will there be a password confirmation?

Again looks really good!  Can't wait to test it out!

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #14 on: February 03, 2011, 10:25:56 pm »
Quote
1) In your configuration/options dialog, to add to the user friendliness, maybe read up the mame list (from somewhere) and then display it in a listbox.

First rattle out of the box, I probably won't do that. Mainly because it's a little more work than I'm likely to have time for right now. Maybe a future rev...


Quote
2) I wouldn't make it required at least, to have to press escape to quit once a wrong password was entered or the time ran out.  I would just have it drop back to mala.  Maybe make this a config setting, to have to press a "cancel key" or not.  And although I'm sure 95% of people have ESC mapped to quit/exit, not everyone may.

Yeah, not really sure of the best way to handle this. Hadn't thought of the timeout, that would work.
I wasn't planning on you being able to "backup" and edit the password or anything. Basically you start pressing buttons, when you've hit the right combination, bam, you're through and the game starts.

If you don't hit the right combination, that's where there's some question. If I wanted to immediately cancel, I'd actually have to save the password somewhere instead of a hash of the password. Not a big deal, but then is it that you cancel as soon as a wrong button is pressed, or once the right number of chars in the password has been entered but its the wrong password?

Either way, there's a clue there as to what the password might be. Again, it's not like this requires any hardcore security, but the password's not likely to be long, and there's only a limited number of buttons on a typical CP. I remember being 10 and guessing the entry code on my Aunt's Cadillac in about 3 minutes at one point because it was incredibly stupid how they'd engineered it.



Quote
Question:  How is the "password entry" done?  Will you click a button and it then captures the keystrokes?  And then have some key to signify you're finished entering?  Will there be a password confirmation?

Basically, you scroll to select the game, press the "Start game" button (whatever that is in mala), and the plugin kicks in.
It checks if the game is restricted and if so, pops that window. You simply press whatever buttons make up the password, and as soon as you've entered the last char, the window closes and the game launches.

Right now, if you miss the password, there's no indication of that. Eventually, you give up and press escape to close the password window. Remember, +you+ would know the password, so this isn't a big deal. Anyone else would not, so this would be that much more of a deterrent (and kids can be insistent!)


Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #15 on: February 03, 2011, 10:44:05 pm »
Quote
First rattle out of the box, I probably won't do that. Mainly because it's a little more work than I'm likely to have time for right now. Maybe a future rev...

That's fine, I meant this more as a rainy day revision anyway.

Quote
If you don't hit the right combination, that's where there's some question.

How bout this for the logic.  You flat out have 5 seconds (maybe the number of seconds is customizable) to enter the password.  If you enter it correctly, immediately when the correct sequence is pressed that game starts.  Otherwise if the correct keys are not pressed within 5 seconds, the dialog cancels.  No matter what keys were pressed.  This way there would be no guessing.

Quote
Basically, you scroll to select the game, press the "Start game" button (whatever that is in mala), and the plugin kicks in.
It checks if the game is restricted and if so, pops that window. You simply press whatever buttons make up the password, and as soon as you've entered the last char, the window closes and the game launches.

I was actually referring to the admin piece of entering the password.  When you're first defining it in the options screen?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #16 on: February 04, 2011, 12:38:05 am »
Quote
I was actually referring to the admin piece of entering the password.  When you're first defining it in the options screen?

Oh. Completely misunderstood that. Yeah, the actual password is just specified in the options screen. You'd use keyboard or the buttons to do that. But it won't ever show the password there.

Guess I really should have a second text box to "verify" the entered password.... Duh.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #17 on: February 05, 2011, 10:39:58 pm »
Added a password verify.
Got the password timeout operational.


Loadman, i was looking through the mala API. Of all the events exported, these are the one's I thought might need to be looked at...


Events that don't need to change:
(at least not as far as I can see)
---------------------------------
MaLaConfigureStop
MaLaGameQuit
MaLaScreensaverStop
MaLaAttractModeStop
PluginCopyright
PluginName


Events that MIGHT need a cancel ability
(though this particular plugin doesn't need it)
--------------------------------------
MaLaQuit
PluginConfigure
MaLaConfigureStart
MaLaGameSelected
MaLaEmulatorSelected
MaLaListSelected
MaLaOrientationSwitch
MaLaScreensaverSwitch
MaLaTreeUp
MaLaTreeDown



Events that should very likely have a cancel ability
-------------------------------------------------
MaLaGameStart (required for this plugin)
MaLaScreensaverStart
MaLaAttractModeStart


Anyway, this is about as far as I can get.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #18 on: February 08, 2011, 08:43:56 pm »
Hmm, Might have figured out a way to hook things such that I can cancel Mala's start of Mame without any mods required to Mala.

Hopefully, I'll get a chance to play this weekend...

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #19 on: February 21, 2011, 02:23:50 pm »
Hopefully, I'll get a chance to play this weekend...

Any luck with that?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #20 on: February 21, 2011, 09:32:19 pm »
Actually, yes, Worked like a champ.

Basically, the trick was to use the Mala config to find the location of MAME, then rename it and replace it with a stub, and put Mala back in place as appropriate. Bit of a hack, but it works, as long as your login has write permissions in the Mala directory.

Sibby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 22
  • Last login:April 17, 2011, 11:30:52 pm
Re: New parental block feature?
« Reply #21 on: February 21, 2011, 11:32:29 pm »
So is this just a temporary workaround until Loadman can open up short circuiting the necessary events?  Also, any chance you could send me a beta test? :)

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #22 on: February 21, 2011, 11:40:46 pm »
Yeah, it's temporary till loadman can make those changes.

It's straightforward enough to prevent Mala from running a rom, but there's other events that I can't intercept in that fashion, that would still be nice to "stop" from a plugin in some cases.

I'll try to zip things up and PM you. I'm not sure it's quite ready to make completely publicly available.

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: New parental block feature?
« Reply #23 on: March 13, 2011, 04:55:29 am »
Yeah, it's temporary till loadman can make those changes.

It's straightforward enough to prevent Mala from running a rom, but there's other events that I can't intercept in that fashion, that would still be nice to "stop" from a plugin in some cases.

I'll try to zip things up and PM you. I'm not sure it's quite ready to make completely publicly available.

I'll have time to look at this soon...

How do you suggest/expect this to be handled....

Quote
Events that should very likely have a cancel ability
-------------------------------------------------
MaLaGameStart (required for this plugin)
MaLaScreensaverStart
MaLaAttractModeStart

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: New parental block feature?
« Reply #24 on: March 14, 2011, 11:43:36 pm »
For a cancel, a pretty typical API is just to accept a return value on that callback. If the return value is FALSE, the call should be canceled and Mala should act like the event never happened (ie it doesn't continue on by calling whatever code would normally be called within Mala.

If TRUE, the call continues on as normal.

The only time that might get a little weird is when you have multiple Plugins, all monitoring a specific event, and each potentially "canceling" the event.

So, Mala calls first plugin that monitors event A, plugin does NOT cancel the event, and therefore assumes it to be continueing on.

Mala gets control again, sees the return value is TRUE so the event has not been canceled, then sees there's another plugin monitoring the event. Mala calls Plugin B.

Plugin B DOES cancel event A, returning a FALSE value.

Mala gets the FALSE and cancels the event, thus it doesn't even CALL the event hook for Plugin C which is also monitoring for the event.

So,

Plugin A, thinks the event continued as normal.
Plugin B knows the event happened and that it was canceled.
Plugin C doesn't even know the event happened.

Depending on how the plugins are coded, this may or may not be a problem.

Usually, the typical philosophy is that a plugin shouldn't assume anything about events it's monitoring past what it can see, and even then it really should expect that the event it's monitoring +could+ get canceled even if that plugin doesn't cancel it.

That's all just documentation really.


If you want to get fancy with it, you'd accept a null return value, or a pointer to a structure that might allow the plugin to alter or pass back return value information.

That's typically the model .NET uses for eventing.

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: New parental block feature?
« Reply #25 on: March 15, 2011, 05:56:15 am »
Thanks for the detailed response :-)

I will start with the concept if MaLa gets 1 cancel it will abort that action and see if anyone reports any undesirable behavious with the mix of plugins they may be running