WarcraftReamls.com
  FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister 
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 
API Request

 
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> Suggestions
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

PostPosted: Wed Apr 11, 2007 9:56 am    Post subject: API Request Reply with quote

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
View user's profile Send private message Visit poster's website
Rollie
Site Admin


Joined: 28 Nov 2004
Posts: 5374
Location: Austin, TX
WR Updates: 480,131
Rollie WR Profile

PostPosted: Wed Apr 11, 2007 12:19 pm    Post subject: Reply with quote

You can check the variable
Code:
g_IsCensusPlusInProgress
to see if a Census is currently running. Try just setting
Code:
g_CensusPlusPaused
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
View user's profile Send private message Visit poster's website
hafeliel



Joined: 11 Apr 2007
Posts: 2
Location: Cedar City, Utah
WR Updates: 0
hafeliel WR Profile

PostPosted: Wed Apr 11, 2007 12:22 pm    Post subject: Reply with quote

Sweet! Many thanks. It is working with projects like this one that makes software development so worth it.
Back to top
View user's profile Send private message Visit poster's website
Phreeze



Joined: 02 Oct 2005
Posts: 172
Location: Luxemburg (L),Europe
WR Updates: 410,136
Phreeze WR Profile

PostPosted: Wed Apr 11, 2007 5:14 pm    Post subject: Reply with quote

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 Wink
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> Suggestions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
WarcraftRealms.com  


Powered by phpBB © 2001, 2005 phpBB Group