aubuti;621262 Wrote: > Thanks much. Version 20110326.020431 was out before I got to this, so > that's what I tested. On a quick test it almost works as expected. I > told it to push 5 players to mysb after 30 minutes of idle, and it did. > After a WOL it only brought back 4 of the 5 -- the first SB in the list > of MAC addresses (an SB3) stayed on mysb.com. Ok, let me add one more tweak to the code here. I'm relying on SBS's own list of "who's on mysb.com" to fetch the players. SBS updates its list of who's-on-first on a schedule...initially every 60 seconds and then on an interval that's suggested by mysb.com itself. If SBS encounters errors communicating with mysb.com, then that polling interval gets progressively longer.
As my code now stands, it's possible that between pushing->sleep->wakeup->fetching, SBS hasn't completely updated its list and so I'll fail to fetch everybody back. The SrvrPowerCtrl settings "Alternate server delay time", "Seconds to wait before trying to restore" and "Restore players forcefully" are all attempts on my part to mitigate that problem. Setting longer times for those should increase your chances of success. Note that this problem isn't present if you're fetching players back from another SBS server, like tinysc on a SBTouch. I *think* I can add code to force SBS to update it's mysb.com player list now-now-now on wake-up. The tricky bit here is the fact that every system, OS and distro seems to have its own wake-up quirks. Thus, it's entirely possible that my "on wakeup" code gets hit before the system's networking is fully awake. So again, timers to the rescue. For my 1st stab at this, I'll try this: -On wakeup, IF we're going to try to fetch players back from mysb.com, 20 seconds before we try to do that, force SBS to refresh it's list of mysb.com players.- The assumption here, of course, is that 20 seconds is sufficient time for SBS to accomplish that task. As far as I can tell from looking at the SBS code, there isn't any way for SrvrPowerCtrl to know if SBS's fetch_players() command has succeeded or not. SBS even has an undocumented 'squeezenetwork fetch_players' CLI command. However it doesn't return anything. Anyway, let me boot up my development machine and add this new code and post the new version. Shouldn't take more than 20 minutes. -- gharris999 ------------------------------------------------------------------------ gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115 View this thread: http://forums.slimdevices.com/showthread.php?t=48521 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
