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;
}
}