-
Posted by a115 on Wed, 27 Oct 2010 21:05:05
Hello all,
I'm working on a mod, part of which needs a list of channel members in a custom chat room.
So, I figure..
GetChannelDisplayInfo(ChannelIndex)
get the count, for number of players
do a GetChannelRosterInfo() on each player to get the char name.
But. GetChannelDisplayInfo is returning nil for count, but all other variables are populated correctly.
local name, header, collapsed, channelNumber, count= GetChannelDisplayInfo(chanIndex);
and yes, there are plenty of people in the chat room, including myself.
Any ideas?
-
Posted by jnwhiteh on Thu, 28 Oct 2010 07:49:30
I believe the channel has to be the 'selected' channel in order to obtain any information about it. You may also need to watch for events, such as
CHANNEL_COUNT_UPDATE
andCHANNEL_ROSTER_UPDATE
, but I'm not 100% sure. The default UI works properly, and if you open the chat UI and run /dump GetChannelDisplayInfo(3), which is "General", it works properly. -
Posted by yasueh on Sat, 16 Jul 2011 23:20:43
(For anyone who's had this problem and comes across this)
Are you using the channel index given by (type/paste it into the game chat):
/run for x = 1, GetNumDisplayChannels() do print(x..". "..GetChannelDisplayInfo(x)); end
or from:
/run print(GetChannelList());
There's 2 ways chat channels are numbered in the game.