diff options
author | Diva Canto | 2010-11-29 09:58:20 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-29 09:58:20 -0800 |
commit | f3835fe15c91ece4ad61ba1caa67603374ad2574 (patch) | |
tree | bed4cf2014aeea194086d940e8c86ac998bc692a /OpenSim/Region | |
parent | Fix unit test. (diff) | |
parent | Fix the build break (diff) | |
download | opensim-SC-f3835fe15c91ece4ad61ba1caa67603374ad2574.zip opensim-SC-f3835fe15c91ece4ad61ba1caa67603374ad2574.tar.gz opensim-SC-f3835fe15c91ece4ad61ba1caa67603374ad2574.tar.bz2 opensim-SC-f3835fe15c91ece4ad61ba1caa67603374ad2574.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
11 files changed, 313 insertions, 194 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 0df4585..ab1c206 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -183,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
183 | }); | 183 | }); |
184 | } | 184 | } |
185 | 185 | ||
186 | // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); | 186 | m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); |
187 | } | 187 | } |
188 | 188 | ||
189 | // Process the visual params, this may change height as well | 189 | // Process the visual params, this may change height as well |
@@ -196,12 +196,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
196 | sp.SetHeight(sp.Appearance.AvatarHeight); | 196 | sp.SetHeight(sp.Appearance.AvatarHeight); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | |||
200 | // Send the appearance back to the avatar, not clear that this is needed | ||
201 | sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
202 | // AvatarAppearance avp = sp.Appearance; | ||
203 | // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
204 | |||
205 | } | 199 | } |
206 | 200 | ||
207 | 201 | ||
@@ -274,21 +268,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
274 | 268 | ||
275 | // Send the appearance to everyone in the scene | 269 | // Send the appearance to everyone in the scene |
276 | sp.SendAppearanceToAllOtherAgents(); | 270 | sp.SendAppearanceToAllOtherAgents(); |
277 | // sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
278 | |||
279 | // Send the appearance back to the avatar | ||
280 | // AvatarAppearance avp = sp.Appearance; | ||
281 | // sp.ControllingClient.SendAppearance(avp.Owner, avp.VisualParams, avp.Texture.GetBytes()); | ||
282 | |||
283 | /* | ||
284 | // this needs to be fixed, the flag should be on scene presence not the region module | ||
285 | // Start the animations if necessary | ||
286 | if (!m_startAnimationSet) | ||
287 | { | ||
288 | sp.Animator.UpdateMovementAnimations(); | ||
289 | m_startAnimationSet = true; | ||
290 | } | ||
291 | */ | ||
292 | } | 271 | } |
293 | 272 | ||
294 | private void HandleAppearanceSave(UUID agentid) | 273 | private void HandleAppearanceSave(UUID agentid) |
@@ -374,6 +353,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
374 | 353 | ||
375 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); | 354 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); |
376 | 355 | ||
356 | // operate on a copy of the appearance so we don't have to lock anything | ||
377 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); | 357 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); |
378 | 358 | ||
379 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 359 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
@@ -388,9 +368,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
388 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 368 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
389 | 369 | ||
390 | // could get fancier with the locks here, but in the spirit of "last write wins" | 370 | // could get fancier with the locks here, but in the spirit of "last write wins" |
391 | // this should work correctly | 371 | // this should work correctly, also, we don't need to send the appearance here |
372 | // since the "iswearing" will trigger a new set of visual param and baked texture changes | ||
373 | // when those complete, the new appearance will be sent | ||
392 | sp.Appearance = avatAppearance; | 374 | sp.Appearance = avatAppearance; |
393 | m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); | 375 | QueueAppearanceSave(client.AgentId); |
394 | } | 376 | } |
395 | 377 | ||
396 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 378 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f02a922..b57dc88 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -903,8 +903,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
903 | } | 903 | } |
904 | 904 | ||
905 | agent.MakeChildAgent(); | 905 | agent.MakeChildAgent(); |
906 | |||
906 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 907 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
907 | agent.SendInitialFullUpdateToAllClients(); | 908 | agent.SendOtherAgentsAvatarDataToMe(); |
909 | agent.SendOtherAgentsAppearanceToMe(); | ||
908 | 910 | ||
909 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); | 911 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); |
910 | 912 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 70aceb1..90223b1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2324,16 +2324,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2324 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2324 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
2325 | return false; | 2325 | return false; |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2); | 2328 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); |
2329 | 2329 | ||
2330 | newObject.ResumeScripts(); | 2330 | newObject.ResumeScripts(); |
2331 | 2331 | ||
2332 | // Do this as late as possible so that listeners have full access to the incoming object | 2332 | // Do this as late as possible so that listeners have full access to the incoming object |
2333 | EventManager.TriggerOnIncomingSceneObject(newObject); | 2333 | EventManager.TriggerOnIncomingSceneObject(newObject); |
2334 | 2334 | ||
2335 | TriggerChangedTeleport(newObject); | ||
2336 | |||
2337 | return true; | 2335 | return true; |
2338 | } | 2336 | } |
2339 | 2337 | ||
@@ -2441,7 +2439,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2441 | return true; | 2439 | return true; |
2442 | } | 2440 | } |
2443 | 2441 | ||
2444 | private void TriggerChangedTeleport(SceneObjectGroup sog) | 2442 | private int GetStateSource(SceneObjectGroup sog) |
2445 | { | 2443 | { |
2446 | ScenePresence sp = GetScenePresence(sog.OwnerID); | 2444 | ScenePresence sp = GetScenePresence(sog.OwnerID); |
2447 | 2445 | ||
@@ -2452,13 +2450,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2452 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) | 2450 | if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) |
2453 | { | 2451 | { |
2454 | // This will get your attention | 2452 | // This will get your attention |
2455 | //m_log.Error("[XXX] Triggering "); | 2453 | //m_log.Error("[XXX] Triggering CHANGED_TELEPORT"); |
2456 | 2454 | ||
2457 | // Trigger CHANGED_TELEPORT | 2455 | return 5; // StateSource.Teleporting |
2458 | sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT); | ||
2459 | } | 2456 | } |
2460 | |||
2461 | } | 2457 | } |
2458 | return 2; // StateSource.PrimCrossing | ||
2462 | } | 2459 | } |
2463 | 2460 | ||
2464 | #endregion | 2461 | #endregion |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index db69093..82214bf 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -445,8 +445,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
445 | PhysicsActor actor = m_physicsActor; | 445 | PhysicsActor actor = m_physicsActor; |
446 | if (actor != null) | 446 | if (actor != null) |
447 | m_pos = actor.Position; | 447 | m_pos = actor.Position; |
448 | else | ||
449 | { | ||
450 | // Obtain the correct position of a seated avatar. | ||
451 | // In addition to providing the correct position while | ||
452 | // the avatar is seated, this value will also | ||
453 | // be used as the location to unsit to. | ||
454 | // | ||
455 | // If m_parentID is not 0, assume we are a seated avatar | ||
456 | // and we should return the position based on the sittarget | ||
457 | // offset and rotation of the prim we are seated on. | ||
458 | // | ||
459 | // Generally, m_pos will contain the position of the avatar | ||
460 | // in the sim unless the avatar is on a sit target. While | ||
461 | // on a sit target, m_pos will contain the desired offset | ||
462 | // without the parent rotation applied. | ||
463 | if (m_parentID != 0) | ||
464 | { | ||
465 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | ||
466 | if (part != null) | ||
467 | { | ||
468 | return m_parentPosition + (m_pos * part.GetWorldRotation()); | ||
469 | } | ||
470 | else | ||
471 | { | ||
472 | return m_parentPosition + m_pos; | ||
473 | } | ||
474 | } | ||
475 | } | ||
448 | 476 | ||
449 | return m_parentPosition + m_pos; | 477 | return m_pos; |
450 | } | 478 | } |
451 | set | 479 | set |
452 | { | 480 | { |
@@ -703,7 +731,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
703 | // Note: This won't send data *to* other clients in that region (children don't send) | 731 | // Note: This won't send data *to* other clients in that region (children don't send) |
704 | 732 | ||
705 | // MIC: This gets called again in CompleteMovement | 733 | // MIC: This gets called again in CompleteMovement |
706 | SendInitialFullUpdateToAllClients(); | 734 | // SendInitialFullUpdateToAllClients(); |
735 | SendOtherAgentsAvatarDataToMe(); | ||
736 | SendOtherAgentsAppearanceToMe(); | ||
707 | 737 | ||
708 | RegisterToEvents(); | 738 | RegisterToEvents(); |
709 | SetDirectionVectors(); | 739 | SetDirectionVectors(); |
@@ -1613,7 +1643,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1613 | { | 1643 | { |
1614 | AbsolutePosition = part.AbsolutePosition; | 1644 | AbsolutePosition = part.AbsolutePosition; |
1615 | Velocity = Vector3.Zero; | 1645 | Velocity = Vector3.Zero; |
1616 | SendFullUpdateToAllClients(); | 1646 | SendAvatarDataToAllAgents(); |
1617 | 1647 | ||
1618 | //HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); | 1648 | //HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); |
1619 | } | 1649 | } |
@@ -1688,7 +1718,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1688 | m_parentPosition = Vector3.Zero; | 1718 | m_parentPosition = Vector3.Zero; |
1689 | 1719 | ||
1690 | m_parentID = 0; | 1720 | m_parentID = 0; |
1691 | SendFullUpdateToAllClients(); | 1721 | SendAvatarDataToAllAgents(); |
1692 | m_requestedSitTargetID = 0; | 1722 | m_requestedSitTargetID = 0; |
1693 | if (m_physicsActor != null && m_appearance != null) | 1723 | if (m_physicsActor != null && m_appearance != null) |
1694 | { | 1724 | { |
@@ -2154,7 +2184,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2154 | RemoveFromPhysicalScene(); | 2184 | RemoveFromPhysicalScene(); |
2155 | 2185 | ||
2156 | Animator.TrySetMovementAnimation(sitAnimation); | 2186 | Animator.TrySetMovementAnimation(sitAnimation); |
2157 | SendFullUpdateToAllClients(); | 2187 | SendAvatarDataToAllAgents(); |
2158 | // This may seem stupid, but Our Full updates don't send avatar rotation :P | 2188 | // This may seem stupid, but Our Full updates don't send avatar rotation :P |
2159 | // So we're also sending a terse update (which has avatar rotation) | 2189 | // So we're also sending a terse update (which has avatar rotation) |
2160 | // [Update] We do now. | 2190 | // [Update] We do now. |
@@ -2379,165 +2409,169 @@ namespace OpenSim.Region.Framework.Scenes | |||
2379 | } | 2409 | } |
2380 | 2410 | ||
2381 | /// <summary> | 2411 | /// <summary> |
2382 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) | 2412 | /// Do everything required once a client completes its movement into a region and becomes |
2413 | /// a root agent. | ||
2383 | /// </summary> | 2414 | /// </summary> |
2384 | /// <param name="remoteAvatar"></param> | 2415 | private void SendInitialData() |
2385 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | ||
2386 | { | 2416 | { |
2387 | // 2 stage check is needed. | 2417 | // Moved this into CompleteMovement to ensure that m_appearance is initialized before |
2388 | if (remoteAvatar == null) | 2418 | // the inventory arrives |
2389 | return; | 2419 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
2390 | |||
2391 | IClientAPI cl = remoteAvatar.ControllingClient; | ||
2392 | if (cl == null) | ||
2393 | return; | ||
2394 | 2420 | ||
2395 | if (m_appearance.Texture == null) | 2421 | // This agent just became root. We are going to tell everyone about it. The process of |
2396 | return; | 2422 | // getting other avatars information was initiated in the constructor... don't do it |
2423 | // again here... | ||
2424 | SendAvatarDataToAllAgents(); | ||
2397 | 2425 | ||
2398 | // MT: This is needed for sit. It's legal to send it to oneself, and the name | 2426 | // We have an appearance but we may not have the baked textures. Check the asset cache |
2399 | // of the method is a misnomer | 2427 | // to see if all the baked textures are already here. |
2400 | // | 2428 | if (m_scene.AvatarFactory != null) |
2401 | // if (LocalId == remoteAvatar.LocalId) | 2429 | { |
2402 | // { | 2430 | if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) |
2403 | // m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); | 2431 | { |
2404 | // return; | 2432 | // m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); |
2405 | // } | 2433 | SendAppearanceToAgent(this); |
2406 | 2434 | ||
2407 | if (IsChildAgent) | 2435 | // If the avatars baked textures are all in the cache, then we have a |
2436 | // complete appearance... send it out, if not, then we'll send it when | ||
2437 | // the avatar finishes updating its appearance | ||
2438 | SendAppearanceToAllOtherAgents(); | ||
2439 | } | ||
2440 | } | ||
2441 | else | ||
2408 | { | 2442 | { |
2409 | m_log.WarnFormat("[SCENEPRESENCE]: A child agent is attempting to send out avatar data; {0}", UUID); | 2443 | m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name); |
2410 | return; | ||
2411 | } | 2444 | } |
2412 | |||
2413 | remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); | ||
2414 | m_scene.StatsReporter.AddAgentUpdates(1); | ||
2415 | } | 2445 | } |
2416 | 2446 | ||
2417 | /// <summary> | 2447 | /// <summary> |
2418 | /// Tell *ALL* agents about this agent | 2448 | /// Send this agent's avatar data to all other root and child agents in the scene |
2449 | /// This agent must be root. This avatar will receive its own update. | ||
2419 | /// </summary> | 2450 | /// </summary> |
2420 | public void SendInitialFullUpdateToAllClients() | 2451 | public void SendAvatarDataToAllAgents() |
2421 | { | 2452 | { |
2422 | m_perfMonMS = Util.EnvironmentTickCount(); | 2453 | // only send update from root agents to other clients; children are only "listening posts" |
2423 | int avUpdates = 0; | 2454 | if (IsChildAgent) |
2424 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | ||
2425 | { | 2455 | { |
2426 | ++avUpdates; | 2456 | m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent"); |
2427 | 2457 | return; | |
2428 | // Don't update ourselves | 2458 | } |
2429 | if (avatar.LocalId == LocalId) | 2459 | |
2430 | return; | 2460 | m_perfMonMS = Util.EnvironmentTickCount(); |
2431 | |||
2432 | // If this is a root agent, then get info about the avatar | ||
2433 | if (!IsChildAgent) | ||
2434 | { | ||
2435 | SendFullUpdateToOtherClient(avatar); | ||
2436 | } | ||
2437 | 2461 | ||
2438 | // If the other avatar is a root | 2462 | int count = 0; |
2439 | if (!avatar.IsChildAgent) | 2463 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2440 | { | 2464 | { |
2441 | avatar.SendFullUpdateToOtherClient(this); | 2465 | SendAvatarDataToAgent(scenePresence); |
2442 | avatar.SendAppearanceToOtherAgent(this); | 2466 | count++; |
2443 | avatar.Animator.SendAnimPackToClient(ControllingClient); | 2467 | }); |
2444 | } | ||
2445 | }); | ||
2446 | 2468 | ||
2447 | m_scene.StatsReporter.AddAgentUpdates(avUpdates); | 2469 | m_scene.StatsReporter.AddAgentUpdates(count); |
2448 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2470 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2449 | |||
2450 | //Animator.SendAnimPack(); | ||
2451 | } | 2471 | } |
2452 | 2472 | ||
2453 | public void SendFullUpdateToAllClients() | 2473 | /// <summary> |
2474 | /// Send avatar data for all other root agents to this agent, this agent | ||
2475 | /// can be either a child or root | ||
2476 | /// </summary> | ||
2477 | public void SendOtherAgentsAvatarDataToMe() | ||
2454 | { | 2478 | { |
2455 | m_perfMonMS = Util.EnvironmentTickCount(); | 2479 | m_perfMonMS = Util.EnvironmentTickCount(); |
2456 | 2480 | ||
2457 | // only send update from root agents to other clients; children are only "listening posts" | ||
2458 | if (IsChildAgent) | ||
2459 | { | ||
2460 | m_log.Warn("[SCENEPRESENCE] attempt to send update from a childagent"); | ||
2461 | return; | ||
2462 | } | ||
2463 | |||
2464 | int count = 0; | 2481 | int count = 0; |
2465 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | 2482 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2466 | { | 2483 | { |
2467 | if (sp.IsChildAgent) | 2484 | // only send information about root agents |
2468 | return; | 2485 | if (scenePresence.IsChildAgent) |
2469 | SendFullUpdateToOtherClient(sp); | 2486 | return; |
2470 | ++count; | 2487 | |
2471 | }); | 2488 | // only send information about other root agents |
2489 | if (scenePresence.UUID == UUID) | ||
2490 | return; | ||
2491 | |||
2492 | scenePresence.SendAvatarDataToAgent(this); | ||
2493 | count++; | ||
2494 | }); | ||
2495 | |||
2472 | m_scene.StatsReporter.AddAgentUpdates(count); | 2496 | m_scene.StatsReporter.AddAgentUpdates(count); |
2473 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2497 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2474 | |||
2475 | Animator.SendAnimPack(); | ||
2476 | } | 2498 | } |
2477 | 2499 | ||
2478 | /// <summary> | 2500 | /// <summary> |
2479 | /// Do everything required once a client completes its movement into a region | 2501 | /// Send avatar data to an agent. |
2480 | /// </summary> | 2502 | /// </summary> |
2481 | public void SendInitialData() | 2503 | /// <param name="avatar"></param> |
2504 | private void SendAvatarDataToAgent(ScenePresence avatar) | ||
2482 | { | 2505 | { |
2483 | // Moved this into CompleteMovement to ensure that m_appearance is initialized before | 2506 | // m_log.WarnFormat("[SP] Send avatar data from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); |
2484 | // the inventory arrives | ||
2485 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | ||
2486 | 2507 | ||
2487 | m_controllingClient.SendAvatarDataImmediate(this); | 2508 | avatar.ControllingClient.SendAvatarDataImmediate(this); |
2488 | if (m_scene.AvatarFactory != null) | 2509 | Animator.SendAnimPackToClient(avatar.ControllingClient); |
2489 | { | 2510 | } |
2490 | if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) | 2511 | |
2491 | { | 2512 | /// <summary> |
2492 | // m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); | 2513 | /// Send this agent's appearance to all other root and child agents in the scene |
2493 | m_controllingClient.SendAppearance( | 2514 | /// This agent must be root. |
2494 | m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | 2515 | /// </summary> |
2495 | } | 2516 | public void SendAppearanceToAllOtherAgents() |
2496 | } | 2517 | { |
2497 | else | 2518 | // only send update from root agents to other clients; children are only "listening posts" |
2519 | if (IsChildAgent) | ||
2498 | { | 2520 | { |
2499 | m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name); | 2521 | m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent"); |
2522 | return; | ||
2500 | } | 2523 | } |
2524 | |||
2525 | m_perfMonMS = Util.EnvironmentTickCount(); | ||
2501 | 2526 | ||
2502 | SendInitialFullUpdateToAllClients(); | 2527 | int count = 0; |
2528 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | ||
2529 | { | ||
2530 | if (scenePresence.UUID == UUID) | ||
2531 | return; | ||
2532 | |||
2533 | SendAppearanceToAgent(scenePresence); | ||
2534 | count++; | ||
2535 | }); | ||
2536 | |||
2537 | m_scene.StatsReporter.AddAgentUpdates(count); | ||
2538 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | ||
2503 | } | 2539 | } |
2504 | 2540 | ||
2505 | /// <summary> | 2541 | /// <summary> |
2506 | /// | 2542 | /// Send appearance from all other root agents to this agent. this agent |
2543 | /// can be either root or child | ||
2507 | /// </summary> | 2544 | /// </summary> |
2508 | public void SendAppearanceToAllOtherAgents() | 2545 | public void SendOtherAgentsAppearanceToMe() |
2509 | { | 2546 | { |
2510 | // DEBUG ON | ||
2511 | // m_log.WarnFormat("[SCENEPRESENCE]: Send appearance from {0} to all other agents", m_uuid); | ||
2512 | // DEBUG OFF | ||
2513 | m_perfMonMS = Util.EnvironmentTickCount(); | 2547 | m_perfMonMS = Util.EnvironmentTickCount(); |
2514 | 2548 | ||
2549 | int count = 0; | ||
2515 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2550 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2516 | { | 2551 | { |
2517 | if (scenePresence.UUID != UUID) | 2552 | // only send information about root agents |
2518 | { | 2553 | if (scenePresence.IsChildAgent) |
2519 | SendAppearanceToOtherAgent(scenePresence); | 2554 | return; |
2520 | } | 2555 | |
2556 | // only send information about other root agents | ||
2557 | if (scenePresence.UUID == UUID) | ||
2558 | return; | ||
2559 | |||
2560 | scenePresence.SendAppearanceToAgent(this); | ||
2561 | count++; | ||
2521 | }); | 2562 | }); |
2522 | 2563 | ||
2564 | m_scene.StatsReporter.AddAgentUpdates(count); | ||
2523 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2565 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2524 | } | 2566 | } |
2525 | 2567 | ||
2526 | /// <summary> | 2568 | /// <summary> |
2527 | /// Send appearance data to an agent that isn't this one. | 2569 | /// Send appearance data to an agent. |
2528 | /// </summary> | 2570 | /// </summary> |
2529 | /// <param name="avatar"></param> | 2571 | /// <param name="avatar"></param> |
2530 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 2572 | private void SendAppearanceToAgent(ScenePresence avatar) |
2531 | { | 2573 | { |
2532 | if (LocalId == avatar.LocalId) | ||
2533 | { | ||
2534 | m_log.WarnFormat("[SCENE PRESENCE]: An agent is attempting to send appearance data to itself; {0}", UUID); | ||
2535 | return; | ||
2536 | } | ||
2537 | |||
2538 | // DEBUG ON | ||
2539 | // m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); | 2574 | // m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); |
2540 | // DEBUG OFF | ||
2541 | 2575 | ||
2542 | avatar.ControllingClient.SendAppearance( | 2576 | avatar.ControllingClient.SendAppearance( |
2543 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); | 2577 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); |
@@ -3050,9 +3084,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3050 | 3084 | ||
3051 | public void CopyFrom(AgentData cAgent) | 3085 | public void CopyFrom(AgentData cAgent) |
3052 | { | 3086 | { |
3053 | // DEBUG ON | ||
3054 | m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYFROM"); | ||
3055 | // DEBUG OFF | ||
3056 | m_originRegionID = cAgent.RegionID; | 3087 | m_originRegionID = cAgent.RegionID; |
3057 | 3088 | ||
3058 | m_callbackURI = cAgent.CallbackURI; | 3089 | m_callbackURI = cAgent.CallbackURI; |
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index aee2d10..3978a7d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -86,23 +86,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
86 | /// <param name="assetUuids">The assets gathered</param> | 86 | /// <param name="assetUuids">The assets gathered</param> |
87 | public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids) | 87 | public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, AssetType> assetUuids) |
88 | { | 88 | { |
89 | assetUuids[assetUuid] = assetType; | 89 | try |
90 | 90 | { | |
91 | if (AssetType.Bodypart == assetType || AssetType.Clothing == assetType) | 91 | assetUuids[assetUuid] = assetType; |
92 | { | 92 | |
93 | GetWearableAssetUuids(assetUuid, assetUuids); | 93 | if (AssetType.Bodypart == assetType || AssetType.Clothing == assetType) |
94 | } | 94 | { |
95 | else if (AssetType.Gesture == assetType) | 95 | GetWearableAssetUuids(assetUuid, assetUuids); |
96 | { | 96 | } |
97 | GetGestureAssetUuids(assetUuid, assetUuids); | 97 | else if (AssetType.Gesture == assetType) |
98 | } | 98 | { |
99 | else if (AssetType.LSLText == assetType) | 99 | GetGestureAssetUuids(assetUuid, assetUuids); |
100 | { | 100 | } |
101 | GetScriptAssetUuids(assetUuid, assetUuids); | 101 | else if (AssetType.LSLText == assetType) |
102 | { | ||
103 | GetScriptAssetUuids(assetUuid, assetUuids); | ||
104 | } | ||
105 | else if (AssetType.Object == assetType) | ||
106 | { | ||
107 | GetSceneObjectAssetUuids(assetUuid, assetUuids); | ||
108 | } | ||
102 | } | 109 | } |
103 | else if (AssetType.Object == assetType) | 110 | catch (Exception) |
104 | { | 111 | { |
105 | GetSceneObjectAssetUuids(assetUuid, assetUuids); | 112 | m_log.ErrorFormat( |
113 | "[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}", | ||
114 | assetUuid, assetType); | ||
115 | throw; | ||
106 | } | 116 | } |
107 | } | 117 | } |
108 | 118 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index a583cca..e9c5453 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
132 | m_FreeswitchService = ServerUtils.LoadPlugin<IFreeswitchService>(serviceDll, args); | 132 | m_FreeswitchService = ServerUtils.LoadPlugin<IFreeswitchService>(serviceDll, args); |
133 | 133 | ||
134 | string jsonConfig = m_FreeswitchService.GetJsonConfig(); | 134 | string jsonConfig = m_FreeswitchService.GetJsonConfig(); |
135 | m_log.Debug("[FreeSwitchVoice]: Configuration string: " + jsonConfig); | 135 | //m_log.Debug("[FreeSwitchVoice]: Configuration string: " + jsonConfig); |
136 | OSDMap map = (OSDMap)OSDParser.DeserializeJson(jsonConfig); | 136 | OSDMap map = (OSDMap)OSDParser.DeserializeJson(jsonConfig); |
137 | 137 | ||
138 | m_freeSwitchAPIPrefix = map["APIPrefix"].AsString(); | 138 | m_freeSwitchAPIPrefix = map["APIPrefix"].AsString(); |
@@ -363,8 +363,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
363 | 363 | ||
364 | try | 364 | try |
365 | { | 365 | { |
366 | m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", | 366 | //m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", |
367 | request, path, param); | 367 | // request, path, param); |
368 | 368 | ||
369 | //XmlElement resp; | 369 | //XmlElement resp; |
370 | string agentname = "x" + Convert.ToBase64String(agentID.GetBytes()); | 370 | string agentname = "x" + Convert.ToBase64String(agentID.GetBytes()); |
@@ -445,8 +445,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
445 | // voice channel | 445 | // voice channel |
446 | LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 446 | LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
447 | 447 | ||
448 | m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", | 448 | //m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", |
449 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); | 449 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); |
450 | 450 | ||
451 | // TODO: EstateSettings don't seem to get propagated... | 451 | // TODO: EstateSettings don't seem to get propagated... |
452 | // if (!scene.RegionInfo.EstateSettings.AllowVoice) | 452 | // if (!scene.RegionInfo.EstateSettings.AllowVoice) |
@@ -592,7 +592,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
592 | 592 | ||
593 | response["int_response_code"] = 200; | 593 | response["int_response_code"] = 200; |
594 | 594 | ||
595 | m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]); | 595 | //m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]); |
596 | return response; | 596 | return response; |
597 | } | 597 | } |
598 | 598 | ||
@@ -664,7 +664,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
664 | response["str_response_string"] = resp.ToString(); | 664 | response["str_response_string"] = resp.ToString(); |
665 | Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); | 665 | Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); |
666 | 666 | ||
667 | m_log.DebugFormat("[FREESWITCH]: {0}", normalizeEndLines.Replace((string)response["str_response_string"],"")); | 667 | //m_log.DebugFormat("[FREESWITCH]: {0}", normalizeEndLines.Replace((string)response["str_response_string"],"")); |
668 | return response; | 668 | return response; |
669 | } | 669 | } |
670 | 670 | ||
@@ -696,8 +696,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
696 | } | 696 | } |
697 | } | 697 | } |
698 | 698 | ||
699 | m_log.DebugFormat("[FreeSwitchVoice]: AUTH, URI: {0}, Content-Type:{1}, Body{2}", uri, contenttype, | 699 | //m_log.DebugFormat("[FreeSwitchVoice]: AUTH, URI: {0}, Content-Type:{1}, Body{2}", uri, contenttype, |
700 | requestbody); | 700 | // requestbody); |
701 | Hashtable response = new Hashtable(); | 701 | Hashtable response = new Hashtable(); |
702 | response["str_response_string"] = string.Format(@"<response xsi:schemaLocation=""/xsd/signin.xsd""> | 702 | response["str_response_string"] = string.Format(@"<response xsi:schemaLocation=""/xsd/signin.xsd""> |
703 | <level0> | 703 | <level0> |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 0c8113e..ccf5289 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -1173,10 +1173,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1173 | presence = scene.GetScenePresence(AgentID); | 1173 | presence = scene.GetScenePresence(AgentID); |
1174 | if (presence != null) | 1174 | if (presence != null) |
1175 | { | 1175 | { |
1176 | presence.Grouptitle = Title; | 1176 | if (presence.Grouptitle != Title) |
1177 | { | ||
1178 | presence.Grouptitle = Title; | ||
1177 | 1179 | ||
1178 | // FixMe: Ter suggests a "Schedule" method that I can't find. | 1180 | if (! presence.IsChildAgent) |
1179 | presence.SendFullUpdateToAllClients(); | 1181 | presence.SendAvatarDataToAllAgents(); |
1182 | } | ||
1180 | } | 1183 | } |
1181 | } | 1184 | } |
1182 | } | 1185 | } |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 0c99d8c..8b7871b 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -42,7 +42,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
42 | NewRez = 1, | 42 | NewRez = 1, |
43 | PrimCrossing = 2, | 43 | PrimCrossing = 2, |
44 | ScriptedRez = 3, | 44 | ScriptedRez = 3, |
45 | AttachedRez = 4 | 45 | AttachedRez = 4, |
46 | Teleporting = 5 | ||
46 | } | 47 | } |
47 | 48 | ||
48 | public interface IScriptWorkItem | 49 | public interface IScriptWorkItem |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d06b134..3c5f2d0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7759,24 +7759,59 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7759 | break; | 7759 | break; |
7760 | 7760 | ||
7761 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 7761 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
7762 | // TODO-------------- | ||
7763 | if (remain < 1) | 7762 | if (remain < 1) |
7764 | return res; | 7763 | return res; |
7765 | 7764 | ||
7766 | face=(int)rules.GetLSLIntegerItem(idx++); | 7765 | face=(int)rules.GetLSLIntegerItem(idx++); |
7767 | 7766 | ||
7768 | res.Add(new LSL_Integer(0)); | 7767 | tex = part.Shape.Textures; |
7769 | res.Add(new LSL_Integer(0)); | 7768 | if (face == ScriptBaseClass.ALL_SIDES) |
7769 | { | ||
7770 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7771 | { | ||
7772 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7773 | // Convert Shininess to PRIM_SHINY_* | ||
7774 | res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); | ||
7775 | // PRIM_BUMP_* | ||
7776 | res.Add(new LSL_Integer((int)texface.Bump)); | ||
7777 | } | ||
7778 | } | ||
7779 | else | ||
7780 | { | ||
7781 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7782 | { | ||
7783 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7784 | // Convert Shininess to PRIM_SHINY_* | ||
7785 | res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); | ||
7786 | // PRIM_BUMP_* | ||
7787 | res.Add(new LSL_Integer((int)texface.Bump)); | ||
7788 | } | ||
7789 | } | ||
7770 | break; | 7790 | break; |
7771 | 7791 | ||
7772 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 7792 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
7773 | // TODO-------------- | ||
7774 | if (remain < 1) | 7793 | if (remain < 1) |
7775 | return res; | 7794 | return res; |
7776 | 7795 | ||
7777 | face=(int)rules.GetLSLIntegerItem(idx++); | 7796 | face=(int)rules.GetLSLIntegerItem(idx++); |
7778 | 7797 | ||
7779 | res.Add(new LSL_Integer(0)); | 7798 | tex = part.Shape.Textures; |
7799 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7800 | { | ||
7801 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7802 | { | ||
7803 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7804 | res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); | ||
7805 | } | ||
7806 | } | ||
7807 | else | ||
7808 | { | ||
7809 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7810 | { | ||
7811 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7812 | res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); | ||
7813 | } | ||
7814 | } | ||
7780 | break; | 7815 | break; |
7781 | 7816 | ||
7782 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: | 7817 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: |
@@ -7797,14 +7832,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7797 | break; | 7832 | break; |
7798 | 7833 | ||
7799 | case (int)ScriptBaseClass.PRIM_TEXGEN: | 7834 | case (int)ScriptBaseClass.PRIM_TEXGEN: |
7800 | // TODO-------------- | ||
7801 | // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) | ||
7802 | if (remain < 1) | 7835 | if (remain < 1) |
7803 | return res; | 7836 | return res; |
7804 | 7837 | ||
7805 | face=(int)rules.GetLSLIntegerItem(idx++); | 7838 | face=(int)rules.GetLSLIntegerItem(idx++); |
7806 | 7839 | ||
7807 | res.Add(new LSL_Integer(0)); | 7840 | tex = part.Shape.Textures; |
7841 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7842 | { | ||
7843 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7844 | { | ||
7845 | MappingType texgen = tex.GetFace((uint)face).TexMapType; | ||
7846 | // Convert MappingType to PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR etc. | ||
7847 | res.Add(new LSL_Integer((uint)texgen >> 1)); | ||
7848 | } | ||
7849 | } | ||
7850 | else | ||
7851 | { | ||
7852 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7853 | { | ||
7854 | MappingType texgen = tex.GetFace((uint)face).TexMapType; | ||
7855 | res.Add(new LSL_Integer((uint)texgen >> 1)); | ||
7856 | } | ||
7857 | } | ||
7808 | break; | 7858 | break; |
7809 | 7859 | ||
7810 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: | 7860 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: |
@@ -7823,14 +7873,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7823 | break; | 7873 | break; |
7824 | 7874 | ||
7825 | case (int)ScriptBaseClass.PRIM_GLOW: | 7875 | case (int)ScriptBaseClass.PRIM_GLOW: |
7826 | // TODO-------------- | ||
7827 | if (remain < 1) | 7876 | if (remain < 1) |
7828 | return res; | 7877 | return res; |
7829 | 7878 | ||
7830 | face=(int)rules.GetLSLIntegerItem(idx++); | 7879 | face=(int)rules.GetLSLIntegerItem(idx++); |
7831 | 7880 | ||
7832 | res.Add(new LSL_Float(0)); | 7881 | tex = part.Shape.Textures; |
7882 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7883 | { | ||
7884 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7885 | { | ||
7886 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7887 | res.Add(new LSL_Float(texface.Glow)); | ||
7888 | } | ||
7889 | } | ||
7890 | else | ||
7891 | { | ||
7892 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7893 | { | ||
7894 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7895 | res.Add(new LSL_Float(texface.Glow)); | ||
7896 | } | ||
7897 | } | ||
7833 | break; | 7898 | break; |
7899 | |||
7834 | case (int)ScriptBaseClass.PRIM_TEXT: | 7900 | case (int)ScriptBaseClass.PRIM_TEXT: |
7835 | Color4 textColor = part.GetTextColor(); | 7901 | Color4 textColor = part.GetTextColor(); |
7836 | res.Add(part.Text); | 7902 | res.Add(part.Text); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 660e9a3..8e712b6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -390,19 +390,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
390 | } | 390 | } |
391 | else if (m_stateSource == StateSource.RegionStart) | 391 | else if (m_stateSource == StateSource.RegionStart) |
392 | { | 392 | { |
393 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); | 393 | //m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); |
394 | PostEvent(new EventParams("changed", | 394 | PostEvent(new EventParams("changed", |
395 | new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, | 395 | new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, new DetectParams[0])); |
396 | new DetectParams[0])); | ||
397 | } | 396 | } |
398 | else if (m_stateSource == StateSource.PrimCrossing) | 397 | else if (m_stateSource == StateSource.PrimCrossing || m_stateSource == StateSource.Teleporting) |
399 | { | 398 | { |
400 | // CHANGED_REGION | 399 | // CHANGED_REGION |
401 | PostEvent(new EventParams("changed", | 400 | PostEvent(new EventParams("changed", |
402 | new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, | 401 | new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, new DetectParams[0])); |
403 | new DetectParams[0])); | 402 | |
403 | // CHANGED_TELEPORT | ||
404 | if (m_stateSource == StateSource.Teleporting) | ||
405 | PostEvent(new EventParams("changed", | ||
406 | new Object[] { new LSL_Types.LSLInteger((int)Changed.TELEPORT) }, new DetectParams[0])); | ||
404 | } | 407 | } |
405 | } | 408 | } |
406 | else | 409 | else |
407 | { | 410 | { |
408 | Start(); | 411 | Start(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs index dfc9aa3..1d55b95 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
47 | { | 47 | { |
48 | 48 | ||
49 | private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6; | 49 | private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6; |
50 | private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d; | ||
50 | private LSL_Api m_lslApi; | 51 | private LSL_Api m_lslApi; |
51 | 52 | ||
52 | [SetUp] | 53 | [SetUp] |
@@ -164,5 +165,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
164 | Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail"); | 165 | Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail"); |
165 | Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail"); | 166 | Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail"); |
166 | } | 167 | } |
168 | |||
169 | [Test] | ||
170 | // llVecNorm test. | ||
171 | public void TestllVecNorm() | ||
172 | { | ||
173 | // Check special case for normalizing zero vector. | ||
174 | CheckllVecNorm(new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); | ||
175 | // Check various vectors. | ||
176 | CheckllVecNorm(new LSL_Types.Vector3(10.0d, 25.0d, 0.0d), new LSL_Types.Vector3(0.371391d, 0.928477d, 0.0d)); | ||
177 | CheckllVecNorm(new LSL_Types.Vector3(1.0d, 0.0d, 0.0d), new LSL_Types.Vector3(1.0d, 0.0d, 0.0d)); | ||
178 | CheckllVecNorm(new LSL_Types.Vector3(-90.0d, 55.0d, 2.0d), new LSL_Types.Vector3(-0.853128d, 0.521356d, 0.018958d)); | ||
179 | CheckllVecNorm(new LSL_Types.Vector3(255.0d, 255.0d, 255.0d), new LSL_Types.Vector3(0.577350d, 0.577350d, 0.577350d)); | ||
180 | } | ||
181 | |||
182 | public void CheckllVecNorm(LSL_Types.Vector3 vec, LSL_Types.Vector3 vecNormCheck) | ||
183 | { | ||
184 | // Call LSL function to normalize the vector. | ||
185 | LSL_Types.Vector3 vecNorm = m_lslApi.llVecNorm(vec); | ||
186 | // Check each vector component against expected result. | ||
187 | Assert.AreEqual(vecNorm.x, vecNormCheck.x, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on x component"); | ||
188 | Assert.AreEqual(vecNorm.y, vecNormCheck.y, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on y component"); | ||
189 | Assert.AreEqual(vecNorm.z, vecNormCheck.z, VECTOR_COMPONENT_ACCURACY, "TestllVecNorm vector check fail on z component"); | ||
190 | } | ||
167 | } | 191 | } |
168 | } | 192 | } |