diff options
author | Justin Clarke Casey | 2008-10-09 18:59:01 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-09 18:59:01 +0000 |
commit | 997f1d465d9eccf6854daa0ee476c05aeb5856f3 (patch) | |
tree | 1e1febf5c3bf85a8af09f44ce11676ac53f5b039 | |
parent | Clean up webmap-generation a bit: (diff) | |
download | opensim-SC-997f1d465d9eccf6854daa0ee476c05aeb5856f3.zip opensim-SC-997f1d465d9eccf6854daa0ee476c05aeb5856f3.tar.gz opensim-SC-997f1d465d9eccf6854daa0ee476c05aeb5856f3.tar.bz2 opensim-SC-997f1d465d9eccf6854daa0ee476c05aeb5856f3.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=2370
* Refactor lLMessageLinked() to use internal method GetLinkParts
* thanks ralphos
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 180 |
1 files changed, 16 insertions, 164 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a33b5cf..a2c82cf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3419,179 +3419,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3419 | return String.Empty; | 3419 | return String.Empty; |
3420 | } | 3420 | } |
3421 | 3421 | ||
3422 | public void llMessageLinked(int linknum, int num, string msg, string id) | 3422 | public void llMessageLinked(int linknumber, int num, string msg, string id) |
3423 | { | 3423 | { |
3424 | |||
3425 | m_host.AddScriptLPS(1); | 3424 | m_host.AddScriptLPS(1); |
3426 | 3425 | ||
3427 | // uint partLocalID; | 3426 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
3428 | UUID partItemID; | ||
3429 | |||
3430 | switch ((int)linknum) | ||
3431 | { | ||
3432 | |||
3433 | case (int)ScriptBaseClass.LINK_ROOT: | ||
3434 | |||
3435 | SceneObjectPart part = m_host.ParentGroup.RootPart; | ||
3436 | |||
3437 | foreach (TaskInventoryItem item in part.TaskInventory.Values) | ||
3438 | { | ||
3439 | if (item.Type == 10) | ||
3440 | { | ||
3441 | // partLocalID = part.LocalId; | ||
3442 | partItemID = item.ItemID; | ||
3443 | |||
3444 | object[] resobj = new object[] | ||
3445 | { | ||
3446 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3447 | }; | ||
3448 | |||
3449 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3450 | new EventParams("link_message", | ||
3451 | resobj, new DetectParams[0])); | ||
3452 | } | ||
3453 | } | ||
3454 | |||
3455 | break; | ||
3456 | |||
3457 | case (int)ScriptBaseClass.LINK_SET: | ||
3458 | |||
3459 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | ||
3460 | { | ||
3461 | |||
3462 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | ||
3463 | { | ||
3464 | if (item.Type == 10) | ||
3465 | { | ||
3466 | // partLocalID = partInst.LocalId; | ||
3467 | partItemID = item.ItemID; | ||
3468 | Object[] resobj = new object[] | ||
3469 | { | ||
3470 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3471 | }; | ||
3472 | |||
3473 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3474 | new EventParams("link_message", | ||
3475 | resobj, new DetectParams[0])); | ||
3476 | } | ||
3477 | } | ||
3478 | } | ||
3479 | |||
3480 | break; | ||
3481 | |||
3482 | case (int)ScriptBaseClass.LINK_ALL_OTHERS: | ||
3483 | |||
3484 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | ||
3485 | { | ||
3486 | |||
3487 | if (partInst.LocalId != m_host.LocalId) | ||
3488 | { | ||
3489 | |||
3490 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | ||
3491 | { | ||
3492 | if (item.Type == 10) | ||
3493 | { | ||
3494 | // partLocalID = partInst.LocalId; | ||
3495 | partItemID = item.ItemID; | ||
3496 | Object[] resobj = new object[] | ||
3497 | { | ||
3498 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3499 | }; | ||
3500 | |||
3501 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3502 | new EventParams("link_message", | ||
3503 | resobj, new DetectParams[0])); | ||
3504 | } | ||
3505 | } | ||
3506 | |||
3507 | } | ||
3508 | } | ||
3509 | |||
3510 | break; | ||
3511 | |||
3512 | case (int)ScriptBaseClass.LINK_ALL_CHILDREN: | ||
3513 | |||
3514 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | ||
3515 | { | ||
3516 | |||
3517 | if (partInst.LocalId != m_host.ParentGroup.RootPart.LocalId) | ||
3518 | { | ||
3519 | |||
3520 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | ||
3521 | { | ||
3522 | if (item.Type == 10) | ||
3523 | { | ||
3524 | // partLocalID = partInst.LocalId; | ||
3525 | partItemID = item.ItemID; | ||
3526 | Object[] resobj = new object[] | ||
3527 | { | ||
3528 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3529 | }; | ||
3530 | |||
3531 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3532 | new EventParams("link_message", | ||
3533 | resobj, new DetectParams[0])); | ||
3534 | } | ||
3535 | } | ||
3536 | |||
3537 | } | ||
3538 | } | ||
3539 | |||
3540 | break; | ||
3541 | |||
3542 | case (int)ScriptBaseClass.LINK_THIS: | ||
3543 | |||
3544 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | ||
3545 | { | ||
3546 | if (item.Type == 10) | ||
3547 | { | ||
3548 | partItemID = item.ItemID; | ||
3549 | |||
3550 | object[] resobj = new object[] | ||
3551 | { | ||
3552 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3553 | }; | ||
3554 | |||
3555 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3556 | new EventParams("link_message", | ||
3557 | resobj, new DetectParams[0])); | ||
3558 | } | ||
3559 | } | ||
3560 | |||
3561 | break; | ||
3562 | |||
3563 | default: | ||
3564 | 3427 | ||
3565 | foreach (SceneObjectPart partInst in m_host.ParentGroup.GetParts()) | 3428 | UUID partItemID; |
3429 | foreach (SceneObjectPart part in parts) | ||
3430 | foreach (TaskInventoryItem item in part.TaskInventory.Values) | ||
3431 | { | ||
3432 | if (item.Type == ScriptBaseClass.INVENTORY_SCRIPT) | ||
3566 | { | 3433 | { |
3567 | 3434 | ||
3568 | if ((partInst.LinkNum) == linknum) | 3435 | partItemID = item.ItemID; |
3569 | { | ||
3570 | 3436 | ||
3571 | foreach (TaskInventoryItem item in partInst.TaskInventory.Values) | 3437 | object[] resobj = new object[] |
3572 | { | 3438 | { |
3573 | if (item.Type == 10) | 3439 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) |
3574 | { | 3440 | }; |
3575 | // partLocalID = partInst.LocalId; | ||
3576 | partItemID = item.ItemID; | ||
3577 | Object[] resObjDef = new object[] | ||
3578 | { | ||
3579 | new LSL_Integer(m_host.LinkNum), new LSL_Integer(num), new LSL_String(msg), new LSL_String(id) | ||
3580 | }; | ||
3581 | |||
3582 | m_ScriptEngine.PostScriptEvent(partItemID, | ||
3583 | new EventParams("link_message", | ||
3584 | resObjDef, new DetectParams[0])); | ||
3585 | } | ||
3586 | } | ||
3587 | 3441 | ||
3588 | } | 3442 | m_ScriptEngine.PostScriptEvent(partItemID, |
3443 | new EventParams("link_message", | ||
3444 | resobj, new DetectParams[0])); | ||
3589 | } | 3445 | } |
3590 | 3446 | } | |
3591 | break; | ||
3592 | |||
3593 | } | ||
3594 | |||
3595 | } | 3447 | } |
3596 | 3448 | ||
3597 | public void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local) | 3449 | public void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local) |