Ok I got it. I sent a message from the client with a type like WHATS_MY_NAME and in that case have the server call user.Send in GotMessage, then it works.
Apparently UserJoined is called on the server before the user is logged in so that's why user.Send doesn't work in that method. Is it so?
serversidecode, user.send method not working
fabidi说
很久以前 | 帖子#2
Oliver说
很久以前 | 帖子#3Everything sent to the user in the UserJoined method should be buffered up and sent when the connection is fully established.
Do you have some test code that reproduces the error? then we can look at it?
My e-mail is my username at this sites domain.
-- Oliver
Do you have some test code that reproduces the error? then we can look at it?
My e-mail is my username at this sites domain.
-- Oliver
回复主题
现在就注册以回复主题
fabidi说
很久以前 | 帖子#1Right now what I need to do is get the client to know what his user id is to he can filter the messages that the server broadcasts.
I was using this bit of code
public override void UserJoined(Player player) {
// send one message to the player upon joining the game
player.Send("hi",1,"strings are okay also",true)
}
The above message never triggers the onMessage event. The broadcast method works fine though.
NonobaAPI.GetUsername. I have this called when the ConnectionEvent.INIT method is called and it still gives me the message the NonobaAPI.NOT_LOGGED_IN response.
How to ppl?