SmartFoxServer 2X C++ API
Sfs2X::Requests::UnsubscribeRoomGroupRequest Class Reference

Stop listening to events of a specific Room Group More...

#include <UnsubscribeRoomGroupRequest.h>

Inherits Sfs2X::Requests::BaseRequest.

Public Member Functions

 UnsubscribeRoomGroupRequest (string groupId)
 Constructor More...
 

Detailed Description

Stop listening to events of a specific Room Group

Constructor & Destructor Documentation

◆ UnsubscribeRoomGroupRequest()

Sfs2X::Requests::UnsubscribeRoomGroupRequest::UnsubscribeRoomGroupRequest ( string  groupId)

Constructor

Parameters
groupIdthe name of the group
ptrSmartFox->AddEventListener(SFSEvent::ROOM_GROUP_UNSUBSCRIBE, boost::shared_ptr<EventListenerDelegate> (EventListenerDelegate(CMyClass::OnUnsubscribeRoomGroup, (unsigned long long)this));
ptrSmartFox->AddEventListener(SFSEvent::ROOM_GROUP_UNSUBSCRIBE_ERROR, boost::shared_ptr<EventListenerDelegate> (EventListenerDelegate(CMyClass::OnUnsubscribeRoomGroupError, (unsigned long long)this));
boost::shared_ptr<IRequest> request (new UnsubscribeRoomGroupRequest("CardGames"));
ptrSmartFox->Send(request);
static void OnUnsubscribeRoomGroup(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
static void OnUnsubscribeRoomGroupError(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
void CMyClass::OnUnsubscribeRoomGroup(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
{
CMyClass* ptrMyClass = (CMyClass*)ptrContext;
boost::shared_ptr<map<string, boost::shared_ptr<void>>> ptrEventParams = ptrEvent->Params();
boost::shared_ptr<void> ptrEventParamValueGroupId = (*ptrEventParams)["groupId"];
boost::shared_ptr<string> ptrGroupId = ((boost::static_pointer_cast<string>)(ptrEventParamValueGroupId));
string* message = new string("Group Removed: " + (*ptrGroupId));
}
void CMyClass::OnUnsubscribeRoomGroupError(unsigned long long ptrContext, boost::shared_ptr<BaseEvent> ptrEvent);
{
CMyClass* ptrMyClass = (CMyClass*)ptrContext;
boost::shared_ptr<map<string, boost::shared_ptr<void>>> ptrEventParams = ptrEvent->Params();
boost::shared_ptr<void> ptrEventParamValueErrorMessage = (*ptrEventParams)["errorMessage"];
boost::shared_ptr<string> ptrErrorMessage = ((boost::static_pointer_cast<string>)(ptrEventParamValueErrorMessage));
string* message = new string("Unsubscribe failure: " + (*ptrErrorMessage));
}
See also
Core.SFSEvent.ROOM_GROUP_UNSUBSCRIBE, Core.SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, SubscribeRoomGroupRequest