diff options
author | David Walter Seikel | 2014-05-13 12:03:48 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-13 12:03:48 +1000 |
commit | bc57556575d79ed64e9d2b7978fb409397adb522 (patch) | |
tree | 7e85c8c55d92dafcb717f9153a713fa0a1e2973c | |
parent | Add some love, er I mean, add the love world server, coz love makes the world... (diff) | |
download | SledjHamr-bc57556575d79ed64e9d2b7978fb409397adb522.zip SledjHamr-bc57556575d79ed64e9d2b7978fb409397adb522.tar.gz SledjHamr-bc57556575d79ed64e9d2b7978fb409397adb522.tar.bz2 SledjHamr-bc57556575d79ed64e9d2b7978fb409397adb522.tar.xz |
Major new TODO details - get llDialog() from the MLP scripts to actually work.
-rw-r--r-- | docs/README.LuaSL | 240 |
1 files changed, 239 insertions, 1 deletions
diff --git a/docs/README.LuaSL b/docs/README.LuaSL index 1444948..56adf12 100644 --- a/docs/README.LuaSL +++ b/docs/README.LuaSL | |||
@@ -61,7 +61,7 @@ forever processing any event. | |||
61 | 61 | ||
62 | Some form of serialization will need to be created for saving script | 62 | Some form of serialization will need to be created for saving script |
63 | state during shutdowns, passing script state to other threads / | 63 | state during shutdowns, passing script state to other threads / |
64 | processes / computers. Aparently Lua is good at this. | 64 | processes / computers. Apparently Lua is good at this. |
65 | 65 | ||
66 | There will have to be a MySQL (and maybe SQLite) client in the system, | 66 | There will have to be a MySQL (and maybe SQLite) client in the system, |
67 | so we can talk directly to the local sim database. Esskyuehl may be | 67 | so we can talk directly to the local sim database. Esskyuehl may be |
@@ -98,3 +98,241 @@ etc. | |||
98 | Performance testing will have to be done on 5000 scripts, to see how | 98 | Performance testing will have to be done on 5000 scripts, to see how |
99 | that compares against XEngine. | 99 | that compares against XEngine. |
100 | 100 | ||
101 | |||
102 | The next goal. | ||
103 | -------------- | ||
104 | |||
105 | The next goal is to support llDialog() in extantz. Extantz has enough | ||
106 | GUI infrastructure now to support a window with a bunch of buttons. | ||
107 | LuaLSL has always used MLP as the test scripts, which in turn reads some | ||
108 | note cards and pops up llDialog to suit. I think I have enough bits to | ||
109 | get this all linked up, or at least start to, and see what missing bits | ||
110 | there are. | ||
111 | |||
112 | |||
113 | Just off the top of my head - | ||
114 | ----------------------------- | ||
115 | |||
116 | MLP uses llGetInventory*() functions to find out what note cards are in | ||
117 | the objects inventory. Then uses llGetNotecardLine() to read the | ||
118 | notecards. In response, the server sends dataserver events with each | ||
119 | line, and the system loops until all lines are read. | ||
120 | |||
121 | MLP sets up a listener with llListen(), then uses llDialog() to send a | ||
122 | "menu" to the client. The client sends a channel message back to the | ||
123 | server when the user makes a choice. These go to the listen event. | ||
124 | |||
125 | |||
126 | In "reality" - | ||
127 | -------------- | ||
128 | |||
129 | LuaSL | ||
130 | starts up | ||
131 | opens an Ecore_Con TCP server at 127.0.0.1:8211 | ||
132 | sets up the compiler | ||
133 | starts luaproc worker thread system | ||
134 | waits for input | ||
135 | compile() -> compile the script, report warnings and errors | ||
136 | run() -> create new Lua state, put it on the worker queue | ||
137 | exit() -> shutdown | ||
138 | * -> send to SID Lua state | ||
139 | |||
140 | LuaSL_test | ||
141 | starts up | ||
142 | connects to LuaSL server | ||
143 | loops through Test sim/objects looking for *.lsl | ||
144 | generates random SID | ||
145 | sends "SID compile file.lsl" to LuaSL | ||
146 | deal with returned results | ||
147 | PW warnings | ||
148 | PE errors | ||
149 | if compiled send "SID run()" to LuaSL | ||
150 | for various llGet*() functions, return random data to LuaSL | ||
151 | This includes the llGetInventory*() functions mentioned above. | ||
152 | waits for a few seconds | ||
153 | sends pretend touch events to LuaSL | ||
154 | sends quit() to LuaSL | ||
155 | sends exit() to LuaSL | ||
156 | |||
157 | Test sim/objects | ||
158 | onefangs test bed | ||
159 | the usual MLP style scripts | ||
160 | .MENUITEMS | ||
161 | .POSITIONS | ||
162 | ball object | ||
163 | |||
164 | MLP | ||
165 | ~run | ||
166 | llSay() to balls telling left over ones to die | ||
167 | llGetOwner() | ||
168 | loop through an internal list of script names | ||
169 | llGetInventoryType() to check if they are there and are scripts. | ||
170 | llSetScriptState() to stop them | ||
171 | llResetOtherScript() | ||
172 | llOwnerSay() to let owner know MLP is turned off | ||
173 | |||
174 | touch_start() | ||
175 | llDetectedKey() to check if it's the owner (current version of MLP doesn't do this) | ||
176 | switch to run state | ||
177 | |||
178 | run state | ||
179 | loop through scripts again, turning them on this time. | ||
180 | |||
181 | |||
182 | ~memory | ||
183 | llGetInventoryNumber() to count the notecards | ||
184 | llGetInventoryName() to find .POSITIONS cards | ||
185 | llGetNoteCardLine() | ||
186 | |||
187 | dataserver() | ||
188 | llGetNoteCardLine() | ||
189 | change to state on when finished | ||
190 | |||
191 | on state | ||
192 | llMessageLinked() | ||
193 | |||
194 | link_message() | ||
195 | llWhisper() | ||
196 | |||
197 | |||
198 | ~menucfg | ||
199 | Same as ~memory. | ||
200 | llGetScriptName() | ||
201 | llGetFreeMemory() | ||
202 | |||
203 | |||
204 | ~menu | ||
205 | llSetTimerEvent() - NOTE doesn't actually setup a timer in the default state. | ||
206 | llSleep() | ||
207 | |||
208 | link_message() | ||
209 | llGetLinkNumber() | ||
210 | switch to state on | ||
211 | |||
212 | on state | ||
213 | llGetKey() to figure out it's channel | ||
214 | llListen() | ||
215 | |||
216 | listen() | ||
217 | llSameGroup() | ||
218 | llDialog() | ||
219 | llResetTime() | ||
220 | |||
221 | link_message() | ||
222 | |||
223 | touch_start() | ||
224 | llDetectedKey() | ||
225 | llDetectedGroup() | ||
226 | |||
227 | timer() | ||
228 | |||
229 | Not to mention copius use of list and string functions. | ||
230 | |||
231 | |||
232 | LSL.Lua | ||
233 | All event stuff is hooked up. | ||
234 | events.detected*(list) is all hooked up to save the list in detected* tables. | ||
235 | llDetected*() functions return those tables. | ||
236 | |||
237 | copius list functions implemented, though there's a TODO about negative indexes. Dunno which ones are missing. | ||
238 | |||
239 | String functions implemented. Actually only llGetSubString() and llSubStringIndex() | ||
240 | |||
241 | llGetScriptName() implemented. | ||
242 | |||
243 | State changes implemented, with a TODO about clearing out pending events. | ||
244 | |||
245 | |||
246 | Not implemented - | ||
247 | llSay + friends, including llOwnerSay(). | ||
248 | llGetOwner() | ||
249 | llGetInventory*() | ||
250 | llGetInventoryType() faked to just return script. | ||
251 | llSetScriptState() and llResetOtherScript() | ||
252 | llResetTime() | ||
253 | llGetNoteCardLine() | ||
254 | llMessageLinked() | ||
255 | llGetFreeMemory() | ||
256 | llSleep() - sorta, not sure how the comment there makes sense. lol | ||
257 | llSetTimerEvent() | ||
258 | llGetLinkNumber() | ||
259 | llGetKey() | ||
260 | llDialog() | ||
261 | llListen() | ||
262 | llSameGroup() | ||
263 | |||
264 | |||
265 | Uses newFunc() to create all the LSL functions. | ||
266 | If there is no return type then sends function and arguments to LuaSL's client. | ||
267 | If there is a return type then sends function and arguments to LuaSL"s client, then waits for the response. | ||
268 | response should be a Lua value as a string. It gets pcall()'d | ||
269 | If we implement a function ourselves, then we override the newFunc created definition with our own function. | ||
270 | |||
271 | |||
272 | Uses waitAndProcess() as the main loop, or to wait for responses. | ||
273 | Which just runs what ever Lua strings are sent to us from the LuaSL client, unless it's waiting for a response above. | ||
274 | |||
275 | |||
276 | What needs to be done - | ||
277 | ----------------------- | ||
278 | |||
279 | Extantz fires up love, which in turn fires up LuaSL. Love then | ||
280 | basically does what LuaSL_test does, sending it scripts to compile and | ||
281 | run from test sim/objects. Except for the timed fake events. | ||
282 | |||
283 | Generate touch events when user touchs the 3D cube. It will pretend to be | ||
284 | the "onefang's test bed" object. Fake up llDetected* stuff. | ||
285 | |||
286 | extantz -> love -> LuaSL | ||
287 | |||
288 | |||
289 | Respond to llSay() and friends by putting them in purkle's history box. | ||
290 | With time stamps. | ||
291 | |||
292 | LuaSL -> love -> extantz | ||
293 | |||
294 | |||
295 | Fake llGetOwner(), llGetFreeMemory(), and llSameGroup(). | ||
296 | |||
297 | LuaSL -> love -> LuaSL | ||
298 | |||
299 | |||
300 | Fake llGetLinkNumber() and llGetKey()? | ||
301 | |||
302 | LuaSL -> love -> LuaSL | ||
303 | |||
304 | |||
305 | Implement llGetInventory*() by actually looking at the files in the | ||
306 | "object". While we could hard code where the "object" is, since we are | ||
307 | starting the run ourselves, we can track which object the scripts are | ||
308 | in. Again, this should be in the love server part. | ||
309 | |||
310 | LuaSL -> love -> LuaSL | ||
311 | |||
312 | |||
313 | Implement llSetScriptState() and friends. Perhaps they should be | ||
314 | implemented in LuaSL? Though they need to know what other scripts are | ||
315 | in the "object", so perhaps not? Do them in love for now. | ||
316 | |||
317 | LuaSL (maybe with a round trip to love as well) | ||
318 | |||
319 | |||
320 | Implement llSleep(), llSetTimerEvent, and generate timer() events. | ||
321 | |||
322 | LuaSL only. | ||
323 | |||
324 | |||
325 | Implement llGetNotecardLine() and generate dataserver() events. | ||
326 | |||
327 | LuaSL -> love | ||
328 | |||
329 | |||
330 | Implement llMessageLink() and generate link_message() events. | ||
331 | |||
332 | LuaSL (maybe with a round trip to love as well) | ||
333 | |||
334 | |||
335 | Implement llListen(), llDialog() and generate listen() events. | ||
336 | |||
337 | LuaSL -> love -> extantz -> love -> LuaSL | ||
338 | |||