corrade-lsl-templates – Diff between revs 25 and 26
?pathlinks?
Rev 25 | Rev 26 | |||
---|---|---|---|---|
Line 265... | Line 265... | |||
265 | if(wasKeyValueGet("command", body) != "version" || |
265 | if(wasKeyValueGet("command", body) != "version" || |
|
266 | wasKeyValueGet("success", body) != "True") { |
266 | wasKeyValueGet("success", body) != "True") { |
|
267 | llOwnerSay("Version check failed..."); |
267 | llOwnerSay("Version check failed..."); |
|
268 | return; |
268 | return; |
|
269 | } |
269 | } |
|
270 | list v = llParseString2List( |
270 | list corradeVersion = llParseString2List( |
|
271 | wasKeyValueGet( |
271 | wasKeyValueGet( |
|
272 | "data", |
272 | "data", |
|
273 | body |
273 | body |
|
274 | ), |
274 | ), |
|
275 | ["."], |
275 | ["."], |
|
276 | [] |
276 | [] |
|
277 | ); |
277 | ); |
|
278 | integer receivedVersion = (integer)(llList2String(v, 0) + llList2String(v, 1)); |
278 | //integer receivedVersion = (integer)(llList2String(v, 0) + llList2String(v, 1)); |
|
279 | v = llParseString2List( |
279 | list notecardVersion = llParseString2List( |
|
280 | wasKeyValueGet( |
280 | wasKeyValueGet( |
|
281 | "version", |
281 | "version", |
|
282 | configuration |
282 | configuration |
|
283 | ), |
283 | ), |
|
284 | ["."], |
284 | ["."], |
|
285 | [] |
285 | [] |
|
286 | ); |
286 | ); |
|
- | 287 | //llOwnerSay((string)receivedVersion); |
||
287 | integer notecardVersion = (integer)(llList2String(v, 0) + llList2String(v, 1)); |
288 | //integer notecardVersion = (integer)(llList2String(v, 0) + llList2String(v, 1)); |
|
288 | if(receivedVersion < notecardVersion) { |
289 | if(llList2Integer(corradeVersion, 0) >= llList2Integer(notecardVersion, 0) || llList2Integer(corradeVersion, 1) >= llList2Integer(notecardVersion, 1)) { |
|
289 | llOwnerSay("HUD version is incompatible! You need a Corrade of at least version: " + |
290 | llOwnerSay("Version is compatible. Deploying HUD..."); |
|
290 | wasKeyValueGet( |
- | ||
291 | "version", |
- | ||
292 | configuration |
- | ||
293 | ) + |
- | ||
294 | " for this HUD." |
- | ||
295 | ); |
- | ||
296 | llMessageLinked(LINK_SET, 0, "retract", NULL_KEY); |
291 | llMessageLinked(LINK_SET, 0, "deploy", NULL_KEY); |
|
297 | open = FALSE; |
292 | open = TRUE; |
|
298 | return; |
293 | return; |
|
299 | } |
294 | } |
|
300 | llOwnerSay("Version is compatible. Deploying HUD..."); |
295 | llOwnerSay("HUD version is incompatible! You need a Corrade of at least version: " + |
|
- | 296 | wasKeyValueGet( |
||
- | 297 | "version", |
||
- | 298 | configuration |
||
- | 299 | ) + |
||
- | 300 | " for this HUD." |
||
- | 301 | ); |
||
301 | llMessageLinked(LINK_SET, 0, "deploy", NULL_KEY); |
302 | llMessageLinked(LINK_SET, 0, "retract", NULL_KEY); |
|
302 | open = TRUE; |
303 | open = FALSE; |
|
303 | return; |
304 | return; |
|
304 | } |
305 | } |
|
305 | link_message(integer sender, integer num, string message, key id) { |
306 | link_message(integer sender, integer num, string message, key id) { |
|
306 | if(message != "configuration") return; |
307 | if(message != "configuration") return; |
|
307 | llMessageLinked(sender, 0, wasKeyValueEncode(tuples), "configuration"); |
308 | llMessageLinked(sender, 0, wasKeyValueEncode(tuples), "configuration"); |