Hello all
Well I looked around for information about this on the forums and in the patch notes, please forgive me if I overlooked the answer.
I have a situation where I am not getting an evt.user object when handling the privMsg internal event (server 1.5.5). I have included "<my zone>.setPrivMsgInternalEvent(true);" in the code, likewise for public, and the handling of public messages works perfectly. But after a frustrating run of "cannot getValue() of undefined" from failed user variable requests on the private event, I traced evt.hasOwnProperty("user") and the reply is false, all indications are that no user object comes along with the event.
This is odd, because private messages sent without the internal event handler work fine, and the recipient definitely has the sender's user object to use for formatting.
The user is logged into multiple rooms, but they're rather vanilla. I have run into situations where disabling room event broadcasts cause server-side handling of user objects to fail, while they continue to work on the client side, and would suspect that this is similar except a) it works for public messages and b) I did eventually figure the other ones out, but this is driving me crazy. I may end up resorting to response objects for all messaging for bandwidth reasons anyway but I was hoping this would work.
Any thoughts?
Thank you,
-abm
Handling "privMsg" internal event, missing user ob
Could you provide a simple example or a step-by-step description that shows us how to reproduce the problem? It's not clear under which circumstances the problem is found.
This is also unclear, what do you mean? What does sending private message without event handler mean?
thanks
Code: Select all
This is odd, because private messages sent without the internal event handler work fine, and the recipient definitely has the sender's user object to use for formatting.
This is also unclear, what do you mean? What does sending private message without event handler mean?
thanks
BUMP, or whatever..
Allthough the first post is a bit confusing, I seem to have similar problems.
Having set zone.setPrivMsgInternalEvent(true);.
The handleInternalEvent->privMsg works..
But e.user = undefined.
The following code:
Produces the following output:
The init code is correct and everything works fine with the pubMsg event.
So, what am I missing, or is it a cleverly disguised feature
Oh, using SmartFoxServer 1.5.9
Kind Regards
KiRuVa[/code]
Allthough the first post is a bit confusing, I seem to have similar problems.
Having set zone.setPrivMsgInternalEvent(true);.
The handleInternalEvent->privMsg works..
But e.user = undefined.
The following code:
Code: Select all
trace("=======================");
trace("=======privMsgInfo=========");
trace("---------------------------");
trace("sourceRoom: " + sourceRoom.getName());
trace("sender: " + e.user);
trace("recipient: " + recipient.getName());
trace("message: " + message);
trace("---------------------------");
Produces the following output:
Code: Select all
[extTextAPI.as]: =======================
[extTextAPI.as]: =======privMsgInfo=========
[extTextAPI.as]: ---------------------------
[extTextAPI.as]: sourceRoom: The Room
[extTextAPI.as]: sender: undefined
[extTextAPI.as]: recipient: bar
[extTextAPI.as]: message: foo2bar
[extTextAPI.as]: ---------------------------
The init code is correct and everything works fine with the pubMsg event.
So, what am I missing, or is it a cleverly disguised feature
Oh, using SmartFoxServer 1.5.9
Kind Regards
KiRuVa[/code]
I think you should better check the documentation:
http://www.smartfoxserver.com/docs/docP ... ivMsg.html
There are two properties called sender and recipient, but there's no user property.
http://www.smartfoxserver.com/docs/docP ... ivMsg.html
There are two properties called sender and recipient, but there's no user property.
-
- Posts: 27
- Joined: 20 Jun 2016, 18:30
Re: Handling "privMsg" internal event, missing user ob
Someone got confused writing the instructions so that's why you made a mistake
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 73 guests