Minimum delaySeconds for SFSApi.kickUser() ?

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
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Minimum delaySeconds for SFSApi.kickUser() ?

Postby xLite » 07 Jun 2013, 06:44

Whats the minimum? Is there an instant option? I essentially just want to disconnect them but I want them to have a message saying why (to be used when malicious activity is detected, so I want the kick to be instant). Although I'm not sure if you set the delay to low that it might disconnect them BEFORE sending them the kick message which would be bad.

So how does the mechanics behind this method work and what are my options regarding this? Thanks!
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby Lapo » 07 Jun 2013, 08:38

I would recommend 2-3 seconds of delay so that the message can be delivered.
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby xLite » 07 Jun 2013, 10:31

Uh oh, so there's a chance it might not be sent if 1-2 second delay is set?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby Lapo » 07 Jun 2013, 10:38

If the user is particularly slow, yes.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby xLite » 07 Jun 2013, 11:07

What does that mean? Doesn't TCP guarantee the kick message is sent first?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby Lapo » 07 Jun 2013, 11:14

Yes it does, but the server will never know when this happens, it could be 10ms or 10 seconds.
If you send a message and immediately after disconnect the user the message has very little chances of making it to the other side, that's why a delay of a few seconds is the best way to go.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby xLite » 07 Jun 2013, 12:13

So the server doesn't have a function that waits until the message is sent before disconnecting?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby Lapo » 07 Jun 2013, 12:41

The server doesn't have a way to know when a message is delivered, it's just how the networks work.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
xLite
Posts: 106
Joined: 05 May 2010, 12:42

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby xLite » 09 Jun 2013, 18:47

So to be safe, it's best to use 3 you would say?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Minimum delaySeconds for SFSApi.kickUser() ?

Postby Lapo » 10 Jun 2013, 07:35

yes
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 65 guests