Page 1 of 1

SFS2X.LoginRequest is not a constructor.

Posted: 20 May 2018, 11:48
by Ninjaoninja2
Hello,
This time I've used the search function for about an hour and haven't been able to come up with anything. :shock:

I think this actually might be a bug. When I'm trying to login, no matter how I send the request, it just says that SFS2X.LoginRequest is not a constructor, it was just working fine before the API update.

Here's my code:

Code: Select all

sfs.send(new SFS2X.LoginRequest(document.getElementById("Username").value, document.getElementById("Password").value, null, "SP"));

And yes, the dom elements I'm calling are in the index.html.

Re: SFS2X.LoginRequest is not a constructor.

Posted: 21 May 2018, 07:35
by Bax
Can you please send a test case?
Because we tested the new API in all our examples, and they work as expected. No "not a constructor" error ever.
Maybe something else is going on?

Re: SFS2X.LoginRequest is not a constructor.

Posted: 21 May 2018, 13:30
by Ninjaoninja2
Bax wrote:Can you please send a test case?
Because we tested the new API in all our examples, and they work as expected. No "not a constructor" error ever.
Maybe something else is going on?

I’ve been wondering that myself, I sent my code and the information to the support email.

Re: SFS2X.LoginRequest is not a constructor.

Posted: 02 Nov 2018, 11:31
by parichaygauss
facing the same issue.
my code:
sfs.send( new SFS2X.LoginRequest("", "", "SimpleChat") );
i am trying to do system login.

Re: SFS2X.LoginRequest is not a constructor.

Posted: 02 Nov 2018, 16:35
by Lapo
Hi,
can you specify which version of the API are you using?
Also can you show the entire function that surrounds that one line of code?
What browser are you testing with?

Are there any other libraries that you're using?
Thanks

Re: SFS2X.LoginRequest is not a constructor.

Posted: 12 Nov 2018, 12:47
by parichaygauss
i am not able to find the api version.hence i am pasting the client api so that you can find the version.
i am using chrome browser for testing.
i am pasting the client api:
/*
SmartFoxServer 2X HTML5/JavaScript API
(c) gotoAndPlay | All rights reserved
http://www.smartfoxserver.com
*/
SFS2X={SmartFox:function(a){this._majVersion=1;this._minVersion=7;this._subVersion=1;

Re: SFS2X.LoginRequest is not a constructor.

Posted: 12 Nov 2018, 13:47
by Bax
Sorry, we had to edit your message because pasting the entire API code wasn't helpful.
In any case you are using version 1.7.1, which 1 year and a half old.
We strongly recommend that you download the latest version (1.7.12) and test again.

Re: SFS2X.LoginRequest is not a constructor.

Posted: 13 Nov 2018, 04:37
by parichaygauss
after using the latest api now i am having problem in connection.
my code snippet for connection:
var sfs=null;
function init()
{
console.log("start");
var config = {};
config.host = "127.0.0.1"
config.port = 9933
config.useSSL = false;
config.zone = "BasicExamples";
config.debug = false;
sfs = new SFS2X.SmartFox();
sfs.connect();
console.log("connected");
}
error message that is displayed on console:- Invalid connection host/address

note- i have tried using port 8090,8080 also but all the mentioned ports are showing the same error.

Re: SFS2X.LoginRequest is not a constructor.

Posted: 13 Nov 2018, 05:27
by parichaygauss
problem solved,by using local host in config.host i am able to login into zone.
but i have another question,
where can we find the user logged in log on server side logs ??

Re: SFS2X.LoginRequest is not a constructor.

Posted: 13 Nov 2018, 08:08
by Lapo
parichaygauss wrote:problem solved,by using local host in config.host i am able to login into zone.
but i have another question,
where can we find the user logged in log on server side logs ??

In the server side logs :)
Under SFS2X/logs/smartfox.log