WarcraftReamls.com
  FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister 
  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 
WhoLib Compatibility
Goto page 1, 2  Next
 
Post new topic   Reply to topic    WarcraftRealms.com Forum Index -> CensusPlus UI Mod Bugs
View previous topic :: View next topic  
Author Message
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Sat Aug 08, 2009 9:14 am    Post subject: WhoLib Compatibility Reply with quote

I'm creating this topic to discuss getting census+ to work with wholib.

Essentially, any addon that wants to run background /whos will work fine on its own - as long as its the only such addon a user is running. When there are more than one - the addons often interact very badly and in difficult to fix ways.

Example: Consider that you have 3 addons that each run a who request at the exact same time. The server sends back one response. Which /who was it to?

WhoLib is supposed to make life easy for addon developers, and it actually does - if you support it in your addon.

If you don't support wholib, well then wholib is just like any other addon which want to run who requests in the background - you will have conflicts.

There are 2 main strategies:

1) Use wholib as part of your addon
2) Use wholib if it is there and your original code if not.

I have modded the current census+ to support wholib if it is there, and work normally if not. I haven't done much testing, I'm hoping that folks will pitch in and help. I posted here almost a year ago about this - but we were all busy getting ready for 3.0 i guess, and noone followed up.

Here's a link to the modded version:

http://www.wowace.com/addons/census-wholib-version/

and the ticket on wowace.com

http://www.wowace.com/addons/wholib/tickets/10-census-compat/

Sylvanaar


Last edited by akhtar on Thu Oct 22, 2009 2:07 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
Rollie
Site Admin


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

PostPosted: Tue Aug 11, 2009 1:35 pm    Post subject: Reply with quote

Thank you for starting this and doing the leg work on getting it all rolling, it is much appreciated!

I am going to look at incorporating your modifications.
Back to top
View user's profile Send private message Visit poster's website
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Tue Aug 11, 2009 2:57 pm    Post subject: Reply with quote

No prob - its been on my todo list for almost a year since I first posted over here about it.

The updated wholib combined with the modified census+ i linked have been running really well.

You should consider hosting the census+ source over on wowace.com or curseforge.com. If you have an account over there let me know - i'll add you onto the wholib project.
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Rollie
Site Admin


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

PostPosted: Tue Aug 11, 2009 3:33 pm    Post subject: Reply with quote

It does currently throw an error if LibWho is NOT present, working on a fix atm.


Code:
Message: ..\AddOns\CensusPlus\CensusPlus.lua line 1346:
   Cannot find a library instance of "LibWho-2.0".
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: Tue Aug 11, 2009 3:40 pm    Post subject: Reply with quote

Changing

Code:
      wholib = wholib or LibStub("LibWho-2.0");


to


Code:
      wholib = wholib or LibStub:GetLibrary("LibWho-2.0", true);



Seems to do the trick. Do you see any problems with doing it this way?
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: Tue Aug 11, 2009 3:49 pm    Post subject: Reply with quote

Okay, testing using WhoLib, and it is doing each query twice. Will need to dig into that.
Back to top
View user's profile Send private message Visit poster's website
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Fri Aug 14, 2009 11:46 am    Post subject: Reply with quote

One thought may be that you don't need to retry queries. Wholib will do that for you.
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Mon Aug 31, 2009 8:44 am    Post subject: Reply with quote

Still running really well with the version i modified - did you resolve the double query issue?
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Isaura



Joined: 08 Oct 2006
Posts: 40
Location: Netherlands
WR Updates: 1,334,593
Isaura WR Profile

PostPosted: Mon Aug 31, 2009 4:24 pm    Post subject: Reply with quote

Will this version also prevent the popping up from the who window every second, when census is active.
It is pretty worse atm, probly cause of another addon that was updated lately.
Before, it stopped popping up by clicking the friendstab and close the social window.
That doesn't work anymore. Actually nothing works.
Well one thing does. Dragging the social window almost out of your screen so its not in the way anymore Laughing

So if this version can change this annoying behavior I will we very glad, and a lot of others with me I think. Smile
Back to top
View user's profile Send private message
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Mon Sep 07, 2009 12:09 am    Post subject: Reply with quote

I cleaned up the issue page at wowace.com, and rezipped the last version I had worked on. The link is updated in the OP, and here : http://static.wowace.com/content/attachments/1/296/CensusPlus-Wholib-003.zip
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Rollie
Site Admin


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

PostPosted: Mon Sep 07, 2009 7:18 pm    Post subject: Reply with quote

Yeah, I haven't looked into it again since the first time. It's up on my list though.
Back to top
View user's profile Send private message Visit poster's website
zybron



Joined: 11 Jun 2009
Posts: 2
Location: Chattanooga, TN
WR Updates: 43,372
zybron WR Profile

PostPosted: Tue Sep 08, 2009 10:05 am    Post subject: Reply with quote

It looks like the section of code beginning on line 2020 of CensusPlus.lua is responsible for re-queuing a /who request:

Code:

               --
               -- Resend /who command
               --
               g_WhoAttempts = g_WhoAttempts + 1;
               local whoText = CensusPlus_CreateWhoText(g_CurrentJob);
               if( CensusPlus_PerCharInfo["Verbose"] == true ) then
                  CensusPlus_Msg(CENSUSPlus_WAITING);
               end
               if( g_WhoAttempts < 2 ) then
                  CensusPlus_SendWho(whoText);
               else
                  g_WaitingForWhoUpdate = false;
               end


If the WhoLib covers this, I would imagine it would be safe to remove this section entirely. I'm at work right now and can't test it, but I'll do so when I get home and see if this fixes the duplicates. Otherwise, I've been using the WhoLib version akhtar worked up for some time now without any other issue.
Back to top
View user's profile Send private message
Kosh



Joined: 01 Jul 2007
Posts: 84
Location: Somewhere on or near Earth
WR Updates: 1,210,548
Kosh WR Profile

PostPosted: Wed Sep 09, 2009 1:41 am    Post subject: Reply with quote

If the goal is to produce a version of CP that optionally uses WhoLib, only if it is present, then removing the section of code wouldn't be the way to go. Instead, if you are right and WhoLib negates the need to resend, then the block should be enclosed in an if() to only execute when WhoLib isn't being used. Without looking more closely at the code, it's possible that some of that may still need to execute (or alternate code might be needed if WhoLib never comes back for a query).
Back to top
View user's profile Send private message
zybron



Joined: 11 Jun 2009
Posts: 2
Location: Chattanooga, TN
WR Updates: 43,372
zybron WR Profile

PostPosted: Wed Sep 09, 2009 5:31 am    Post subject: Reply with quote

Kosh wrote:
If the goal is to produce a version of CP that optionally uses WhoLib, only if it is present, then removing the section of code wouldn't be the way to go. Instead, if you are right and WhoLib negates the need to resend, then the block should be enclosed in an if() to only execute when WhoLib isn't being used. Without looking more closely at the code, it's possible that some of that may still need to execute (or alternate code might be needed if WhoLib never comes back for a query).


Yes, very true. And after playing around with it, with wholib enabled, that section of code still needs

Code:
g_WaitingForWhoUpdate = false;


in order to function properly. So, add a check for wholib and process the original code or just turn turn off the waiting flag.

With the above code replacing the original code, there were no duplicates.
Back to top
View user's profile Send private message
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Fri Sep 18, 2009 4:03 am    Post subject: Reply with quote

Sounds like its pretty close - enough so - that we could put together an alpha/beta version for further testing.
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Isaura



Joined: 08 Oct 2006
Posts: 40
Location: Netherlands
WR Updates: 1,334,593
Isaura WR Profile

PostPosted: Sun Sep 20, 2009 10:02 am    Post subject: Reply with quote

This afternoon I installed this version from wowace: CensusPlus-Wholib-003 (.zip)
I must say I didn't play very long, but yeah, hurrah, I didn't see any popups anymore.

Just to let you know Smile
Back to top
View user's profile Send private message
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Thu Oct 01, 2009 10:26 pm    Post subject: Reply with quote

I have created a project on wowace.com to store the source changes I have made, in case anyone wants to submit patches etc.

http://www.wowace.com/addons/census-wholib-version/
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Ody



Joined: 20 Apr 2007
Posts: 23
Location: Germany
WR Updates: 1,372,740
Ody WR Profile

PostPosted: Tue Dec 08, 2009 1:24 pm    Post subject: Reply with quote

I'm using your modified version for serveral months, waiting for a 3.3 release.
Back to top
View user's profile Send private message
akhtar



Joined: 31 Jul 2005
Posts: 31
Location: Raleigh, NC
WR Updates: 78,987
akhtar WR Profile

PostPosted: Sun Nov 14, 2010 8:30 am    Post subject: Reply with quote

Updated wholib version for 4.0

http://www.wowace.com/addons/census-wholib-version/

Sylvanaar
_________________
Jon S Akhtar
Back to top
View user's profile Send private message AIM Address
Ody



Joined: 20 Apr 2007
Posts: 23
Location: Germany
WR Updates: 1,372,740
Ody WR Profile

PostPosted: Mon Nov 15, 2010 3:38 pm    Post subject: Reply with quote

Thanks Sylvanaar for the update 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 -> CensusPlus UI Mod Bugs All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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