aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-23 03:14:11 +1000
committerDavid Walter Seikel2012-02-23 03:14:11 +1000
commite039a8bcecde03cc803fa86b3bea4d4d75bfda41 (patch)
treed49e68146e780c228587e08b6d3c44b02f82116f /LuaSL
parentImplement llSetTimerEvent(), though it wont work so well until the events sys... (diff)
downloadSledjHamr-e039a8bcecde03cc803fa86b3bea4d4d75bfda41.zip
SledjHamr-e039a8bcecde03cc803fa86b3bea4d4d75bfda41.tar.gz
SledjHamr-e039a8bcecde03cc803fa86b3bea4d4d75bfda41.tar.bz2
SledjHamr-e039a8bcecde03cc803fa86b3bea4d4d75bfda41.tar.xz
Fake some more functions in the test harness.
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_test.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c
index 9053878..c8512b3 100644
--- a/LuaSL/src/LuaSL_test.c
+++ b/LuaSL/src/LuaSL_test.c
@@ -124,7 +124,7 @@ static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Server_Ad
124 snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); 124 snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR);
125 eina_file_dir_list(buf, EINA_TRUE, dirList_compile, game); 125 eina_file_dir_list(buf, EINA_TRUE, dirList_compile, game);
126 // Wait awhile, then quit all scripts we started, for testing. 126 // Wait awhile, then quit all scripts we started, for testing.
127 ecore_timer_add(3.5, _quit_timer_cb, game); 127 ecore_timer_add(4.0, _quit_timer_cb, game);
128 return ECORE_CALLBACK_RENEW; 128 return ECORE_CALLBACK_RENEW;
129} 129}
130 130
@@ -227,12 +227,24 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D
227 { 227 {
228 if (0 == strcmp(command, "llGetKey()")) // Send back a random UUID for testing. 228 if (0 == strcmp(command, "llGetKey()")) // Send back a random UUID for testing.
229 sendForth(game, SID, "\"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random()); 229 sendForth(game, SID, "\"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random());
230 else if (0 == strcmp(command, "llGetOwner()")) // Send back a random UUID for testing.
231 sendForth(game, SID, "\"%08lx-%04lx-%04lx-%04lx-%012lx\"", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random());
230 else if (0 == strcmp(command, "llGetPos()")) // Send back a fixed position for testing. 232 else if (0 == strcmp(command, "llGetPos()")) // Send back a fixed position for testing.
231 sendForth(game, SID, "{x=128.0, y=128.0, z=128.0}"); 233 sendForth(game, SID, "{x=128.0, y=128.0, z=128.0}");
232 else if (0 == strcmp(command, "llGetRot()")) // Send back a fixed rotation for testing. 234 else if (0 == strcmp(command, "llGetRot()")) // Send back a fixed rotation for testing.
233 sendForth(game, SID, "{x=0.0, y=0.0, z=0.0, s=1.0}"); 235 sendForth(game, SID, "{x=0.0, y=0.0, z=0.0, s=1.0}");
234 else if (0 == strcmp(command, "llGetObjectDesc()")) // Send back a blank description for testing. 236 else if (0 == strcmp(command, "llGetObjectDesc()")) // Send back a blank description for testing.
235 sendForth(game, SID, "\"\""); 237 sendForth(game, SID, "\"\"");
238 else if (0 == strncmp(command, "llGetAlpha(", 11)) // Send back a fixed alpha for testing.
239 sendForth(game, SID, "1.0");
240 else if (0 == strcmp(command, "llGetInventoryNumber(7)")) // Send back a fixed value for testing.
241 sendForth(game, SID, "3");
242 else if (0 == strcmp(command, "llGetInventoryName(7, 2)")) // Send back a fixed value for testing.
243 sendForth(game, SID, "\".readme\"");
244 else if (0 == strcmp(command, "llGetInventoryName(7, 1)")) // Send back a fixed value for testing.
245 sendForth(game, SID, "\".POSITIONS\"");
246 else if (0 == strcmp(command, "llGetInventoryName(7, 0)")) // Send back a fixed value for testing.
247 sendForth(game, SID, "\".MENUITEMS\"");
236 else 248 else
237 PI("Script %s sent command %s", SID, command); 249 PI("Script %s sent command %s", SID, command);
238 } 250 }