Greetings! I'm a mod developer and not currently a user of CensusPlus, so please bear with me if this has been covered earlier.
I've developed a mod (http://ui.worldofwar.net/ui.php?id=4294) that helps people get groups together. Like CensusPlus, my mod does /who requests also, so if a user is running a census in the background while trying to use my mod, the mods will interfere with each other and neither will function correctly.
Unlike CensusPlus, my mod doesn't continue to do /who requests in the background once my main window is closed, so I'd like a way to cooperate with CP instead of competing with it. Ideally, I'd like a way for me to ask CP to pause when the user asks my mod to search and then have a way for my mod to tell CP to continue when my mod is done.
Obviously, I could do this by reverse engineering your code, but I'd really rather not, or I'll end up updating my code everytime you guys make a change to yours. Would it be possible to add (or do you already have) an API that I could work with? All I would really need is:
* An identifier whose value I could test to see if CP is present or running.
* A method I could call to ask CP to pause any /who requests.
* A method I could call to ask CP to continue.
Many thanks for any feedback other than flames.
API Request
You can check the variable to see if a Census is currently running. Try just setting to true to pause the census and false to resume. Alternately you could call which will set a manually paused if a Census is running and will resume if a Census were running but paused.
Looking at the code, it looks that would probably be the easiest thing to do.
Just before you do your /who data, call CensusPlus_TogglePause and then call it again when you're done.
Code: Select all
g_IsCensusPlusInProgress
Code: Select all
g_CensusPlusPaused
Code: Select all
CensusPlus_TogglePause
Looking at the code, it looks that would probably be the easiest thing to do.
Just before you do your /who data, call CensusPlus_TogglePause and then call it again when you're done.
phpbb:phpinfo()