corrade-lsl-templates – Diff between revs 11 and 15
?pathlinks?
Rev 11 | Rev 15 | |||
---|---|---|---|---|
Line 180... | Line 180... | |||
180 | // store message over state. |
180 | // store message over state. |
|
181 | string data = ""; |
181 | string data = ""; |
|
182 | // banee |
182 | // banee |
|
183 | string firstname = ""; |
183 | string firstname = ""; |
|
184 | string lastname = ""; |
184 | string lastname = ""; |
|
- | 185 | string soft = "True"; |
||
Line 185... | Line 186... | |||
185 | |
186 | |
|
186 | default { |
187 | default { |
|
187 | state_entry() { |
188 | state_entry() { |
|
188 | llOwnerSay("[Ban] Starting..."); |
189 | llOwnerSay("[Ban] Starting..."); |
|
Line 239... | Line 240... | |||
239 | if(llGetSubString(data, 0, 0) != |
240 | if(llGetSubString(data, 0, 0) != |
|
240 | wasKeyValueGet("command", configuration)) |
241 | wasKeyValueGet("command", configuration)) |
|
241 | return; |
242 | return; |
|
Line 242... | Line 243... | |||
242 | |
243 | |
|
243 | // Check if the command matches the current module. |
244 | // Check if the command matches the current module. |
|
244 | list command = llParseString2List(data, |
245 | list command = llParseString2List(data, [" "], []); |
|
245 | [wasKeyValueGet("command", configuration), " "], ["@"]); |
246 | if(llList2String(command, 0) != |
|
246 | if(llList2String(command, 0) != "ban") |
247 | wasKeyValueGet("command", configuration) + "ban") |
|
Line -... | Line 248... | |||
- | 248 | return; |
||
- | 249 | |
||
- | 250 | // Remove command. |
||
247 | return; |
251 | command = llDeleteSubList(command, 0, 0); |
|
248 | |
252 | |
|
Line 249... | Line 253... | |||
249 | firstname = wasKeyValueGet("firstname", message); |
253 | firstname = wasKeyValueGet("firstname", message); |
|
250 | lastname = wasKeyValueGet("lastname", message); |
254 | lastname = wasKeyValueGet("lastname", message); |
|
251 | |
255 | |
|
252 | if(firstname == "" || lastname == "") { |
256 | if(firstname == "" || lastname == "") { |
|
253 | data = "And who would yarr be?"; |
257 | data = "And who would yarr be?"; |
|
254 | state tell; |
- | ||
255 | } |
- | ||
256 | |
- | ||
257 | // Remove command. |
258 | state tell; |
|
258 | command = llDeleteSubList(command, 0, 0); |
259 | } |
|
Line 259... | Line 260... | |||
259 | |
260 | |
|
260 | // Dump the rest of the message. |
261 | // Dump the rest of the message. |
|
Line 368... | Line 369... | |||
368 | } |
369 | } |
|
Line 369... | Line 370... | |||
369 | |
370 | |
|
Line 370... | Line 371... | |||
370 | list banee = llParseString2List(data, [" "], []); |
371 | list banee = llParseString2List(data, [" "], []); |
|
- | 372 | |
||
371 | |
373 | firstname = llList2String(banee, 0); |
|
- | 374 | banee = llDeleteSubList(banee, 0, 0); |
||
Line 372... | Line 375... | |||
372 | firstname = llList2String(banee, 0); |
375 | lastname = llList2String(banee, 0); |
|
373 | lastname = llList2String(banee, 1); |
376 | banee = llDeleteSubList(banee, 0, 0); |
|
374 | |
377 | |
|
375 | if(firstname == "" || lastname == "") { |
378 | if(firstname == "" || lastname == "") { |
|
Line -... | Line 379... | |||
- | 379 | data = "Full name required."; |
||
- | 380 | state tell; |
||
- | 381 | } |
||
- | 382 | |
||
- | 383 | if(llGetListLength(banee) != 0 && |
||
- | 384 | llToLower(llList2String(banee, 0)) == "nosoft") { |
||
376 | data = "Full name required."; |
385 | soft = "False"; |
|
377 | state tell; |
386 | banee = llDeleteSubList(banee, 0, 0); |
|
378 | } |
387 | } |
|
379 | |
388 | |
|
380 | // GC |
389 | // GC |
|
Line 434... | Line 443... | |||
434 | } |
443 | } |
|
435 | http_request(key id, string method, string body) { |
444 | http_request(key id, string method, string body) { |
|
436 | llHTTPResponse(id, 200, "OK"); |
445 | llHTTPResponse(id, 200, "OK"); |
|
437 | if(wasKeyValueGet("command", body) != "getmemberroles" || |
446 | if(wasKeyValueGet("command", body) != "getmemberroles" || |
|
438 | wasKeyValueGet("success", body) != "True") { |
447 | wasKeyValueGet("success", body) != "True") { |
|
- | 448 | if(wasKeyValueGet("status", body) == "19862") { |
||
- | 449 | // DEBUG |
||
- | 450 | llOwnerSay("[Ban] User not in group, but proceeding anyway..."); |
||
- | 451 | jump continue; |
||
- | 452 | } |
||
439 | // DEBUG |
453 | // DEBUG |
|
440 | llOwnerSay("[Ban] Unable to get member roles: " + |
454 | llOwnerSay("[Ban] Unable to get member roles: " + |
|
441 | wasURLUnescape( |
455 | wasURLUnescape( |
|
442 | wasKeyValueGet("error", body) |
456 | wasKeyValueGet("error", body) |
|
443 | ) |
457 | ) |
|
444 | ); |
458 | ); |
|
445 | llReleaseURL(URL); |
459 | llReleaseURL(URL); |
|
446 | state listen_group; |
460 | state listen_group; |
|
447 | } |
461 | } |
|
Line -... | Line 462... | |||
- | 462 | |
||
448 | |
463 | @continue; |
|
449 | string result = wasURLUnescape( |
464 | string result = wasURLUnescape( |
|
450 | wasKeyValueGet("data", body) |
465 | wasKeyValueGet("data", body) |
|
Line 451... | Line 466... | |||
451 | ); |
466 | ); |
|
452 | |
467 | |
|
453 | if(result != "" && llListFindList(wasCSVToList(result), (list)"Owners") != -1) { |
468 | if(result != "" && llListFindList(wasCSVToList(result), (list)"Owners") != -1) { |
|
454 | data = "Ejectee is an owner. I'm not gonna open the pod bay doors."; |
469 | data = "Ejectee is an owner. I'm not gunna open the pod bay doors."; |
|
455 | llReleaseURL(URL); |
470 | llReleaseURL(URL); |
|
Line 456... | Line 471... | |||
456 | state tell; |
471 | state tell; |
|
Line 499... | Line 514... | |||
499 | wasKeyValueGet( |
514 | wasKeyValueGet( |
|
500 | "password", |
515 | "password", |
|
501 | configuration |
516 | configuration |
|
502 | ) |
517 | ) |
|
503 | ), |
518 | ), |
|
- | 519 | "soft", soft, |
||
504 | "action", "ban", |
520 | "action", "ban", |
|
505 | "avatars", wasURLEscape( |
521 | "avatars", wasURLEscape( |
|
506 | wasListToCSV( |
522 | wasListToCSV( |
|
507 | [ |
523 | [ |
|
508 | firstname + " " + lastname |
524 | firstname + " " + lastname |
|
Line 580... | Line 596... | |||
580 | "entity", "group", |
596 | "entity", "group", |
|
581 | "message", wasURLEscape(data) |
597 | "message", wasURLEscape(data) |
|
582 | ] |
598 | ] |
|
583 | ) |
599 | ) |
|
584 | ); |
600 | ); |
|
- | 601 | |
||
- | 602 | // reset variables. |
||
- | 603 | soft = "True"; |
||
- | 604 | |
||
585 | state listen_group; |
605 | state listen_group; |
|
586 | } |
606 | } |
|
587 | } |
607 | } |