Thread Tools Display Modes
05-17-13, 08:44 PM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
GetNumGuildMembers problem

I'm using GetNumGuildMembers to return the number on online members but for some reason it returns less then who is online

Wowpedia says argument1 returns total members and argument2 returns who is actually online but argument2 does not return the correct value, interesting enough if i add an argument3 like so:

_,_,1 = GetNumGuildMembers() it does return the correct value

So my question is this. Is wowpedia/wowwikki not updated on this or am I missing something?
  Reply With Quote
05-17-13, 09:15 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Spawnova View Post
I'm using GetNumGuildMembers to return the number on online members but for some reason it returns less then who is online

Wowpedia says argument1 returns total members and argument2 returns who is actually online but argument2 does not return the correct value, interesting enough if i add an argument3 like so:

_,_,1 = GetNumGuildMembers() it does return the correct value

So my question is this. Is wowpedia/wowwikki not updated on this or am I missing something?
I've always gotten correct values if I listen for GUILD_ROSTER_UPDATE and then wait a second or two before calling GetNumGuildMembers.

If you need to force an update and retrieve updated guild information from the server you can call GuildRoster(), which will subsequently cause GUILD_ROSTER_UPDATE to fire when new information is retrieved. Only use this when necessary, however, as it is a server request and will cause a minor game freeze.
  Reply With Quote
05-17-13, 09:34 PM   #3
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Still returns incorrect value. I use this macro to test

/run local _,i = GetNumGuildMembers(); print(i)

But why is it that a third argument always returns the correct value?
  Reply With Quote
05-17-13, 09:42 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Found this line in Blizzard_GuildRoster.lua
Lua Code:
  1. local totalMembers, onlineMembers, onlineAndMobileMembers = GetNumGuildMembers()
which is just what I figured.

You're not paying attention to whether they're actually online or just in chat through battle.net.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
05-17-13, 09:46 PM   #5
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Seerah View Post
Found this line in Blizzard_GuildRoster.lua
Lua Code:
  1. local totalMembers, onlineMembers, onlineAndMobileMembers = GetNumGuildMembers()
which is just what I figured.

You're not paying attention to whether they're actually online or just in chat through battle.net.
Clever girl
  Reply With Quote
05-17-13, 09:47 PM   #6
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Ah! thanks that makes sense now
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetNumGuildMembers problem


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off