Support Request: OnScreenSaverBegin fires on begin and end of screen saver

Reproduction


SiteKiosk.ScreenSaver.OnScreenSaverBegin = OnScreenSaverBegin;
function OnScreenSaverBegin()
{
   SiteKiosk.Plugins('SiteCash').TerminateSession();
}

Description

I am trying to clear all credit on a kiosk terminal whenever the screen saver activates. I created the following function which I placed in our start page.


SiteKiosk.ScreenSaver.OnScreenSaverBegin = OnScreenSaverBegin;
function OnScreenSaverBegin()
{
   SiteKiosk.Plugins('SiteCash').TerminateSession();
}


In the skcfg file the "Do not activate screensaver if credit available" is disabled.

The code works as desired, if I have credit on a machine and the screensaver activates, the credit is wiped out.

However, the bug that is happening is, if you then insert a dollar, it will credit the kiosk, and when the screensaver deactivates, it will wipe out the credit.

It appears thatt the OnScreenSaverBegin is firing both on begin and end of screensaver because you can see the kiosk get credited with the cash amount for a split second until the screensaver fully deactivates, then the balance is cleared to zero and you are dumped to the desktop.

This error happens every time and in both admin and limited user accounts w/ and without system security setting enabled.

Answer: (5)

Re: OnScreenSaverBegin fires on begin and end of screen saver 1/25/2011 11:53 AM
Hello,

There is no known issue with the OnScreenSaverBegin Event and it is also not reproducible (using your code and a EMP coin checker)

You can add a notification to the function to see in the log when it will be called:

SiteKiosk.ScreenSaver.OnScreenSaverBegin = OnScreenSaverBegin;
function OnScreenSaverBegin()
{
   SiteKiosk.Plugins('SiteCash').TerminateSession();
   SiteKiosk.Logfile.Notification('This is a notification.');
}


Also make sure that the function OnScreenSaverBegin will not be called from somewhere else.

Regards,
Michael Olbrich
Re: OnScreenSaverBegin fires on begin and end of screen saver 1/26/2011 8:49 PM
Test response.
Re: OnScreenSaverBegin fires on begin and end of screen saver 1/26/2011 8:50 PM
Hello Michael,

Thank you for the response. I believe I might not have been clear in my initial report of how to reproduce the bug.

The steps are as follows.
1.) make sure that screensaver is running
2.) insert cash
3.) watch kiosk get credited
4.) screensaver will deactivate
5.) credit will be lost.

The key is that the screensaver has to already be running before you insert cash.

I modified my code to write a notification to the logs as per your suggesion and I am able to reproduce the problem and see the notification in the logs. My new code is as follows.


SiteKiosk.ScreenSaver.OnScreenSaverBegin = OnScreenSaverBegin;
function OnScreenSaverBegin()
{
   SiteKiosk.Plugins('SiteCash').TerminateSession();
   SiteKiosk.Logfile.Notification('Notification of OnScreensaverBegin firing.');
}
Re: OnScreenSaverBegin fires on begin and end of screen saver 1/26/2011 8:52 PM
Michael,

I am trying to paste in the output of our logs but I keep getting an error message. How can I email to you or attach to this ticket?

-Peter
Re: OnScreenSaverBegin fires on begin and end of screen saver 1/26/2011 9:49 PM
Issue fixed.
My Account
Login
Language (Tickets):