SmartFoxServer Silverlight API
SendObject Method (obj, roomId)
Namespaces ► SmartFoxClientAPI ► SmartFoxClient ► SendObject(SFSObject, Int32)
Send an SFSObject to the other users in the current room.
This method can be used to send complex/nested data structures to clients, like a game move or a game status change. Supported data types are: Strings, Booleans, Numbers, Arrays, Objects.
Declaration Syntax

C# | Visual Basic | Visual C++

    public void SendObject(
    	SFSObject obj,
    	int roomId
    )

    Public Sub SendObject ( _
    	obj As SFSObject, _
    	roomId As Integer _
    )

    public:
    void SendObject(
    	SFSObject^ obj,
    	int roomId
    )

Parameters

obj (SFSObject)
  the SFSObject to be sent.

roomId (Int32)
  the id of the target room, in case of multi-room join (optional, default value: activeRoomId).

Remarks

Sends:
SFSEvent..::.OnObjectReceivedDelegate

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to send a simple object with primitive data to the other users.
CopyC#

    SFSObject move = new SFSObject();
    move.Put("x", 150);
    move.Put("y", 250);
    move.Put("speed", 8);
    smartFox.SendObject(move);

See Also
SendObjectToGroup(SFSObject, List<(Of <(Int32>)>), Int32)
SFSEvent..::.OnObjectReceivedDelegate

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)