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 | |
parent | rename position parameter in osNpcMoveToTarget to target (diff) | |
download | opensim-SC_OLD-76e0afe83f012e451a66a145c50e79c1bd047f37.zip opensim-SC_OLD-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.gz opensim-SC_OLD-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.bz2 opensim-SC_OLD-76e0afe83f012e451a66a145c50e79c1bd047f37.tar.xz |
tidy up some OSSL NPC parameter names
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
3 files changed, 34 insertions, 34 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> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 1f3454f..87cfe1a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -168,9 +168,9 @@ 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 | key osNpcCreate(string user, string name, vector position, key cloneFrom); | 171 | key osNpcCreate(string user, string name, vector position, string notecard); |
172 | LSL_Key osNpcSaveAppearance(key npc, string notecardName); | 172 | LSL_Key osNpcSaveAppearance(key npc, string notecard); |
173 | void osNpcLoadAppearance(key npc, string notecardNameOrUuid); | 173 | void osNpcLoadAppearance(key npc, string notecard); |
174 | vector osNpcGetPos(key npc); | 174 | vector osNpcGetPos(key npc); |
175 | void osNpcMoveTo(key npc, vector position); | 175 | void osNpcMoveTo(key npc, vector position); |
176 | void osNpcMoveToTarget(key npc, vector target, int options); | 176 | void osNpcMoveToTarget(key npc, vector target, int options); |
@@ -180,8 +180,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
180 | void osNpcSay(key npc, string message); | 180 | void osNpcSay(key npc, string message); |
181 | void osNpcRemove(key npc); | 181 | void osNpcRemove(key npc); |
182 | 182 | ||
183 | LSL_Key osOwnerSaveAppearance(string notecardName); | 183 | LSL_Key osOwnerSaveAppearance(string notecard); |
184 | LSL_Key osAgentSaveAppearance(key agentId, string notecardName); | 184 | LSL_Key osAgentSaveAppearance(key agentId, string notecard); |
185 | 185 | ||
186 | key osGetMapTexture(); | 186 | key osGetMapTexture(); |
187 | key osGetRegionMapTexture(string regionName); | 187 | 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 13cf7fa..bbc8cc6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -483,14 +483,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
483 | return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); | 483 | return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom); |
484 | } | 484 | } |
485 | 485 | ||
486 | public key osNpcSaveAppearance(key npc, string notecardName) | 486 | public key osNpcSaveAppearance(key npc, string notecard) |
487 | { | 487 | { |
488 | return m_OSSL_Functions.osNpcSaveAppearance(npc, notecardName); | 488 | return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard); |
489 | } | 489 | } |
490 | 490 | ||
491 | public void osNpcLoadAppearance(key npc, string notecardNameOrUuid) | 491 | public void osNpcLoadAppearance(key npc, string notecard) |
492 | { | 492 | { |
493 | m_OSSL_Functions.osNpcLoadAppearance(npc, notecardNameOrUuid); | 493 | m_OSSL_Functions.osNpcLoadAppearance(npc, notecard); |
494 | } | 494 | } |
495 | 495 | ||
496 | public vector osNpcGetPos(LSL_Key npc) | 496 | public vector osNpcGetPos(LSL_Key npc) |
@@ -533,14 +533,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
533 | m_OSSL_Functions.osNpcRemove(npc); | 533 | m_OSSL_Functions.osNpcRemove(npc); |
534 | } | 534 | } |
535 | 535 | ||
536 | public LSL_Key osOwnerSaveAppearance(string notecardName) | 536 | public LSL_Key osOwnerSaveAppearance(string notecard) |
537 | { | 537 | { |
538 | return m_OSSL_Functions.osOwnerSaveAppearance(notecardName); | 538 | return m_OSSL_Functions.osOwnerSaveAppearance(notecard); |
539 | } | 539 | } |
540 | 540 | ||
541 | public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecardName) | 541 | public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecard) |
542 | { | 542 | { |
543 | return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecardName); | 543 | return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard); |
544 | } | 544 | } |
545 | 545 | ||
546 | public OSSLPrim Prim; | 546 | public OSSLPrim Prim; |