diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build.lua | 1 | ||||
-rw-r--r-- | docs/README.Lspace | 4 | ||||
-rw-r--r-- | docs/love.txt | 67 | ||||
-rwxr-xr-x | src/LuaSL/build.lua | 5 | ||||
-rwxr-xr-x | src/LuaSL/test.sh | 4 | ||||
-rwxr-xr-x | src/love/build.lua | 27 | ||||
-rw-r--r-- | src/love/love.c (renamed from src/LuaSL/LuaSL_test.c) | 8 | ||||
-rw-r--r-- | src/love/love.edc (renamed from src/LuaSL/LuaSL.edc) | 0 |
9 files changed, 106 insertions, 11 deletions
@@ -1,5 +1,6 @@ | |||
1 | /docs/XMRE.txt | 1 | /docs/XMRE.txt |
2 | /extantz | 2 | /extantz |
3 | /love | ||
3 | /LuaSL | 4 | /LuaSL |
4 | /skang | 5 | /skang |
5 | /libraries/irrlicht-1.8.1/bin/Linux/01.HelloWorld | 6 | /libraries/irrlicht-1.8.1/bin/Linux/01.HelloWorld |
@@ -94,6 +94,7 @@ if 'nil' == type(args) then | |||
94 | runCommand('Irrlicht','libraries/irrlicht-1.8.1/source/Irrlicht', 'make') | 94 | runCommand('Irrlicht','libraries/irrlicht-1.8.1/source/Irrlicht', 'make') |
95 | buildSub('libraries', 'src/libraries') | 95 | buildSub('libraries', 'src/libraries') |
96 | buildSub('LuaSL', 'src/LuaSL') | 96 | buildSub('LuaSL', 'src/LuaSL') |
97 | buildSub('love', 'src/love') | ||
97 | buildSub('GuiLua', 'src/GuiLua') | 98 | buildSub('GuiLua', 'src/GuiLua') |
98 | buildSub('purkle', 'src/purkle') | 99 | buildSub('purkle', 'src/purkle') |
99 | buildSub('extantz', 'src/extantz') | 100 | buildSub('extantz', 'src/extantz') |
diff --git a/docs/README.Lspace b/docs/README.Lspace index a86de96..2eb9b24 100644 --- a/docs/README.Lspace +++ b/docs/README.Lspace | |||
@@ -1 +1,3 @@ | |||
1 | Sim contents server, which is pretty much a web server. | 1 | Sim contents server, which is pretty much a web server. Should support |
2 | WebDAV so people can point their file browsers at it. More details in | ||
3 | love.txt. | ||
diff --git a/docs/love.txt b/docs/love.txt new file mode 100644 index 0000000..c704aba --- /dev/null +++ b/docs/love.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | Love makes the world go around. Though in this case, it's the name of | ||
2 | the world server, the module that directly controls what happens to the | ||
3 | content of the virtual world. | ||
4 | |||
5 | The love world server that deals with changing the world. It manages | ||
6 | the on disk representation of the world, and lets others screw with it | ||
7 | via nails pumps. Love also sends nails events on changes. | ||
8 | |||
9 | World server vs local world. | ||
10 | ---------------------------- | ||
11 | |||
12 | Extantz defaults to running a local world at start up. Lspace serves | ||
13 | the content for a networked world. They may be the same world if the | ||
14 | local world is also networked. Nails pumps commands to and from the | ||
15 | world. | ||
16 | |||
17 | Lspace just serves the results as a web server. The love world server | ||
18 | changes on disk content, Lspace checks on disk modified time stamps to | ||
19 | deal with "do you have a newer version" HTTP requests. Standard web | ||
20 | server stuff really, though a mod_nails might be useful to catch events | ||
21 | in order to invalidate any internal web caches. | ||
22 | |||
23 | For networked worlds, Extantz fetches new content from Lspace, and hooks | ||
24 | up to the nails pump of the love server for changes. For local worlds, | ||
25 | extantz would basically BE the world server? No, that duplicates | ||
26 | things, it can just run a local love server, then connect to it like | ||
27 | every one else. No need to connect to a local Lspace server, just deal | ||
28 | with the file system direct. | ||
29 | |||
30 | The local love server would be configured to listen on 127.0.0.1, and/or | ||
31 | the outside IP address. Extantz checks to see if there's one running on | ||
32 | 127.0.0.1 first before starting one if needed. | ||
33 | |||
34 | Separate vs combined. | ||
35 | --------------------- | ||
36 | |||
37 | There's two ways of doing this. The world server could be part of | ||
38 | Lspace, or they could be separate modules. What we really have is a web | ||
39 | server, backing store, and command pump. The command pump is nails, and | ||
40 | should be a library that is shared, since both ends of the protocol | ||
41 | would be needed by most modules. | ||
42 | |||
43 | Combined might be useful to conserve resources. They both need to deal | ||
44 | with the contents of the world. Lspace just serves it to the outside | ||
45 | world via HTTP, but needs to track changes. Love makes those changes, | ||
46 | and also sends changes via nails to every one. Keeping the current | ||
47 | working set in memory only once saves a lot of memory. | ||
48 | |||
49 | The down sides of combined is that one might bog down the other, and it | ||
50 | gets harder to use standard web servers. | ||
51 | |||
52 | Separated is good coz Lspace might just be any ordinary web server. | ||
53 | They already have mechanisms in place to serve dynamic data, and even | ||
54 | deal with changes to the files. | ||
55 | |||
56 | The down side of separated is that changes might be slower propogating | ||
57 | to the web server, and there might be two copies of any given set of | ||
58 | assets in memory at once. | ||
59 | |||
60 | A third option is to be separated, but any given web server could have a | ||
61 | mod_love type module written for it. This could share memory with the | ||
62 | love server process. So tighter integration is an option, but they can | ||
63 | work apart. Changes happen in this shared memory, driven by the command | ||
64 | pump in the love server. Lspace just needs read access, and just | ||
65 | serves the current state of the world. Love server persists to disk | ||
66 | when it's ready to, though the shared memory can just be memory mapped | ||
67 | files. | ||
diff --git a/src/LuaSL/build.lua b/src/LuaSL/build.lua index 4bf0c09..0efcca3 100755 --- a/src/LuaSL/build.lua +++ b/src/LuaSL/build.lua | |||
@@ -14,19 +14,16 @@ if 'nil' == type(dir) then | |||
14 | end | 14 | end |
15 | 15 | ||
16 | 16 | ||
17 | removeFiles(dir, {'../../LuaSL', '*.o', '*.output', '*.backup', '../../media/LuaSL.edj', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) | 17 | removeFiles(dir, {'../../LuaSL', '*.o', '*.output', '*.backup', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) |
18 | 18 | ||
19 | -- Run lemon first, flex depends on it to define the symbol values. | 19 | -- Run lemon first, flex depends on it to define the symbol values. |
20 | runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') | 20 | runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') |
21 | runCommand('flex', dir, 'flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l') | 21 | runCommand('flex', dir, 'flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l') |
22 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' LuaSL.edc ../../media/LuaSL.edj') | ||
23 | 22 | ||
24 | -- While SledHamr.c does this, we can't use that here, coz LuaSL is not an Elm app. | 23 | -- While SledHamr.c does this, we can't use that here, coz LuaSL is not an Elm app. |
25 | -- Neither is LuaSL_test actually. | ||
26 | CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"' | 24 | CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"' |
27 | CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"' | 25 | CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"' |
28 | CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"' | 26 | CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"' |
29 | CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"' | 27 | CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"' |
30 | 28 | ||
31 | compileFiles('../../LuaSL', dir, {'LuaSL_main', 'LuaSL_compile', 'LuaSL_threads', 'LuaSL_utilities', 'LuaSL_lexer', 'LuaSL_lemon_yaccer'}, '') | 29 | compileFiles('../../LuaSL', dir, {'LuaSL_main', 'LuaSL_compile', 'LuaSL_threads', 'LuaSL_utilities', 'LuaSL_lexer', 'LuaSL_lemon_yaccer'}, '') |
32 | compileFiles('LuaSL_test', dir, {'LuaSL_test', 'LuaSL_utilities'}, '') | ||
diff --git a/src/LuaSL/test.sh b/src/LuaSL/test.sh index 435c5e2..e8471c8 100755 --- a/src/LuaSL/test.sh +++ b/src/LuaSL/test.sh | |||
@@ -20,8 +20,8 @@ case $@ in | |||
20 | echo "_______________ STARTING LuaSL _______________" | 20 | echo "_______________ STARTING LuaSL _______________" |
21 | ../../LuaSL & | 21 | ../../LuaSL & |
22 | sleep 1 | 22 | sleep 1 |
23 | echo "_______________ STARTING LuaSL_test _______________" | 23 | echo "_______________ STARTING love _______________" |
24 | ./LuaSL_test | 24 | ../../love |
25 | ;; | 25 | ;; |
26 | 26 | ||
27 | esac | 27 | esac |
diff --git a/src/love/build.lua b/src/love/build.lua new file mode 100755 index 0000000..c1a52e2 --- /dev/null +++ b/src/love/build.lua | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/usr/bin/env lua | ||
2 | |||
3 | local dir = ... | ||
4 | |||
5 | if 'nil' == type(dir) then | ||
6 | local build, err = loadfile('../../build.lua') | ||
7 | if build then | ||
8 | setfenv(build, getfenv(2)) | ||
9 | build(2) | ||
10 | else | ||
11 | print("ERROR - " .. err) | ||
12 | end | ||
13 | dir = workingDir | ||
14 | end | ||
15 | |||
16 | |||
17 | removeFiles(dir, {'../../love', '*.o', '../../media/love.edj'}) | ||
18 | |||
19 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') | ||
20 | |||
21 | -- While SledHamr.c does this, we can't use that here, coz love is not an Elm app. | ||
22 | CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"' | ||
23 | CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"' | ||
24 | CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"' | ||
25 | CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"' | ||
26 | |||
27 | compileFiles('../../love', dir, {'love', '../LuaSL/LuaSL_utilities'}, '') | ||
diff --git a/src/LuaSL/LuaSL_test.c b/src/love/love.c index 8fc86c0..e30c8ac 100644 --- a/src/LuaSL/LuaSL_test.c +++ b/src/love/love.c | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | #include "LuaSL.h" | 2 | #include "../LuaSL/LuaSL.h" |
3 | 3 | ||
4 | 4 | ||
5 | int logDom; // Our logging domain. | 5 | int logDom; // Our logging domain. |
@@ -314,7 +314,7 @@ int main(int argc, char **argv) | |||
314 | 314 | ||
315 | if (eina_init()) | 315 | if (eina_init()) |
316 | { | 316 | { |
317 | logDom = loggingStartup("LuaSL_test", logDom); | 317 | logDom = loggingStartup("love", logDom); |
318 | ourGlobals.scripts = eina_hash_string_superfast_new(NULL); | 318 | ourGlobals.scripts = eina_hash_string_superfast_new(NULL); |
319 | 319 | ||
320 | if (ecore_con_init()) | 320 | if (ecore_con_init()) |
@@ -380,7 +380,7 @@ int main(int argc, char **argv) | |||
380 | return -1; | 380 | return -1; |
381 | } | 381 | } |
382 | ourGlobals.canvas = ecore_evas_get(ourGlobals.ee); | 382 | ourGlobals.canvas = ecore_evas_get(ourGlobals.ee); |
383 | ecore_evas_title_set(ourGlobals.ee, "LuaSL test harness"); | 383 | ecore_evas_title_set(ourGlobals.ee, "love test harness (snickers)"); |
384 | ecore_evas_show(ourGlobals.ee); | 384 | ecore_evas_show(ourGlobals.ee); |
385 | 385 | ||
386 | ourGlobals.bg = evas_object_rectangle_add(ourGlobals.canvas); | 386 | ourGlobals.bg = evas_object_rectangle_add(ourGlobals.canvas); |
@@ -393,7 +393,7 @@ int main(int argc, char **argv) | |||
393 | evas_object_focus_set(ourGlobals.bg, EINA_TRUE); | 393 | evas_object_focus_set(ourGlobals.bg, EINA_TRUE); |
394 | 394 | ||
395 | ourGlobals.edje = edje_object_add(ourGlobals.canvas); | 395 | ourGlobals.edje = edje_object_add(ourGlobals.canvas); |
396 | snprintf(buf, sizeof(buf), "%s/%s.edj", PACKAGE_DATA_DIR, "LuaSL"); | 396 | snprintf(buf, sizeof(buf), "%s/%s.edj", PACKAGE_DATA_DIR, "love"); |
397 | if (!edje_object_file_set(ourGlobals.edje, buf, group)) | 397 | if (!edje_object_file_set(ourGlobals.edje, buf, group)) |
398 | { | 398 | { |
399 | int err = edje_object_load_error_get(ourGlobals.edje); | 399 | int err = edje_object_load_error_get(ourGlobals.edje); |
diff --git a/src/LuaSL/LuaSL.edc b/src/love/love.edc index 844fc8e..844fc8e 100644 --- a/src/LuaSL/LuaSL.edc +++ b/src/love/love.edc | |||