SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
JoinRoomInvitationRequest.h
1 //
2 // JoinRoomInvitationRequest.h
3 // SFS2X
4 //
5 // Created by Lapo on 25/10/16.
6 // Copyright © 2016 A51 Integrated | http://a51integrated.com. All rights reserved.
7 //
8 
9 #import "BaseRequest.h"
10 #import "Room.h"
11 
12 EXTERN NSString * const JoinRoomInvitationRequest_KEY_ROOM_ID;
13 EXTERN NSString * const JoinRoomInvitationRequest_KEY_EXPIRY_SECONDS;
14 EXTERN NSString * const JoinRoomInvitationRequest_KEY_INVITED_NAMES;
15 EXTERN NSString * const JoinRoomInvitationRequest_KEY_AS_SPECT;
16 EXTERN NSString * const JoinRoomInvitationRequest_KEY_OPTIONAL_PARAMS;
17 
18 
19 /**
20  Sends an invitation to other users/players to join a specific Room.
21  Invitations can be used for different purposes such as playing games, visiting a specific Room, Buddy requests etc...
22 
23  Depending on the Room's settings this invitation can be sent only by Room's owner or by all other players, with the exception of spectators. This behavior can be changed via the RoomSetting.allowOwnerOnlyInvitation parameter.
24 
25  <b>NOTE:</b> spectators in a game Room are not allowed to invite other people.
26 
27  An invitation can also specify the amount of time given to each invitee to reply. Default is 30 seconds. A positive answer will attempt to join the user in the designated Room.
28  For game Rooms the <i>asSpectator</i> flag can be toggled to join the invitee as player or spectator (default = player).
29 
30  There aren't any specific notifications sent back to the inviter after the invitee's response. Users that have accepted the invitation will join the Room while those who didn't reply or turned down the invitation won't generate any event. In case you want to send specific messages (e.g. chat) you can simply send a private message back to the inviter.
31 
32  @see RoomSettings
33 
34  */
35 @interface JoinRoomInvitationRequest : BaseRequest
36 {
37 
38 @protected
39  id<Room> _targetRoom;
40  NSArray* _invitedUserNames;
41  NSInteger _expirySeconds;
42  BOOL _asSpectator;
43  id <ISFSObject> _params;
44 }
45 
46 @property (nonatomic, strong) id<Room> targetRoom;
47 @property (nonatomic, strong) NSArray* invitedUserNames;
48 @property (nonatomic, assign) NSInteger expirySeconds;
49 @property (nonatomic, assign) BOOL asSpectator;
50 @property (nonatomic, strong) id <ISFSObject> params;
51 
52 -(id)initWithInvitedUserNames:(NSArray *)invitedUserNames targetRoom:(id<Room>)room expirySeconds:(NSInteger)secs asSpectator:(BOOL)asSpect params:(id <ISFSObject>)params;
53 
54 /**
55  Sends an invitation to join an existing Room.
56 
57  @param invitedUserNames an array of online user names to invite in the Room
58  @param targetRoom the target Room for the invitation
59  @param expirySeconds how much time each invitee has to reply, in seconds (suggested = 30-60 secs)
60  @param asSpect indicates whether the invited people will join the target Room as players or spectators
61  @param params optional SFSObject containing custom data about the invitation (e.g. custom message, game info etc...)
62 
63  @see [ISFSEvents onInvitationReply:]
64  */
65 +(id)initWithInvitedUserNames:(NSArray *)invitedUserNames targetRoom:(id<Room>)room expirySeconds:(NSInteger)secs asSpectator:(BOOL)asSpect params:(id <ISFSObject>)params;
66 
67 @end
68 
JoinRoomInvitationRequest
Definition: JoinRoomInvitationRequest.h:35