How to fire USER_ENTER_ROOM event?

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

spencergong2
Posts: 8
Joined: 11 Dec 2010, 13:29

How to fire USER_ENTER_ROOM event?

Postby spencergong2 » 19 Dec 2010, 23:22

Hi Thomas,

How to fire USER_ENTER_ROOM event?
When send JoinRoomRequest, ROOM_JOIN event is fired?
What sort of request is sending, then fire USER_ENTER_ROOM event?

What is difference between user join the room and enter room?

Thanks.
Spencer
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 20 Dec 2010, 06:55

it's OnUserEnterRoom, when a user is in a room and a new one enters, it will get fired if you registered to it.
spencergong2
Posts: 8
Joined: 11 Dec 2010, 13:29

Postby spencergong2 » 20 Dec 2010, 11:03

Hi appels.

Thanks for your answer.

It should be right, but when I test LobbyGUI.cs in unity3D SFS2XFPSTutorial, nothing is happened in method OnUserEnterRoom?
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 20 Dec 2010, 12:11

Code: Select all

   public void OnUserEnterRoom(BaseEvent evt) {
      User user = (User)evt.Params["user"];
      lock (messagesLocker) {
         messages.Add(user.Name + " joined room");
      }
   }


when a user enters the lobby this gets triggered, add's a message to the chatlog.

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 63 guests