*Trunk compiles now

*Added "RemoveEntity" and renamed "AddNewEntity" to "AddEntity"
afrisby
mingchen 2007-07-16 14:56:35 +00:00
parent cba02cb632
commit d216f5779c
6 changed files with 50 additions and 7 deletions

View File

@ -57,6 +57,8 @@ namespace OpenSim.Framework
public event ParcelJoinRequest OnParcelJoinRequest; public event ParcelJoinRequest OnParcelJoinRequest;
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
public event ParcelSelectObjects OnParcelSelectObjects; public event ParcelSelectObjects OnParcelSelectObjects;
public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
public event ObjectDeselect OnObjectDeselect;
public event EstateOwnerMessageRequest OnEstateOwnerMessage; public event EstateOwnerMessageRequest OnEstateOwnerMessage;

View File

@ -240,7 +240,7 @@ namespace OpenSim
scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
scene.localStorage.LoadParcels((ILocalStorageParcelReceiver)scene.ParcelManager); scene.localStorage.LoadParcels((ILocalStorageParcelReceiver)scene.ParcelManager);
} }
LocalWorld.performParcelPrimCountUpdate(); scene.performParcelPrimCountUpdate();
scene.StartTimer(); scene.StartTimer();
} }
} }

View File

@ -1024,6 +1024,7 @@ namespace OpenSim.Region.Environment
} }
#endregion #endregion
#region Object Select and Object Owner Listing
public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
{ {
List<uint> resultLocalIDs = new List<uint>(); List<uint> resultLocalIDs = new List<uint>();
@ -1123,6 +1124,19 @@ namespace OpenSim.Region.Environment
remote_client.OutPacket(pack); remote_client.OutPacket(pack);
} }
} }
#endregion
#region Object Returning
public void returnObject(SceneObject obj)
{
}
public void returnParcelObjects(int type, LLUUID owner)
{
}
#endregion
#region Object Adding/Removing from Parcel
public void resetParcelPrimCounts() public void resetParcelPrimCounts()
{ {
parcelData.groupPrims = 0; parcelData.groupPrims = 0;
@ -1180,7 +1194,7 @@ namespace OpenSim.Region.Environment
primsOverMe.Remove(obj); primsOverMe.Remove(obj);
} }
} }
#endregion
#endregion #endregion

View File

@ -155,7 +155,7 @@ namespace OpenSim.Region.Environment.Scenes
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects(); List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
foreach (SceneObject prim in PrimsFromDB) foreach (SceneObject prim in PrimsFromDB)
{ {
Prims.Add(prim.uuid, prim); AddEntity(prim);
} }
MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)"); MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)");
@ -483,14 +483,40 @@ namespace OpenSim.Region.Environment.Scenes
{ {
SceneObject sceneOb = new SceneObject(this, m_eventManager, ownerID, this.PrimIDAllocate(), pos, shape); SceneObject sceneOb = new SceneObject(this, m_eventManager, ownerID, this.PrimIDAllocate(), pos, shape);
AddNewEntity(sceneOb); AddEntity(sceneOb);
} }
public void AddNewEntity(SceneObject sceneObject) public void RemovePrim(uint localID, LLUUID avatar_deleter)
{
foreach (EntityBase obj in Entities.Values)
{
if (obj is SceneObject)
{
if (((SceneObject)obj).LocalId == localID)
{
RemoveEntity((SceneObject)obj);
return;
}
}
}
}
public void AddEntity(SceneObject sceneObject)
{ {
this.Entities.Add(sceneObject.rootUUID, sceneObject); this.Entities.Add(sceneObject.rootUUID, sceneObject);
} }
public void RemoveEntity(SceneObject sceneObject)
{
if (this.Entities.ContainsKey(sceneObject.rootUUID))
{
m_parcelManager.removePrimFromParcelCounts(sceneObject);
this.Entities.Remove(sceneObject.rootUUID);
m_parcelManager.setPrimsTainted();
}
}
/// <summary> /// <summary>
/// Called by a prim when it has been created/cloned, so that its events can be subscribed to /// Called by a prim when it has been created/cloned, so that its events can be subscribed to
/// </summary> /// </summary>

View File

@ -69,7 +69,8 @@ namespace SimpleApp
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
public event ParcelSelectObjects OnParcelSelectObjects; public event ParcelSelectObjects OnParcelSelectObjects;
public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
public event ObjectDeselect OnObjectDeselect;
public event EstateOwnerMessageRequest OnEstateOwnerMessage; public event EstateOwnerMessageRequest OnEstateOwnerMessage;
private LLUUID myID = LLUUID.Random(); private LLUUID myID = LLUUID.Random();

View File

@ -92,7 +92,7 @@ namespace SimpleApp
LLVector3 pos = new LLVector3(138, 129, 27); LLVector3 pos = new LLVector3(138, 129, 27);
m_sceneObject = new MySceneObject(world, world.EventManager, LLUUID.Zero, world.PrimIDAllocate(), pos, shape); m_sceneObject = new MySceneObject(world, world.EventManager, LLUUID.Zero, world.PrimIDAllocate(), pos, shape);
world.AddNewEntity(m_sceneObject); world.AddEntity(m_sceneObject);
m_character = new MyNpcCharacter(); m_character = new MyNpcCharacter();
world.AddNewClient(m_character, false); world.AddNewClient(m_character, false);