diff options
author | Sean Dague | 2008-04-24 12:27:24 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-24 12:27:24 +0000 |
commit | 2a2ef42e64e202c81762adf0cc0e4cb1393f71ef (patch) | |
tree | 20768ffd9610712a51a4cc7f9f0ffbe667fbe2e2 /OpenSim/Region/ScriptEngine/Common | |
parent | * Adds much better support for attachments that you right click on in world. (diff) | |
download | opensim-SC-2a2ef42e64e202c81762adf0cc0e4cb1393f71ef.zip opensim-SC-2a2ef42e64e202c81762adf0cc0e4cb1393f71ef.tar.gz opensim-SC-2a2ef42e64e202c81762adf0cc0e4cb1393f71ef.tar.bz2 opensim-SC-2a2ef42e64e202c81762adf0cc0e4cb1393f71ef.tar.xz |
replace hard tabs with 4 spaces to be consistant in the source.
Please adjust your editors to not use hard tabs.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 384 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | 10 |
2 files changed, 197 insertions, 197 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3778c09..3273023 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
70 | 70 | ||
71 | private DateTime m_timer = DateTime.Now; | 71 | private DateTime m_timer = DateTime.Now; |
72 | private string m_state = "default"; | 72 | private string m_state = "default"; |
73 | private bool m_waitingForScriptAnswer=false; | 73 | private bool m_waitingForScriptAnswer=false; |
74 | 74 | ||
75 | 75 | ||
76 | public string State | 76 | public string State |
@@ -121,50 +121,50 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
121 | return World.GetCommander(name); | 121 | return World.GetCommander(name); |
122 | } | 122 | } |
123 | 123 | ||
124 | private LLUUID InventorySelf() | 124 | private LLUUID InventorySelf() |
125 | { | 125 | { |
126 | LLUUID invItemID=new LLUUID(); | 126 | LLUUID invItemID=new LLUUID(); |
127 | 127 | ||
128 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 128 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
129 | { | 129 | { |
130 | if(inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) | 130 | if(inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) |
131 | { | 131 | { |
132 | invItemID=inv.Key; | 132 | invItemID=inv.Key; |
133 | break; | 133 | break; |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | return invItemID; | 137 | return invItemID; |
138 | } | 138 | } |
139 | 139 | ||
140 | private LLUUID InventoryKey(string name, int type) | 140 | private LLUUID InventoryKey(string name, int type) |
141 | { | 141 | { |
142 | m_host.AddScriptLPS(1); | 142 | m_host.AddScriptLPS(1); |
143 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 143 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
144 | { | 144 | { |
145 | if(inv.Value.Name == name) | 145 | if(inv.Value.Name == name) |
146 | { | 146 | { |
147 | if(inv.Value.Type != type) | 147 | if(inv.Value.Type != type) |
148 | return LLUUID.Zero; | 148 | return LLUUID.Zero; |
149 | 149 | ||
150 | return inv.Value.AssetID.ToString(); | 150 | return inv.Value.AssetID.ToString(); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | return LLUUID.Zero; | 153 | return LLUUID.Zero; |
154 | } | 154 | } |
155 | 155 | ||
156 | private LLUUID InventoryKey(string name) | 156 | private LLUUID InventoryKey(string name) |
157 | { | 157 | { |
158 | m_host.AddScriptLPS(1); | 158 | m_host.AddScriptLPS(1); |
159 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) | 159 | foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) |
160 | { | 160 | { |
161 | if(inv.Value.Name == name) | 161 | if(inv.Value.Name == name) |
162 | { | 162 | { |
163 | return inv.Value.AssetID.ToString(); | 163 | return inv.Value.AssetID.ToString(); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | return LLUUID.Zero; | 166 | return LLUUID.Zero; |
167 | } | 167 | } |
168 | 168 | ||
169 | //These are the implementations of the various ll-functions used by the LSL scripts. | 169 | //These are the implementations of the various ll-functions used by the LSL scripts. |
170 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 | 170 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 |
@@ -947,15 +947,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
947 | { | 947 | { |
948 | m_host.AddScriptLPS(1); | 948 | m_host.AddScriptLPS(1); |
949 | 949 | ||
950 | LLUUID textureID=new LLUUID(); | 950 | LLUUID textureID=new LLUUID(); |
951 | 951 | ||
952 | if(!LLUUID.TryParse(texture, out textureID)) | 952 | if(!LLUUID.TryParse(texture, out textureID)) |
953 | { | 953 | { |
954 | textureID=InventoryKey(texture, (int)AssetType.Texture); | 954 | textureID=InventoryKey(texture, (int)AssetType.Texture); |
955 | } | 955 | } |
956 | 956 | ||
957 | if(textureID == LLUUID.Zero) | 957 | if(textureID == LLUUID.Zero) |
958 | return; | 958 | return; |
959 | 959 | ||
960 | LLObject.TextureEntry tex = m_host.Shape.Textures; | 960 | LLObject.TextureEntry tex = m_host.Shape.Textures; |
961 | 961 | ||
@@ -1610,41 +1610,41 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1610 | 1610 | ||
1611 | public int llGiveMoney(string destination, int amount) | 1611 | public int llGiveMoney(string destination, int amount) |
1612 | { | 1612 | { |
1613 | LLUUID invItemID=InventorySelf(); | 1613 | LLUUID invItemID=InventorySelf(); |
1614 | if(invItemID == LLUUID.Zero) | 1614 | if(invItemID == LLUUID.Zero) |
1615 | return 0; | 1615 | return 0; |
1616 | 1616 | ||
1617 | m_host.AddScriptLPS(1); | 1617 | m_host.AddScriptLPS(1); |
1618 | 1618 | ||
1619 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 1619 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
1620 | return 0; | 1620 | return 0; |
1621 | 1621 | ||
1622 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0) | 1622 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_DEBIT) == 0) |
1623 | { | 1623 | { |
1624 | LSLError("No permissions to give money"); | 1624 | LSLError("No permissions to give money"); |
1625 | return 0; | 1625 | return 0; |
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | LLUUID toID=new LLUUID(); | 1628 | LLUUID toID=new LLUUID(); |
1629 | 1629 | ||
1630 | if(!LLUUID.TryParse(destination, out toID)) | 1630 | if(!LLUUID.TryParse(destination, out toID)) |
1631 | { | 1631 | { |
1632 | LSLError("Bad key in llGiveMoney"); | 1632 | LSLError("Bad key in llGiveMoney"); |
1633 | return 0; | 1633 | return 0; |
1634 | } | 1634 | } |
1635 | 1635 | ||
1636 | IMoneyModule money=World.RequestModuleInterface<IMoneyModule>(); | 1636 | IMoneyModule money=World.RequestModuleInterface<IMoneyModule>(); |
1637 | 1637 | ||
1638 | if(money == null) | 1638 | if(money == null) |
1639 | { | 1639 | { |
1640 | NotImplemented("llGiveMoney"); | 1640 | NotImplemented("llGiveMoney"); |
1641 | return 0; | 1641 | return 0; |
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | bool result=money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount); | 1644 | bool result=money.ObjectGiveMoney(m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount); |
1645 | 1645 | ||
1646 | if(result) | 1646 | if(result) |
1647 | return 1; | 1647 | return 1; |
1648 | 1648 | ||
1649 | return 0; | 1649 | return 0; |
1650 | } | 1650 | } |
@@ -1883,57 +1883,57 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1883 | { | 1883 | { |
1884 | m_host.AddScriptLPS(1); | 1884 | m_host.AddScriptLPS(1); |
1885 | 1885 | ||
1886 | LLUUID invItemID=InventorySelf(); | 1886 | LLUUID invItemID=InventorySelf(); |
1887 | if(invItemID == LLUUID.Zero) | 1887 | if(invItemID == LLUUID.Zero) |
1888 | return; | 1888 | return; |
1889 | 1889 | ||
1890 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 1890 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
1891 | return; | 1891 | return; |
1892 | 1892 | ||
1893 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) | 1893 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) |
1894 | { | 1894 | { |
1895 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID | 1895 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID |
1896 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); | 1896 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); |
1897 | if(animID == LLUUID.Zero) | 1897 | if(animID == LLUUID.Zero) |
1898 | return; | 1898 | return; |
1899 | 1899 | ||
1900 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 1900 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) |
1901 | { | 1901 | { |
1902 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | 1902 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; |
1903 | presence.AddAnimation(animID); | 1903 | presence.AddAnimation(animID); |
1904 | } | 1904 | } |
1905 | } | 1905 | } |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | public void llStopAnimation(string anim) | 1908 | public void llStopAnimation(string anim) |
1909 | { | 1909 | { |
1910 | m_host.AddScriptLPS(1); | 1910 | m_host.AddScriptLPS(1); |
1911 | 1911 | ||
1912 | LLUUID invItemID=InventorySelf(); | 1912 | LLUUID invItemID=InventorySelf(); |
1913 | if(invItemID == LLUUID.Zero) | 1913 | if(invItemID == LLUUID.Zero) |
1914 | return; | 1914 | return; |
1915 | 1915 | ||
1916 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) | 1916 | if(m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) |
1917 | return; | 1917 | return; |
1918 | 1918 | ||
1919 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) | 1919 | if((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) |
1920 | { | 1920 | { |
1921 | LLUUID animID = new LLUUID(); | 1921 | LLUUID animID = new LLUUID(); |
1922 | 1922 | ||
1923 | if(!LLUUID.TryParse(anim, out animID)) | 1923 | if(!LLUUID.TryParse(anim, out animID)) |
1924 | { | 1924 | { |
1925 | animID=InventoryKey(anim); | 1925 | animID=InventoryKey(anim); |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | if(animID == LLUUID.Zero) | 1928 | if(animID == LLUUID.Zero) |
1929 | return; | 1929 | return; |
1930 | 1930 | ||
1931 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 1931 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) |
1932 | { | 1932 | { |
1933 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | 1933 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; |
1934 | presence.RemoveAnimation(animID); | 1934 | presence.RemoveAnimation(animID); |
1935 | } | 1935 | } |
1936 | } | 1936 | } |
1937 | } | 1937 | } |
1938 | 1938 | ||
1939 | public void llPointAt() | 1939 | public void llPointAt() |
@@ -1972,108 +1972,108 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1972 | 1972 | ||
1973 | public void llRequestPermissions(string agent, int perm) | 1973 | public void llRequestPermissions(string agent, int perm) |
1974 | { | 1974 | { |
1975 | LLUUID agentID=new LLUUID(); | 1975 | LLUUID agentID=new LLUUID(); |
1976 | 1976 | ||
1977 | if(!LLUUID.TryParse(agent, out agentID)) | 1977 | if(!LLUUID.TryParse(agent, out agentID)) |
1978 | return; | 1978 | return; |
1979 | 1979 | ||
1980 | LLUUID invItemID=InventorySelf(); | 1980 | LLUUID invItemID=InventorySelf(); |
1981 | 1981 | ||
1982 | if(invItemID == LLUUID.Zero) | 1982 | if(invItemID == LLUUID.Zero) |
1983 | return; // Not in a prim? How?? | 1983 | return; // Not in a prim? How?? |
1984 | 1984 | ||
1985 | if(agentID == LLUUID.Zero || perm == 0) // Releasing permissions | 1985 | if(agentID == LLUUID.Zero || perm == 0) // Releasing permissions |
1986 | { | 1986 | { |
1987 | m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; | 1987 | m_host.TaskInventory[invItemID].PermsGranter=LLUUID.Zero; |
1988 | m_host.TaskInventory[invItemID].PermsMask=0; | 1988 | m_host.TaskInventory[invItemID].PermsMask=0; |
1989 | 1989 | ||
1990 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 1990 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
1991 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0}); | 1991 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0}); |
1992 | 1992 | ||
1993 | return; | 1993 | return; |
1994 | } | 1994 | } |
1995 | 1995 | ||
1996 | m_host.AddScriptLPS(1); | 1996 | m_host.AddScriptLPS(1); |
1997 | 1997 | ||
1998 | bool attachment=false; // Attachments not implemented yet. TODO: reflect real attachemnt state | 1998 | bool attachment=false; // Attachments not implemented yet. TODO: reflect real attachemnt state |
1999 | 1999 | ||
2000 | if(attachment && agent == m_host.OwnerID) | 2000 | if(attachment && agent == m_host.OwnerID) |
2001 | { | 2001 | { |
2002 | // When attached, certain permissions are implicit if requested from owner | 2002 | // When attached, certain permissions are implicit if requested from owner |
2003 | int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS | | 2003 | int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS | |
2004 | BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | | 2004 | BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | |
2005 | BuiltIn_Commands_BaseClass.PERMISSION_ATTACH; | 2005 | BuiltIn_Commands_BaseClass.PERMISSION_ATTACH; |
2006 | 2006 | ||
2007 | if((perm & (~implicitPerms)) == 0) // Requested only implicit perms | 2007 | if((perm & (~implicitPerms)) == 0) // Requested only implicit perms |
2008 | { | 2008 | { |
2009 | m_host.TaskInventory[invItemID].PermsGranter=agentID; | 2009 | m_host.TaskInventory[invItemID].PermsGranter=agentID; |
2010 | m_host.TaskInventory[invItemID].PermsMask=perm; | 2010 | m_host.TaskInventory[invItemID].PermsMask=perm; |
2011 | 2011 | ||
2012 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 2012 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
2013 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm}); | 2013 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm}); |
2014 | 2014 | ||
2015 | return; | 2015 | return; |
2016 | } | 2016 | } |
2017 | } | 2017 | } |
2018 | else if(m_host.m_sitTargetAvatar == agentID) // Sitting avatar | 2018 | else if(m_host.m_sitTargetAvatar == agentID) // Sitting avatar |
2019 | { | 2019 | { |
2020 | // When agent is sitting, certain permissions are implicit if requested from sitting agent | 2020 | // When agent is sitting, certain permissions are implicit if requested from sitting agent |
2021 | int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | | 2021 | int implicitPerms = BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION | |
2022 | BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA; | 2022 | BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA; |
2023 | 2023 | ||
2024 | if((perm & (~implicitPerms)) == 0) // Requested only implicit perms | 2024 | if((perm & (~implicitPerms)) == 0) // Requested only implicit perms |
2025 | { | 2025 | { |
2026 | m_host.TaskInventory[invItemID].PermsGranter=agentID; | 2026 | m_host.TaskInventory[invItemID].PermsGranter=agentID; |
2027 | m_host.TaskInventory[invItemID].PermsMask=perm; | 2027 | m_host.TaskInventory[invItemID].PermsMask=perm; |
2028 | 2028 | ||
2029 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 2029 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
2030 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm}); | 2030 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm}); |
2031 | 2031 | ||
2032 | return; | 2032 | return; |
2033 | } | 2033 | } |
2034 | } | 2034 | } |
2035 | 2035 | ||
2036 | if (World.m_innerScene.ScenePresences.ContainsKey(agentID)) | 2036 | if (World.m_innerScene.ScenePresences.ContainsKey(agentID)) |
2037 | { | 2037 | { |
2038 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); | 2038 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); |
2039 | if(ownerName == String.Empty) | 2039 | if(ownerName == String.Empty) |
2040 | ownerName="(hippos)"; | 2040 | ownerName="(hippos)"; |
2041 | 2041 | ||
2042 | ScenePresence presence = World.m_innerScene.ScenePresences[agentID]; | 2042 | ScenePresence presence = World.m_innerScene.ScenePresences[agentID]; |
2043 | if(!m_waitingForScriptAnswer) | 2043 | if(!m_waitingForScriptAnswer) |
2044 | { | 2044 | { |
2045 | m_host.TaskInventory[invItemID].PermsGranter=agentID; | 2045 | m_host.TaskInventory[invItemID].PermsGranter=agentID; |
2046 | m_host.TaskInventory[invItemID].PermsMask=0; | 2046 | m_host.TaskInventory[invItemID].PermsMask=0; |
2047 | presence.ControllingClient.OnScriptAnswer+=handleScriptAnswer; | 2047 | presence.ControllingClient.OnScriptAnswer+=handleScriptAnswer; |
2048 | m_waitingForScriptAnswer=true; | 2048 | m_waitingForScriptAnswer=true; |
2049 | } | 2049 | } |
2050 | 2050 | ||
2051 | presence.ControllingClient.SendScriptQuestion(m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm); | 2051 | presence.ControllingClient.SendScriptQuestion(m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm); |
2052 | return; | 2052 | return; |
2053 | } | 2053 | } |
2054 | 2054 | ||
2055 | // Requested agent is not in range, refuse perms | 2055 | // Requested agent is not in range, refuse perms |
2056 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 2056 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
2057 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0}); | 2057 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0}); |
2058 | } | 2058 | } |
2059 | 2059 | ||
2060 | void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) | 2060 | void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer) |
2061 | { | 2061 | { |
2062 | if(taskID != m_host.UUID) | 2062 | if(taskID != m_host.UUID) |
2063 | return; | 2063 | return; |
2064 | 2064 | ||
2065 | LLUUID invItemID=InventorySelf(); | 2065 | LLUUID invItemID=InventorySelf(); |
2066 | 2066 | ||
2067 | if(invItemID == LLUUID.Zero) | 2067 | if(invItemID == LLUUID.Zero) |
2068 | return; | 2068 | return; |
2069 | 2069 | ||
2070 | client.OnScriptAnswer-=handleScriptAnswer; | 2070 | client.OnScriptAnswer-=handleScriptAnswer; |
2071 | m_waitingForScriptAnswer=false; | 2071 | m_waitingForScriptAnswer=false; |
2072 | 2072 | ||
2073 | m_host.TaskInventory[invItemID].PermsMask=answer; | 2073 | m_host.TaskInventory[invItemID].PermsMask=answer; |
2074 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 2074 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
2075 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)answer}); | 2075 | m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)answer}); |
2076 | } | 2076 | } |
2077 | 2077 | ||
2078 | public string llGetPermissionsKey() | 2078 | public string llGetPermissionsKey() |
2079 | { | 2079 | { |
@@ -2083,7 +2083,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2083 | { | 2083 | { |
2084 | if(item.Type == 10 && item.ItemID == m_itemID) | 2084 | if(item.Type == 10 && item.ItemID == m_itemID) |
2085 | { | 2085 | { |
2086 | return item.PermsGranter.ToString(); | 2086 | return item.PermsGranter.ToString(); |
2087 | } | 2087 | } |
2088 | } | 2088 | } |
2089 | 2089 | ||
@@ -2098,7 +2098,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2098 | { | 2098 | { |
2099 | if(item.Type == 10 && item.ItemID == m_itemID) | 2099 | if(item.Type == 10 && item.ItemID == m_itemID) |
2100 | { | 2100 | { |
2101 | return item.PermsMask; | 2101 | return item.PermsMask; |
2102 | } | 2102 | } |
2103 | } | 2103 | } |
2104 | 2104 | ||
@@ -3997,24 +3997,24 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3997 | LSLError("First parameter to llDialog needs to be a key"); | 3997 | LSLError("First parameter to llDialog needs to be a key"); |
3998 | return; | 3998 | return; |
3999 | } | 3999 | } |
4000 | if(buttons.Length > 12) | 4000 | if(buttons.Length > 12) |
4001 | { | 4001 | { |
4002 | LSLError("No more than 12 buttons can be shown"); | 4002 | LSLError("No more than 12 buttons can be shown"); |
4003 | return; | 4003 | return; |
4004 | } | 4004 | } |
4005 | string[] buts = new string[buttons.Length]; | 4005 | string[] buts = new string[buttons.Length]; |
4006 | for(int i = 0; i < buttons.Length; i++) | 4006 | for(int i = 0; i < buttons.Length; i++) |
4007 | { | 4007 | { |
4008 | if(buttons.Data[i].ToString() == String.Empty) | 4008 | if(buttons.Data[i].ToString() == String.Empty) |
4009 | { | 4009 | { |
4010 | LSLError("button label cannot be blank"); | 4010 | LSLError("button label cannot be blank"); |
4011 | return; | 4011 | return; |
4012 | } | 4012 | } |
4013 | if(buttons.Data[i].ToString().Length > 24) | 4013 | if(buttons.Data[i].ToString().Length > 24) |
4014 | { | 4014 | { |
4015 | LSLError("button label cannot be longer than 24 characters"); | 4015 | LSLError("button label cannot be longer than 24 characters"); |
4016 | return; | 4016 | return; |
4017 | } | 4017 | } |
4018 | buts[i] = buttons.Data[i].ToString(); | 4018 | buts[i] = buttons.Data[i].ToString(); |
4019 | } | 4019 | } |
4020 | World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); | 4020 | World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); |
@@ -5137,16 +5137,16 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5137 | { | 5137 | { |
5138 | m_host.AddScriptLPS(1); | 5138 | m_host.AddScriptLPS(1); |
5139 | 5139 | ||
5140 | if(quick_pay_buttons.Data.Length != 4) | 5140 | if(quick_pay_buttons.Data.Length != 4) |
5141 | { | 5141 | { |
5142 | LSLError("List must have 4 elements"); | 5142 | LSLError("List must have 4 elements"); |
5143 | return; | 5143 | return; |
5144 | } | 5144 | } |
5145 | m_host.ParentGroup.RootPart.PayPrice[0]=price; | 5145 | m_host.ParentGroup.RootPart.PayPrice[0]=price; |
5146 | m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0]; | 5146 | m_host.ParentGroup.RootPart.PayPrice[1]=(int)quick_pay_buttons.Data[0]; |
5147 | m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1]; | 5147 | m_host.ParentGroup.RootPart.PayPrice[2]=(int)quick_pay_buttons.Data[1]; |
5148 | m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2]; | 5148 | m_host.ParentGroup.RootPart.PayPrice[3]=(int)quick_pay_buttons.Data[2]; |
5149 | m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3]; | 5149 | m_host.ParentGroup.RootPart.PayPrice[4]=(int)quick_pay_buttons.Data[3]; |
5150 | } | 5150 | } |
5151 | 5151 | ||
5152 | public LSL_Types.Vector3 llGetCameraPos() | 5152 | public LSL_Types.Vector3 llGetCameraPos() |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index c2e3209..d3e9948 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -71,11 +71,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
71 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 71 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; |
72 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | 72 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; |
73 | // TODO: HOOK ALL EVENTS UP TO SERVER! | 73 | // TODO: HOOK ALL EVENTS UP TO SERVER! |
74 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | 74 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); |
75 | if(money != null) | 75 | if(money != null) |
76 | { | 76 | { |
77 | money.OnObjectPaid+=HandleObjectPaid; | 77 | money.OnObjectPaid+=HandleObjectPaid; |
78 | } | 78 | } |
79 | 79 | ||
80 | } | 80 | } |
81 | } | 81 | } |