How to make (login in a flash game) work using smart fox server pro?‏

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

mark1907
Posts: 4
Joined: 15 Jun 2019, 04:20

How to make (login in a flash game) work using smart fox server pro?‏

Postby mark1907 » 15 Jun 2019, 04:26

Hello everyone ,
I have a flash game and I want to make it work on a private server . I have to use the "smart fox server pro" to make the login work . I connected the game with the smart fox server without any problems . but the game allows to login with any username and password ! . I mean when I try to login with any username and any password, the game allows me to login, then a message appears says:"The account data was not loaded" although I connected "smart fox server" with the database of game . I tried to solve the problem by reading docs in the site but I did not understand because I'm not good with servers at all . I mean I don't have any idea about how they work .

Can anyone help me to write the code (step by step) that makes smart fox server only allow the person who has an account in the database to login the game , and if the username or password is incorrect make him not allowed to login ?
because as I said I have no idea about servers .
thank you very much
User avatar
Lapo
Site Admin
Posts: 21952
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby Lapo » 15 Jun 2019, 07:29

Hi,
I would recommend using SmartFoxServer 2X instead of SFSPRO, as the latter is much older and we no longer support it, besides security patches.

SFS2X offers a lot more features and comes for free with a 100 users license (as opposed to SFSPRO, which offers 20 CCU)
https://www.smartfoxserver.com/download#p=installer

As regards your question we provide plenty of tutorials for connecting to a database and implementing your own login check here:
http://docs2x.smartfoxserver.com/Gettin ... stallation

In particular you should look at this tutorial:
http://docs2x.smartfoxserver.com/Extens ... -assistant

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
mark1907
Posts: 4
Joined: 15 Jun 2019, 04:20

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby mark1907 » 15 Jun 2019, 13:47

At first thank you very much mr lapo for your help
this game has been closed 2 years ago and i got the game Files befor it closed, and I wanna open it now on localhost.
the game is programmed to connect to the smart fox server pro so I cant replace it, because when I installed "smart fox server pro" and ran the server, (login) became available, But befor smartfox it was not.
I almost finished everything, But the last problem is (login).
I just want login to be allowed to anyone who has an account in the database. I mean I want the server to make sure when someone tries to login if the username and password are correct.
If the username and password are correct the player will be allowed to login, and if not he will be prevented to login with an error message says : "username or password is incorrect".
So how can I write the code? And Where should i write the code? In config.xml or in a new file?
Because as I said I don’t understand servers and I tried to write the code myself by reading the docs but I didn't understand
So please tell me what should i do exactly without reading the docs because i didn't understand.
Thank you.
User avatar
Lapo
Site Admin
Posts: 21952
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby Lapo » 17 Jun 2019, 07:48

You can learn how to create a custom login procedure from the documentation examples.
Check section 8 (SFS PRO Tutorials) here:
https://www.smartfoxserver.com/docs/1x/

There are lots of database examples. In particular this one:
https://www.smartfoxserver.com/docs/1x/ ... _loginExt/

Which demonstrates a custom login procedure.
Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
mark1907
Posts: 4
Joined: 15 Jun 2019, 04:20

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby mark1907 » 17 Jun 2019, 09:52

I have read these docs befor but I couldn't solve the problem .
Because I want "smart fox server pro" to make sure that the information I use to log in to the game are correct or not depending on the database.
The link that you sent I have read it befor and it doesn't contain anything to make sure the username and the password are correct or not from the database(mysql)
Could you please contact me on Facebook for example to show you the game and the problem so that you can help me?
User avatar
Lapo
Site Admin
Posts: 21952
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby Lapo » 17 Jun 2019, 10:49

The question is not clear.
In order for the custom login process to check a User's credentials, these credentials (e.g. login name and password) must be stored somewhere. Be it on local disk or database, typically.

In your opening post you said you already connected SFS PRO with the database, so I assumed you were going to load the user data from there.

Where exactly have you stored the player's credentials?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
mark1907
Posts: 4
Joined: 15 Jun 2019, 04:20

Re: How to make (login in a flash game) work using smart fox server pro?‏

Postby mark1907 » 17 Jun 2019, 13:11

Yes I connected SFS PRO with the database of the game.
But you didn't get what I mean
Now if you open the game for the frist time as a player you will have to regist
So you will regist in the game by choosing username, password, mask, mask color and birth date.
These information will be stored in the database of the game in users' table okay?
After that you will log in to the game By using the username and the password you chose when u registed.
Here is the problem, although I connected SFS PRO with the database and I'm sure of that by DBtest but SFS PRO doesn't use the database when someone tries to log in.
So I can't log in to my game because SFS PRO doesn't receive my account information from the database users' table specifically.
When I enter my username and password then click on "login" button, the color of button turns from brown to white and stay always like that.
Is it clear now?

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 31 guests