The-any-Key
Member
Web-API
This is a WebAPI written in PHP that allow you to create an online user database for your game (backend). Setup buttons will create the tables and fields in your mysql database on your web-server. The players can register, validate their email and login with this API. You can also save data to the database and load it cross platforms. Ex: the user save data in your game on an android device and then load the data on the PC version of your game. Users can also upload files. No extra DLL files. You control the API with gml code. Mostly http_post_string(). Here is a complete list of features:
Buy here (Available for GMS1.4 and 2):
YoYo Marketplace
Public features:
Is there a limit on how mush I can save?
This is a WebAPI written in PHP that allow you to create an online user database for your game (backend). Setup buttons will create the tables and fields in your mysql database on your web-server. The players can register, validate their email and login with this API. You can also save data to the database and load it cross platforms. Ex: the user save data in your game on an android device and then load the data on the PC version of your game. Users can also upload files. No extra DLL files. You control the API with gml code. Mostly http_post_string(). Here is a complete list of features:
Buy here (Available for GMS1.4 and 2):
YoYo Marketplace
Public features:
- List online high-score (in game and web)
- High-score count entities
- Load user share data (user can share data with each other)
- Get active users (check how may is "online" and playing your game right now)
- Get total users count
- Download files (http_get_file)
- Get external IP
- Register with email validation
- Login
- Forgot password reset email
- Delete user account
- Save user data
- Load user data
- Save high-score
- Load high-score (get points and rank)
- Change password
- Change username
- Save share data (for the public)
- Upload files
- Upload files via web browser
- Check if file exists on server (ex uploaded files exists)
- Server curl upload (web-server to web-server upload)
- Ordinary web-server space with a PHP version 5.6 or above.
- PHP mysql 5.5 database or above on your web-server.
Is there a limit on how mush I can save?
In the demo you can save a string in slot (column) 1 and 2.
The limit is 4GB for each slot so you can save 8GB data. But if people go over this limit they can also use the upload feature that is limitless.
The limit is 4GB for each slot so you can save 8GB data. But if people go over this limit they can also use the upload feature that is limitless.
Here is an example on how to save 10 different user data. But you can add as many keys to the map as you want.
Code:
user_data=ds_map_create();
// Player stats
user_data[? "hp"] = 100;
user_data[? "agility"] = 10;
user_data[? "name"] = "Knight";
user_data[? "save_x_pos"] = 4578;
user_data[? "save_y_pos"] = 2578;
// Player inventory
user_data[? "inventory_slot_1"] = "Sword;attack=10;effect=fire";
user_data[? "inventory_slot_2"] = "Shield;defence=2;effect=ice";
user_data[? "inventory_slot_3"] = "";
user_data[? "inventory_slot_4"] = "";
user_data[? "inventory_slot_5"] = "Boots;effect=speed+1";
var json_string=json_encode(user_data);
// scr_webapi_save(slot nr, save string, script to run when saved data);
scr_webapi_save(1,json_string,scr_webapi_Save_Done);
This saves the user data to the db on your web-server. You can load it by:
Code:
scr_webapi_load(1,scr_webapi_Load_Done);
The above call send a request to the server and when you get a response scr_webapi_Load_Done is triggered. (Make a please wait screen while loading the data)
in scr_webapi_Load_Done:
UPDATE:
To update to 1.0.5 just replace the PHP folder on your host. You can skip the Config.php and keep the one with the settings you already have.
Code:
/// scr_webapi_Load_Done(success, data string, error, result_map);
var success=argument0;
var data_string=argument1;
var error=argument2;
var result_map=argument3;
if success
{
// Got data from DB (Turn it to a ds map again, you should replace the old user_data with this map)
user_data=json_decode(data_string);
remove the please wait screen and go on with your game
}
else
{
// Failed to get data from DB
show the error to the user, he may be offline but just show the error variable to get what is wrong.
}
To update to 1.0.5 just replace the PHP folder on your host. You can skip the Config.php and keep the one with the settings you already have.
Last edited: