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("[Unban] Starting..."); |
189 | llOwnerSay("[Unban] 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) != "unban") |
247 | wasKeyValueGet("command", configuration) + "unban") |
|
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 == "") { |
|
Line 253... | Line -... | |||
253 | data = "And who would yarr be?"; |
- | ||
254 | state tell; |
- | ||
255 | } |
- | ||
256 | |
257 | data = "And who would yarr be?"; |
|
257 | // Remove command. |
258 | state tell; |
|
Line 258... | Line 259... | |||
258 | command = llDeleteSubList(command, 0, 0); |
259 | } |
|
259 | |
260 | |
|
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("[Unban] User not in group, but proceeding anyway..."); |
||
- | 451 | jump continue; |
||
- | 452 | } |
||
439 | // DEBUG |
453 | // DEBUG |
|
440 | llOwnerSay("[Unban] Unable to get member roles: " + |
454 | llOwnerSay("[Unban] Unable to get member roles: " + |
|
441 | wasURLUnescape( |
455 | wasURLUnescape( |
|
442 | wasKeyValueGet("error", body) |
456 | wasKeyValueGet("error", body) |
|
443 | ) |
457 | ) |
|
Line 454... | Line 468... | |||
454 | data = "Ejectee is an owner. I'm not gonna open the pod bay doors."; |
468 | data = "Ejectee is an owner. I'm not gonna open the pod bay doors."; |
|
455 | llReleaseURL(URL); |
469 | llReleaseURL(URL); |
|
456 | state tell; |
470 | state tell; |
|
457 | } |
471 | } |
|
Line -... | Line 472... | |||
- | 472 | |
||
- | 473 | @continue; |
||
458 | |
474 | |
|
459 | state ban; |
475 | state unban; |
|
460 | } |
476 | } |
|
461 | timer() { |
477 | timer() { |
|
462 | llReleaseURL(URL); |
478 | llReleaseURL(URL); |
|
463 | state listen_group; |
479 | state listen_group; |
|
Line 475... | Line 491... | |||
475 | state_exit() { |
491 | state_exit() { |
|
476 | llSetTimerEvent(0); |
492 | llSetTimerEvent(0); |
|
477 | } |
493 | } |
|
478 | } |
494 | } |
|
Line 479... | Line 495... | |||
479 | |
495 | |
|
480 | state ban { |
496 | state unban { |
|
481 | state_entry() { |
497 | state_entry() { |
|
482 | // DEBUG |
498 | // DEBUG |
|
483 | llOwnerSay("[Unban] Unbanning..."); |
499 | llOwnerSay("[Unban] Unbanning..."); |
|
484 | llInstantMessage( |
500 | llInstantMessage( |
|
485 | wasKeyValueGet( |
501 | wasKeyValueGet( |
|
486 | "corrade", |
502 | "corrade", |
|
487 | configuration |
503 | configuration |
|
488 | ), |
504 | ), |
|
489 | wasKeyValueEncode( |
505 | wasKeyValueEncode( |
|
490 | [ |
506 | [ |
|
491 | "command", "unban", |
507 | "command", "ban", |
|
492 | "group", wasURLEscape( |
508 | "group", wasURLEscape( |
|
493 | wasKeyValueGet( |
509 | wasKeyValueGet( |
|
494 | "group", |
510 | "group", |
|
495 | configuration |
511 | configuration |
|
Line 499... | Line 515... | |||
499 | wasKeyValueGet( |
515 | wasKeyValueGet( |
|
500 | "password", |
516 | "password", |
|
501 | configuration |
517 | configuration |
|
502 | ) |
518 | ) |
|
503 | ), |
519 | ), |
|
- | 520 | "soft", soft, |
||
504 | "action", "unban", |
521 | "action", "unban", |
|
505 | "avatars", wasURLEscape( |
522 | "avatars", wasURLEscape( |
|
506 | wasListToCSV( |
523 | wasListToCSV( |
|
507 | [ |
524 | [ |
|
508 | firstname + " " + lastname |
525 | firstname + " " + lastname |
|
Line 527... | Line 544... | |||
527 | ) |
544 | ) |
|
528 | ); |
545 | ); |
|
529 | state listen_group; |
546 | state listen_group; |
|
530 | } |
547 | } |
|
Line 531... | Line 548... | |||
531 | |
548 | |
|
Line 532... | Line 549... | |||
532 | data = "Hasta la vista, baby!"; |
549 | data = "They'll be bak!"; |
|
533 | |
550 | |
|
534 | state tell; |
551 | state tell; |
|
535 | } |
552 | } |
|
Line 579... | Line 596... | |||
579 | "entity", "group", |
596 | "entity", "group", |
|
580 | "message", wasURLEscape(data) |
597 | "message", wasURLEscape(data) |
|
581 | ] |
598 | ] |
|
582 | ) |
599 | ) |
|
583 | ); |
600 | ); |
|
- | 601 | |
||
- | 602 | // reset variables. |
||
- | 603 | soft = "True"; |
||
- | 604 | |
||
584 | state listen_group; |
605 | state listen_group; |
|
585 | } |
606 | } |
|
586 | } |
607 | } |