Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into prioritization

prioritization
John Hurliman 2009-10-16 10:09:19 -07:00
commit 06354a093d
4 changed files with 69 additions and 17 deletions

View File

@ -3461,11 +3461,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
new CoarseLocationUpdatePacket.IndexBlock(); new CoarseLocationUpdatePacket.IndexBlock();
loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total];
loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total];
int selfindex = -1;
for (int i = 0; i < total; i++) for (int i = 0; i < total; i++)
{ {
CoarseLocationUpdatePacket.LocationBlock lb = CoarseLocationUpdatePacket.LocationBlock lb =
new CoarseLocationUpdatePacket.LocationBlock(); new CoarseLocationUpdatePacket.LocationBlock();
lb.X = (byte)CoarseLocations[i].X; lb.X = (byte)CoarseLocations[i].X;
lb.Y = (byte)CoarseLocations[i].Y; lb.Y = (byte)CoarseLocations[i].Y;
@ -3473,8 +3474,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
loc.Location[i] = lb; loc.Location[i] = lb;
loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock();
loc.AgentData[i].AgentID = users[i]; loc.AgentData[i].AgentID = users[i];
if (users[i] == AgentId)
selfindex = i;
} }
ib.You = -1; ib.You = (short)selfindex;
ib.Prey = -1; ib.Prey = -1;
loc.Index = ib; loc.Index = ib;
loc.Header.Reliable = false; loc.Header.Reliable = false;
@ -10122,11 +10125,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
Utils.BytesToString(avatarNotesUpdate.Data.Notes)); Utils.BytesToString(avatarNotesUpdate.Data.Notes));
break; break;
// case PacketType.AvatarInterestsUpdate: case PacketType.AvatarInterestsUpdate:
// AvatarInterestsUpdatePacket avatarInterestUpdate = AvatarInterestsUpdatePacket avatarInterestUpdate =
// (AvatarInterestsUpdatePacket)Pack; (AvatarInterestsUpdatePacket)Pack;
//
// break; #region Packet Session and User Check
if (m_checkPackets)
{
if (avatarInterestUpdate.AgentData.SessionID != SessionId ||
avatarInterestUpdate.AgentData.AgentID != AgentId)
break;
}
#endregion
AvatarInterestUpdate handlerAvatarInterestUpdate = OnAvatarInterestUpdate;
if (handlerAvatarInterestUpdate != null)
handlerAvatarInterestUpdate(this,
avatarInterestUpdate.PropertiesData.WantToMask,
Utils.BytesToString(avatarInterestUpdate.PropertiesData.WantToText),
avatarInterestUpdate.PropertiesData.SkillsMask,
Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText),
Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText));
break;
case PacketType.PlacesQuery: case PacketType.PlacesQuery:
PlacesQueryPacket placesQueryPacket = PlacesQueryPacket placesQueryPacket =

View File

@ -902,6 +902,7 @@ namespace OpenSim.Region.Framework.Scenes
if (PhysicsActor != null) if (PhysicsActor != null)
{ {
m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
m_physicsActor.OnOutOfBounds -= OutOfBoundsCall;
m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
m_physicsActor.UnSubscribeEvents(); m_physicsActor.UnSubscribeEvents();
m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
@ -2500,8 +2501,9 @@ namespace OpenSim.Region.Framework.Scenes
List<ScenePresence> avatars = m_scene.GetAvatars(); List<ScenePresence> avatars = m_scene.GetAvatars();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
if (avatars[i] != this) // Requested by LibOMV. Send Course Location on self.
{ //if (avatars[i] != this)
//{
if (avatars[i].ParentID != 0) if (avatars[i].ParentID != 0)
{ {
// sitting avatar // sitting avatar
@ -2523,7 +2525,7 @@ namespace OpenSim.Region.Framework.Scenes
CoarseLocations.Add(avatars[i].m_pos); CoarseLocations.Add(avatars[i].m_pos);
AvatarUUIDs.Add(avatars[i].UUID); AvatarUUIDs.Add(avatars[i].UUID);
} }
} //}
} }
m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations);
@ -3402,11 +3404,20 @@ namespace OpenSim.Region.Framework.Scenes
scene.AddPhysicsActorTaint(m_physicsActor); scene.AddPhysicsActorTaint(m_physicsActor);
//m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
m_physicsActor.SubscribeEvents(500); m_physicsActor.SubscribeEvents(500);
m_physicsActor.LocalID = LocalId; m_physicsActor.LocalID = LocalId;
} }
private void OutOfBoundsCall(PhysicsVector pos)
{
bool flying = m_physicsActor.Flying;
RemoveFromPhysicalScene();
AddToPhysicalScene(flying);
}
// Event called by the physics plugin to tell the avatar about a collision. // Event called by the physics plugin to tell the avatar about a collision.
private void PhysicsCollisionUpdate(EventArgs e) private void PhysicsCollisionUpdate(EventArgs e)
{ {

View File

@ -1105,7 +1105,19 @@ namespace OpenSim.Region.Physics.OdePlugin
public void UpdatePositionAndVelocity() public void UpdatePositionAndVelocity()
{ {
// no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
d.Vector3 vec = d.BodyGetPosition(Body); d.Vector3 vec;
try
{
vec = d.BodyGetPosition(Body);
}
catch (NullReferenceException)
{
vec = new d.Vector3(_position.X, _position.Y, _position.Z);
base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem!
m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name);
}
// kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!)
if (vec.X < 0.0f) vec.X = 0.0f; if (vec.X < 0.0f) vec.X = 0.0f;
@ -1137,7 +1149,16 @@ namespace OpenSim.Region.Physics.OdePlugin
else else
{ {
m_lastUpdateSent = false; m_lastUpdateSent = false;
vec = d.BodyGetLinearVel(Body); try
{
vec = d.BodyGetLinearVel(Body);
}
catch (NullReferenceException)
{
vec.X = _velocity.X;
vec.Y = _velocity.Y;
vec.Z = _velocity.Z;
}
_velocity.X = (vec.X); _velocity.X = (vec.X);
_velocity.Y = (vec.Y); _velocity.Y = (vec.Y);

View File

@ -58,7 +58,7 @@ LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService"
AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
StorageProvider = "OpenSim.Data.MySQL.dll" StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;" ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;"
; Realm = "auth" ; Realm = "users"
; * This is the new style user service. ; * This is the new style user service.
; * "Realm" is the table that is used for user lookup. ; * "Realm" is the table that is used for user lookup.
@ -75,7 +75,7 @@ ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=gr
; * It defaults to "regions", which uses the legacy tables ; * It defaults to "regions", which uses the legacy tables
; * ; *
[GridService] [GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=grid;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=grid;"
Realm = "regions" Realm = "regions"