aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2009-10-10 10:26:47 +0100
committerMelanie2009-10-10 10:26:47 +0100
commit5e6e31591cfc17746f9b1d837d3cc2045c9f7766 (patch)
tree568f45c145bf4ed1396de8df145a95ff8b947427 /OpenSim
parent* Changed the "Packet exceeded buffer size" log line to debug and include the... (diff)
parentFix selling objects (diff)
downloadopensim-SC-5e6e31591cfc17746f9b1d837d3cc2045c9f7766.zip
opensim-SC-5e6e31591cfc17746f9b1d837d3cc2045c9f7766.tar.gz
opensim-SC-5e6e31591cfc17746f9b1d837d3cc2045c9f7766.tar.bz2
opensim-SC-5e6e31591cfc17746f9b1d837d3cc2045c9f7766.tar.xz
Merge branch 'master' into htb-throttle
This is hand-edited to not let master changes creep into here and may cause a somewhat rocky merge to master later.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs35
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs18
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs1
5 files changed, 43 insertions, 33 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 2410f31..4bf9018 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -209,35 +209,24 @@ namespace OpenSim.Framework.Communications
209 209
210 private string[] doUUIDNameRequest(UUID uuid) 210 private string[] doUUIDNameRequest(UUID uuid)
211 { 211 {
212 string[] returnstring = new string[0];
213 bool doLookup = false;
214
215 lock (m_nameRequestCache) 212 lock (m_nameRequestCache)
216 { 213 {
217 if (m_nameRequestCache.ContainsKey(uuid)) 214 if (m_nameRequestCache.ContainsKey(uuid))
218 { 215 return m_nameRequestCache[uuid];
219 returnstring = m_nameRequestCache[uuid];
220 }
221 else
222 {
223 // we don't want to lock the dictionary while we're doing the lookup
224 doLookup = true;
225 }
226 } 216 }
227 217
228 if (doLookup) { 218 string[] returnstring = new string[0];
229 UserProfileData profileData = m_userService.GetUserProfile(uuid); 219 CachedUserInfo uinfo = UserProfileCacheService.GetUserDetails(uuid);
230 if (profileData != null) 220
221 if ((uinfo != null) && (uinfo.UserProfile != null))
222 {
223 returnstring = new string[2];
224 returnstring[0] = uinfo.UserProfile.FirstName;
225 returnstring[1] = uinfo.UserProfile.SurName;
226 lock (m_nameRequestCache)
231 { 227 {
232 returnstring = new string[2]; 228 if (!m_nameRequestCache.ContainsKey(uuid))
233 // UUID profileId = profileData.ID; 229 m_nameRequestCache.Add(uuid, returnstring);
234 returnstring[0] = profileData.FirstName;
235 returnstring[1] = profileData.SurName;
236 lock (m_nameRequestCache)
237 {
238 if (!m_nameRequestCache.ContainsKey(uuid))
239 m_nameRequestCache.Add(uuid, returnstring);
240 }
241 } 230 }
242 } 231 }
243 232
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 901144a..fe9de1b 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -556,6 +556,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
556 556
557 // Customize the EveryoneMask 557 // Customize the EveryoneMask
558 uint objectEveryoneMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags); 558 uint objectEveryoneMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags);
559 if (objectOwner != UUID.Zero)
560 objectEveryoneMask |= (uint)PrimFlags.ObjectAnyOwner;
559 561
560 if (m_bypassPermissions) 562 if (m_bypassPermissions)
561 return objectOwnerMask; 563 return objectOwnerMask;
@@ -578,12 +580,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
578 { 580 {
579 // Admin objects should not be editable by the above 581 // Admin objects should not be editable by the above
580 if (!IsAdministrator(objectOwner)) 582 if (!IsAdministrator(objectOwner))
581 return objectOwnerMask; 583 return objectOwnerMask;
582 } 584 }
583 585
584 if ((objectOwnerMask & (uint)PermissionMask.Transfer) != 0 && task.ObjectSaleType != 0)
585 objectEveryoneMask |= (uint)PrimFlags.ObjectTransfer;
586
587 // Group permissions 586 // Group permissions
588 if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0)) 587 if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0))
589 return objectGroupMask | objectEveryoneMask; 588 return objectGroupMask | objectEveryoneMask;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3996cdc..15fb11f 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3409,7 +3409,7 @@ namespace OpenSim.Region.Framework.Scenes
3409 scene.AddPhysicsActorTaint(m_physicsActor); 3409 scene.AddPhysicsActorTaint(m_physicsActor);
3410 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3410 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3411 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3411 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3412 m_physicsActor.SubscribeEvents(1000); 3412 m_physicsActor.SubscribeEvents(500);
3413 m_physicsActor.LocalID = LocalId; 3413 m_physicsActor.LocalID = LocalId;
3414 3414
3415 } 3415 }
@@ -3417,7 +3417,15 @@ namespace OpenSim.Region.Framework.Scenes
3417 // Event called by the physics plugin to tell the avatar about a collision. 3417 // Event called by the physics plugin to tell the avatar about a collision.
3418 private void PhysicsCollisionUpdate(EventArgs e) 3418 private void PhysicsCollisionUpdate(EventArgs e)
3419 { 3419 {
3420 if ((e == null) || m_invulnerable) 3420 if (e == null)
3421 return;
3422
3423 //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f))
3424 // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents(
3425 // as of this comment the interval is set in AddToPhysicalScene
3426 UpdateMovementAnimations();
3427
3428 if (m_invulnerable)
3421 return; 3429 return;
3422 CollisionEventUpdate collisionData = (CollisionEventUpdate)e; 3430 CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
3423 Dictionary<uint, float> coldata = collisionData.m_objCollisionList; 3431 Dictionary<uint, float> coldata = collisionData.m_objCollisionList;
@@ -3455,8 +3463,7 @@ namespace OpenSim.Region.Framework.Scenes
3455 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 3463 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
3456 } 3464 }
3457 3465
3458 if (Velocity.X > 0 || Velocity.Y > 0) 3466
3459 UpdateMovementAnimations();
3460 } 3467 }
3461 3468
3462 public void setHealthWithUpdate(float health) 3469 public void setHealthWithUpdate(float health)
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index a00ba11..bd81d50 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -98,6 +98,7 @@ namespace OpenSim.Region.Physics.OdePlugin
98 private bool m_alwaysRun = false; 98 private bool m_alwaysRun = false;
99 private bool m_hackSentFall = false; 99 private bool m_hackSentFall = false;
100 private bool m_hackSentFly = false; 100 private bool m_hackSentFly = false;
101 private int m_requestedUpdateFrequency = 0;
101 private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); 102 private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0);
102 public uint m_localID = 0; 103 public uint m_localID = 0;
103 public bool m_returnCollisions = false; 104 public bool m_returnCollisions = false;
@@ -1184,26 +1185,31 @@ namespace OpenSim.Region.Physics.OdePlugin
1184 1185
1185 public override void SubscribeEvents(int ms) 1186 public override void SubscribeEvents(int ms)
1186 { 1187 {
1188 m_requestedUpdateFrequency = ms;
1187 m_eventsubscription = ms; 1189 m_eventsubscription = ms;
1188 _parent_scene.addCollisionEventReporting(this); 1190 _parent_scene.addCollisionEventReporting(this);
1189 } 1191 }
1190 public override void UnSubscribeEvents() 1192 public override void UnSubscribeEvents()
1191 { 1193 {
1192 _parent_scene.remCollisionEventReporting(this); 1194 _parent_scene.remCollisionEventReporting(this);
1195 m_requestedUpdateFrequency = 0;
1193 m_eventsubscription = 0; 1196 m_eventsubscription = 0;
1194 } 1197 }
1195 public void AddCollisionEvent(uint CollidedWith, float depth) 1198 public void AddCollisionEvent(uint CollidedWith, float depth)
1196 { 1199 {
1197 if (m_eventsubscription > 0) 1200 if (m_eventsubscription > 0)
1198 CollisionEventsThisFrame.addCollider(CollidedWith,depth); 1201 {
1202 CollisionEventsThisFrame.addCollider(CollidedWith, depth);
1203 }
1199 } 1204 }
1200 1205
1201 public void SendCollisions() 1206 public void SendCollisions()
1202 { 1207 {
1203 if (m_eventsubscription > 0) 1208 if (m_eventsubscription > m_requestedUpdateFrequency)
1204 { 1209 {
1205 base.SendCollisionUpdate(CollisionEventsThisFrame); 1210 base.SendCollisionUpdate(CollisionEventsThisFrame);
1206 CollisionEventsThisFrame = new CollisionEventUpdate(); 1211 CollisionEventsThisFrame = new CollisionEventUpdate();
1212 m_eventsubscription = 0;
1207 } 1213 }
1208 } 1214 }
1209 public override bool SubscribedEvents() 1215 public override bool SubscribedEvents()
@@ -1309,5 +1315,13 @@ namespace OpenSim.Region.Physics.OdePlugin
1309 } 1315 }
1310 1316
1311 } 1317 }
1318
1319 internal void AddCollisionFrameTime(int p)
1320 {
1321 // protect it from overflow crashing
1322 if (m_eventsubscription + p >= int.MaxValue)
1323 m_eventsubscription = 0;
1324 m_eventsubscription += p;
1325 }
1312 } 1326 }
1313} 1327}
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index f5ab1de..083b7db 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -2928,6 +2928,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2928 { 2928 {
2929 case ActorTypes.Agent: 2929 case ActorTypes.Agent:
2930 OdeCharacter cobj = (OdeCharacter)obj; 2930 OdeCharacter cobj = (OdeCharacter)obj;
2931 cobj.AddCollisionFrameTime(100);
2931 cobj.SendCollisions(); 2932 cobj.SendCollisions();
2932 break; 2933 break;
2933 case ActorTypes.Prim: 2934 case ActorTypes.Prim: