Class ObjectMessageRequest

java.lang.Object
sfs3.client.requests.BaseRequest
sfs3.client.requests.GenericMessageRequest
sfs3.client.requests.ObjectMessageRequest
All Implemented Interfaces:
sfs3.client.requests.IClientRequest

public class ObjectMessageRequest extends sfs3.client.requests.GenericMessageRequest
Sends an object containing custom data to all users in a Room, or a subset of them.

The data object is delivered to the selected users (or all users excluding the sender) inside the target Room by means of the objectMessage event. It can be useful to send game data, like for example the target coordinates of the user's avatar in a virtual world.

See Also:
  • Constructor Details

    • ObjectMessageRequest

      public ObjectMessageRequest(ISFSObject obj, Room targetRoom, List<User> recipients)
      Creates a new ObjectMessageRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.
      Parameters:
      obj - An instance of SFSObject containing custom parameters to be sent to the message recipients.
      targetRoom - The Room object corresponding to the Room where the message should be dispatched; if null, the last Room joined by the user is used.
      recipients - A list of User objects corresponding to the message recipients; if null, the message is sent to all users in the target Room (except the sender itself).
      See Also:
    • ObjectMessageRequest

      public ObjectMessageRequest(ISFSObject obj, Room targetRoom)
      See Also:
    • ObjectMessageRequest

      public ObjectMessageRequest(ISFSObject obj)
      See Also: