Problem with kicking users and API v1.0.5

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Problem with kicking users and API v1.0.5

Postby LeMageFou » 19 Nov 2012, 15:59

Hi.

When I try to kick a user, either by using the admin tool or directly in the server code, the Unity Editor or my web browser freezes and I need to manually kill the client with the resource manager. But when I use the previous version of the Unity Api, everything works perfectly.
I'm using the 2.3.0 version of the SmartFox server.

Regards
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem with kicking users and API v1.0.5

Postby Lapo » 20 Nov 2012, 11:26

Thanks for reporting, what Unity Editor version do you use?
Did you check the editor or player logs for any error report?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Re: Problem with kicking users and API v1.0.5

Postby LeMageFou » 20 Nov 2012, 11:51

Hi, thanks for your reply.
I'm using the version 3.5.6f4 of Unity. If I use the admin tool and kick a user with a zero delay, I have nohing in the editor console : no error, no exception, the editor just freezes.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem with kicking users and API v1.0.5

Postby Lapo » 20 Nov 2012, 14:51

Does not happen with delay?
Lapo

--

gotoAndPlay()

...addicted to flash games
LeMageFou
Posts: 18
Joined: 19 Aug 2011, 15:51

Re: Problem with kicking users and API v1.0.5

Postby LeMageFou » 20 Nov 2012, 15:52

It's the same with a delay except that the client receives correctly the kick message. But as soon as the user is kicked (he disappears from the admin tool), Unity or the embedded webplayer freezes.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem with kicking users and API v1.0.5

Postby Lapo » 20 Nov 2012, 16:14

LeMageFou wrote:Hi, thanks for your reply.
I'm using the version 3.5.6f4 of Unity. If I use the admin tool and kick a user with a zero delay, I have nohing in the editor console : no error, no exception, the editor just freezes.

This is strange. I have tested exactly under the same Unity Editor version (3.5.6f4, MacOSX) using the Lobby Example we provide and the latest API 1.0.5. I didn't find any problems. The disconnection doesn't cause any crashes, it just works as expected.

It's the same with a delay except that the client receives correctly the kick message. But as soon as the user is kicked (he disappears from the admin tool), Unity or the embedded webplayer freezes.

Well if you don't allow a bit of delay the message won't actually be able to get to the other side, so a minimum of 1 second should be allowed.

I would probably suggest to check on another machine and see if you can reproduce the issue. Maybe it's just a local problem?
Lapo

--

gotoAndPlay()

...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: Problem with kicking users and API v1.0.5

Postby ThomasLund » 25 Nov 2012, 16:34

What browser are you using?

And what happens if you do the same in the Unity editor running the game - please check the log (also the editor.log and player.log) files for any errors or hints.

Browsers and the Unity webplayer in certain combinations are ultra sensitive to null reference exceptions. Firefox has had (uncertain if it still has) freeze problems on any kind of null reference exception in the SFS dll and/or the game code.

Report back if there are any hints of this being an issue in the SFS dll. But I cannot reproduce it here (mac osx, firefox). So that could hint at an NRE issue in your game code on kick. Maybe you still have a reference to the kicked user in some kind of list in your game or something.

Best
Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Re: Problem with kicking users and API v1.0.5

Postby vkalpias » 14 Dec 2012, 09:31

Hello there,

The same thing happens to our project. We are using the 1.0.5 version of Smartfox.dll and Smartfox server 2.3.0. We are running a Unity 4.0 webplayer in Windows 7 Ultimate 64bit and if we kick a user from the admin panel the web player freezes.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: Problem with kicking users and API v1.0.5

Postby ThomasLund » 15 Dec 2012, 17:24

Please - do give us the needed info to try to help.

After the crash, grab the player log + webplayer log + info about your environment + code snippet if this only happens in your game and not in examples etc.

Else its impossible to help you

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Re: Problem with kicking users and API v1.0.5

Postby vkalpias » 17 Dec 2012, 12:10

I will grab all the logs and send them to you as soon as possible. In the meantime I have noticed that Unity 4 freezes even when playing in the Editor when the connection with the server is lost. This is an exception from the edtior log:

[SFS - ERROR] TCPSocketLayer: General error reading data from socket: Read failure at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0

at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0

It seems like a thread is not being aborted or something like that ( i had similar issues before and it really looks like a thread issue ).

Anyway I will post more info as soon as I can
vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Re: Problem with kicking users and API v1.0.5

Postby vkalpias » 18 Dec 2012, 11:41

So I checked the logs and unfortunately I didn't find any exceptions or other helpful data... The CONNECTION_LOST event is raised and after that the game freezes. I do not have any null exceptions or anything.

The scenario where both the editor and the web player freeze is the followiing ( this is for our project - I have not checked the examples yet ).

- Log into a zone and a room.
- Kick the user from the admin tool with a delay of 5 seconds
- Freeze ( if running in Editor mode you need to stop and hit play again to see the freeze )

Here is some info about the system I've tried this ( I have tested this on other systems as well and get the same issues ):

Initialize engine version: 4.0.0f7
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 9.0c [nvd3dum.dll 9.18.13.1070]
Renderer: NVIDIA GeForce 9800 GT
Vendor: NVIDIA
VRAM: 1896 MB (via DXGI)
Caps: Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 DF24=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0

Operating System: Windows 7 Ultimate 64-bit

I noticed that you said you tested this on Unity 3.5.6 on MaxOSX. Have you tried running Unity4 on Windows 7 ?
Last edited by vkalpias on 18 Dec 2012, 12:03, edited 1 time in total.
vkalpias
Posts: 56
Joined: 03 Oct 2011, 09:24

Re: Problem with kicking users and API v1.0.5

Postby vkalpias » 18 Dec 2012, 12:01

I have confirmed that this issue exists with your examples as well. Specifically I have tried the Lobby example ( obviously I replaced the Smartfox2.dll with the 1.0.5 version ), logged into a room, kicked the user using the admin tool and then this happens ( same as in our project ):
- The editor received the connection lost message and the reason ( kick )
- We stop the editor
- Then we hit play again and Unity freezes.

I suspect that if I build a web player it will simply freeze as the behavior seems identical.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: Problem with kicking users and API v1.0.5

Postby ThomasLund » 29 Dec 2012, 12:49

Poke me on PM with your email, and I'll send you a 1.0.6 SVN build for verification. In our tests we could reproduce this with the 1.0.5 release version but we had fixed it unnoticed by working on a different feature.

Or wait to 1.0.6 is public released

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 28 guests