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.
sendxt not working
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
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 =]
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 =]
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
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
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