* Started renaming world to Scene
* Update and UpdateMovement now first stores array to avoid collection update exceptions * Ignored some binsafrisby
parent
74654dc735
commit
39b64564dc
|
@ -44,7 +44,7 @@ namespace OpenSim.Framework.Interfaces
|
||||||
void LoadPrimitives(ILocalStorageReceiver receiver);
|
void LoadPrimitives(ILocalStorageReceiver receiver);
|
||||||
|
|
||||||
[System.Obsolete("Use DataStorage instead")]
|
[System.Obsolete("Use DataStorage instead")]
|
||||||
float[] LoadWorld();
|
float[] LoadScene();
|
||||||
[System.Obsolete("Use DataStorage instead")]
|
[System.Obsolete("Use DataStorage instead")]
|
||||||
void SaveMap(float[] heightmap);
|
void SaveMap(float[] heightmap);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ using OpenSim.Framework.Types;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Interfaces
|
namespace OpenSim.Framework.Interfaces
|
||||||
{
|
{
|
||||||
public interface IWorld
|
public interface IScene
|
||||||
{
|
{
|
||||||
void AddNewClient(IClientAPI client, bool child);
|
void AddNewClient(IClientAPI client, bool child);
|
||||||
void RemoveClient(LLUUID agentID);
|
void RemoveClient(LLUUID agentID);
|
|
@ -65,7 +65,7 @@ namespace OpenSim
|
||||||
|
|
||||||
protected List<UDPServer> m_udpServers = new List<UDPServer>();
|
protected List<UDPServer> m_udpServers = new List<UDPServer>();
|
||||||
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
|
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
|
||||||
protected List<IWorld> m_localWorld = new List<IWorld>();
|
protected List<IScene> m_localScenes = new List<IScene>();
|
||||||
|
|
||||||
private bool m_silent;
|
private bool m_silent;
|
||||||
private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
|
private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
|
||||||
|
@ -83,7 +83,7 @@ namespace OpenSim
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs initialisation of the world, such as loading configuration from disk.
|
/// Performs initialisation of the scene, such as loading configuration from disk.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void StartUp()
|
public override void StartUp()
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ namespace OpenSim
|
||||||
UDPServer udpServer;
|
UDPServer udpServer;
|
||||||
Scene scene = SetupScene(regionInfo, out udpServer);
|
Scene scene = SetupScene(regionInfo, out udpServer);
|
||||||
|
|
||||||
m_localWorld.Add(scene);
|
m_localScenes.Add(scene);
|
||||||
|
|
||||||
|
|
||||||
m_udpServers.Add(udpServer);
|
m_udpServers.Add(udpServer);
|
||||||
|
@ -311,9 +311,9 @@ namespace OpenSim
|
||||||
m_log.Verbose("Main.cs:Shutdown() - Killing clients");
|
m_log.Verbose("Main.cs:Shutdown() - Killing clients");
|
||||||
// IMPLEMENT THIS
|
// IMPLEMENT THIS
|
||||||
m_log.Verbose("Main.cs:Shutdown() - Closing console and terminating");
|
m_log.Verbose("Main.cs:Shutdown() - Closing console and terminating");
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
((Scene)m_localWorld[i]).Close();
|
((Scene)m_localScenes[i]).Close();
|
||||||
}
|
}
|
||||||
m_log.Close();
|
m_log.Close();
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
|
@ -343,32 +343,32 @@ namespace OpenSim
|
||||||
|
|
||||||
case "terrain":
|
case "terrain":
|
||||||
string result = "";
|
string result = "";
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
if (!((Scene)m_localWorld[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localWorld[i].RegionInfo.RegionName))
|
if (!((Scene)m_localScenes[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localScenes[i].RegionInfo.RegionName))
|
||||||
{
|
{
|
||||||
m_log.Error(result);
|
m_log.Error(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "script":
|
case "script":
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
((Scene)m_localWorld[i]).SendCommandToScripts(cmdparams);
|
((Scene)m_localScenes[i]).SendCommandToScripts(cmdparams);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "backup":
|
case "backup":
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
((Scene)m_localWorld[i]).Backup();
|
((Scene)m_localScenes[i]).Backup();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "alert":
|
case "alert":
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
((Scene)m_localWorld[i]).HandleAlertCommand(cmdparams);
|
((Scene)m_localScenes[i]).HandleAlertCommand(cmdparams);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -398,14 +398,14 @@ namespace OpenSim
|
||||||
case "users":
|
case "users":
|
||||||
ScenePresence TempAv;
|
ScenePresence TempAv;
|
||||||
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
|
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
|
||||||
for (int i = 0; i < m_localWorld.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
foreach (libsecondlife.LLUUID UUID in ((Scene)m_localWorld[i]).Entities.Keys)
|
foreach (libsecondlife.LLUUID UUID in ((Scene)m_localScenes[i]).Entities.Keys)
|
||||||
{
|
{
|
||||||
if (((Scene)m_localWorld[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
if (((Scene)m_localScenes[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
||||||
{
|
{
|
||||||
TempAv = (ScenePresence)((Scene)m_localWorld[i]).Entities[UUID];
|
TempAv = (ScenePresence)((Scene)m_localScenes[i]).Entities[UUID];
|
||||||
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localWorld[i]).RegionInfo.RegionName);
|
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localScenes[i]).RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region World/Avatar to Client
|
#region Scene/Avatar to Client
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#region World/Avatar
|
#region Scene/Avatar
|
||||||
case PacketType.ChatFromViewer:
|
case PacketType.ChatFromViewer:
|
||||||
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
||||||
if (Util.FieldToString(inchatpack.ChatData.Message) == "")
|
if (Util.FieldToString(inchatpack.ChatData.Message) == "")
|
||||||
|
@ -466,33 +466,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
// Console.WriteLine(Pack.ToString());
|
// Console.WriteLine(Pack.ToString());
|
||||||
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
|
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
|
||||||
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
||||||
/*if (myinventory != null)
|
|
||||||
{
|
|
||||||
if (updatetask.UpdateData.Key == 0)
|
|
||||||
{
|
|
||||||
if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
|
|
||||||
{
|
|
||||||
if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7)
|
|
||||||
{
|
|
||||||
LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID;
|
|
||||||
AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
|
|
||||||
if (assBase != null)
|
|
||||||
{
|
|
||||||
foreach (Entity ent in m_world.Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == updatetask.UpdateData.LocalID)
|
|
||||||
{
|
|
||||||
if (ent is OpenSim.world.Primitive)
|
|
||||||
{
|
|
||||||
this.m_world.AddScript(ent, Util.FieldToString(assBase.Data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
break;
|
break;
|
||||||
case PacketType.MapLayerRequest:
|
case PacketType.MapLayerRequest:
|
||||||
this.RequestMapLayer();
|
this.RequestMapLayer();
|
||||||
|
@ -524,7 +498,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
AssetLandmark lm = new AssetLandmark(lma);
|
AssetLandmark lm = new AssetLandmark(lma);
|
||||||
|
|
||||||
if (lm.RegionID == m_world.RegionInfo.SimUUID)
|
if (lm.RegionID == m_scene.RegionInfo.SimUUID)
|
||||||
{
|
{
|
||||||
TeleportLocalPacket tpLocal = new TeleportLocalPacket();
|
TeleportLocalPacket tpLocal = new TeleportLocalPacket();
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
private AgentAssetUpload UploadAssets;
|
private AgentAssetUpload UploadAssets;
|
||||||
private LLUUID newAssetFolder = LLUUID.Zero;
|
private LLUUID newAssetFolder = LLUUID.Zero;
|
||||||
private bool debug = false;
|
private bool debug = false;
|
||||||
protected IWorld m_world;
|
protected IScene m_scene;
|
||||||
private Dictionary<uint, ClientView> m_clientThreads;
|
private Dictionary<uint, ClientView> m_clientThreads;
|
||||||
private AssetCache m_assetCache;
|
private AssetCache m_assetCache;
|
||||||
private InventoryCache m_inventoryCache;
|
private InventoryCache m_inventoryCache;
|
||||||
|
@ -85,9 +85,9 @@ namespace OpenSim.Region.ClientStack
|
||||||
private int probesWithNoIngressPackets = 0;
|
private int probesWithNoIngressPackets = 0;
|
||||||
private int lastPacketsReceived = 0;
|
private int lastPacketsReceived = 0;
|
||||||
|
|
||||||
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
|
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
|
||||||
{
|
{
|
||||||
m_world = world;
|
m_scene = scene;
|
||||||
m_clientThreads = clientThreads;
|
m_clientThreads = clientThreads;
|
||||||
m_assetCache = assetCache;
|
m_assetCache = assetCache;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
clientPingTimer.Stop();
|
clientPingTimer.Stop();
|
||||||
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
||||||
m_world.RemoveClient(this.AgentId);
|
m_scene.RemoveClient(this.AgentId);
|
||||||
|
|
||||||
m_clientThreads.Remove(this.CircuitCode);
|
m_clientThreads.Remove(this.CircuitCode);
|
||||||
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
||||||
|
@ -231,8 +231,8 @@ namespace OpenSim.Region.ClientStack
|
||||||
clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
|
clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
|
||||||
clientPingTimer.Enabled = true;
|
clientPingTimer.Enabled = true;
|
||||||
|
|
||||||
MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
|
||||||
this.m_world.AddNewClient(this, false);
|
this.m_scene.AddNewClient(this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void AuthUser()
|
protected virtual void AuthUser()
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
public class PacketServer
|
public class PacketServer
|
||||||
{
|
{
|
||||||
private ClientStackNetworkHandler _networkHandler;
|
private ClientStackNetworkHandler _networkHandler;
|
||||||
private IWorld _localWorld;
|
private IScene _localScene;
|
||||||
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
|
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
|
||||||
private ClientManager m_clientManager = new ClientManager();
|
private ClientManager m_clientManager = new ClientManager();
|
||||||
public ClientManager ClientManager
|
public ClientManager ClientManager
|
||||||
|
@ -54,11 +54,11 @@ namespace OpenSim.Region.ClientStack
|
||||||
_networkHandler.RegisterPacketServer(this);
|
_networkHandler.RegisterPacketServer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IWorld LocalWorld
|
public IScene LocalScene
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this._localWorld = value;
|
this._localScene = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,19 +122,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="remoteEP"></param>
|
|
||||||
/// <param name="initialcirpack"></param>
|
|
||||||
/// <param name="clientThreads"></param>
|
|
||||||
/// <param name="world"></param>
|
|
||||||
/// <param name="assetCache"></param>
|
|
||||||
/// <param name="packServer"></param>
|
|
||||||
/// <param name="inventoryCache"></param>
|
|
||||||
/// <param name="authenSessions"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
|
|
||||||
{
|
{
|
||||||
return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions );
|
return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions );
|
||||||
}
|
}
|
||||||
|
@ -151,7 +139,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass)
|
public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass)
|
||||||
{
|
{
|
||||||
ClientView newuser =
|
ClientView newuser =
|
||||||
CreateNewClient(epSender, useCircuit, ClientThreads, _localWorld, assetCache, this, inventoryCache,
|
CreateNewClient(epSender, useCircuit, ClientThreads, _localScene, assetCache, this, inventoryCache,
|
||||||
authenticateSessionsClass);
|
authenticateSessionsClass);
|
||||||
|
|
||||||
this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
|
this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
StorageManager storageManager = CreateStorageManager(regionInfo);
|
StorageManager storageManager = CreateStorageManager(regionInfo);
|
||||||
Scene scene = CreateScene(regionInfo, storageManager, authen);
|
Scene scene = CreateScene(regionInfo, storageManager, authen);
|
||||||
|
|
||||||
udpServer.LocalWorld = scene;
|
udpServer.LocalScene = scene;
|
||||||
|
|
||||||
scene.LoadWorldMap();
|
scene.LoadWorldMap();
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
protected PacketServer _packetServer;
|
protected PacketServer _packetServer;
|
||||||
|
|
||||||
protected int listenPort;
|
protected int listenPort;
|
||||||
protected IWorld m_localWorld;
|
protected IScene m_localScene;
|
||||||
protected AssetCache m_assetCache;
|
protected AssetCache m_assetCache;
|
||||||
protected InventoryCache m_inventoryCache;
|
protected InventoryCache m_inventoryCache;
|
||||||
protected LogBase m_log;
|
protected LogBase m_log;
|
||||||
|
@ -71,12 +71,12 @@ namespace OpenSim.Region.ClientStack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IWorld LocalWorld
|
public IScene LocalScene
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.m_localWorld = value;
|
this.m_localScene = value;
|
||||||
this._packetServer.LocalWorld = this.m_localWorld;
|
this._packetServer.LocalScene = this.m_localScene;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,12 @@ namespace OpenSim.Region.Environment
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EstateManager
|
public class EstateManager
|
||||||
{
|
{
|
||||||
private Scene m_world;
|
private Scene m_scene;
|
||||||
private RegionInfo m_regInfo;
|
private RegionInfo m_regInfo;
|
||||||
|
|
||||||
public EstateManager(Scene world,RegionInfo reginfo)
|
public EstateManager(Scene scene,RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
m_world = world; //Estate settings found at world.m_regInfo.estateSettings
|
m_scene = scene;
|
||||||
m_regInfo = reginfo;
|
m_regInfo = reginfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public void sendRegionInfoPacketToAll()
|
public void sendRegionInfoPacketToAll()
|
||||||
{
|
{
|
||||||
List<Avatar> avatars = m_world.RequestAvatarList();
|
List<Avatar> avatars = m_scene.RequestAvatarList();
|
||||||
|
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -253,7 +253,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public void sendRegionHandshakeToAll()
|
public void sendRegionHandshakeToAll()
|
||||||
{
|
{
|
||||||
List<Avatar> avatars = m_world.RequestAvatarList();
|
List<Avatar> avatars = m_scene.RequestAvatarList();
|
||||||
|
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
public LandData landData = new LandData();
|
public LandData landData = new LandData();
|
||||||
public List<SceneObject> primsOverMe = new List<SceneObject>();
|
public List<SceneObject> primsOverMe = new List<SceneObject>();
|
||||||
|
|
||||||
public Scene m_world;
|
public Scene m_scene;
|
||||||
|
|
||||||
private bool[,] landBitmap = new bool[64, 64];
|
private bool[,] landBitmap = new bool[64, 64];
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
public Land(LLUUID owner_id, bool is_group_owned, Scene world)
|
public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
|
||||||
{
|
{
|
||||||
m_world = world;
|
m_scene = scene;
|
||||||
landData.ownerID = owner_id;
|
landData.ownerID = owner_id;
|
||||||
landData.isGroupOwned = is_group_owned;
|
landData.isGroupOwned = is_group_owned;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
public Land Copy()
|
public Land Copy()
|
||||||
{
|
{
|
||||||
Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_world);
|
Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene);
|
||||||
|
|
||||||
//Place all new variables here!
|
//Place all new variables here!
|
||||||
newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
|
newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
|
||||||
|
@ -101,7 +101,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.LocalID = landData.localID;
|
updatePacket.ParcelData.LocalID = landData.localID;
|
||||||
if (landData.area > 0)
|
if (landData.area > 0)
|
||||||
{
|
{
|
||||||
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
|
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -118,14 +118,17 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.OwnerID = landData.ownerID;
|
updatePacket.ParcelData.OwnerID = landData.ownerID;
|
||||||
updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
|
updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
|
||||||
updatePacket.ParcelData.ParcelFlags = landData.landFlags;
|
updatePacket.ParcelData.ParcelFlags = landData.landFlags;
|
||||||
updatePacket.ParcelData.ParcelPrimBonus = m_world.RegionInfo.estateSettings.objectBonusFactor;
|
updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor;
|
||||||
updatePacket.ParcelData.PassHours = landData.passHours;
|
updatePacket.ParcelData.PassHours = landData.passHours;
|
||||||
updatePacket.ParcelData.PassPrice = landData.passPrice;
|
updatePacket.ParcelData.PassPrice = landData.passPrice;
|
||||||
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
||||||
updatePacket.ParcelData.RegionDenyAnonymous = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
|
|
||||||
updatePacket.ParcelData.RegionDenyIdentified = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
|
uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags;
|
||||||
updatePacket.ParcelData.RegionDenyTransacted = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
|
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
|
||||||
updatePacket.ParcelData.RegionPushOverride = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
|
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
|
||||||
|
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
|
||||||
|
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
|
||||||
|
|
||||||
updatePacket.ParcelData.RentPrice = 0;
|
updatePacket.ParcelData.RentPrice = 0;
|
||||||
updatePacket.ParcelData.RequestResult = request_result;
|
updatePacket.ParcelData.RequestResult = request_result;
|
||||||
updatePacket.ParcelData.SalePrice = landData.salePrice;
|
updatePacket.ParcelData.SalePrice = landData.salePrice;
|
||||||
|
@ -134,7 +137,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.SequenceID = sequence_id;
|
updatePacket.ParcelData.SequenceID = sequence_id;
|
||||||
if (landData.simwideArea > 0)
|
if (landData.simwideArea > 0)
|
||||||
{
|
{
|
||||||
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
|
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -180,10 +183,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
public void sendLandUpdateToAvatarsOverMe()
|
public void sendLandUpdateToAvatarsOverMe()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = m_world.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
Land over = m_world.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
|
Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
|
||||||
if (over.landData.localID == this.landData.localID)
|
if (over.landData.localID == this.landData.localID)
|
||||||
{
|
{
|
||||||
sendLandProperties(0, false, 0, avatars[i].ControllingClient);
|
sendLandProperties(0, false, 0, avatars[i].ControllingClient);
|
||||||
|
@ -219,8 +222,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.GetHeight((min_x * 4), (min_y * 4)));
|
landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4)));
|
||||||
landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.GetHeight((max_x * 4), (max_y * 4)));
|
landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4)));
|
||||||
landData.area = tempArea;
|
landData.area = tempArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool landPrimCountTainted = false;
|
public bool landPrimCountTainted = false;
|
||||||
|
|
||||||
private Scene m_world;
|
private Scene m_scene;
|
||||||
private RegionInfo m_regInfo;
|
private RegionInfo m_regInfo;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
public LandManager(Scene world, RegionInfo reginfo)
|
public LandManager(Scene scene, RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_world = world;
|
m_scene = scene;
|
||||||
m_regInfo = reginfo;
|
m_regInfo = reginfo;
|
||||||
landIDList.Initialize();
|
landIDList.Initialize();
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
#region Parcel From Storage Functions
|
#region Parcel From Storage Functions
|
||||||
public void LandFromStorage(LandData data)
|
public void LandFromStorage(LandData data)
|
||||||
{
|
{
|
||||||
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_world);
|
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
|
||||||
new_land.landData = data.Copy();
|
new_land.landData = data.Copy();
|
||||||
new_land.setLandBitmapFromByteArray();
|
new_land.setLandBitmapFromByteArray();
|
||||||
addLandObject(new_land);
|
addLandObject(new_land);
|
||||||
|
@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Land createBaseLand()
|
public Land createBaseLand()
|
||||||
{
|
{
|
||||||
return new Land(new LLUUID(), false, m_world);
|
return new Land(new LLUUID(), false, m_scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
lastLandLocalID = START_LAND_LOCAL_ID - 1;
|
lastLandLocalID = START_LAND_LOCAL_ID - 1;
|
||||||
landIDList.Initialize();
|
landIDList.Initialize();
|
||||||
|
|
||||||
Land fullSimParcel = new Land(LLUUID.Zero, false, m_world);
|
Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene);
|
||||||
|
|
||||||
fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256));
|
fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256));
|
||||||
fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
|
fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
|
||||||
|
@ -529,7 +529,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
public void handleSignificantClientMovement(IClientAPI remote_client)
|
public void handleSignificantClientMovement(IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
ScenePresence clientAvatar = m_world.RequestAvatar(remote_client.AgentId);
|
ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId);
|
||||||
if (clientAvatar != null)
|
if (clientAvatar != null)
|
||||||
{
|
{
|
||||||
Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y);
|
Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y);
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (this._physActor != null)
|
if (_physActor != null)
|
||||||
{
|
{
|
||||||
m_pos.X = _physActor.Position.X;
|
m_pos.X = _physActor.Position.X;
|
||||||
m_pos.Y = _physActor.Position.Y;
|
m_pos.Y = _physActor.Position.Y;
|
||||||
|
@ -53,14 +53,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (this._physActor != null)
|
if (_physActor != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (this.m_world.SyncRoot)
|
lock (m_scene.SyncRoot)
|
||||||
{
|
{
|
||||||
|
_physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -81,7 +80,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (this._physActor != null)
|
if (_physActor != null)
|
||||||
{
|
{
|
||||||
m_velocity.X = _physActor.Velocity.X;
|
m_velocity.X = _physActor.Velocity.X;
|
||||||
m_velocity.Y = _physActor.Velocity.Y;
|
m_velocity.Y = _physActor.Velocity.Y;
|
||||||
|
@ -92,14 +91,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (this._physActor != null)
|
if (_physActor != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (this.m_world.SyncRoot)
|
lock (m_scene.SyncRoot)
|
||||||
{
|
{
|
||||||
|
_physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
this._physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
protected List<EntityBase> m_children;
|
protected List<EntityBase> m_children;
|
||||||
|
|
||||||
|
|
||||||
protected Scene m_world;
|
protected Scene m_scene;
|
||||||
protected string m_name;
|
protected string m_name;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -24,19 +24,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_pos;
|
protected LLVector3 m_pos;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual LLVector3 Pos
|
public virtual LLVector3 Pos
|
||||||
{
|
{
|
||||||
get
|
get { return m_pos; }
|
||||||
{
|
set { m_pos = value; }
|
||||||
return m_pos;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_pos = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLVector3 m_velocity;
|
public LLVector3 m_velocity;
|
||||||
|
@ -46,28 +41,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual LLVector3 Velocity
|
public virtual LLVector3 Velocity
|
||||||
{
|
{
|
||||||
get
|
get { return m_velocity; }
|
||||||
{
|
set { m_velocity = value; }
|
||||||
return m_velocity;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_velocity = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
|
protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
|
||||||
|
|
||||||
public virtual Quaternion Rotation
|
public virtual Quaternion Rotation
|
||||||
{
|
{
|
||||||
get
|
get { return m_rotation; }
|
||||||
{
|
set { m_rotation = value; }
|
||||||
return m_rotation;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_rotation = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected uint m_localId;
|
protected uint m_localId;
|
||||||
|
@ -91,19 +74,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_name = "(basic entity)";
|
m_name = "(basic entity)";
|
||||||
|
|
||||||
m_children = new List<EntityBase>();
|
m_children = new List<EntityBase>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void updateMovement()
|
public virtual void UpdateMovement()
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (EntityBase child in m_children)
|
foreach (EntityBase child in m_children)
|
||||||
|
|
||||||
{
|
{
|
||||||
child.updateMovement();
|
child.UpdateMovement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +106,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void BackUp()
|
public virtual void BackUp()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -134,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual EntityBase Copy()
|
public virtual EntityBase Copy()
|
||||||
{
|
{
|
||||||
return (EntityBase)this.MemberwiseClone();
|
return (EntityBase) MemberwiseClone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -142,7 +122,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void LandRenegerated()
|
public virtual void LandRenegerated()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -138,22 +138,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="regionHandle"></param>
|
|
||||||
/// <param name="world"></param>
|
|
||||||
/// <param name="addPacket"></param>
|
|
||||||
/// <param name="ownerID"></param>
|
|
||||||
/// <param name="localID"></param>
|
|
||||||
/// <param name="isRoot"></param>
|
|
||||||
/// <param name="parent"></param>
|
|
||||||
/// <param name="rootObject"></param>
|
|
||||||
public Primitive(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
|
|
||||||
SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos)
|
SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos)
|
||||||
{
|
{
|
||||||
m_regionHandle = regionHandle;
|
m_regionHandle = regionHandle;
|
||||||
m_world = world;
|
m_scene = scene;
|
||||||
m_inventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
m_inventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
m_isRootPrim = isRoot;
|
m_isRootPrim = isRoot;
|
||||||
|
@ -163,7 +152,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
Rotation = Quaternion.Identity;
|
Rotation = Quaternion.Identity;
|
||||||
|
|
||||||
m_world.AcknowledgeNewPrim(this);
|
m_scene.AcknowledgeNewPrim(this);
|
||||||
|
|
||||||
OnPrimCountTainted();
|
OnPrimCountTainted();
|
||||||
}
|
}
|
||||||
|
@ -202,10 +191,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.m_children = new List<EntityBase>();
|
dupe.m_children = new List<EntityBase>();
|
||||||
dupe.m_Shape = m_Shape.Copy();
|
dupe.m_Shape = m_Shape.Copy();
|
||||||
dupe.m_regionHandle = m_regionHandle;
|
dupe.m_regionHandle = m_regionHandle;
|
||||||
dupe.m_world = m_world;
|
dupe.m_scene = m_scene;
|
||||||
|
|
||||||
|
|
||||||
uint newLocalID = m_world.PrimIDAllocate();
|
uint newLocalID = m_scene.PrimIDAllocate();
|
||||||
dupe.m_uuid = LLUUID.Random();
|
dupe.m_uuid = LLUUID.Random();
|
||||||
dupe.LocalId = newLocalID;
|
dupe.LocalId = newLocalID;
|
||||||
|
|
||||||
|
@ -225,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z);
|
dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z);
|
||||||
|
|
||||||
rootParent.AddChildToList(dupe);
|
rootParent.AddChildToList(dupe);
|
||||||
m_world.AcknowledgeNewPrim(dupe);
|
m_scene.AcknowledgeNewPrim(dupe);
|
||||||
dupe.TriggerOnPrimCountTainted();
|
dupe.TriggerOnPrimCountTainted();
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_children.Add(linkObject.rootPrimitive);
|
m_children.Add(linkObject.rootPrimitive);
|
||||||
linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
|
linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
|
||||||
|
|
||||||
m_world.DeleteEntity(linkObject.rootUUID);
|
m_scene.DeleteEntity(linkObject.rootUUID);
|
||||||
linkObject.DeleteAllChildren();
|
linkObject.DeleteAllChildren();
|
||||||
|
|
||||||
OnPrimCountTainted();
|
OnPrimCountTainted();
|
||||||
|
@ -676,7 +665,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendFullUpdateToAllClients()
|
public void SendFullUpdateToAllClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = m_world.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
SendFullUpdateToClient(avatars[i].ControllingClient);
|
SendFullUpdateToClient(avatars[i].ControllingClient);
|
||||||
|
@ -721,7 +710,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendTerseUpdateToALLClients()
|
public void SendTerseUpdateToALLClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = m_world.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
SendTerseUpdateToClient(avatars[i].ControllingClient);
|
SendTerseUpdateToClient(avatars[i].ControllingClient);
|
||||||
|
|
|
@ -140,23 +140,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_eventManager = new EventManager();
|
m_eventManager = new EventManager();
|
||||||
|
|
||||||
m_eventManager.OnParcelPrimCountAdd +=
|
m_eventManager.OnParcelPrimCountAdd +=
|
||||||
new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts);
|
m_LandManager.addPrimToLandPrimCounts;
|
||||||
|
|
||||||
MainLog.Instance.Verbose("World.cs - creating new entitities instance");
|
MainLog.Instance.Verbose("Creating new entitities instance");
|
||||||
Entities = new Dictionary<LLUUID, EntityBase>();
|
Entities = new Dictionary<LLUUID, EntityBase>();
|
||||||
Avatars = new Dictionary<LLUUID, ScenePresence>();
|
Avatars = new Dictionary<LLUUID, ScenePresence>();
|
||||||
Prims = new Dictionary<LLUUID, SceneObject>();
|
Prims = new Dictionary<LLUUID, SceneObject>();
|
||||||
|
|
||||||
MainLog.Instance.Verbose("World.cs - loading objects from datastore");
|
MainLog.Instance.Verbose("Loading objects from datastore");
|
||||||
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
|
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
|
||||||
foreach (SceneObject prim in PrimsFromDB)
|
foreach (SceneObject prim in PrimsFromDB)
|
||||||
{
|
{
|
||||||
AddEntity(prim);
|
AddEntity(prim);
|
||||||
}
|
}
|
||||||
MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)");
|
MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
|
||||||
|
|
||||||
|
|
||||||
MainLog.Instance.Verbose("World.cs - creating LandMap");
|
MainLog.Instance.Verbose("Creating LandMap");
|
||||||
Terrain = new TerrainEngine();
|
Terrain = new TerrainEngine();
|
||||||
|
|
||||||
ScenePresence.LoadAnims();
|
ScenePresence.LoadAnims();
|
||||||
|
@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs per-frame updates on the world, this should be the central world loop
|
/// Performs per-frame updates on the scene, this should be the central world loop
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
|
@ -210,9 +210,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
phyScene.GetResults();
|
phyScene.GetResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (LLUUID UUID in Entities.Keys)
|
List<EntityBase> moveEntities = new List<EntityBase>( Entities.Values );
|
||||||
|
|
||||||
|
foreach (EntityBase entity in moveEntities)
|
||||||
{
|
{
|
||||||
Entities[UUID].updateMovement();
|
entity.UpdateMovement();
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
|
@ -220,9 +222,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
phyScene.Simulate(timeStep);
|
phyScene.Simulate(timeStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (LLUUID UUID in Entities.Keys)
|
List<EntityBase> updateEntities = new List<EntityBase>(Entities.Values);
|
||||||
|
|
||||||
|
foreach (EntityBase entity in updateEntities)
|
||||||
{
|
{
|
||||||
Entities[UUID].Update();
|
entity.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// General purpose event manager
|
// General purpose event manager
|
||||||
|
|
|
@ -38,7 +38,7 @@ using OpenSim.Framework;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
public abstract class SceneBase : IWorld
|
public abstract class SceneBase : IScene
|
||||||
{
|
{
|
||||||
public Dictionary<LLUUID, EntityBase> Entities;
|
public Dictionary<LLUUID, EntityBase> Entities;
|
||||||
protected ulong m_regionHandle;
|
protected ulong m_regionHandle;
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||||
{
|
{
|
||||||
m_regionHandle = world.RegionInfo.RegionHandle;
|
m_regionHandle = world.RegionInfo.RegionHandle;
|
||||||
m_world = world;
|
m_scene = world;
|
||||||
m_eventManager = eventManager;
|
m_eventManager = eventManager;
|
||||||
|
|
||||||
this.Pos = pos;
|
this.Pos = pos;
|
||||||
|
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
|
public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
|
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos);
|
||||||
this.m_children.Add(rootPrimitive);
|
this.m_children.Add(rootPrimitive);
|
||||||
|
|
||||||
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
|
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
|
||||||
|
@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObject dupe = new SceneObject();
|
SceneObject dupe = new SceneObject();
|
||||||
|
|
||||||
dupe.m_world = this.m_world;
|
dupe.m_scene = this.m_scene;
|
||||||
dupe.m_eventManager = this.m_eventManager;
|
dupe.m_eventManager = this.m_eventManager;
|
||||||
dupe.m_regionHandle = this.m_regionHandle;
|
dupe.m_regionHandle = this.m_regionHandle;
|
||||||
Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
|
Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
|
||||||
|
@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.m_children.Add(dupe.rootPrimitive);
|
dupe.m_children.Add(dupe.rootPrimitive);
|
||||||
dupe.rootPrimitive.Pos = this.Pos;
|
dupe.rootPrimitive.Pos = this.Pos;
|
||||||
dupe.Rotation = this.Rotation;
|
dupe.Rotation = this.Rotation;
|
||||||
dupe.LocalId = m_world.PrimIDAllocate();
|
dupe.LocalId = m_scene.PrimIDAllocate();
|
||||||
|
|
||||||
dupe.registerEvents();
|
dupe.registerEvents();
|
||||||
return dupe;
|
return dupe;
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
|
public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_world = world;
|
m_scene = world;
|
||||||
this.m_uuid = theClient.AgentId;
|
this.m_uuid = theClient.AgentId;
|
||||||
|
|
||||||
m_regionInfo = reginfo;
|
m_regionInfo = reginfo;
|
||||||
|
@ -129,7 +129,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
ControllingClient = theClient;
|
ControllingClient = theClient;
|
||||||
this.firstname = ControllingClient.FirstName;
|
this.firstname = ControllingClient.FirstName;
|
||||||
this.lastname = ControllingClient.LastName;
|
this.lastname = ControllingClient.LastName;
|
||||||
m_localId = m_world.NextLocalId;
|
m_localId = m_scene.NextLocalId;
|
||||||
Pos = ControllingClient.StartPos;
|
Pos = ControllingClient.StartPos;
|
||||||
visualParams = new byte[218];
|
visualParams = new byte[218];
|
||||||
for (int i = 0; i < 218; i++)
|
for (int i = 0; i < 218; i++)
|
||||||
|
@ -394,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendTerseUpdateToALLClients()
|
public void SendTerseUpdateToALLClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
|
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
this.SendTerseUpdateToClient(avatars[i].ControllingClient);
|
this.SendTerseUpdateToClient(avatars[i].ControllingClient);
|
||||||
|
@ -412,8 +412,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SendFullUpdateToALLClients()
|
public void SendFullUpdateToALLClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
|
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
||||||
foreach (ScenePresence avatar in this.m_world.RequestAvatarList())
|
foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
|
||||||
{
|
{
|
||||||
this.SendFullUpdateToOtherClient(avatar);
|
this.SendFullUpdateToOtherClient(avatar);
|
||||||
avatar.SendFullUpdateToOtherClient(this);
|
avatar.SendFullUpdateToOtherClient(this);
|
||||||
|
@ -428,7 +428,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
|
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
|
||||||
if (this.newAvatar)
|
if (this.newAvatar)
|
||||||
{
|
{
|
||||||
this.m_world.InformClientOfNeighbours(this.ControllingClient);
|
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
|
||||||
this.newAvatar = false;
|
this.newAvatar = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
this.ControllingClient.SendWearables(this.Wearables);
|
this.ControllingClient.SendWearables(this.Wearables);
|
||||||
this.SendFullUpdateToALLClients();
|
this.SendFullUpdateToALLClients();
|
||||||
this.m_world.SendAllSceneObjectsToClient(this.ControllingClient);
|
this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -462,7 +462,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
this.current_anim = animID;
|
this.current_anim = animID;
|
||||||
this.anim_seq = seq;
|
this.anim_seq = seq;
|
||||||
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
|
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
|
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
|
||||||
|
@ -550,10 +550,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
LLVector3 vel = this.m_velocity;
|
LLVector3 vel = this.m_velocity;
|
||||||
ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
|
ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
|
||||||
RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle);
|
RegionInfo neighbourRegion = this.m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
|
||||||
if (neighbourRegion != null)
|
if (neighbourRegion != null)
|
||||||
{
|
{
|
||||||
bool res = this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
|
bool res = this.m_scene.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint);
|
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint);
|
||||||
|
@ -574,7 +574,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void updateMovement()
|
public override void UpdateMovement()
|
||||||
{
|
{
|
||||||
newForce = false;
|
newForce = false;
|
||||||
lock (this.forcesList)
|
lock (this.forcesList)
|
||||||
|
|
|
@ -23,13 +23,13 @@ namespace SimpleApp
|
||||||
m_counter = new PerformanceCounter(objectName, counterName, instanceName);
|
m_counter = new PerformanceCounter(objectName, counterName, instanceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update( )
|
public override void UpdateMovement( )
|
||||||
{
|
{
|
||||||
float cpu = m_counter.NextValue() / 40f;
|
float cpu = m_counter.NextValue() / 40f;
|
||||||
LLVector3 size = new LLVector3(cpu, cpu, cpu);
|
LLVector3 size = new LLVector3(cpu, cpu, cpu);
|
||||||
rootPrimitive.ResizeGoup( size );
|
rootPrimitive.ResizeGoup( size );
|
||||||
|
|
||||||
base.Update();
|
base.UpdateMovement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue