aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs35
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
3 files changed, 37 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b18aa3b..939602a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2165,7 +2165,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2165 2165
2166 if (npcModule != null) 2166 if (npcModule != null)
2167 { 2167 {
2168 UUID npcId = new UUID(npc.m_string); 2168 UUID npcId;
2169 if (!UUID.TryParse(npc.m_string, out npcId))
2170 return new LSL_Key(UUID.Zero.ToString());
2169 2171
2170 if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) 2172 if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
2171 return new LSL_Key(UUID.Zero.ToString()); 2173 return new LSL_Key(UUID.Zero.ToString());
@@ -2273,14 +2275,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2273 return SaveAppearanceToNotecard(m_host.OwnerID, notecardName); 2275 return SaveAppearanceToNotecard(m_host.OwnerID, notecardName);
2274 } 2276 }
2275 2277
2276 protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecardName) 2278 public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecardName)
2279 {
2280 CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
2281
2282 return SaveAppearanceToNotecard(avatarId, notecardName);
2283 }
2284
2285 protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecardName)
2277 { 2286 {
2278 IAvatarFactory appearanceModule = World.RequestModuleInterface<IAvatarFactory>(); 2287 IAvatarFactory appearanceModule = World.RequestModuleInterface<IAvatarFactory>();
2279 2288
2280 if (appearanceModule != null) 2289 if (appearanceModule != null)
2281 { 2290 {
2282 appearanceModule.SaveBakedTextures(m_host.OwnerID); 2291 appearanceModule.SaveBakedTextures(sp.UUID);
2283 ScenePresence sp = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID);
2284 OSDMap appearancePacked = sp.Appearance.Pack(); 2292 OSDMap appearancePacked = sp.Appearance.Pack();
2285 2293
2286 TaskInventoryItem item 2294 TaskInventoryItem item
@@ -2293,6 +2301,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2293 return new LSL_Key(UUID.Zero.ToString()); 2301 return new LSL_Key(UUID.Zero.ToString());
2294 } 2302 }
2295 } 2303 }
2304
2305 protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecardName)
2306 {
2307 ScenePresence sp = World.GetScenePresence(avatarId);
2308
2309 if (sp == null || sp.IsChildAgent)
2310 return new LSL_Key(UUID.Zero.ToString());
2311
2312 return SaveAppearanceToNotecard(sp, notecardName);
2313 }
2314
2315 protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecardName)
2316 {
2317 UUID avatarId;
2318 if (!UUID.TryParse(rawAvatarId, out avatarId))
2319 return new LSL_Key(UUID.Zero.ToString());
2320
2321 return SaveAppearanceToNotecard(avatarId, notecardName);
2322 }
2296 2323
2297 /// <summary> 2324 /// <summary>
2298 /// Get current region's map texture UUID 2325 /// Get current region's map texture UUID
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index f4a618b..88e1f15 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -168,7 +168,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
168 168
169 LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules); 169 LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
170 170
171
172 key osNpcCreate(string user, string name, vector position, key cloneFrom); 171 key osNpcCreate(string user, string name, vector position, key cloneFrom);
173 LSL_Key osNpcSaveAppearance(key npc, string notecardName); 172 LSL_Key osNpcSaveAppearance(key npc, string notecardName);
174 void osNpcLoadAppearance(key npc, string notecardNameOrUuid); 173 void osNpcLoadAppearance(key npc, string notecardNameOrUuid);
@@ -179,6 +178,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
179 void osNpcRemove(key npc); 178 void osNpcRemove(key npc);
180 179
181 LSL_Key osOwnerSaveAppearance(string notecardName); 180 LSL_Key osOwnerSaveAppearance(string notecardName);
181 LSL_Key osAgentSaveAppearance(key agentId, string notecardName);
182 182
183 key osGetMapTexture(); 183 key osGetMapTexture();
184 key osGetRegionMapTexture(string regionName); 184 key osGetRegionMapTexture(string regionName);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 84d61f4..4701736 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -523,6 +523,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
523 return m_OSSL_Functions.osOwnerSaveAppearance(notecardName); 523 return m_OSSL_Functions.osOwnerSaveAppearance(notecardName);
524 } 524 }
525 525
526 public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecardName)
527 {
528 return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecardName);
529 }
530
526 public OSSLPrim Prim; 531 public OSSLPrim Prim;
527 532
528 [Serializable] 533 [Serializable]