@gamely/gly-engine-lite 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.lua +148 -96
- package/package.json +4 -3
package/dist/main.lua
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
|
|
2
|
-
local
|
|
3
|
-
local
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
local
|
|
9
|
-
local
|
|
10
|
-
local
|
|
11
|
-
local
|
|
12
|
-
local
|
|
13
|
-
local
|
|
14
|
-
local
|
|
15
|
-
local
|
|
16
|
-
local
|
|
17
|
-
local
|
|
18
|
-
local
|
|
19
|
-
local
|
|
20
|
-
local
|
|
21
|
-
local
|
|
22
|
-
local
|
|
23
|
-
local
|
|
24
|
-
local
|
|
25
|
-
local function
|
|
26
|
-
local version =
|
|
27
|
-
local zeebo_module =
|
|
28
|
-
local engine_encoder =
|
|
29
|
-
local engine_game =
|
|
30
|
-
local engine_hash =
|
|
31
|
-
local engine_http =
|
|
32
|
-
local engine_i18n =
|
|
33
|
-
local engine_key =
|
|
34
|
-
local engine_log =
|
|
35
|
-
local engine_math =
|
|
36
|
-
local engine_array =
|
|
37
|
-
local engine_media =
|
|
38
|
-
local engine_draw_fps =
|
|
39
|
-
local engine_draw_text =
|
|
40
|
-
local engine_draw_poly =
|
|
41
|
-
local engine_raw_memory =
|
|
42
|
-
local callback_http =
|
|
43
|
-
local application_default =
|
|
44
|
-
local color =
|
|
45
|
-
local std =
|
|
2
|
+
local src_version_560c51e6c020 = nil
|
|
3
|
+
local src_lib_common_module_560c51e81030 = nil
|
|
4
|
+
local src_lib_engine_api_encoder_560c51e671b0 = nil
|
|
5
|
+
local src_lib_engine_api_app_560c51e67890 = nil
|
|
6
|
+
local src_lib_engine_api_hash_560c51e82110 = nil
|
|
7
|
+
local src_lib_engine_api_http_560c51e8b270 = nil
|
|
8
|
+
local src_lib_engine_api_i18n_560c51e5e8f0 = nil
|
|
9
|
+
local src_lib_engine_api_key_560c51e7f130 = nil
|
|
10
|
+
local src_lib_engine_api_log_560c51e8c2a0 = nil
|
|
11
|
+
local src_lib_engine_api_math_560c51e81c30 = nil
|
|
12
|
+
local src_lib_engine_api_array_560c51e81500 = nil
|
|
13
|
+
local src_lib_engine_api_media_560c51e62230 = nil
|
|
14
|
+
local src_lib_engine_draw_fps_560c51e694a0 = nil
|
|
15
|
+
local src_lib_engine_draw_text_560c51e69bd0 = nil
|
|
16
|
+
local src_lib_engine_draw_poly_560c51e7e7e0 = nil
|
|
17
|
+
local src_lib_engine_raw_memory_560c51e82820 = nil
|
|
18
|
+
local src_lib_protocol_http_callback_560c51e7c810 = nil
|
|
19
|
+
local src_lib_object_root_560c51e6d3f0 = nil
|
|
20
|
+
local src_lib_object_color_560c51e80600 = nil
|
|
21
|
+
local src_lib_object_std_560c51e7d900 = nil
|
|
22
|
+
local src_lib_util_pipeline_560c51e36e60 = nil
|
|
23
|
+
local src_lib_util_decorator_560c51e7fd40 = nil
|
|
24
|
+
local src_lib_util_http_560c51e3c4b0 = nil
|
|
25
|
+
local function main_560c51e83670()
|
|
26
|
+
local version = src_version_560c51e6c020()
|
|
27
|
+
local zeebo_module = src_lib_common_module_560c51e81030()
|
|
28
|
+
local engine_encoder = src_lib_engine_api_encoder_560c51e671b0()
|
|
29
|
+
local engine_game = src_lib_engine_api_app_560c51e67890()
|
|
30
|
+
local engine_hash = src_lib_engine_api_hash_560c51e82110()
|
|
31
|
+
local engine_http = src_lib_engine_api_http_560c51e8b270()
|
|
32
|
+
local engine_i18n = src_lib_engine_api_i18n_560c51e5e8f0()
|
|
33
|
+
local engine_key = src_lib_engine_api_key_560c51e7f130()
|
|
34
|
+
local engine_log = src_lib_engine_api_log_560c51e8c2a0()
|
|
35
|
+
local engine_math = src_lib_engine_api_math_560c51e81c30()
|
|
36
|
+
local engine_array = src_lib_engine_api_array_560c51e81500()
|
|
37
|
+
local engine_media = src_lib_engine_api_media_560c51e62230()
|
|
38
|
+
local engine_draw_fps = src_lib_engine_draw_fps_560c51e694a0()
|
|
39
|
+
local engine_draw_text = src_lib_engine_draw_text_560c51e69bd0()
|
|
40
|
+
local engine_draw_poly = src_lib_engine_draw_poly_560c51e7e7e0()
|
|
41
|
+
local engine_raw_memory = src_lib_engine_raw_memory_560c51e82820()
|
|
42
|
+
local callback_http = src_lib_protocol_http_callback_560c51e7c810()
|
|
43
|
+
local application_default = src_lib_object_root_560c51e6d3f0()
|
|
44
|
+
local color = src_lib_object_color_560c51e80600()
|
|
45
|
+
local std = src_lib_object_std_560c51e7d900()
|
|
46
46
|
local application = application_default
|
|
47
47
|
local engine = {
|
|
48
48
|
keyboard = function(a, b, c, d) end,
|
|
@@ -61,9 +61,11 @@ local cfg_media = {
|
|
|
61
61
|
bootstrap=native_media_bootstrap,
|
|
62
62
|
position=native_media_position,
|
|
63
63
|
resize=native_media_resize,
|
|
64
|
+
resume=native_media_resume,
|
|
65
|
+
source=native_media_source,
|
|
64
66
|
pause=native_media_pause,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
play=native_media_play,
|
|
68
|
+
stop=native_media_stop
|
|
67
69
|
}
|
|
68
70
|
local cfg_poly = {
|
|
69
71
|
repeats = {
|
|
@@ -181,7 +183,6 @@ zeebo_module.require(std, application, engine)
|
|
|
181
183
|
:package('i18n', engine_i18n, cfg_system)
|
|
182
184
|
:package('hash', engine_hash, cfg_system)
|
|
183
185
|
:package('media.video', engine_media, cfg_media)
|
|
184
|
-
:package('media.audio', engine_media, cfg_media)
|
|
185
186
|
:package('mock.video', engine_media)
|
|
186
187
|
:package('mock.audio', engine_media)
|
|
187
188
|
:run()
|
|
@@ -201,13 +202,13 @@ version=version
|
|
|
201
202
|
}
|
|
202
203
|
return P
|
|
203
204
|
end
|
|
204
|
-
|
|
205
|
-
return '0.0.
|
|
205
|
+
src_version_560c51e6c020 = function()
|
|
206
|
+
return '0.0.21'
|
|
206
207
|
end
|
|
207
208
|
--
|
|
208
|
-
|
|
209
|
-
local zeebo_pipeline =
|
|
210
|
-
local application_default =
|
|
209
|
+
src_lib_common_module_560c51e81030 = function()
|
|
210
|
+
local zeebo_pipeline = src_lib_util_pipeline_560c51e36e60()
|
|
211
|
+
local application_default = src_lib_object_root_560c51e6d3f0()
|
|
211
212
|
local function default(application, defaults)
|
|
212
213
|
if not application then return nil end
|
|
213
214
|
local index = 1
|
|
@@ -225,6 +226,7 @@ end
|
|
|
225
226
|
index = index + 1
|
|
226
227
|
end
|
|
227
228
|
normalized_aplication.config.id = tostring(application)
|
|
229
|
+
normalized_aplication.fonts = application.fonts or {}
|
|
228
230
|
normalized_aplication.assets = application.assets or {}
|
|
229
231
|
if application.callbacks then
|
|
230
232
|
for event, handler in pairs(application.callbacks) do
|
|
@@ -247,6 +249,7 @@ end
|
|
|
247
249
|
local normalized_aplication = {
|
|
248
250
|
data = {},
|
|
249
251
|
meta = {},
|
|
252
|
+
fonts = {},
|
|
250
253
|
assets = {},
|
|
251
254
|
config = {},
|
|
252
255
|
callbacks = {}
|
|
@@ -254,6 +257,8 @@ callbacks = {}
|
|
|
254
257
|
for key, value in pairs(application) do
|
|
255
258
|
if key == 'assets' then
|
|
256
259
|
normalized_aplication.assets = value
|
|
260
|
+
elseif key == 'fonts' then
|
|
261
|
+
normalized_aplication.fonts = value
|
|
257
262
|
elseif application_default.meta[key] then
|
|
258
263
|
normalized_aplication.meta[key] = value
|
|
259
264
|
elseif application_default.config[key] then
|
|
@@ -405,7 +410,7 @@ require = require
|
|
|
405
410
|
return P
|
|
406
411
|
end
|
|
407
412
|
--
|
|
408
|
-
|
|
413
|
+
src_lib_engine_api_encoder_560c51e671b0 = function()
|
|
409
414
|
local function install(std, engine, library, name)
|
|
410
415
|
std = std or {}
|
|
411
416
|
std[name] = {
|
|
@@ -420,8 +425,8 @@ install=install
|
|
|
420
425
|
return P
|
|
421
426
|
end
|
|
422
427
|
--
|
|
423
|
-
|
|
424
|
-
local util_decorator =
|
|
428
|
+
src_lib_engine_api_app_560c51e67890 = function()
|
|
429
|
+
local util_decorator = src_lib_util_decorator_560c51e7fd40()
|
|
425
430
|
local function reset(std, engine)
|
|
426
431
|
if std.node then
|
|
427
432
|
std.bus.emit('exit')
|
|
@@ -461,7 +466,7 @@ install=install
|
|
|
461
466
|
return P
|
|
462
467
|
end
|
|
463
468
|
--
|
|
464
|
-
|
|
469
|
+
src_lib_engine_api_hash_560c51e82110 = function()
|
|
465
470
|
local function djb2(digest)
|
|
466
471
|
local index = 1
|
|
467
472
|
local hash = 5381
|
|
@@ -487,26 +492,38 @@ install = install
|
|
|
487
492
|
return P
|
|
488
493
|
end
|
|
489
494
|
--
|
|
490
|
-
|
|
491
|
-
local zeebo_pipeline =
|
|
492
|
-
local function
|
|
493
|
-
self.
|
|
495
|
+
src_lib_engine_api_http_560c51e8b270 = function()
|
|
496
|
+
local zeebo_pipeline = src_lib_util_pipeline_560c51e36e60()
|
|
497
|
+
local function json(self)
|
|
498
|
+
self.options['json'] = true
|
|
494
499
|
return self
|
|
495
500
|
end
|
|
496
|
-
local function
|
|
497
|
-
self.
|
|
501
|
+
local function noforce(self)
|
|
502
|
+
self.options['noforce'] = true
|
|
503
|
+
return self
|
|
504
|
+
end
|
|
505
|
+
local function fast(self)
|
|
506
|
+
self.speed = '_fast'
|
|
498
507
|
return self
|
|
499
508
|
end
|
|
500
509
|
local function param(self, name, value)
|
|
501
510
|
local index = #self.param_list + 1
|
|
502
|
-
self.param_list[index] = name
|
|
503
|
-
self.param_dict[name] = value
|
|
511
|
+
self.param_list[index] = tostring(name)
|
|
512
|
+
self.param_dict[name] = tostring(value)
|
|
504
513
|
return self
|
|
505
514
|
end
|
|
506
515
|
local function header(self, name, value)
|
|
507
516
|
local index = #self.header_list + 1
|
|
508
|
-
self.header_list[index] = name
|
|
509
|
-
self.header_dict[name] = value
|
|
517
|
+
self.header_list[index] = tostring(name)
|
|
518
|
+
self.header_dict[name] = tostring(value)
|
|
519
|
+
return self
|
|
520
|
+
end
|
|
521
|
+
local function body(self, content, json_encode)
|
|
522
|
+
if type(content) == 'table' then
|
|
523
|
+
header(self, 'Content-Type', 'application/json')
|
|
524
|
+
content = json_encode(content)
|
|
525
|
+
end
|
|
526
|
+
self.body_content=content
|
|
510
527
|
return self
|
|
511
528
|
end
|
|
512
529
|
local function success(self, handler_func)
|
|
@@ -533,14 +550,15 @@ return function (url)
|
|
|
533
550
|
if protocol.has_callback then
|
|
534
551
|
engine.http_count = engine.http_count + 1
|
|
535
552
|
end
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
end
|
|
553
|
+
local json_encode = std.json and std.json.encode
|
|
554
|
+
local json_decode = std.json and std.json.decode
|
|
555
|
+
local http_body = function(self, content) return body(self, content, json_encode) end
|
|
539
556
|
local game = engine.current.data
|
|
540
557
|
local self = {
|
|
541
558
|
id = engine.http_count,
|
|
542
559
|
url = url,
|
|
543
560
|
speed = '',
|
|
561
|
+
options = {},
|
|
544
562
|
method = method,
|
|
545
563
|
body_content = '',
|
|
546
564
|
header_list = {},
|
|
@@ -551,7 +569,9 @@ success_handler = function (std, game) end,
|
|
|
551
569
|
failed_handler = function (std, game) end,
|
|
552
570
|
error_handler = function (std, game) end,
|
|
553
571
|
fast = fast,
|
|
554
|
-
|
|
572
|
+
json = json,
|
|
573
|
+
noforce = noforce,
|
|
574
|
+
body = http_body,
|
|
555
575
|
param = param,
|
|
556
576
|
header = header,
|
|
557
577
|
success = success,
|
|
@@ -570,10 +590,22 @@ std.http[key] = value
|
|
|
570
590
|
end
|
|
571
591
|
self.pipeline = {
|
|
572
592
|
function()
|
|
593
|
+
if not protocol.force or self.options['noforce'] then return end
|
|
594
|
+
self.url = url:gsub("^[^:]+://", protocol.force.."://")
|
|
595
|
+
end,
|
|
596
|
+
function()
|
|
573
597
|
if protocol.has_callback then engine.http_requests[self.id] = self end
|
|
574
598
|
protocol.handler(self, self.id)
|
|
575
599
|
end,
|
|
576
600
|
function()
|
|
601
|
+
if self.options['json'] and json_decode and std.http.body then
|
|
602
|
+
pcall(function()
|
|
603
|
+
local new_body = json_decode(std.http.body)
|
|
604
|
+
std.http.body = new_body
|
|
605
|
+
end)
|
|
606
|
+
end
|
|
607
|
+
end,
|
|
608
|
+
function()
|
|
577
609
|
callback_handler(std, game)
|
|
578
610
|
if std.http.ok then
|
|
579
611
|
self.success_handler(std, game)
|
|
@@ -591,6 +623,7 @@ std.http.ok = nil
|
|
|
591
623
|
std.http.body = nil
|
|
592
624
|
std.http.error = nil
|
|
593
625
|
std.http.status = nil
|
|
626
|
+
std.http.body_is_table = nil
|
|
594
627
|
end,
|
|
595
628
|
function()
|
|
596
629
|
if protocol.has_callback then engine.http_requests[self.id] = nil end
|
|
@@ -623,7 +656,7 @@ install=install
|
|
|
623
656
|
return P
|
|
624
657
|
end
|
|
625
658
|
--
|
|
626
|
-
|
|
659
|
+
src_lib_engine_api_i18n_560c51e5e8f0 = function()
|
|
627
660
|
local language = 'en-US'
|
|
628
661
|
local language_default = 'en-US'
|
|
629
662
|
local language_list = {}
|
|
@@ -715,7 +748,7 @@ install=install
|
|
|
715
748
|
return P
|
|
716
749
|
end
|
|
717
750
|
--
|
|
718
|
-
|
|
751
|
+
src_lib_engine_api_key_560c51e7f130 = function()
|
|
719
752
|
local function real_key(std, engine, rkey, rvalue)
|
|
720
753
|
local value = rvalue == 1 or rvalue == true
|
|
721
754
|
local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
|
|
@@ -755,8 +788,8 @@ install = install
|
|
|
755
788
|
return P
|
|
756
789
|
end
|
|
757
790
|
--
|
|
758
|
-
|
|
759
|
-
local util_decorator =
|
|
791
|
+
src_lib_engine_api_log_560c51e8c2a0 = function()
|
|
792
|
+
local util_decorator = src_lib_util_decorator_560c51e7fd40()
|
|
760
793
|
local logging_types = {
|
|
761
794
|
'none', 'fatal', 'error', 'warn', 'debug', 'info'
|
|
762
795
|
}
|
|
@@ -802,7 +835,7 @@ install = install
|
|
|
802
835
|
return P
|
|
803
836
|
end
|
|
804
837
|
--
|
|
805
|
-
|
|
838
|
+
src_lib_engine_api_math_560c51e81c30 = function()
|
|
806
839
|
local function abs(value)
|
|
807
840
|
if value < 0 then
|
|
808
841
|
return -value
|
|
@@ -977,8 +1010,8 @@ install = install_clib_random
|
|
|
977
1010
|
return P;
|
|
978
1011
|
end
|
|
979
1012
|
--
|
|
980
|
-
|
|
981
|
-
local util_decorator =
|
|
1013
|
+
src_lib_engine_api_array_560c51e81500 = function()
|
|
1014
|
+
local util_decorator = src_lib_util_decorator_560c51e7fd40()
|
|
982
1015
|
local function array_map(array, func)
|
|
983
1016
|
local res = {}
|
|
984
1017
|
local index = 1
|
|
@@ -1139,7 +1172,7 @@ install = install
|
|
|
1139
1172
|
return P
|
|
1140
1173
|
end
|
|
1141
1174
|
--
|
|
1142
|
-
|
|
1175
|
+
src_lib_engine_api_media_560c51e62230 = function()
|
|
1143
1176
|
local function media_create(node, channels, handler)
|
|
1144
1177
|
local decorator = function(func)
|
|
1145
1178
|
func = func or function() end
|
|
@@ -1156,6 +1189,8 @@ resume = decorator(handler.resume),
|
|
|
1156
1189
|
stop = decorator(handler.stop),
|
|
1157
1190
|
position = decorator(handler.position),
|
|
1158
1191
|
resize = decorator(handler.resize),
|
|
1192
|
+
in_mutex = handler.mutex or function() return false end,
|
|
1193
|
+
get_error = handler.error or function() return nil end,
|
|
1159
1194
|
node = node,
|
|
1160
1195
|
apply = function() end
|
|
1161
1196
|
}
|
|
@@ -1166,6 +1201,9 @@ end
|
|
|
1166
1201
|
local function install(std, engine, handler, name)
|
|
1167
1202
|
std.media = std.media or {}
|
|
1168
1203
|
local mediatype = name:match('%w+%.(%w+)')
|
|
1204
|
+
if handler.install then
|
|
1205
|
+
handler.install(std, engine, mediatype, name)
|
|
1206
|
+
end
|
|
1169
1207
|
if not std.media[mediatype] then
|
|
1170
1208
|
local channels = handler.bootstrap and handler.bootstrap(mediatype)
|
|
1171
1209
|
if (not channels or channels == 0) and handler.bootstrap then
|
|
@@ -1181,7 +1219,7 @@ install=install
|
|
|
1181
1219
|
return P
|
|
1182
1220
|
end
|
|
1183
1221
|
--
|
|
1184
|
-
|
|
1222
|
+
src_lib_engine_draw_fps_560c51e694a0 = function()
|
|
1185
1223
|
local function draw_fps(std, engine, show, pos_x, pos_y)
|
|
1186
1224
|
if show < 1 then return end
|
|
1187
1225
|
local x = engine.current.config.offset_x + pos_x
|
|
@@ -1233,8 +1271,8 @@ install=install
|
|
|
1233
1271
|
return P
|
|
1234
1272
|
end
|
|
1235
1273
|
--
|
|
1236
|
-
|
|
1237
|
-
local util_decorator =
|
|
1274
|
+
src_lib_engine_draw_text_560c51e69bd0 = function()
|
|
1275
|
+
local util_decorator = src_lib_util_decorator_560c51e7fd40()
|
|
1238
1276
|
local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
|
|
1239
1277
|
size = size or 2
|
|
1240
1278
|
local hem = engine.current.data.width / 80
|
|
@@ -1245,10 +1283,10 @@ std.text.font_size(font_size)
|
|
|
1245
1283
|
std.text.print(pos_x * hem, pos_y * vem, text)
|
|
1246
1284
|
font_previous()
|
|
1247
1285
|
end
|
|
1248
|
-
local function text_print_ex(std, engine, x, y, text,
|
|
1286
|
+
local function text_print_ex(std, engine, x, y, text, align_x, align_y)
|
|
1249
1287
|
local w, h = std.text.mensure(text)
|
|
1250
|
-
local
|
|
1251
|
-
std.text.print(x -
|
|
1288
|
+
local aligns_x, aligns_y = {w, w/2, 0}, {h, h/2, 0}
|
|
1289
|
+
std.text.print(x - aligns_x[(align_x or 1) + 2], y - aligns_y[(align_y or 1) + 2], text)
|
|
1252
1290
|
return w, h
|
|
1253
1291
|
end
|
|
1254
1292
|
local function install(std, engine, config)
|
|
@@ -1261,7 +1299,7 @@ install=install
|
|
|
1261
1299
|
return P
|
|
1262
1300
|
end
|
|
1263
1301
|
--
|
|
1264
|
-
|
|
1302
|
+
src_lib_engine_draw_poly_560c51e7e7e0 = function()
|
|
1265
1303
|
local function decorator_poo(object, func)
|
|
1266
1304
|
if not object or not func then return func end
|
|
1267
1305
|
return function(a, b, c, d)
|
|
@@ -1368,7 +1406,7 @@ install=install
|
|
|
1368
1406
|
return P
|
|
1369
1407
|
end
|
|
1370
1408
|
--
|
|
1371
|
-
|
|
1409
|
+
src_lib_engine_raw_memory_560c51e82820 = function()
|
|
1372
1410
|
local memory_dict_unload = {}
|
|
1373
1411
|
local memory_dict = {}
|
|
1374
1412
|
local memory_list = {}
|
|
@@ -1423,8 +1461,8 @@ install=install
|
|
|
1423
1461
|
return P
|
|
1424
1462
|
end
|
|
1425
1463
|
--
|
|
1426
|
-
|
|
1427
|
-
local http_util =
|
|
1464
|
+
src_lib_protocol_http_callback_560c51e7c810 = function()
|
|
1465
|
+
local http_util = src_lib_util_http_560c51e3c4b0()
|
|
1428
1466
|
local callbacks = {
|
|
1429
1467
|
['async-promise'] = function(self)
|
|
1430
1468
|
return self:promise()
|
|
@@ -1491,7 +1529,7 @@ func = native_http_callback
|
|
|
1491
1529
|
return P
|
|
1492
1530
|
end
|
|
1493
1531
|
--
|
|
1494
|
-
|
|
1532
|
+
src_lib_object_root_560c51e6d3f0 = function()
|
|
1495
1533
|
local P = {
|
|
1496
1534
|
data={
|
|
1497
1535
|
width=1280,
|
|
@@ -1521,7 +1559,7 @@ callbacks={
|
|
|
1521
1559
|
return P;
|
|
1522
1560
|
end
|
|
1523
1561
|
--
|
|
1524
|
-
|
|
1562
|
+
src_lib_object_color_560c51e80600 = function()
|
|
1525
1563
|
local function install(std)
|
|
1526
1564
|
std.color = std.color or {}
|
|
1527
1565
|
std.color.white = 0xFFFFFFFF
|
|
@@ -1556,7 +1594,7 @@ install = install
|
|
|
1556
1594
|
return P
|
|
1557
1595
|
end
|
|
1558
1596
|
--
|
|
1559
|
-
|
|
1597
|
+
src_lib_object_std_560c51e7d900 = function()
|
|
1560
1598
|
local P = {
|
|
1561
1599
|
milis = 0,
|
|
1562
1600
|
delta = 0,
|
|
@@ -1622,7 +1660,7 @@ any=false
|
|
|
1622
1660
|
return P;
|
|
1623
1661
|
end
|
|
1624
1662
|
--
|
|
1625
|
-
|
|
1663
|
+
src_lib_util_pipeline_560c51e36e60 = function()
|
|
1626
1664
|
local function pipe(self)
|
|
1627
1665
|
return function()
|
|
1628
1666
|
self:run()
|
|
@@ -1672,7 +1710,7 @@ run=run
|
|
|
1672
1710
|
return P
|
|
1673
1711
|
end
|
|
1674
1712
|
--
|
|
1675
|
-
|
|
1713
|
+
src_lib_util_decorator_560c51e7fd40 = function()
|
|
1676
1714
|
local function decorator_prefix3(zig, zag, zom, func)
|
|
1677
1715
|
return function (a, b, c, d, e, f)
|
|
1678
1716
|
return func(zig, zag, zom, a, b, c, d, e, f)
|
|
@@ -1730,7 +1768,7 @@ prefix1_t = table_prefix1
|
|
|
1730
1768
|
return P
|
|
1731
1769
|
end
|
|
1732
1770
|
--
|
|
1733
|
-
|
|
1771
|
+
src_lib_util_http_560c51e3c4b0 = function()
|
|
1734
1772
|
local function is_ok(status)
|
|
1735
1773
|
return (status and 200 <= status and status < 300) or false
|
|
1736
1774
|
end
|
|
@@ -1742,6 +1780,18 @@ end
|
|
|
1742
1780
|
local function is_redirect(status)
|
|
1743
1781
|
return (status and 300 <= status and status < 400) or false
|
|
1744
1782
|
end
|
|
1783
|
+
local function get_content(response)
|
|
1784
|
+
local header, body = response:match("^(.-\r\n\r\n)(.*)")
|
|
1785
|
+
if not header or not body then return nil end
|
|
1786
|
+
local content_length = tonumber(header:match("Content%-Length:%s*(%d+)"))
|
|
1787
|
+
if not content_length then return nil end
|
|
1788
|
+
if #body < content_length then return nil end
|
|
1789
|
+
local content = body:sub(1, content_length)
|
|
1790
|
+
return content
|
|
1791
|
+
end
|
|
1792
|
+
local function get_user_agent()
|
|
1793
|
+
return 'Ginga (GlyOS;SmartTv/Linux)'
|
|
1794
|
+
end
|
|
1745
1795
|
local function url_search_param(param_list, param_dict)
|
|
1746
1796
|
local index, params = 1, ''
|
|
1747
1797
|
while param_list and param_dict and index <= #param_list do
|
|
@@ -1752,7 +1802,7 @@ params = params..'?'
|
|
|
1752
1802
|
else
|
|
1753
1803
|
params = params..'&'
|
|
1754
1804
|
end
|
|
1755
|
-
params = params..param..'='..(value or '')
|
|
1805
|
+
params = params..param:gsub(' ', '%20')..'='..(value or ''):gsub(' ', '%20')
|
|
1756
1806
|
index = index + 1
|
|
1757
1807
|
end
|
|
1758
1808
|
return params
|
|
@@ -1874,9 +1924,11 @@ return {
|
|
|
1874
1924
|
is_ok=is_ok,
|
|
1875
1925
|
is_ok_header=is_ok_header,
|
|
1876
1926
|
is_redirect=is_redirect,
|
|
1927
|
+
get_content=get_content,
|
|
1928
|
+
get_user_agent=get_user_agent,
|
|
1877
1929
|
url_search_param=url_search_param,
|
|
1878
1930
|
create_request=create_request
|
|
1879
1931
|
}
|
|
1880
1932
|
end
|
|
1881
1933
|
--
|
|
1882
|
-
return
|
|
1934
|
+
return main_560c51e83670()
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamely/gly-engine-lite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"author": "RodrigoDornelles",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.gamely.com.br",
|
|
7
|
-
"repository": "https://github.com/
|
|
7
|
+
"repository": "https://github.com/gly-engine/gly-engine",
|
|
8
8
|
"funding": "https://github.com/sponsors/RodrigoDornelles",
|
|
9
|
-
"bugs": "https://github.com/
|
|
9
|
+
"bugs": "https://github.com/gly-engine/gly-engine/issues",
|
|
10
10
|
"description": "Game Engine written in 100% lua that runs in a vacuum.",
|
|
11
11
|
"main": "dist/main.lua",
|
|
12
|
+
"browser": "dist/main.lua",
|
|
12
13
|
"types": "types/main.d.ts",
|
|
13
14
|
"keywords": [
|
|
14
15
|
"game engine",
|