UserList not enabled / showing existing users

Everything about the SmartFoxBits UI Components for SmartFoxServer 2X. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

UserList not enabled / showing existing users

Postby mmancuso » 24 Jul 2012, 18:48

I have a UserList and ChatBox in a room.

The ChatBox works perfectly fine. If I message back and forth between clients, the messages show up with the user names and everything.

The UserList on the other hand, has a few problems, which I've tried to troubleshoot but can't figure out.

1) The UserList doesn't appear to be enabled. I've enabled it programmatically by setting the enabled property to true, but it still appears as gray.

2) If I join the room, after another user is already in the room, the existing user doesn't show up in the user list.

I'm not expecting anyone to have the solution, but rather point me in a general direction of troubleshooting this issue, since the UserList component is a bit of a black box.

Much appreciated,
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 24 Jul 2012, 20:02

Ok, I solved this by attaching a USER_COUNT_CHANGE listener to my smartfox instance. Then in the listener method, I grab the userList component and refresh it. Does the trick.
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 25 Jul 2012, 19:13

Scratch that. I'm now getting the following error intermittently:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.smartfoxserver.smartfoxbits.bits::UserList/initDataProvider()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/UserList.as:1162]
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 02 Aug 2012, 10:41

Not sure what can go wrong in that line, which is:

Code: Select all

if (smartFox.lastJoinedRoom != null)

The only possibility is that the smartFox instance is null.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 25 Aug 2012, 22:43

I'm not sure either. I put in a check to see whether or not smartfox was null (it wasn't) and also checked to see the value of smartfox.lastJoinedRoom (which was being correctly set).

I've tried for a long time to fix this issue but can't seem to find a solution. It's preventing us from shipping our product.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 27 Aug 2012, 07:33

Are you sure you are using the latest version of SmartFoxBits? Maybe it is an older one and that line number is not corresponding to our latest version.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 28 Aug 2012, 20:01

I'm using SmartFoxBits2X_BasePack.swc, is that not the latest one?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 29 Aug 2012, 07:44

Impossible to say from the filename. When did you purchase your license?
The latest version is 1.3.0a and it was released on July 7th 2011.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 29 Aug 2012, 18:01

Hm, I'm just using whichever one came with the SFS2x download. We are waiting to purchase a license until I can figure this issue out, I really appreciate your help thus far.

It's a weird error in that when I have the UserList active when OpenSpace is active, it always works. If I'm loading my own interface (and disabling OpenSpace), where the user is in a room corresponding to the interface, the UserList intermittently works, but the Chat always works.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 30 Aug 2012, 08:36

I'd suggest that you get the latest version available at the following link and retest: http://bits.smartfoxserver.com/download
I would like to get to a point where we really understand where the problem arises.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 20 Nov 2012, 23:42

after a hiatus, we've resumed the product and this is the only remaining problem in our way.

a little refresh: so when I'm in open space, I have a UserList component that works great, never had one problem with it. my application allows a user to leave the OpenSpace world, and join another room, bringing up a custom interface. In this interface, there is a chat box and a user list. the chat box initializes perfectly fine and has always worked. the user list on the other hand, doesn't. it shows up as a grayed out box such that I can't click on anyone (but displays other users).
originally, I was initializing the UserList by placing it in the mxml component, along with the chatbox. no go. now I've tried programmatically adding it to the interface, after the fact, and it still shows up as grayed out.

greyed out image http://imgur.com/SOgUI

Code: Select all

var ul:UserList = new UserList();
   ul.enablePrivateChat = true;
   addChild(ul);


This is a show-stopper for us and we desperately need this resolved. Any help is much appreciated.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 21 Nov 2012, 09:00

The reason for this behavior is that the UserList listens to the ROOM_JOIN event in order to initialize itself.
If this event is fired before the component is ready, it won't work.
So you have two options:

1) create and add to the stage the UserList before joining the new Room;

2) call the refreshList() method on the UserList, which forces a re-initialization.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 21 Nov 2012, 16:28

Thanks very much Bax for the quick response, much appreciated. I had a feeling this was the problem. I've tried the refreshList() before but I get the following error:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.smartfoxserver.smartfoxbits.bits::UserList/initDataProvider()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/UserList.as:1162]
   at com.smartfoxserver.smartfoxbits.bits::UserList/initUserList()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/UserList.as:1152]
   at com.smartfoxserver.smartfoxbits.bits::UserList/refreshList()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/SmartFoxBits/Flex/Base Pack/source/src/com/smartfoxserver/smartfoxbits/bits/UserList.as:965]
   at com.packages.interfaces::Theater/init()[C:\xampp\htdocs\pilot\jumbocinema\flash_project\src\com\packages\interfaces\scripts\TheaterScript.as:105]


When you responded earlier above, it seems like that error was being thrown on a line where the user list was checking for the last joined room. The odd thing is that when I print out the last joined room, it's returns the last joined room.

What makes this even weirder, is that I can see people in the list when they enter the room, it just stays greyed out.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 22 Nov 2012, 08:49

The error you reported indicates that the UserList's internal reference to the SmartFox class is null.
This reference is set when the component creation is completed, and it's value is taken from the Connector.
Something really odd is going on, in particular because you can see the list of users still being displayed.

Anyway, have you tried the approach of creating the component before joining the Room?
Another thing you might try is enabling the inner list component manually, getting a reference to it by means of the UserList.list property.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 22 Nov 2012, 18:41

Thanks Bax.

I agree it's odd. I have two main flex components; MAIN and THEATER. In the MAIN component, I have the sfb:Connector component. When a user clicks on a login button, connector.connect() is called and it connects and everything works. The THEATER doesn't have this sfb:Connector component, and it seems like the userList half works, but the sfb:ChatBox fully works. Could this be why? I tried putting an sfb:Connector in the THEATER but that didn't work. I'm testing out removing the sfb:Connector and doing it all from my MAIN script.

Return to “SmartFoxBits for SFS 2X”

Who is online

Users browsing this forum: No registered users and 17 guests