diff options
author | David Walter Seikel | 2012-02-23 20:44:28 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-23 20:44:28 +1000 |
commit | d6ad5f15e40e7c8d289d89622deac7cc72977e53 (patch) | |
tree | 0aba743c8c74943396c11e51fa725596c70200b8 | |
parent | Change the quit timer into a more general purpose timed events timer, for mor... (diff) | |
download | SledjHamr-d6ad5f15e40e7c8d289d89622deac7cc72977e53.zip SledjHamr-d6ad5f15e40e7c8d289d89622deac7cc72977e53.tar.gz SledjHamr-d6ad5f15e40e7c8d289d89622deac7cc72977e53.tar.bz2 SledjHamr-d6ad5f15e40e7c8d289d89622deac7cc72977e53.tar.xz |
Have the returns from external function calls include the word "return" at the start.
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 2 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_test.c | 41 |
2 files changed, 22 insertions, 21 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index fcbfa03..5a56a88 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -12,7 +12,7 @@ static Eina_Bool _sleep_timer_cb(void *data) | |||
12 | gameGlobals *game = script->game; | 12 | gameGlobals *game = script->game; |
13 | 13 | ||
14 | PD("Waking up %s", script->SID); | 14 | PD("Waking up %s", script->SID); |
15 | sendToChannel(script->SID, "0.0", NULL, NULL); | 15 | sendToChannel(script->SID, "return 0.0", NULL, NULL); |
16 | return ECORE_CALLBACK_CANCEL; | 16 | return ECORE_CALLBACK_CANCEL; |
17 | } | 17 | } |
18 | 18 | ||
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c index b29d6c3..3d27dd2 100644 --- a/LuaSL/src/LuaSL_test.c +++ b/LuaSL/src/LuaSL_test.c | |||
@@ -252,26 +252,27 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
252 | } | 252 | } |
253 | else | 253 | else |
254 | { | 254 | { |
255 | if (0 == strcmp(command, "llGetKey()")) // Send back a random UUID for testing. | 255 | // Send back some random or fixed values for testing. |
256 | sendForth(game, SID, "\"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random()); | 256 | if (0 == strcmp(command, "llGetKey()")) |
257 | else if (0 == strcmp(command, "llGetOwner()")) // Send back a random UUID for testing. | 257 | sendForth(game, SID, "return \"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random()); |
258 | sendForth(game, SID, "\"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random()); | 258 | else if (0 == strcmp(command, "llGetOwner()")) |
259 | else if (0 == strcmp(command, "llGetPos()")) // Send back a fixed position for testing. | 259 | sendForth(game, SID, "return \"%s\"", ownerKey); |
260 | sendForth(game, SID, "{x=128.0, y=128.0, z=128.0}"); | 260 | else if (0 == strcmp(command, "llGetPos()")) |
261 | else if (0 == strcmp(command, "llGetRot()")) // Send back a fixed rotation for testing. | 261 | sendForth(game, SID, "return {x=128.0, y=128.0, z=128.0}"); |
262 | sendForth(game, SID, "{x=0.0, y=0.0, z=0.0, s=1.0}"); | 262 | else if (0 == strcmp(command, "llGetRot()")) |
263 | else if (0 == strcmp(command, "llGetObjectDesc()")) // Send back a blank description for testing. | 263 | sendForth(game, SID, "return {x=0.0, y=0.0, z=0.0, s=1.0}"); |
264 | sendForth(game, SID, "\"\""); | 264 | else if (0 == strcmp(command, "llGetObjectDesc()")) |
265 | else if (0 == strncmp(command, "llGetAlpha(", 11)) // Send back a fixed alpha for testing. | 265 | sendForth(game, SID, "return \"\""); |
266 | sendForth(game, SID, "1.0"); | 266 | else if (0 == strncmp(command, "llGetAlpha(", 11)) |
267 | else if (0 == strcmp(command, "llGetInventoryNumber(7)")) // Send back a fixed value for testing. | 267 | sendForth(game, SID, "return 1.0"); |
268 | sendForth(game, SID, "3"); | 268 | else if (0 == strcmp(command, "llGetInventoryNumber(7)")) |
269 | else if (0 == strcmp(command, "llGetInventoryName(7, 2)")) // Send back a fixed value for testing. | 269 | sendForth(game, SID, "return 3"); |
270 | sendForth(game, SID, "\".readme\""); | 270 | else if (0 == strcmp(command, "llGetInventoryName(7, 2)")) |
271 | else if (0 == strcmp(command, "llGetInventoryName(7, 1)")) // Send back a fixed value for testing. | 271 | sendForth(game, SID, "return \".readme\""); |
272 | sendForth(game, SID, "\".POSITIONS\""); | 272 | else if (0 == strcmp(command, "llGetInventoryName(7, 1)")) |
273 | else if (0 == strcmp(command, "llGetInventoryName(7, 0)")) // Send back a fixed value for testing. | 273 | sendForth(game, SID, "return \".POSITIONS\""); |
274 | sendForth(game, SID, "\".MENUITEMS\""); | 274 | else if (0 == strcmp(command, "llGetInventoryName(7, 0)")) |
275 | sendForth(game, SID, "return \".MENUITEMS\""); | ||
275 | else | 276 | else |
276 | PI("Script %s sent command %s", SID, command); | 277 | PI("Script %s sent command %s", SID, command); |
277 | } | 278 | } |