Last active
September 19, 2016 15:40
-
-
Save darmie/704aa276b5e9a5c3b922c846fecc4085 to your computer and use it in GitHub Desktop.
Create a new Game Maker object for sending usage status to iConcept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map = ds_map_create(); | |
ds_map_add(map, "Content-Type", "application/json"); | |
var date = string(current_day); | |
var data = '{"IMEI": 0, "Package":"com.saltgaming.hero_of_the_north", "date":'+ date+ '}' | |
global.check_usage = http_request("http://46.38.168.148:3452/emts/game/requsage","POST", map, json_encode(data)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ds_map_find_value(async_load, "id") == global.check_usage | |
{ | |
var status = ds_map_find_value(async_load, "status"); | |
if status == 0 | |
{ | |
if(ds_map_exists(async_load, "result")){ | |
self.jmap = json_decode(async_load[? "result"]); | |
} | |
if(ds_map_exists(self.jmap, "responsestring")){ | |
self.response = self.jmap[? "responsestring"]; | |
show_debug_message("REQUEST USAGE:: " + string(self.response)); | |
} | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment