1. Register for a free account if you have not already done so.
Registering for a free account with GMDB opens a range of back end services for your Gamemaker Studio projects.
2. Create a new Project
Choose a project name and click create project. This will generate a new project string that we will use later.
3. Send your registration data
Send registration using the http_post_string() function as follows.
var appRegistration = "appUsername=" + string(global.register_username) + "&appPassword=" + string(global.register_password) + "&appID=" + string(global.app_id);
sendAppRegistration = http_post_string("https://www.gmdb.co.uk/data/creater-app-account.php", appRegistration);
4. To get the result of a successful or failed registration
Retrieve registration status using async
if (ds_map_find_value(async_load, "id") == sendAppRegistration)
{
if (ds_map_find_value(async_load, "status") == 0)
{
getResult = ds_map_find_value(async_load, "result");
getResultDecoded = json_decode(getResult);
var getAllData = ds_map_find_value(getResultDecoded, "default");
userDetails = ds_list_find_value(getAllData, 0);
registerStatus = string(ds_map_find_value(userDetails, "status"));
}
}
5. Sending Login Data
Send login using the http_post_string() function as follows.
appLogin = "appUsername=" + string(global.login_username) + "&appPassword=" + string(global.login_password) + "&appID=" + string(global.app_id);
sendAppLogin =
http_post_string("https://www.gmdb.co.uk/data/login-app-account.php", appLogin);
6. Async Result
async will return a status of "Success" or "Failed".