Troubles accessing the Admin extension with .net

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

cryolithic
Posts: 3
Joined: 13 May 2010, 20:39

Troubles accessing the Admin extension with .net

Postby cryolithic » 13 May 2010, 20:57

Hello, I'm working on a system to allow a limited version of the smartfox admin tool, which is done through a .Net daemon via a php website.

I have the daemon able to login to the admin zone and, and I can request the roomlist successfully, however on any subsequent messages sent, the connection seems to be dropped and the onConnectionLost event fires.

Any ideas why this would cause the connection to be lost?


Code looks like:

Code: Select all

        private void RequestServerStatus(Socket client)
        {
            SmartFoxClient smartFox = new SmartFoxClient();
            RemoteCallHandler handler = new RemoteCallHandler(client, smartFox);
 
            Connect(smartFox, handler);
            Login(smartFox, handler, "$dmn", "$_$sfs_admin", "sfs_pass");
            GetRoomList(smartFox, handler);
 
            SFSEvent.onJoinRoom += handler.OnJoinRoom;
            SFSEvent.onJoinRoomError += handler.OnJoinRoomError;
            smartFox.AutoJoin();
 
            SFSEvent.onExtensionResponse += handler.OnExtensionResponse;
            smartFox.SendXtMessage("$dmn", "zoneInfo", null);
            handler.loginEvent.WaitOne();
 
            client.SendEncodedString(Encoding.ASCII, "ret::status");
        }
shivafang
Posts: 15
Joined: 24 Mar 2010, 12:23

Postby shivafang » 14 May 2010, 11:48

Not an expert on this, but two things come to mind immediately:

1) You're trying to join a room before you receive the room list (you are joining in the same function you are requesting the list which means you are joining before the request gets to the server and the response comes back). I don't know if AutoJoin gets around this, but try putting it in onRoomListRecieved.

2) Do you have a room in your SmartFox config XML that has autoJoin=True? If not, the server has no idea which room to autoJoin you to.

http://www.smartfoxserver.com/docs/docP ... l#autoJoin

Hope that helps in any way.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 35 guests