SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
QuickJoinOrCreateRoomRequest.h
1 //
2 // QuickJoinOrCreateRoomRequest.h
3 // SFS2X
4 //
5 // Copyright © 2022 GOTOANDPLAY s.n.c | https://www.smartfoxserver.com All rights reserved.
6 //
7 
8 #ifndef QuickJoinOrCreateRoomRequest_h
9 #define QuickJoinOrCreateRoomRequest_h
10 
11 #endif /* QuickJoinOrCreateRoomRequest */
12 
13 #import "BaseRequest.h"
14 #import "MatchExpression.h"
15 #import "RoomSettings.h"
16 #import "CreateRoomRequest.h"
17 #import "Room.h"
18 
19 EXTERN NSString * const QuickJoinOrCreateRoomRequest_KEY_MATCH_EXPRESSION;
20 EXTERN NSString * const QuickJoinOrCreateRoomRequest_KEY_GROUP_LIST;
21 EXTERN NSString * const QuickJoinOrCreateRoomRequest_KEY_ROOM_SETTINGS;
22 EXTERN NSString * const QuickJoinOrCreateRoomRequest_KEY_ROOM_TO_LEAVE;
23 
24 /** The request attempts to find a matching Room to join immediately. If the provided MatchExpression doesn't return any valid match a new Room
25  is created with the settings provided and auto-joined.
26 
27  */
28 @interface QuickJoinOrCreateRoomRequest : BaseRequest {
29 
30 @private
31  MatchExpression* _matchExp;
32  NSArray* _groupList;
33  RoomSettings* _roomSettings;
34  id<Room> _roomToLeave;
35 
36  CreateRoomRequest* _createRoomRequest;
37 }
38 
39 /**
40  @param matchExp a MatchExpression to search for a specifc subset of Rooms
41  @param groupList one or more valid group names where to search for Rooms
42  @param roomSettings the setting for the Room that will be created if no Rooms match the search criteria
43  @param roomToLeave an optional Room to leave when the new Room is joined
44 
45  @see [ISFSEvents onRoomJoin:]
46  @see [ISFSEvents onRoomJoinError:]
47  @see [ISFSEvents onRoomAdd:]
48  @see [ISFSEvents onRoomCreationError:]
49  @see LeaveRoomRequest
50  */
51 
52 +(id) requestWithMatchExpression:(MatchExpression*)matchExp groupList:(NSArray*)groupList roomSettings:(RoomSettings*)settings roomToLeave:(id<Room>)roomToLeave;
53 
54 
55 /**
56  @param matchExp a MatchExpression to search for a specifc subset of Rooms
57  @param groupList one or more valid group names where to search for Rooms
58  @param roomSettings the setting for the Room that will be created if no Rooms match the search criteria
59 
60  @see [ISFSEvents onRoomJoin:]
61  @see [ISFSEvents onRoomJoinError:]
62  @see [ISFSEvents onRoomAdd:]
63  @see [ISFSEvents onRoomCreationError:]
64  @see LeaveRoomRequest
65  */
66 +(id) requestWithMatchExpression:(MatchExpression*)matchExp groupList:(NSArray*)groupList roomSettings:(RoomSettings*)settings;
67 
68 
69 @end
MatchExpression
Definition: MatchExpression.h:42
CreateRoomRequest
Definition: CreateRoomRequest.h:43
QuickJoinOrCreateRoomRequest
Definition: QuickJoinOrCreateRoomRequest.h:28
RoomSettings
Definition: RoomSettings.h:39