diff options
author | Justin Clark-Casey (justincc) | 2011-08-12 02:46:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-12 02:46:44 +0100 |
commit | 76e0afe83f012e451a66a145c50e79c1bd047f37 (patch) | |
tree | bd21bb928ca2b0975099ad69c821be71ee60e902 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | rename position parameter in osNpcMoveToTarget to target (diff) | |
download | opensim-SC-76e0afe83f012e451a66a145c50e79c1bd047f37.zip opensim-SC-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.gz opensim-SC-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.bz2 opensim-SC-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.xz |
tidy up some OSSL NPC parameter names
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2e28907..d791885 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2127,7 +2127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2127 | return retVal; | 2127 | return retVal; |
2128 | } | 2128 | } |
2129 | 2129 | ||
2130 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, LSL_Key cloneFrom) | 2130 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) |
2131 | { | 2131 | { |
2132 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2132 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); |
2133 | 2133 | ||
@@ -2136,17 +2136,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2136 | { | 2136 | { |
2137 | AvatarAppearance appearance = null; | 2137 | AvatarAppearance appearance = null; |
2138 | 2138 | ||
2139 | UUID cloneId; | 2139 | UUID id; |
2140 | if (UUID.TryParse(cloneFrom, out cloneId)) | 2140 | if (UUID.TryParse(notecard, out id)) |
2141 | { | 2141 | { |
2142 | ScenePresence clonePresence = World.GetScenePresence(new UUID(cloneFrom.m_string)); | 2142 | ScenePresence clonePresence = World.GetScenePresence(id); |
2143 | if (clonePresence != null) | 2143 | if (clonePresence != null) |
2144 | appearance = clonePresence.Appearance; | 2144 | appearance = clonePresence.Appearance; |
2145 | } | 2145 | } |
2146 | 2146 | ||
2147 | if (appearance == null) | 2147 | if (appearance == null) |
2148 | { | 2148 | { |
2149 | string appearanceSerialized = LoadNotecard(cloneFrom.m_string); | 2149 | string appearanceSerialized = LoadNotecard(notecard); |
2150 | 2150 | ||
2151 | if (appearanceSerialized != null) | 2151 | if (appearanceSerialized != null) |
2152 | { | 2152 | { |
@@ -2175,9 +2175,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2175 | /// Save the current appearance of the NPC permanently to the named notecard. | 2175 | /// Save the current appearance of the NPC permanently to the named notecard. |
2176 | /// </summary> | 2176 | /// </summary> |
2177 | /// <param name="avatar"></param> | 2177 | /// <param name="avatar"></param> |
2178 | /// <param name="notecardName">The name of the notecard to which to save the appearance.</param> | 2178 | /// <param name="notecard">The name of the notecard to which to save the appearance.</param> |
2179 | /// <returns>The asset ID of the notecard saved.</returns> | 2179 | /// <returns>The asset ID of the notecard saved.</returns> |
2180 | public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecardName) | 2180 | public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard) |
2181 | { | 2181 | { |
2182 | CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); | 2182 | CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance"); |
2183 | 2183 | ||
@@ -2192,13 +2192,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2192 | if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) | 2192 | if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene)) |
2193 | return new LSL_Key(UUID.Zero.ToString()); | 2193 | return new LSL_Key(UUID.Zero.ToString()); |
2194 | 2194 | ||
2195 | return SaveAppearanceToNotecard(npcId, notecardName); | 2195 | return SaveAppearanceToNotecard(npcId, notecard); |
2196 | } | 2196 | } |
2197 | 2197 | ||
2198 | return new LSL_Key(UUID.Zero.ToString()); | 2198 | return new LSL_Key(UUID.Zero.ToString()); |
2199 | } | 2199 | } |
2200 | 2200 | ||
2201 | public void osNpcLoadAppearance(LSL_Key npc, string notecardNameOrUuid) | 2201 | public void osNpcLoadAppearance(LSL_Key npc, string notecard) |
2202 | { | 2202 | { |
2203 | CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); | 2203 | CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance"); |
2204 | 2204 | ||
@@ -2210,7 +2210,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2210 | if (!UUID.TryParse(npc.m_string, out npcId)) | 2210 | if (!UUID.TryParse(npc.m_string, out npcId)) |
2211 | return; | 2211 | return; |
2212 | 2212 | ||
2213 | string appearanceSerialized = LoadNotecard(notecardNameOrUuid); | 2213 | string appearanceSerialized = LoadNotecard(notecard); |
2214 | OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized); | 2214 | OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized); |
2215 | // OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized); | 2215 | // OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized); |
2216 | // Console.WriteLine("appearanceSerialized {0}", appearanceSerialized); | 2216 | // Console.WriteLine("appearanceSerialized {0}", appearanceSerialized); |
@@ -2356,23 +2356,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2356 | /// <summary> | 2356 | /// <summary> |
2357 | /// Save the current appearance of the script owner permanently to the named notecard. | 2357 | /// Save the current appearance of the script owner permanently to the named notecard. |
2358 | /// </summary> | 2358 | /// </summary> |
2359 | /// <param name="notecardName">The name of the notecard to which to save the appearance.</param> | 2359 | /// <param name="notecard">The name of the notecard to which to save the appearance.</param> |
2360 | /// <returns>The asset ID of the notecard saved.</returns> | 2360 | /// <returns>The asset ID of the notecard saved.</returns> |
2361 | public LSL_Key osOwnerSaveAppearance(string notecardName) | 2361 | public LSL_Key osOwnerSaveAppearance(string notecard) |
2362 | { | 2362 | { |
2363 | CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); | 2363 | CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance"); |
2364 | 2364 | ||
2365 | return SaveAppearanceToNotecard(m_host.OwnerID, notecardName); | 2365 | return SaveAppearanceToNotecard(m_host.OwnerID, notecard); |
2366 | } | 2366 | } |
2367 | 2367 | ||
2368 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecardName) | 2368 | public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard) |
2369 | { | 2369 | { |
2370 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); | 2370 | CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance"); |
2371 | 2371 | ||
2372 | return SaveAppearanceToNotecard(avatarId, notecardName); | 2372 | return SaveAppearanceToNotecard(avatarId, notecard); |
2373 | } | 2373 | } |
2374 | 2374 | ||
2375 | protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecardName) | 2375 | protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecard) |
2376 | { | 2376 | { |
2377 | IAvatarFactory appearanceModule = World.RequestModuleInterface<IAvatarFactory>(); | 2377 | IAvatarFactory appearanceModule = World.RequestModuleInterface<IAvatarFactory>(); |
2378 | 2378 | ||
@@ -2382,7 +2382,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2382 | OSDMap appearancePacked = sp.Appearance.Pack(); | 2382 | OSDMap appearancePacked = sp.Appearance.Pack(); |
2383 | 2383 | ||
2384 | TaskInventoryItem item | 2384 | TaskInventoryItem item |
2385 | = SaveNotecard(notecardName, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true); | 2385 | = SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true); |
2386 | 2386 | ||
2387 | return new LSL_Key(item.AssetID.ToString()); | 2387 | return new LSL_Key(item.AssetID.ToString()); |
2388 | } | 2388 | } |
@@ -2392,23 +2392,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2392 | } | 2392 | } |
2393 | } | 2393 | } |
2394 | 2394 | ||
2395 | protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecardName) | 2395 | protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecard) |
2396 | { | 2396 | { |
2397 | ScenePresence sp = World.GetScenePresence(avatarId); | 2397 | ScenePresence sp = World.GetScenePresence(avatarId); |
2398 | 2398 | ||
2399 | if (sp == null || sp.IsChildAgent) | 2399 | if (sp == null || sp.IsChildAgent) |
2400 | return new LSL_Key(UUID.Zero.ToString()); | 2400 | return new LSL_Key(UUID.Zero.ToString()); |
2401 | 2401 | ||
2402 | return SaveAppearanceToNotecard(sp, notecardName); | 2402 | return SaveAppearanceToNotecard(sp, notecard); |
2403 | } | 2403 | } |
2404 | 2404 | ||
2405 | protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecardName) | 2405 | protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecard) |
2406 | { | 2406 | { |
2407 | UUID avatarId; | 2407 | UUID avatarId; |
2408 | if (!UUID.TryParse(rawAvatarId, out avatarId)) | 2408 | if (!UUID.TryParse(rawAvatarId, out avatarId)) |
2409 | return new LSL_Key(UUID.Zero.ToString()); | 2409 | return new LSL_Key(UUID.Zero.ToString()); |
2410 | 2410 | ||
2411 | return SaveAppearanceToNotecard(avatarId, notecardName); | 2411 | return SaveAppearanceToNotecard(avatarId, notecard); |
2412 | } | 2412 | } |
2413 | 2413 | ||
2414 | /// <summary> | 2414 | /// <summary> |