aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-14 14:32:49 +1000
committerDavid Walter Seikel2014-05-14 14:32:49 +1000
commitecc9fa8cee890efc3dba0875c426a3c3a2fb9b07 (patch)
tree61466effd7d74979e33b587ddb845f9739e92c13 /src/LuaSL
parentDisable the testing part of test.lua, so it doesn't flood the screen. (diff)
downloadSledjHamr-ecc9fa8cee890efc3dba0875c426a3c3a2fb9b07.zip
SledjHamr-ecc9fa8cee890efc3dba0875c426a3c3a2fb9b07.tar.gz
SledjHamr-ecc9fa8cee890efc3dba0875c426a3c3a2fb9b07.tar.bz2
SledjHamr-ecc9fa8cee890efc3dba0875c426a3c3a2fb9b07.tar.xz
Display LSL script names instead of lengthy paths and UUIDs.
Diffstat (limited to 'src/LuaSL')
-rw-r--r--src/LuaSL/LuaSL.h1
-rw-r--r--src/LuaSL/LuaSL_main.c13
2 files changed, 9 insertions, 5 deletions
diff --git a/src/LuaSL/LuaSL.h b/src/LuaSL/LuaSL.h
index 175cebf..d43d6cd 100644
--- a/src/LuaSL/LuaSL.h
+++ b/src/LuaSL/LuaSL.h
@@ -38,6 +38,7 @@ struct _script
38 gameGlobals *game; 38 gameGlobals *game;
39 char SID[PATH_MAX]; 39 char SID[PATH_MAX];
40 char fileName[PATH_MAX]; 40 char fileName[PATH_MAX];
41 char *name;
41 lua_State *L; 42 lua_State *L;
42 struct timeval startTime; 43 struct timeval startTime;
43 float timerTime; 44 float timerTime;
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c
index bfa8728..33b15c6 100644
--- a/src/LuaSL/LuaSL_main.c
+++ b/src/LuaSL/LuaSL_main.c
@@ -13,7 +13,7 @@ static Eina_Bool _sleep_timer_cb(void *data)
13 script *script = data; 13 script *script = data;
14 gameGlobals *ourGlobals = script->game; 14 gameGlobals *ourGlobals = script->game;
15 15
16 PD("Waking up %s", script->SID); 16 PD("Waking up %s", script->name);
17 sendToChannel(ourGlobals, script->SID, "return 0.0"); 17 sendToChannel(ourGlobals, script->SID, "return 0.0");
18 return ECORE_CALLBACK_CANCEL; 18 return ECORE_CALLBACK_CANCEL;
19} 19}
@@ -23,7 +23,7 @@ static Eina_Bool _timer_timer_cb(void *data)
23 script *script = data; 23 script *script = data;
24 gameGlobals *ourGlobals = script->game; 24 gameGlobals *ourGlobals = script->game;
25 25
26 PD("Timer for %s", script->SID); 26 PD("Timer for %s", script->name);
27 sendToChannel(ourGlobals, script->SID, "events.timer()"); 27 sendToChannel(ourGlobals, script->SID, "events.timer()");
28 return ECORE_CALLBACK_RENEW; 28 return ECORE_CALLBACK_RENEW;
29} 29}
@@ -87,10 +87,10 @@ void scriptSendBack(void * data)
87 sendToChannel(ourGlobals, them->SID, "start()"); 87 sendToChannel(ourGlobals, them->SID, "start()");
88 else 88 else
89 sendToChannel(ourGlobals, them->SID, "stop()"); 89 sendToChannel(ourGlobals, them->SID, "stop()");
90 PD("Stopped %s", them->fileName); 90 PD("Stopped %s", them->name);
91 } 91 }
92 else 92 else
93 PE("Missing script state in llSetScriptState(%s, )", them->fileName); 93 PE("Missing script state in llSetScriptState(%s, )", them->name);
94 } 94 }
95 else 95 else
96 { 96 {
@@ -147,6 +147,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
147 { 147 {
148 char *temp; 148 char *temp;
149 char *file; 149 char *file;
150 char *name;
150 151
151 strcpy(buf, &command[8]); 152 strcpy(buf, &command[8]);
152 temp = buf; 153 temp = buf;
@@ -155,7 +156,8 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
155 temp++; 156 temp++;
156 temp[0] = '\0'; 157 temp[0] = '\0';
157 158
158 PD("Compiling %s, %s.", SID, file); 159 name = &file[sizeof(PACKAGE_DATA_DIR)];
160 PD("Compiling %s, %s.", SID, name);
159 if (compileLSL(ourGlobals, ev->client, SID, file, FALSE)) 161 if (compileLSL(ourGlobals, ev->client, SID, file, FALSE))
160 { 162 {
161 script *me = calloc(1, sizeof(script)); 163 script *me = calloc(1, sizeof(script));
@@ -163,6 +165,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
163 gettimeofday(&me->startTime, NULL); 165 gettimeofday(&me->startTime, NULL);
164 strncpy(me->SID, SID, sizeof(me->SID)); 166 strncpy(me->SID, SID, sizeof(me->SID));
165 strncpy(me->fileName, file, sizeof(me->fileName)); 167 strncpy(me->fileName, file, sizeof(me->fileName));
168 me->name = &me->fileName[sizeof(PACKAGE_DATA_DIR)];
166 me->game = ourGlobals; 169 me->game = ourGlobals;
167 me->client = ev->client; 170 me->client = ev->client;
168 eina_hash_add(ourGlobals->scripts, me->SID, me); 171 eina_hash_add(ourGlobals->scripts, me->SID, me);