diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 25 |
3 files changed, 64 insertions, 12 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 0a7d923..58fd2e7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3461,11 +3461,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3461 | new CoarseLocationUpdatePacket.IndexBlock(); | 3461 | new CoarseLocationUpdatePacket.IndexBlock(); |
3462 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; | 3462 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; |
3463 | loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; | 3463 | loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; |
3464 | 3464 | int selfindex = -1; | |
3465 | for (int i = 0; i < total; i++) | 3465 | for (int i = 0; i < total; i++) |
3466 | { | 3466 | { |
3467 | CoarseLocationUpdatePacket.LocationBlock lb = | 3467 | CoarseLocationUpdatePacket.LocationBlock lb = |
3468 | new CoarseLocationUpdatePacket.LocationBlock(); | 3468 | new CoarseLocationUpdatePacket.LocationBlock(); |
3469 | |||
3469 | lb.X = (byte)CoarseLocations[i].X; | 3470 | lb.X = (byte)CoarseLocations[i].X; |
3470 | lb.Y = (byte)CoarseLocations[i].Y; | 3471 | lb.Y = (byte)CoarseLocations[i].Y; |
3471 | 3472 | ||
@@ -3473,8 +3474,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3473 | loc.Location[i] = lb; | 3474 | loc.Location[i] = lb; |
3474 | loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); | 3475 | loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); |
3475 | loc.AgentData[i].AgentID = users[i]; | 3476 | loc.AgentData[i].AgentID = users[i]; |
3477 | if (users[i] == AgentId) | ||
3478 | selfindex = i; | ||
3476 | } | 3479 | } |
3477 | ib.You = -1; | 3480 | ib.You = (short)selfindex; |
3478 | ib.Prey = -1; | 3481 | ib.Prey = -1; |
3479 | loc.Index = ib; | 3482 | loc.Index = ib; |
3480 | loc.Header.Reliable = false; | 3483 | loc.Header.Reliable = false; |
@@ -10122,11 +10125,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10122 | Utils.BytesToString(avatarNotesUpdate.Data.Notes)); | 10125 | Utils.BytesToString(avatarNotesUpdate.Data.Notes)); |
10123 | break; | 10126 | break; |
10124 | 10127 | ||
10125 | // case PacketType.AvatarInterestsUpdate: | 10128 | case PacketType.AvatarInterestsUpdate: |
10126 | // AvatarInterestsUpdatePacket avatarInterestUpdate = | 10129 | AvatarInterestsUpdatePacket avatarInterestUpdate = |
10127 | // (AvatarInterestsUpdatePacket)Pack; | 10130 | (AvatarInterestsUpdatePacket)Pack; |
10128 | // | 10131 | |
10129 | // break; | 10132 | #region Packet Session and User Check |
10133 | if (m_checkPackets) | ||
10134 | { | ||
10135 | if (avatarInterestUpdate.AgentData.SessionID != SessionId || | ||
10136 | avatarInterestUpdate.AgentData.AgentID != AgentId) | ||
10137 | break; | ||
10138 | } | ||
10139 | #endregion | ||
10140 | |||
10141 | AvatarInterestUpdate handlerAvatarInterestUpdate = OnAvatarInterestUpdate; | ||
10142 | if (handlerAvatarInterestUpdate != null) | ||
10143 | handlerAvatarInterestUpdate(this, | ||
10144 | avatarInterestUpdate.PropertiesData.WantToMask, | ||
10145 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText), | ||
10146 | avatarInterestUpdate.PropertiesData.SkillsMask, | ||
10147 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText), | ||
10148 | Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); | ||
10149 | break; | ||
10130 | 10150 | ||
10131 | case PacketType.PlacesQuery: | 10151 | case PacketType.PlacesQuery: |
10132 | PlacesQueryPacket placesQueryPacket = | 10152 | PlacesQueryPacket placesQueryPacket = |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a5b88c6..973537e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -902,6 +902,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
902 | if (PhysicsActor != null) | 902 | if (PhysicsActor != null) |
903 | { | 903 | { |
904 | m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; | 904 | m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; |
905 | m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; | ||
905 | m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); | 906 | m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); |
906 | m_physicsActor.UnSubscribeEvents(); | 907 | m_physicsActor.UnSubscribeEvents(); |
907 | m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; | 908 | m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; |
@@ -2500,8 +2501,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2500 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 2501 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
2501 | for (int i = 0; i < avatars.Count; i++) | 2502 | for (int i = 0; i < avatars.Count; i++) |
2502 | { | 2503 | { |
2503 | if (avatars[i] != this) | 2504 | // Requested by LibOMV. Send Course Location on self. |
2504 | { | 2505 | //if (avatars[i] != this) |
2506 | //{ | ||
2505 | if (avatars[i].ParentID != 0) | 2507 | if (avatars[i].ParentID != 0) |
2506 | { | 2508 | { |
2507 | // sitting avatar | 2509 | // sitting avatar |
@@ -2523,7 +2525,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2523 | CoarseLocations.Add(avatars[i].m_pos); | 2525 | CoarseLocations.Add(avatars[i].m_pos); |
2524 | AvatarUUIDs.Add(avatars[i].UUID); | 2526 | AvatarUUIDs.Add(avatars[i].UUID); |
2525 | } | 2527 | } |
2526 | } | 2528 | //} |
2527 | } | 2529 | } |
2528 | 2530 | ||
2529 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); | 2531 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); |
@@ -3402,11 +3404,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
3402 | scene.AddPhysicsActorTaint(m_physicsActor); | 3404 | scene.AddPhysicsActorTaint(m_physicsActor); |
3403 | //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 3405 | //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
3404 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 3406 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; |
3407 | m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong | ||
3405 | m_physicsActor.SubscribeEvents(500); | 3408 | m_physicsActor.SubscribeEvents(500); |
3406 | m_physicsActor.LocalID = LocalId; | 3409 | m_physicsActor.LocalID = LocalId; |
3407 | 3410 | ||
3408 | } | 3411 | } |
3409 | 3412 | ||
3413 | private void OutOfBoundsCall(PhysicsVector pos) | ||
3414 | { | ||
3415 | bool flying = m_physicsActor.Flying; | ||
3416 | RemoveFromPhysicalScene(); | ||
3417 | |||
3418 | AddToPhysicalScene(flying); | ||
3419 | } | ||
3420 | |||
3410 | // Event called by the physics plugin to tell the avatar about a collision. | 3421 | // Event called by the physics plugin to tell the avatar about a collision. |
3411 | private void PhysicsCollisionUpdate(EventArgs e) | 3422 | private void PhysicsCollisionUpdate(EventArgs e) |
3412 | { | 3423 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd81d50..e5458d4 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1105,7 +1105,19 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1105 | public void UpdatePositionAndVelocity() | 1105 | public void UpdatePositionAndVelocity() |
1106 | { | 1106 | { |
1107 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! | 1107 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! |
1108 | d.Vector3 vec = d.BodyGetPosition(Body); | 1108 | d.Vector3 vec; |
1109 | try | ||
1110 | { | ||
1111 | vec = d.BodyGetPosition(Body); | ||
1112 | |||
1113 | } | ||
1114 | catch (NullReferenceException) | ||
1115 | { | ||
1116 | vec = new d.Vector3(_position.X, _position.Y, _position.Z); | ||
1117 | base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! | ||
1118 | m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); | ||
1119 | } | ||
1120 | |||
1109 | 1121 | ||
1110 | // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) | 1122 | // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) |
1111 | if (vec.X < 0.0f) vec.X = 0.0f; | 1123 | if (vec.X < 0.0f) vec.X = 0.0f; |
@@ -1137,7 +1149,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1137 | else | 1149 | else |
1138 | { | 1150 | { |
1139 | m_lastUpdateSent = false; | 1151 | m_lastUpdateSent = false; |
1140 | vec = d.BodyGetLinearVel(Body); | 1152 | try |
1153 | { | ||
1154 | vec = d.BodyGetLinearVel(Body); | ||
1155 | } | ||
1156 | catch (NullReferenceException) | ||
1157 | { | ||
1158 | vec.X = _velocity.X; | ||
1159 | vec.Y = _velocity.Y; | ||
1160 | vec.Z = _velocity.Z; | ||
1161 | } | ||
1141 | _velocity.X = (vec.X); | 1162 | _velocity.X = (vec.X); |
1142 | _velocity.Y = (vec.Y); | 1163 | _velocity.Y = (vec.Y); |
1143 | 1164 | ||