Canceling an invitation

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

Moderators: Lapo, Bax

User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Canceling an invitation

Postby Evil-Dog » 11 Mar 2011, 05:39

Hi, is there a way to cancel an invitation request? or some feature I'm not currently aware of that could help me achieve something similar?

For exemple, in my game lobby, you can check other people's "character panel" and from there you can add them as friend, request a trade, etc. For the trading , it seems wise to use the invitation system. But if I close the character panel, I want to cancel the trade request.

I can also manage the trade requests myself with standard extension requests but yeah, the invitation system seems to be a good bet but only if I can cancel invitations.

Thoughts? Suggestions?

Thanks you
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Postby Evil-Dog » 11 Mar 2011, 06:09

Hmmm, after some more looking around, it seems like InvitationManager.suppressInvitation might be what I need.

I'll try it out and hopefully end this monologue ;)
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 11 Mar 2011, 10:50

You are on the right path! :)
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Mar 2011, 11:07

The scenario is not entirely clear.
When User A sends and invitation (of any kind) to User B the latter can either accept or refuse.
Simply refuse it and it will be cancelled.

It doesn't make, however, that you can kill an invitation in the middle of it, just because you changed your mind. Once it is sent it will stay active until it runs out of the configured time.

If you want you can still avoid to accept the response if you keep track of when you closed the panel in question (trading panel)
That's your choice.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Postby Evil-Dog » 13 Mar 2011, 04:12

Alright well, I'll play around with that, I might simply manage the trading mechanics with extension requests.

Seems like a CancelInvitationRequest would be a good feature in the future. Then the invitation recipient could be notified and update its display of the canceled invitation.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 13 Mar 2011, 12:29

It's not easy as it sounds. There are many synchronization issues that can happen. For example the cancellation event arrives to the client after he has already accepted the invitation.
In that case we find ourselves in an inconsistent state in which the server knows that the invitation was cancelled, but for a while the client doesn't and he can still send an "accept" message.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Postby Evil-Dog » 15 Mar 2011, 00:15

Lapo thanks for the replies, I understand the synchronization problem, but wouldn't that be solved with an "Invite Reply Successful" event and in the case of the canceled invitation, a new error in the "Invite Reply Error" event like "The invitation has been canceled"

Basicly, anything that is an interaction between 2 users will need that kind of system right? Cause that's what I will need to do I reckon. Seems like any game using the invite system is kinda restricted when it sends an invite, restrictions like not being able to send other invites, not leaving the interface where the invite was sent from. Otherwise you'd get many cases where someone accepts an invite and the inviter has already moved on to another game or something like that. If I create a game room and invite someone into it and then leave the game room, without canceling the invite, I'm leaving a dangling/invalid invite out there for the invitee.

Anyway, that's probably all because of the type of game I'm doing but it would be nice if the invite system had more support for synchronized/mutual interactions, like trading, game invites, team-up request, etc

And what the heck christian.kelvin10?
You're just repeating my question with an incredibly corrupted english
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Mar 2011, 10:47

If I create a game room and invite someone into it and then leave the game room, without canceling the invite, I'm leaving a dangling/invalid invite out there for the invitee.

No, an invitation has an expiry time. Let's say 10 seconds
Each invited player has that same amount of time to respond yes or no.
So the whole invitation cycle can last very little time, if you set it up correctly.

I don't understand a scenario where someone starts a game, fires 3 invitations that last 10-15 seconds and then he doesn't even wait for that, changes his mind and leaves the room to do something else.
It makes little to no sense at all.

With this I am not saying that this is not possible, but I am wondering why should you support such scenario.

It's like a restaurant trying to figure how to handle customers that sit at a table, make and order and then leave the building even before the waiter returns with the food and beverages :)
Hope you understand.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Mar 2011, 10:48

And what the heck christian.kelvin10?
You're just repeating my question with an incredibly corrupted english

It's likely to be a bot of some sort. Banishment is on its way.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Evil-Dog
Posts: 86
Joined: 08 Mar 2011, 17:59
Contact:

Postby Evil-Dog » 15 Mar 2011, 16:28

I do understand Lapo, thanks for the clarifications

I could try making the trading system into a Room Extension, so if the trading expires or is canceled, then the trading room is gone and if the invitee accepts the invite, it will tell him that the room is gone, meaning the trading was canceled.
dev6
Posts: 3
Joined: 13 Jan 2017, 16:36

Re: Canceling an invitation

Postby dev6 » 21 Jun 2017, 08:30

Hello,

For my part, I see in many cases that a client who sent an invitation to demand help, will change his mind, and don't need any help, so he want to cancel his invitation. That is in my case, so I will send a message to cancel, and all sellers who get the cancel message, will reply to the invitation automatically as impossible or refuse. And the client will not see the refuse, because he is in state of canceled invitation. that will change after reciving the automatically reply to his invitation. It is a lot of changes because there is no cancel invitation request.

Best.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 142 guests