| View previous topic :: View next topic |
| Author |
Message |
hafeliel
Joined: 11 Apr 2007
Posts: 2
Location: Cedar City, Utah
WR Updates: 0
hafeliel WR Profile
|
Posted: Wed Apr 11, 2007 9:56 am Post subject: API Request |
|
|
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. |
|
| Back to top |
|
 |
Rollie
Site Admin

Joined: 28 Nov 2004
Posts: 5370
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile
|
Posted: Wed Apr 11, 2007 12:19 pm Post subject: |
|
|
You can check the variable | Code: | | g_IsCensusPlusInProgress | 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 | Code: | | CensusPlus_TogglePause | 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. |
|
| Back to top |
|
 |
hafeliel
Joined: 11 Apr 2007
Posts: 2
Location: Cedar City, Utah
WR Updates: 0
hafeliel WR Profile
|
Posted: Wed Apr 11, 2007 12:22 pm Post subject: |
|
|
| Sweet! Many thanks. It is working with projects like this one that makes software development so worth it. |
|
| Back to top |
|
 |
Phreeze
Joined: 02 Oct 2005
Posts: 174
Location: Luxemburg (L),Europe
WR Updates: 410,136
Phreeze WR Profile
|
Posted: Wed Apr 11, 2007 5:14 pm Post subject: |
|
|
an thanks to a such good developper like Rollie, that has by far the best support for his addon, this one and newer addons like yours have no problems to coexist  _________________
  |
|
| Back to top |
|
 |
|
|
|