Networking -- Database / Login System

You’ll probably want to give some more detail here on your setup, of your server and exactly how you are trying to communicate with it. It’s a bit broad at the moment. What is the result your expecting, and what have you got set up so far to achieve that expectation.

Hello!
So I have been tinkering around with the Networking side of things recently and I could really use some insight from some people who have an actual Online Database system setup for a Login System and Item Data Storage System. (Store Items, Armor, NPC info, etc.)
I know it’s all based on the Database structure I want to use, blah blah blah… But here’s what I’ve learned so far and what I have.

I Use the VaRest Plugin which construct Request’s to retrieve information from a URL. I have the URL setup properly (I THINK) and my Database is hosted through Amazon Web Services. (Someone told me to try them out)
I know that I need to use my “Endpoint” URL as the “Host” in my config.php file and set the database name to be the name of my database and so on.

The Issue: Okay, so after running a series of debugs and reading log files during testing, I’ve found that my URL is working(I think) because when I use an incorrect username and password to sign into my database the log files give me an error saying it couldn’t connect to my database. However, if I use the correct username and password it doesn’t do anything. Doesn’t give me an error, doesn’t tell me if its connected and I can’t retrieve any information from my database. The “ApplyURL” doesn’t even complete. So I’m not sure what happening? The only thing I can think of is maybe my database is denying access to my ApplyURL and it’s just held up? Idk enough about this to be able to debug it any further, so I turn to the geniuses!

First of all, what exacly do you use on PHP side considering you mention config.php? PHP normally don’t come with anything.

About missing errors. PHP have configurable error output and lot of hosting services disable php error output by default for security reasons as those exposes file locations on the server. But PHP allows to change that setting on the code in PHP code with error_reporting function.

Before you gonna do anything on UE4, test the code on the browser, make sure server outputs pure valid . Make a test from page if oyu need to.

Also remeber that oyu don’t need to use hosting services for testing and devlopment, you can install HTTP server and PHP (or anything else) on your computer too.

Sorry guys, very vague I know! I followed the VaRest Tutorial for the Plugin which was dated for earlier versions of UE4. So that’s probably apart of my issue.

Anyways, I have a website that I’ve been using through GoDaddy.com and I just figured Id throw my PHP API’s in a folder on that site, for my game to communicate to. Then I host a Database through AWS RDS (Amazon Web Services) Specific to PHP and MySQL.

Basically What I have is a Login Widget in my game that Constructs a request using the “VERB” GET, and Content Type: x-www-form-urlencoded(URL) which then goes into an “ApplyURL” node. The Url is specified with an Append String which declares my Server URL(GoDaddy Website) and appends my g_userinfo.php(which includes my config.php, that declares my database hostname along with the username and password for the db))

Essentially what is supposed to happen is I am supposed to enter my Username and Password (For my login account to my game, not DB) and then click my Login button. My login button then constructs a request and applies the URL (Appended String) and on completion its supposed to retrieve information based on the g_userinfo.php (Get’s my username and password based on the info I entered and then it retrieves any other additional information declared via g_userinfo.php)

The problem is, It doesn’t do anything after it ApplyURL.

If I type in my url to my website followed by the directory of my php files and type g_userinfo.php it echos the proper response “wrong api key!” which is a simple error check that ensures the proper authentication is being used. So I know the website side of things is working. However, I can’t seem to construct a request properly, to retrieve information from my AWS website.

Honestly, I don’t even care If I use VaRest plugin or a different method to construct requests. I just don’t know C++ all that well to be able to code my own HTTP Requests. All I want to do is be able to GET and POST information to a database. I would like to store as much information to my game in the database as possible, but I mostly want to store Login information for players to be able to sign into my game and retrieve their account details (characters, items, etc)

but you said you dont have any output, that means something is wrong.

Right… which is why I am posting on here lol. Asking for help because I don’t know whats wrong…?

Can you post some of your backend PHP? This might not even be an Unreal question really. But, if you post what you’re doing on the backend and how you are making requests, that would help answer.