Cross Origin Resource Sharing. C.O.R.S

I would just like to share what I learned with the group in case anyone else is struggling with this same problem. I spent 3 weeks learning how to build a leaderboard for my game inside my actual game and I finally got it working. I have it set up so each level in my game has a top 60 in the world leaderboard. And this interface is inside Gdevelop not an HTML page with online scores. If anyone needs help setting this up I can assist. My set up is all based on using GoDaddy services in case anyones wondering.

First of all you have to have your own server so you can manage Remote Connections because while your web browser may echo out results from your database it still won’t work in Gdevelop unless you have root access to your server. It doesn’t cost much more than having a shared hosting plan and it isn’t that complicated to set it up. You can easily migrate your website to the new server and even your SSL certificates will re-set themselves up after phoning your web host provider and asking them to change your ip address to the new one your server is.

So just make sure you back up your databases and your site locally before you switch. When you get your new server it takes 24 hours to propagate. Then you are able to Patch it. I recommend using the CentOS version it’s simpler to use and with linux eventually you might have to do updates where CentOS stays the same for a long time. Then you just need an SSH program like Putty to connect to the server. You do this with your username and password then once your in you can switch to root access. Don’t try to login with root as username it doesn’t work. After you have root access theres a bunch of things you can do to your server with SSH you jsut have to google the commands. But that’s how your gonna patch it. Once patched you need to install CPanel and Web Host Manager. I believe they come as one. But be prepared to pay $15 to set up cpanel as you need a license every month.

Once you add your server ip to your remote access hosts in cpanel, and your SSL is set-up right, and domain name(make sure your domain name is set-up before you install CPANEL or the license tokens won’t work! You need a proper FQDN - Fully Qualified Domain Name in order for it to work right).

After all that you should now be able to access your Databases through Gdevelop but make sure you Grant Priveledges to the user you are using in your PHP scripts to read and write.

Just thought I would share what I learned with everyone. Thanks for anyones help getting going.

2 Likes