Is it possible to implement a log-in and register form?

Hi, I discover CoronaSDK yesterday and I found it incredibly easy to use. I’d like to use it for a game I want to make. But I was wondering, can I add a form for the users to log-in or register?

I want to show my game just to registered users, if so, could it be possible with a godaddy shared hosting or firebase or even better set a raspberry pi as a database?

Corona can certainly implement a login/registration system. However, Corona doesn’t have any built-in magic to make it happen. The reason for that is that login/registration is dependent on your server side. The server expects forms to be submitted with fields named as expected. For instance, we can’t predict if your server wants a field named “login” or “username”. We have no way of knowing if your registration form handler expects a UserID, email and/or phone number.  Many services also let you use Facebook or Google to login instead of filling out a new form.

All of this makes it impossible for us to build an API that would do this for you. You can setup your own form(s) using native.newTextField() to collect user input. Then you can use network.request() to call your web server’s registration/login forms sending data in based on their requirements (HTTP GET vs POST, any encoding requirements on credentials, any API Key’s that need passed, etc.).

If you don’t have an existing server to register/authenticate against, then you will also have to set up the server side to manage this. You could use PHP and MySQL and build your own system. You could choose to use a service like GameSparks or PlayFab (which there are Corona plugins for). You could also still host your own database using something like Coronium which is very Corona/Lua friendly and comes with a pre-built server (you still run it on your own servers), but you get nice API’s to manage this.  There are also community plugins that you can use to access Firebase databases and create your own login system.

I however would not recommend running this on a Raspberry Pi. If you have any level of success and unless you have a balanced fiber network connection, I don’t know you want your customers using your bandwidth for this. You want to use a hosting service, such as GoDaddy so someone else is in charge of making sure your servers are up and running.

Rob

Corona can certainly implement a login/registration system. However, Corona doesn’t have any built-in magic to make it happen. The reason for that is that login/registration is dependent on your server side. The server expects forms to be submitted with fields named as expected. For instance, we can’t predict if your server wants a field named “login” or “username”. We have no way of knowing if your registration form handler expects a UserID, email and/or phone number.  Many services also let you use Facebook or Google to login instead of filling out a new form.

All of this makes it impossible for us to build an API that would do this for you. You can setup your own form(s) using native.newTextField() to collect user input. Then you can use network.request() to call your web server’s registration/login forms sending data in based on their requirements (HTTP GET vs POST, any encoding requirements on credentials, any API Key’s that need passed, etc.).

If you don’t have an existing server to register/authenticate against, then you will also have to set up the server side to manage this. You could use PHP and MySQL and build your own system. You could choose to use a service like GameSparks or PlayFab (which there are Corona plugins for). You could also still host your own database using something like Coronium which is very Corona/Lua friendly and comes with a pre-built server (you still run it on your own servers), but you get nice API’s to manage this.  There are also community plugins that you can use to access Firebase databases and create your own login system.

I however would not recommend running this on a Raspberry Pi. If you have any level of success and unless you have a balanced fiber network connection, I don’t know you want your customers using your bandwidth for this. You want to use a hosting service, such as GoDaddy so someone else is in charge of making sure your servers are up and running.

Rob