ObjectMessageRequest Class |
Namespace: Sfs2X.Requests
public class ObjectMessageRequest : GenericMessageRequest
Name | Description | |
---|---|---|
ObjectMessageRequest(ISFSObject) |
See ObjectMessageRequest(ISFSObject, Room, ICollection<User>) constructor.
| |
ObjectMessageRequest(ISFSObject, Room) |
See ObjectMessageRequest(ISFSObject, Room, ICollection<User>) constructor.
| |
ObjectMessageRequest(ISFSObject, Room, ICollectionUser) |
Creates a new ObjectMessageRequest instance.
|
void SomeMethod() { sfs.AddEventListener(SFSEvent.OBJECT_MESSAGE, OnObjectMessage); // Send a game move to all players ISFSObject dataObj = new SFSObject(); dataObj.PutInt("x", myAvatar.x); dataObj.PutInt("y", myAvatar.y); sfs.Send( new ObjectMessageRequest(dataObj) ); } void OnObjectMessage(BaseEvent evt) { ISFSObject dataObj = (SFSObject)evt.Params["message"]; int x = dataObj.GetInt("x"); int y = dataObj.GetInt("y"); // etc... }