[Unity API] Problem with SetRoomVariables();

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

ringhino
Posts: 8
Joined: 19 Dec 2008, 08:33

[Unity API] Problem with SetRoomVariables();

Postby ringhino » 27 Mar 2009, 12:58

Hi Thomas.

I'm using your API with Unity and Smartfox server.

I need to set a variable inside a room, I've created them in the config.xml and I can see them thru the administration. I can read them from the clients by Unity, but I cannot write inside them using SetRoomVariables because I get a compiling error.

During the compiling process the error log says:

SmartFoxClientAPI.SmartFoxClient does not contain definition for SetRoomVariables().

To modify this variables from the clients, is this the correct method or there is another way?

NB: this variables must contain the latest values also when the other users log out from the game.

Example: If a player modify the position of an object, that object must mantain its position when the user logs off so when another user logs in it must see the object in the last position of the previous one.

thanks

Ringhino
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 27 Mar 2009, 15:59

Hi!

You should be able to set the variables with

public void SetRoomVariables(ArrayList varList)
public void SetRoomVariables(ArrayList varList, int roomId)
or
public void SetRoomVariables(ArrayList varList, int roomId, bool setOwnership)

I see that the documentation writes setRoomVariables instead of SetRoomVariables. It also has the wrong syntax - seems I simply forgot to translate that part into C#. Thats a bug in the documentation, and I'll fix that in the next release.

The ArrayList containts RoomVariable objects btw.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 23 guests