@gamely/gly-engine-lite 0.0.21 → 0.1.0

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.
Files changed (2) hide show
  1. package/dist/main.lua +107 -101
  2. package/package.json +1 -1
package/dist/main.lua CHANGED
@@ -1,48 +1,49 @@
1
1
  local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
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()
2
+ local source_version_55b12fccc2f0 = nil
3
+ local source_shared_module_55b12fccb780 = nil
4
+ local source_engine_api_data_encoder_55b12fcbbfb0 = nil
5
+ local source_engine_api_system_app_55b12fcbbe60 = nil
6
+ local source_engine_api_data_hash_55b12fca97d0 = nil
7
+ local source_engine_api_io_http_55b12fcbc6a0 = nil
8
+ local source_engine_api_data_i18n_55b12fccb930 = nil
9
+ local source_engine_api_system_key_55b12fccb710 = nil
10
+ local source_engine_api_debug_log_55b12fcdc150 = nil
11
+ local source_engine_api_system_math_55b12fcd9b60 = nil
12
+ local source_engine_api_data_array_55b12fcdac30 = nil
13
+ local source_engine_api_io_media_55b12fccdcc0 = nil
14
+ local source_engine_api_draw_fps_55b12fcc92c0 = nil
15
+ local source_engine_api_draw_text_55b12fcc8aa0 = nil
16
+ local source_engine_api_draw_poly_55b12fcc9100 = nil
17
+ local source_engine_api_raw_memory_55b12fc62480 = nil
18
+ local source_engine_protocol_http_callback_55b12fca1ac0 = nil
19
+ local source_shared_var_object_root_55b12fcb7d70 = nil
20
+ local source_engine_api_system_color_55b12fcb8930 = nil
21
+ local source_shared_var_object_std_55b12fcb96a0 = nil
22
+ local source_shared_functional_pipeline_55b12fc71770 = nil
23
+ local source_shared_functional_decorator_55b12fc834b0 = nil
24
+ local source_shared_string_encode_http_55b12fc78030 = nil
25
+ local source_shared_string_encode_url_55b12fc82be0 = nil
26
+ local function main_55b12fccbf90()
27
+ local version = source_version_55b12fccc2f0()
28
+ local zeebo_module = source_shared_module_55b12fccb780()
29
+ local engine_encoder = source_engine_api_data_encoder_55b12fcbbfb0()
30
+ local engine_game = source_engine_api_system_app_55b12fcbbe60()
31
+ local engine_hash = source_engine_api_data_hash_55b12fca97d0()
32
+ local engine_http = source_engine_api_io_http_55b12fcbc6a0()
33
+ local engine_i18n = source_engine_api_data_i18n_55b12fccb930()
34
+ local engine_key = source_engine_api_system_key_55b12fccb710()
35
+ local engine_log = source_engine_api_debug_log_55b12fcdc150()
36
+ local engine_math = source_engine_api_system_math_55b12fcd9b60()
37
+ local engine_array = source_engine_api_data_array_55b12fcdac30()
38
+ local engine_media = source_engine_api_io_media_55b12fccdcc0()
39
+ local engine_api_draw_fps = source_engine_api_draw_fps_55b12fcc92c0()
40
+ local engine_api_draw_text = source_engine_api_draw_text_55b12fcc8aa0()
41
+ local engine_api_draw_poly = source_engine_api_draw_poly_55b12fcc9100()
42
+ local engine_raw_memory = source_engine_api_raw_memory_55b12fc62480()
43
+ local callback_http = source_engine_protocol_http_callback_55b12fca1ac0()
44
+ local application_default = source_shared_var_object_root_55b12fcb7d70()
45
+ local color = source_engine_api_system_color_55b12fcb8930()
46
+ local std = source_shared_var_object_std_55b12fcb96a0()
46
47
  local application = application_default
47
48
  local engine = {
48
49
  keyboard = function(a, b, c, d) end,
@@ -168,9 +169,9 @@ zeebo_module.require(std, application, engine)
168
169
  :package('@math', engine_math)
169
170
  :package('@array', engine_array)
170
171
  :package('@key', engine_key, {})
171
- :package('@draw.fps', engine_draw_fps)
172
- :package('@draw.text', engine_draw_text, cfg_text)
173
- :package('@draw.poly', engine_draw_poly, cfg_poly)
172
+ :package('@draw.fps', engine_api_draw_fps)
173
+ :package('@draw.text', engine_api_draw_text, cfg_text)
174
+ :package('@draw.poly', engine_api_draw_poly, cfg_poly)
174
175
  :package('@color', color)
175
176
  :package('@log', engine_log, cfg_log)
176
177
  :package('math', engine_math.clib)
@@ -202,13 +203,13 @@ version=version
202
203
  }
203
204
  return P
204
205
  end
205
- src_version_560c51e6c020 = function()
206
- return '0.0.21'
206
+ source_version_55b12fccc2f0 = function()
207
+ return '0.1.0'
207
208
  end
208
209
  --
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()
210
+ source_shared_module_55b12fccb780 = function()
211
+ local zeebo_pipeline = source_shared_functional_pipeline_55b12fc71770()
212
+ local application_default = source_shared_var_object_root_55b12fcb7d70()
212
213
  local function default(application, defaults)
213
214
  if not application then return nil end
214
215
  local index = 1
@@ -410,7 +411,7 @@ require = require
410
411
  return P
411
412
  end
412
413
  --
413
- src_lib_engine_api_encoder_560c51e671b0 = function()
414
+ source_engine_api_data_encoder_55b12fcbbfb0 = function()
414
415
  local function install(std, engine, library, name)
415
416
  std = std or {}
416
417
  std[name] = {
@@ -425,8 +426,8 @@ install=install
425
426
  return P
426
427
  end
427
428
  --
428
- src_lib_engine_api_app_560c51e67890 = function()
429
- local util_decorator = src_lib_util_decorator_560c51e7fd40()
429
+ source_engine_api_system_app_55b12fcbbe60 = function()
430
+ local util_decorator = source_shared_functional_decorator_55b12fc834b0()
430
431
  local function reset(std, engine)
431
432
  if std.node then
432
433
  std.bus.emit('exit')
@@ -466,17 +467,15 @@ install=install
466
467
  return P
467
468
  end
468
469
  --
469
- src_lib_engine_api_hash_560c51e82110 = function()
470
+ source_engine_api_data_hash_55b12fca97d0 = function()
470
471
  local function djb2(digest)
471
472
  local index = 1
472
473
  local hash = 5381
473
474
  while index <= #digest do
474
475
  local char = string.byte(digest, index)
475
- hash = (hash * 33) + char
476
+ hash = (hash * 33 + char) % 4294967296
476
477
  index = index + 1
477
478
  end
478
- hash = string.format('%08x', hash)
479
- hash = tonumber(hash:sub(#hash - 7), 16)
480
479
  return hash
481
480
  end
482
481
  local function install(std, engine, cfg_system)
@@ -492,8 +491,8 @@ install = install
492
491
  return P
493
492
  end
494
493
  --
495
- src_lib_engine_api_http_560c51e8b270 = function()
496
- local zeebo_pipeline = src_lib_util_pipeline_560c51e36e60()
494
+ source_engine_api_io_http_55b12fcbc6a0 = function()
495
+ local zeebo_pipeline = source_shared_functional_pipeline_55b12fc71770()
497
496
  local function json(self)
498
497
  self.options['json'] = true
499
498
  return self
@@ -656,7 +655,7 @@ install=install
656
655
  return P
657
656
  end
658
657
  --
659
- src_lib_engine_api_i18n_560c51e5e8f0 = function()
658
+ source_engine_api_data_i18n_55b12fccb930 = function()
660
659
  local language = 'en-US'
661
660
  local language_default = 'en-US'
662
661
  local language_list = {}
@@ -748,7 +747,7 @@ install=install
748
747
  return P
749
748
  end
750
749
  --
751
- src_lib_engine_api_key_560c51e7f130 = function()
750
+ source_engine_api_system_key_55b12fccb710 = function()
752
751
  local function real_key(std, engine, rkey, rvalue)
753
752
  local value = rvalue == 1 or rvalue == true
754
753
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -788,8 +787,8 @@ install = install
788
787
  return P
789
788
  end
790
789
  --
791
- src_lib_engine_api_log_560c51e8c2a0 = function()
792
- local util_decorator = src_lib_util_decorator_560c51e7fd40()
790
+ source_engine_api_debug_log_55b12fcdc150 = function()
791
+ local util_decorator = source_shared_functional_decorator_55b12fc834b0()
793
792
  local logging_types = {
794
793
  'none', 'fatal', 'error', 'warn', 'debug', 'info'
795
794
  }
@@ -835,7 +834,7 @@ install = install
835
834
  return P
836
835
  end
837
836
  --
838
- src_lib_engine_api_math_560c51e81c30 = function()
837
+ source_engine_api_system_math_55b12fcd9b60 = function()
839
838
  local function abs(value)
840
839
  if value < 0 then
841
840
  return -value
@@ -1010,8 +1009,8 @@ install = install_clib_random
1010
1009
  return P;
1011
1010
  end
1012
1011
  --
1013
- src_lib_engine_api_array_560c51e81500 = function()
1014
- local util_decorator = src_lib_util_decorator_560c51e7fd40()
1012
+ source_engine_api_data_array_55b12fcdac30 = function()
1013
+ local util_decorator = source_shared_functional_decorator_55b12fc834b0()
1015
1014
  local function array_map(array, func)
1016
1015
  local res = {}
1017
1016
  local index = 1
@@ -1172,7 +1171,7 @@ install = install
1172
1171
  return P
1173
1172
  end
1174
1173
  --
1175
- src_lib_engine_api_media_560c51e62230 = function()
1174
+ source_engine_api_io_media_55b12fccdcc0 = function()
1176
1175
  local function media_create(node, channels, handler)
1177
1176
  local decorator = function(func)
1178
1177
  func = func or function() end
@@ -1219,7 +1218,7 @@ install=install
1219
1218
  return P
1220
1219
  end
1221
1220
  --
1222
- src_lib_engine_draw_fps_560c51e694a0 = function()
1221
+ source_engine_api_draw_fps_55b12fcc92c0 = function()
1223
1222
  local function draw_fps(std, engine, show, pos_x, pos_y)
1224
1223
  if show < 1 then return end
1225
1224
  local x = engine.current.config.offset_x + pos_x
@@ -1271,8 +1270,8 @@ install=install
1271
1270
  return P
1272
1271
  end
1273
1272
  --
1274
- src_lib_engine_draw_text_560c51e69bd0 = function()
1275
- local util_decorator = src_lib_util_decorator_560c51e7fd40()
1273
+ source_engine_api_draw_text_55b12fcc8aa0 = function()
1274
+ local util_decorator = source_shared_functional_decorator_55b12fc834b0()
1276
1275
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
1277
1276
  size = size or 2
1278
1277
  local hem = engine.current.data.width / 80
@@ -1299,7 +1298,7 @@ install=install
1299
1298
  return P
1300
1299
  end
1301
1300
  --
1302
- src_lib_engine_draw_poly_560c51e7e7e0 = function()
1301
+ source_engine_api_draw_poly_55b12fcc9100 = function()
1303
1302
  local function decorator_poo(object, func)
1304
1303
  if not object or not func then return func end
1305
1304
  return function(a, b, c, d)
@@ -1406,7 +1405,7 @@ install=install
1406
1405
  return P
1407
1406
  end
1408
1407
  --
1409
- src_lib_engine_raw_memory_560c51e82820 = function()
1408
+ source_engine_api_raw_memory_55b12fc62480 = function()
1410
1409
  local memory_dict_unload = {}
1411
1410
  local memory_dict = {}
1412
1411
  local memory_list = {}
@@ -1461,8 +1460,9 @@ install=install
1461
1460
  return P
1462
1461
  end
1463
1462
  --
1464
- src_lib_protocol_http_callback_560c51e7c810 = function()
1465
- local http_util = src_lib_util_http_560c51e3c4b0()
1463
+ source_engine_protocol_http_callback_55b12fca1ac0 = function()
1464
+ local str_http = source_shared_string_encode_http_55b12fc78030()
1465
+ local str_url = source_shared_string_encode_url_55b12fc82be0()
1466
1466
  local callbacks = {
1467
1467
  ['async-promise'] = function(self)
1468
1468
  return self:promise()
@@ -1474,7 +1474,7 @@ end,
1474
1474
  return self.url
1475
1475
  end,
1476
1476
  ['get-fullurl'] = function(self)
1477
- return self.url..http_util.url_search_param(self.param_list, self.param_dict)
1477
+ return self.url..str_url.search_param(self.param_list, self.param_dict)
1478
1478
  end,
1479
1479
  ['get-method'] = function(self)
1480
1480
  return self.method
@@ -1502,7 +1502,7 @@ return self.heeader_dict[self.data] or self.heeader_dict[self.header_list[self.d
1502
1502
  end,
1503
1503
  ['set-status'] = function(self, data)
1504
1504
  self.set('status', data)
1505
- self.set('ok', http_util.is_ok(data))
1505
+ self.set('ok', str_http.is_ok(data))
1506
1506
  end,
1507
1507
  ['set-error'] = function(self, data)
1508
1508
  self.set('error', data)
@@ -1529,7 +1529,7 @@ func = native_http_callback
1529
1529
  return P
1530
1530
  end
1531
1531
  --
1532
- src_lib_object_root_560c51e6d3f0 = function()
1532
+ source_shared_var_object_root_55b12fcb7d70 = function()
1533
1533
  local P = {
1534
1534
  data={
1535
1535
  width=1280,
@@ -1559,7 +1559,7 @@ callbacks={
1559
1559
  return P;
1560
1560
  end
1561
1561
  --
1562
- src_lib_object_color_560c51e80600 = function()
1562
+ source_engine_api_system_color_55b12fcb8930 = function()
1563
1563
  local function install(std)
1564
1564
  std.color = std.color or {}
1565
1565
  std.color.white = 0xFFFFFFFF
@@ -1594,7 +1594,7 @@ install = install
1594
1594
  return P
1595
1595
  end
1596
1596
  --
1597
- src_lib_object_std_560c51e7d900 = function()
1597
+ source_shared_var_object_std_55b12fcb96a0 = function()
1598
1598
  local P = {
1599
1599
  milis = 0,
1600
1600
  delta = 0,
@@ -1660,7 +1660,7 @@ any=false
1660
1660
  return P;
1661
1661
  end
1662
1662
  --
1663
- src_lib_util_pipeline_560c51e36e60 = function()
1663
+ source_shared_functional_pipeline_55b12fc71770 = function()
1664
1664
  local function pipe(self)
1665
1665
  return function()
1666
1666
  self:run()
@@ -1710,7 +1710,7 @@ run=run
1710
1710
  return P
1711
1711
  end
1712
1712
  --
1713
- src_lib_util_decorator_560c51e7fd40 = function()
1713
+ source_shared_functional_decorator_55b12fc834b0 = function()
1714
1714
  local function decorator_prefix3(zig, zag, zom, func)
1715
1715
  return function (a, b, c, d, e, f)
1716
1716
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -1768,7 +1768,7 @@ prefix1_t = table_prefix1
1768
1768
  return P
1769
1769
  end
1770
1770
  --
1771
- src_lib_util_http_560c51e3c4b0 = function()
1771
+ source_shared_string_encode_http_55b12fc78030 = function()
1772
1772
  local function is_ok(status)
1773
1773
  return (status and 200 <= status and status < 300) or false
1774
1774
  end
@@ -1792,21 +1792,6 @@ end
1792
1792
  local function get_user_agent()
1793
1793
  return 'Ginga (GlyOS;SmartTv/Linux)'
1794
1794
  end
1795
- local function url_search_param(param_list, param_dict)
1796
- local index, params = 1, ''
1797
- while param_list and param_dict and index <= #param_list do
1798
- local param = param_list[index]
1799
- local value = param_dict[param]
1800
- if #params == 0 then
1801
- params = params..'?'
1802
- else
1803
- params = params..'&'
1804
- end
1805
- params = params..param:gsub(' ', '%20')..'='..(value or ''):gsub(' ', '%20')
1806
- index = index + 1
1807
- end
1808
- return params
1809
- end
1810
1795
  local function create_request(method, uri)
1811
1796
  local self = {
1812
1797
  body_content = '',
@@ -1926,9 +1911,30 @@ is_ok_header=is_ok_header,
1926
1911
  is_redirect=is_redirect,
1927
1912
  get_content=get_content,
1928
1913
  get_user_agent=get_user_agent,
1929
- url_search_param=url_search_param,
1930
1914
  create_request=create_request
1931
1915
  }
1932
1916
  end
1933
1917
  --
1934
- return main_560c51e83670()
1918
+ source_shared_string_encode_url_55b12fc82be0 = function()
1919
+ local function search_param(param_list, param_dict)
1920
+ local index, params = 1, ''
1921
+ while param_list and param_dict and index <= #param_list do
1922
+ local param = param_list[index]
1923
+ local value = param_dict[param]
1924
+ if #params == 0 then
1925
+ params = params..'?'
1926
+ else
1927
+ params = params..'&'
1928
+ end
1929
+ params = params..param:gsub(' ', '%20')..'='..(value or ''):gsub(' ', '%20')
1930
+ index = index + 1
1931
+ end
1932
+ return params
1933
+ end
1934
+ local P = {
1935
+ search_param = search_param
1936
+ }
1937
+ return P
1938
+ end
1939
+ --
1940
+ return main_55b12fccbf90()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-lite",
3
- "version": "0.0.21",
3
+ "version": "0.1.0",
4
4
  "author": "RodrigoDornelles",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.gamely.com.br",