Leave room Request problem

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

sudharsan
Posts: 4
Joined: 02 Nov 2018, 10:30

Leave room Request problem

Postby sudharsan » 28 Nov 2018, 13:43

In Public Message Request When I Click Leave Room Request It Automatically Leave All Clients in the Same Room. How to Avoid this problem


Code: Select all

function leaveroom()
{
   // Leave the last joined Room

   sfs.send(new SFS2X.LeaveRoomRequest());
//   $("#sender").val("");
   document.getElementById("sender").value="";
}

function onUserExitRoom(evtParams)
{
   var room = evtParams.room;
   var user = evtParams.user;

   console.log("User " + user.name + " just left Room " + room.name);
         
//   alert($("#pvchat").attr('id'));
   $("#pchat").hide();
   $("#jroom").show();
}
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Leave room Request problem

Postby Lapo » 28 Nov 2018, 15:30

Hi,
your request is not very clear. It seems like you're referring to one of our examples but there is no "Public Message Request" example. Maybe you mean the Advanced Chat from our Example Pack?
https://www.smartfoxserver.com/download/#p=examples

If not, I'd recommend to check that example because it shows exactly how to use the LeaveRoom request.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
sudharsan
Posts: 4
Joined: 02 Nov 2018, 10:30

Re: Leave room Request problem

Postby sudharsan » 30 Nov 2018, 05:00

Thank you for your Response i solved that problem.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 86 guests