serversidecode, user.send method not working

fabidifabidi

很久以前 | 帖子#1
Hi I'm new to using nonoba mp api.

Right 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?

fabidifabidi

很久以前 | 帖子#2
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?

OliverOliver

很久以前 | 帖子#3
Everything 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

回复主题

现在就注册以回复主题

5dyouxi

5dyouxi.com是一个独立的游戏网站,在这里你将可以免费玩到各种好玩的单人和多人游戏。

开发者工具

如果你是一位flash游戏开发者,我们有一些非常强大的工具来帮助你开发更加优秀的游戏。

经典游戏

为什么不试试我们这里的一些最为优秀的在线flash游戏呢?这可是完全免费的!

Copyright ©2007-2012 5dyouxi™ - All rights reserved.342.0196ms on SERVER34097
注册 或者