aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-11 02:19:13 +0100
committerJustin Clark-Casey (justincc)2011-08-11 02:19:13 +0100
commitee22569c9262277467df9a4b15674a1472fa0b71 (patch)
tree7488dfd04814435041d98ec5e8ef73708dedca80 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentcomment out some of the currently less useful debug log messages (diff)
downloadopensim-SC_OLD-ee22569c9262277467df9a4b15674a1472fa0b71.zip
opensim-SC_OLD-ee22569c9262277467df9a4b15674a1472fa0b71.tar.gz
opensim-SC_OLD-ee22569c9262277467df9a4b15674a1472fa0b71.tar.bz2
opensim-SC_OLD-ee22569c9262277467df9a4b15674a1472fa0b71.tar.xz
only accept npc UUIDs to osNpc* functions, not names (except for create)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs26
1 files changed, 11 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 71fc15f..91ac3b7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2153,7 +2153,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2153 /// <param name="avatar"></param> 2153 /// <param name="avatar"></param>
2154 /// <param name="notecardName">The name of the notecard to which to save the appearance.</param> 2154 /// <param name="notecardName">The name of the notecard to which to save the appearance.</param>
2155 /// <returns>The asset ID of the notecard saved.</returns> 2155 /// <returns>The asset ID of the notecard saved.</returns>
2156 public LSL_Key osNpcSaveAppearance(string avatar, string notecardName) 2156 public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecardName)
2157 { 2157 {
2158 CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); 2158 CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance");
2159 2159
@@ -2161,20 +2161,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2161 2161
2162 if (npcModule != null) 2162 if (npcModule != null)
2163 { 2163 {
2164 UUID avatarId = UUID.Zero; 2164 UUID npcId = new UUID(npc.m_string);
2165 if (!UUID.TryParse(avatar, out avatarId))
2166 return new LSL_Key(UUID.Zero.ToString());
2167 2165
2168 if (!npcModule.IsNPC(avatarId, m_host.ParentGroup.Scene)) 2166 if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
2169 return new LSL_Key(UUID.Zero.ToString()); 2167 return new LSL_Key(UUID.Zero.ToString());
2170 2168
2171 return SaveAppearanceToNotecard(avatarId, notecardName); 2169 return SaveAppearanceToNotecard(npcId, notecardName);
2172 } 2170 }
2173 2171
2174 return new LSL_Key(UUID.Zero.ToString()); 2172 return new LSL_Key(UUID.Zero.ToString());
2175 } 2173 }
2176 2174
2177 public void osNpcLoadAppearance(string avatar, string notecardNameOrUuid) 2175 public void osNpcLoadAppearance(LSL_Key npc, string notecardNameOrUuid)
2178 { 2176 {
2179 CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); 2177 CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance");
2180 2178
@@ -2182,11 +2180,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2182 2180
2183 if (npcModule != null) 2181 if (npcModule != null)
2184 { 2182 {
2185 UUID avatarId = UUID.Zero; 2183 UUID npcId = new UUID(npc.m_string);
2186 if (!UUID.TryParse(avatar, out avatarId))
2187 return;
2188 2184
2189 if (!npcModule.IsNPC(avatarId, m_host.ParentGroup.Scene)) 2185 if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
2190 return; 2186 return;
2191 2187
2192 string appearanceSerialized = LoadNotecard(notecardNameOrUuid); 2188 string appearanceSerialized = LoadNotecard(notecardNameOrUuid);
@@ -2197,7 +2193,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2197 AvatarAppearance appearance = new AvatarAppearance(); 2193 AvatarAppearance appearance = new AvatarAppearance();
2198 appearance.Unpack(appearanceOsd); 2194 appearance.Unpack(appearanceOsd);
2199 2195
2200 npcModule.SetNPCAppearance(avatarId, appearance, m_host.ParentGroup.Scene); 2196 npcModule.SetNPCAppearance(npcId, appearance, m_host.ParentGroup.Scene);
2201 } 2197 }
2202 } 2198 }
2203 2199
@@ -2213,7 +2209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2213 } 2209 }
2214 } 2210 }
2215 2211
2216 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int moveParams) 2212 public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector position, int options)
2217 { 2213 {
2218 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget"); 2214 CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
2219 2215
@@ -2225,8 +2221,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2225 new UUID(npc.m_string), 2221 new UUID(npc.m_string),
2226 World, 2222 World,
2227 pos, 2223 pos,
2228 (moveParams & ScriptBaseClass.OS_NPC_NO_FLY) != 0, 2224 (options & ScriptBaseClass.OS_NPC_NO_FLY) != 0,
2229 (moveParams & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0); 2225 (options & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0);
2230 } 2226 }
2231 } 2227 }
2232 2228