aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs29
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs32
4 files changed, 54 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs b/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs
index 7d5c310..cd2fe4f 100644
--- a/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs
@@ -1,4 +1,31 @@
1using OpenMetaverse; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
2using OpenSim.Region.Framework.Scenes; 29using OpenSim.Region.Framework.Scenes;
3 30
4namespace OpenSim.Region.CoreModules.Avatar.NPC 31namespace OpenSim.Region.CoreModules.Avatar.NPC
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
index b61959f..3c5e8c9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
@@ -213,7 +213,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
213 m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword); 213 m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword);
214 string[] excludes = config.GetString("exclude_list", "").Trim().Split(new Char[] { ',' }); 214 string[] excludes = config.GetString("exclude_list", "").Trim().Split(new Char[] { ',' });
215 cs.ExcludeList = new List<string>(excludes.Length); 215 cs.ExcludeList = new List<string>(excludes.Length);
216 foreach(string name in excludes) 216 foreach (string name in excludes)
217 { 217 {
218 cs.ExcludeList.Add(name.Trim().ToLower()); 218 cs.ExcludeList.Add(name.Trim().ToLower());
219 } 219 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index a43a5f5..b3bfe07 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
89 p_returnUuid = UUID.Zero; 89 p_returnUuid = UUID.Zero;
90 } 90 }
91 91
92 while(p_returnUuid == UUID.Zero) 92 while (p_returnUuid == UUID.Zero)
93 { 93 {
94 Thread.Sleep(250); 94 Thread.Sleep(250);
95 } 95 }
@@ -102,31 +102,37 @@ namespace OpenSim.Region.OptionalModules.World.NPC
102 public void Autopilot(UUID agentID, Scene scene, Vector3 pos) 102 public void Autopilot(UUID agentID, Scene scene, Vector3 pos)
103 { 103 {
104 lock (m_avatars) 104 lock (m_avatars)
105 {
105 if (m_avatars.ContainsKey(agentID)) 106 if (m_avatars.ContainsKey(agentID))
106 { 107 {
107 ScenePresence sp; 108 ScenePresence sp;
108 scene.TryGetAvatar(agentID, out sp); 109 scene.TryGetAvatar(agentID, out sp);
109 sp.DoAutoPilot(0, pos, m_avatars[agentID]); 110 sp.DoAutoPilot(0, pos, m_avatars[agentID]);
110 } 111 }
112 }
111 } 113 }
112 114
113 public void Say(UUID agentID, Scene scene, string text) 115 public void Say(UUID agentID, Scene scene, string text)
114 { 116 {
115 lock (m_avatars) 117 lock (m_avatars)
118 {
116 if (m_avatars.ContainsKey(agentID)) 119 if (m_avatars.ContainsKey(agentID))
117 { 120 {
118 m_avatars[agentID].Say(text); 121 m_avatars[agentID].Say(text);
119 } 122 }
123 }
120 } 124 }
121 125
122 public void DeleteNPC(UUID agentID, Scene scene) 126 public void DeleteNPC(UUID agentID, Scene scene)
123 { 127 {
124 lock(m_avatars) 128 lock (m_avatars)
129 {
125 if (m_avatars.ContainsKey(agentID)) 130 if (m_avatars.ContainsKey(agentID))
126 { 131 {
127 scene.RemoveClient(agentID); 132 scene.RemoveClient(agentID);
128 m_avatars.Remove(agentID); 133 m_avatars.Remove(agentID);
129 } 134 }
135 }
130 } 136 }
131 137
132 138
@@ -146,7 +152,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
146 { 152 {
147 p_inUse = false; 153 p_inUse = false;
148 154
149
150 NPCAvatar npcAvatar = new NPCAvatar(p_firstname, p_lastname, p_position, p_scene); 155 NPCAvatar npcAvatar = new NPCAvatar(p_firstname, p_lastname, p_position, p_scene);
151 npcAvatar.CircuitCode = (uint) Util.RandomClass.Next(0, int.MaxValue); 156 npcAvatar.CircuitCode = (uint) Util.RandomClass.Next(0, int.MaxValue);
152 157
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 972e71c..16dd834 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1978,25 +1978,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1978 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 1978 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
1979 } 1979 }
1980 1980
1981 private LSL_Rotation GetPartRot( SceneObjectPart part ) 1981 private LSL_Rotation GetPartRot(SceneObjectPart part)
1982 { 1982 {
1983 Quaternion q; 1983 Quaternion q;
1984 if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim 1984 if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim
1985 { 1985 {
1986 if (part.ParentGroup.RootPart.AttachmentPoint != 0) 1986 if (part.ParentGroup.RootPart.AttachmentPoint != 0)
1987 { 1987 {
1988 ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); 1988 ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar);
1989 if (avatar != null) 1989 if (avatar != null)
1990 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) 1990 {
1991 q = avatar.CameraRotation; // Mouselook 1991 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
1992 else 1992 q = avatar.CameraRotation; // Mouselook
1993 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate 1993 else
1994 else 1994 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
1995 q = part.ParentGroup.GroupRotation; // Likely never get here but just in case 1995 }
1996 } 1996 else
1997 else 1997 q = part.ParentGroup.GroupRotation; // Likely never get here but just in case
1998 q = part.ParentGroup.GroupRotation; // just the group rotation 1998 }
1999 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 1999 else
2000 q = part.ParentGroup.GroupRotation; // just the group rotation
2001 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
2000 } 2002 }
2001 q = part.GetWorldRotation(); 2003 q = part.GetWorldRotation();
2002 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 2004 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);