Added Basic Parcel Support

*Created Parcel class to handle each parcel 
*Created ParcelManager class to handle the Parcel Object 
*For now, by default it is assigned to a fake avatar key and set for sale to L$0
This commit is contained in:
mingchen
2007-06-03 16:02:08 +00:00
parent 79de35aea2
commit f22e27498e
11 changed files with 751 additions and 697 deletions

View File

@@ -292,6 +292,30 @@ namespace OpenSim.world
}
}
}
#region Parcel Packet Handlers
void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, ClientView remote_client)
{
//Get the parcels within the bounds
List<Parcel> temp = new List<Parcel>();
int x, y;
int inc_x = end_x - start_x;
int inc_y = end_y - start_y;
for(x = 0; x < inc_x; x++)
{
for(y = 0; y < inc_y; y++)
{
Parcel currentParcel = parcelManager.getParcel(start_x + x,start_y + y);
if(!temp.Contains(currentParcel))
{
temp.Add(currentParcel);
currentParcel.sendParcelProperties(sequence_id,snap_selection,remote_client);
}
}
}
parcelManager.sendParcelOverlay(remote_client);
}
#endregion
/*
public void RequestMapBlock(ClientView simClient, int minX, int minY, int maxX, int maxY)

View File

@@ -35,6 +35,7 @@ namespace OpenSim.world
private Dictionary<string, ScriptFactory> m_scripts;
private Mutex updateLock;
public string m_datastore;
public ParcelManager parcelManager;
#region Properties
public PhysicsScene PhysScene
@@ -85,6 +86,8 @@ namespace OpenSim.world
Avatar.LoadAnims();
this.SetDefaultScripts();
this.LoadScriptEngines();
parcelManager = new ParcelManager(this);
}
catch (Exception e)
{
@@ -564,6 +567,7 @@ namespace OpenSim.world
agentClient.OnLinkObjects += new LinkObjects(this.LinkObjects);
agentClient.OnAddPrim += new ClientView.GenericCall4(this.AddNewPrim);
agentClient.OnUpdatePrimShape += new ClientView.UpdateShape(this.UpdatePrimShape);
agentClient.OnObjectSelect += new ClientView.ObjectSelect(this.SelectPrim);
agentClient.OnUpdatePrimFlags += new ClientView.UpdatePrimFlags(this.UpdatePrimFlags);
agentClient.OnUpdatePrimTexture += new ClientView.UpdatePrimTexture(this.UpdatePrimTexture);
@@ -571,6 +575,8 @@ namespace OpenSim.world
agentClient.OnUpdatePrimRotation += new ClientView.UpdatePrimRotation(this.UpdatePrimRotation);
agentClient.OnUpdatePrimScale += new ClientView.UpdatePrimVector(this.UpdatePrimScale);
agentClient.OnDeRezObject += new ClientView.GenericCall4(this.DeRezObject);
agentClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(ParcelPropertiesRequest);
Avatar newAvatar = null;
try
{
@@ -618,6 +624,8 @@ namespace OpenSim.world
return newAvatar;
}
public override void RemoveViewerAgent(ClientView agentClient)
{
try