sendxt not working

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

Moderators: Lapo, Bax

jeff_o
Posts: 13
Joined: 03 Oct 2008, 20:59

sendxt not working

Postby jeff_o » 03 Oct 2008, 21:07

I am trying to send an extension message, which does not seem to be working :( I have verified that my connection to the smartfox server does indeed work, and I have tested the extension from director using Lingo, doing _server.sendXtMessage("extname", "func", obj, "str") and this is successful. When I attempt to do the equivalent from within the .Net framework, like this:
smc.SendXtMessage("extension", "func", args, SmartFoxClient.XTMSG_TYPE_STR) where args is a Hashtable, and smc is of type SmartFoxClient, it appears that the message does not get sent. GetConnectionMode() is socket, and smc.IsConnected() is True. I am stuck, any help on this would be much appreciated, thanks.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 06 Oct 2008, 06:03

Hi Jeff

I have tested the sendXtMessage method and it works here in my test.

Could you put together a minimal testcase and ship it to me? I'll try to run it and see if I can spot the problem. Either send the code here - or in a PM to me. I'll treat is at confidential if that matters.

/Thomas
jeff_o
Posts: 13
Joined: 03 Oct 2008, 20:59

Postby jeff_o » 07 Oct 2008, 18:59

Okay so after futher investigation I have found that an error occurs even before I try to send the xt msg.

public Form1()
{
InitializeComponent();
sfc = new SmartFoxClient();
sfc.debug = true;
SFSEvent.onLogin += onLogin;
SFSEvent.onConnection += OnConnection;
sfc.Connect("10.116.66.251", 9339);
sfc.Login("zone", "username", "*secretpass");
}

The error occurs on sfc.Login...here is the error:
"A first chance exception of type 'System.NullReferenceException' occurred in SmartFoxClient.dll"

I did not catch this at first since the application keeps running, and the onConnection event gets triggered just fine, but the onLogin event does not. I am pm'ing you my project also but felt I should reply here also just in case anyone else has this same problem as me in the future =]
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 10 Oct 2008, 06:35

Support on this was handled in PM's, but just wanted to recap for others in the same situation.

The issue ended up being that the call to login has to be in the response from the connection.

Sending the login command before the connection is up running will not work - also remember in general to check the success of the connection before trying to login.

/Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 41 guests