Initial commit
This commit is contained in:
8
objects/obj_http/Create_0.gml
Normal file
8
objects/obj_http/Create_0.gml
Normal file
@@ -0,0 +1,8 @@
|
||||
/// @description
|
||||
//gml_pragma("global","instance_create_depth(0,0,0,obj_http);");
|
||||
|
||||
if (instance_number(object_index) > 1) {
|
||||
instance_destroy(); // THERE CAN ONLY BE ONE
|
||||
}
|
||||
|
||||
requests = ds_map_create();
|
||||
50
objects/obj_http/Other_62.gml
Normal file
50
objects/obj_http/Other_62.gml
Normal file
@@ -0,0 +1,50 @@
|
||||
/// @description
|
||||
var req = async_load[? "id"]
|
||||
if (requests[? req] == undefined) return;
|
||||
|
||||
var status = async_load[? "status"];
|
||||
var options = requests[? req].options;
|
||||
if (status < 0) {
|
||||
// Error
|
||||
|
||||
var error = requests[? req].error;
|
||||
if (error != undefined) {
|
||||
var result = async_load[? "result"];
|
||||
if (options.get_file) {
|
||||
result = options.buffer;
|
||||
}
|
||||
if (async_load[? "response_headers"]) {
|
||||
options.response_headers = async_load[? "response_headers"];
|
||||
}
|
||||
error(async_load[? "http_status"],result,requests[? req].options);
|
||||
if (requests[? req].options.keep_buffer == false) {
|
||||
buffer_delete(requests[? req].options.buffer);
|
||||
}
|
||||
requests[? req] = undefined;
|
||||
}
|
||||
}
|
||||
if (status == 0) {
|
||||
// Complete
|
||||
var callback = requests[? req].callback;
|
||||
if (callback != undefined) {
|
||||
var result = async_load[? "result"];
|
||||
if (options.get_file) {
|
||||
result = options.buffer;
|
||||
}
|
||||
if (async_load[? "response_headers"]) {
|
||||
options.response_headers = async_load[? "response_headers"];
|
||||
}
|
||||
callback(async_load[? "http_status"],result,requests[? req].options);
|
||||
if (requests[? req].options.keep_buffer == false && requests[? req].options.buffer) {
|
||||
buffer_delete(requests[? req].options.buffer);
|
||||
}
|
||||
requests[? req] = undefined;
|
||||
}
|
||||
}
|
||||
if (status == 1) {
|
||||
// Progress
|
||||
var progress = requests[? req].progress;
|
||||
if (progress == undefined) {
|
||||
progress(async_load[? "contentLength"],async_load[? "sizeDownloaded"],requests[? req].options);
|
||||
}
|
||||
}
|
||||
34
objects/obj_http/obj_http.yy
Normal file
34
objects/obj_http/obj_http.yy
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"spriteId": null,
|
||||
"solid": false,
|
||||
"visible": true,
|
||||
"spriteMaskId": null,
|
||||
"persistent": true,
|
||||
"parentObjectId": null,
|
||||
"physicsObject": false,
|
||||
"physicsSensor": false,
|
||||
"physicsShape": 1,
|
||||
"physicsGroup": 1,
|
||||
"physicsDensity": 0.5,
|
||||
"physicsRestitution": 0.1,
|
||||
"physicsLinearDamping": 0.1,
|
||||
"physicsAngularDamping": 0.1,
|
||||
"physicsFriction": 0.2,
|
||||
"physicsStartAwake": true,
|
||||
"physicsKinematic": false,
|
||||
"physicsShapePoints": [],
|
||||
"eventList": [
|
||||
{"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
|
||||
{"isDnD":false,"eventNum":62,"eventType":7,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
|
||||
],
|
||||
"properties": [],
|
||||
"overriddenProperties": [],
|
||||
"parent": {
|
||||
"name": "Objects",
|
||||
"path": "folders/Objects.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "obj_http",
|
||||
"tags": [],
|
||||
"resourceType": "GMObject",
|
||||
}
|
||||
Reference in New Issue
Block a user