Class SFS2X.Entities.Invitation.SFSInvitation

The details of an invitation received by the current user.

Class Summary
Constructor Attributes Constructor Name and Description
 
SFS2X.Entities.Invitation.SFSInvitation(inviter, invitee, secondsForAnswer, params)
Creates a new SFSInvitation instance.

Field Summary

Class Detail

SFS2X.Entities.Invitation.SFSInvitation(inviter, invitee, secondsForAnswer, params)
Creates a new SFSInvitation instance.

An invitation is sent through the InviteUsersRequest request and it is received as an invitation event. Clients can reply to an invitation using the InvitationReplyRequest request.

NOTE: developers never istantiate an SFSInvitation manually: this is done by the SmartFoxServer 2X API internally. A reference to an existing instance is always provided by the invitation event.

Parameters:
{SFSUser} inviter
A SFSUser object corresponding to the user who sent the invitation.
{SFSUser} invitee
A SFSUser object corresponding to the user who received the invitation.
{Number} secondsForAnswer
The number of seconds available to the invitee to reply to the invitation.
{Object} params
An object containing a custom set of parameters representing the invitation details.
See also:
SFS2X.Requests.Game.InviteUsersRequest
SFS2X.Requests.Game.InvitationReplyRequest
SFS2X.SFSEvent.INVITATION

Field Detail

{Number} id
Indicates the id of the invitation. It is generated by the server when the invitation is sent.

NOTE: setting the id property manually has no effect on the server and can disrupt the API functioning.

{SFSUser} invitee
Returns the SFSUser object corresponding to the user who received the invitation.
See also:
SFS2X.Entities.SFSUser
{SFSUser} inviter
Returns the SFSUser object corresponding to the user who sent the invitation.
See also:
SFS2X.Entities.SFSUser
{Object} params
Returns an object containing a custom set of parameters. It usually stores invitation details, like a message to the invitee and any other relevant data.
Default Value:
null
{Number} secondsForAnswer
Returns the number of seconds available to the invitee to reply to the invitation, after which the invitation expires.
Default Value:
15