Invitation Refuse event not able to handle @client side

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

pavan.kuppa
Posts: 2
Joined: 30 Apr 2013, 11:15

Invitation Refuse event not able to handle @client side

Postby pavan.kuppa » 01 May 2013, 10:23

Invitation Refuse event not able to handle @client side
In Game Lobby example also not working

using server version 2.6.0
here the code

Code: Select all

sfs.addEventListener(SFS2X.SFSEvent.INVITATION_REPLY, onInvitationReply, this);
sfs.addEventListener(SFS2X.SFSEvent.INVITATION, getInvitations,this);
sfs.addEventListener(SFS2X.SFSEvent.INVITATION_REPLY_ERROR, onInviationReplyError,this);


function invitationAccept(e){
   var inviteId = jQuery(e).attr("inviteid");
   sfs.send(new SFS2X.Requests.Game.InvitationReplyRequest(invitationList[inviteId], SFS2X.Entities.Invitation.InvitationReply.ACCEPT));

}

function invitationDeny(e){
   var inviteId = jQuery(e).attr("inviteid");
   sfs.send(new SFS2X.Requests.Game.InvitationReplyRequest(invitationList[inviteId], SFS2X.Entities.Invitation.InvitationReply.REFUSE));
}

function onInviationReplyError(event){
   if(event){
      alert(event.errorMessage);
   }
}

function getInvitations(event){
   if(event.invitation){
      var inv = event.invitation;
      jQuery("#invitations").show();
      jQuery(".invitationList").trigger("click");
      var inviteList = jQuery(".invite_list").html();
      inviteList +="<li>From : "
               +inv.inviter.name
               +"<p>"+inv.params.msg
               +"</p><div><input type='button' class='btn btn-primary ' onclick='invitationAccept(this)' inviteId='"+inv.id+"' value='Accept'/><input type='button' class='btn marl_sm' onclick='invitationDeny(this)' inviteId='"+inv.id+"'  value='Deny'/></div><li>";
      jQuery(".invite_list").html(inviteList);
      invitationList[inv.id]=inv;
   }
}
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Invitation Refuse event not able to handle @client side

Postby Bax » 02 May 2013, 12:42

Thank you for reporting. We will look into this and let you know.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 19 guests