Hello,
I'm trying to setup a multi-chat. I have reviewed the example in the docs. I have a main lobby with a chat that works fine until after you join another room (a game room). The user does remain in the main lobby... The creation and joining of the game room is performed on the server.
The problem....
Once the game room is joined, the chat box in the main lobby returns a null sender. The message and room ID are correct.
The game room chat works fine and returns a valid sender. Even once the user leaves the game room the sender is still null in the main lobby.
Does anyone know why the sender would become null in the main lobby after joining another room and remaining in both rooms? I'm using the room id in sendpublicmessage for each room.
EDIT: If it helps... I'm still using sfs 1.5.5
Thanks for any help,
Brent
[Help] onPublicMessage Null Sender Issue
-
BattleSpace
- Posts: 41
- Joined: 03 Oct 2005, 20:53
- Location: Phoenix, AZ
- Contact:
-
BattleSpace
- Posts: 41
- Joined: 03 Oct 2005, 20:53
- Location: Phoenix, AZ
- Contact:
Some clarification...
If the user that is in both rooms types a chat message in the main lobby... the message is seen by other users and the sender is NOT null (to everyone else...)... the user that sent the message does not see it because it errors out on null sender.
It is the user that is in both rooms that always receives a null sender... even from other users in the main lobby.
Any hints on where to look?
If the user that is in both rooms types a chat message in the main lobby... the message is seen by other users and the sender is NOT null (to everyone else...)... the user that sent the message does not see it because it errors out on null sender.
It is the user that is in both rooms that always receives a null sender... even from other users in the main lobby.
Any hints on where to look?
-
BattleSpace
- Posts: 41
- Joined: 03 Oct 2005, 20:53
- Location: Phoenix, AZ
- Contact:
-
BattleSpace
- Posts: 41
- Joined: 03 Oct 2005, 20:53
- Location: Phoenix, AZ
- Contact:
Hi Lapo...
Any hint on what is happening?
I have also noticed the following:
I have two browser sessions open each logged in with different IDs. If I create and join a game room in one of the two sessions... then close the browser in that same session... the other browser session that is still connected receives the following errors:
Note this is only happening after creating a game room... if I never create a game room I can close the browser with no problem. When I try it in the client so I can see the trace statements it reports the same error... but my SFSEvent for onUserLeaveRoom does not even execute. I know this because there is a trace statement on the first line with ("on leave room").
Any help is appreciated... since the joinRoom was on the server I thought I would see if it made a difference to join the room on the client... no change.
Any hint on what is happening?
I have also noticed the following:
I have two browser sessions open each logged in with different IDs. If I create and join a game room in one of the two sessions... then close the browser in that same session... the other browser session that is still connected receives the following errors:
Code: Select all
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleUserLeaveRoom()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::xmlReceived()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleSocketData()
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
at it.gotoandplay.smartfoxserver::SmartFoxClient/::xmlReceived()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleMessage()
at it.gotoandplay.smartfoxserver::SmartFoxClient/::handleSocketData()
Any help is appreciated... since the joinRoom was on the server I thought I would see if it made a difference to join the room on the client... no change.
-
BattleSpace
- Posts: 41
- Joined: 03 Oct 2005, 20:53
- Location: Phoenix, AZ
- Contact:
Lapo,
I have resolved this issue through trial and error....
I read in a thread by you on the forum that said you were suppose to update the room list on the client prior to joining a room otherwise it could cause problems. Perhaps I misread the statement... that was when I had the server handling the joining of the room immediately after it was created. Now the client handles the joining... after it is created by the server.
Once I removed the "sfs.getRoomList();" on the client before calling sfs.joinRoom the issues have disappeared (both chat windows work... and my browser close window issue is gone.)
So I can better understand what happened... do you know why calling getRoomList before joinRoom would cause this type of behavior?
Regards,
Brent
I have resolved this issue through trial and error....
I read in a thread by you on the forum that said you were suppose to update the room list on the client prior to joining a room otherwise it could cause problems. Perhaps I misread the statement... that was when I had the server handling the joining of the room immediately after it was created. Now the client handles the joining... after it is created by the server.
Once I removed the "sfs.getRoomList();" on the client before calling sfs.joinRoom the issues have disappeared (both chat windows work... and my browser close window issue is gone.)
So I can better understand what happened... do you know why calling getRoomList before joinRoom would cause this type of behavior?
Regards,
Brent
Could you report the sequence of actions that you do in order to reproduce the problem? It's not easy to understand what's going on like this.
All I can say is that the getRoomList() command is usually invoked once then you just receive updates about which rooms where created or removed.
The default login mechanism calls getRoomList for you as soon as you successfully log into a Zone. Conversely if you perform a custom login you can decide to send the list from the server side, get it from client side or even not sending it at all ( which is usually not recommended )
All I can say is that the getRoomList() command is usually invoked once then you just receive updates about which rooms where created or removed.
The default login mechanism calls getRoomList for you as soon as you successfully log into a Zone. Conversely if you perform a custom login you can decide to send the list from the server side, get it from client side or even not sending it at all ( which is usually not recommended )