Click or drag to resize

UnsubscribeRoomGroupRequest Class

Unsubscribes the current user to Room-related events occurring in the specified Group.
Inheritance Hierarchy
SystemObject
  BaseRequest
    Sfs2X.RequestsUnsubscribeRoomGroupRequest

Namespace:  Sfs2X.Requests
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class UnsubscribeRoomGroupRequest : BaseRequest

The UnsubscribeRoomGroupRequest type exposes the following members.

Constructors
  NameDescription
Public methodUnsubscribeRoomGroupRequest
Creates a new UnsubscribeRoomGroupRequest instance.
Top
Remarks
This allows the user to stop being notified of specific Room events occurring in Rooms belonging to the unsubscribed Group.

If the operation is successful, the current user receives a ROOM_GROUP_UNSUBSCRIBE event; otherwise the ROOM_GROUP_UNSUBSCRIBE_ERROR event is fired.

Examples
The following example makes the current user unsubscribe a Group:
void SomeMethod() {
    sfs.AddEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE, OnUnsubscribeRoomGroup);
    sfs.AddEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, OnUnsubscribeRoomGroupError);

    // Unsubscribe the "card_games" group
    sfs.Send( new UnsubscribeRoomGroupRequest("card_games") );
}

void OnUnsubscribeRoomGroup(BaseEvent evt) {
    Console.WriteLine("Group unsubscribed: " + (string)evt.Params["groupId"]);                          // .Net / Unity
    System.Diagnostics.Debug.WriteLine("Group unsubscribed: " + (string)evt.Params["groupId"]);         // UWP
}

void OnUnsubscribeRoomGroupError(BaseEvent evt) {
    Console.WriteLine("Group unsubscribing failed: " + (string)evt.Params["errorMessage"]);                         // .Net / Unity
    System.Diagnostics.Debug.WriteLine("Group unsubscribing failed: " + (string)evt.Params["errorMessage"]);        // UWP
}
See Also