* SimpleApp works again:

* NetworkServersInfo settable without config file
  * DefaultHomeLoc throws if getted before setted
  * Removed nonsensical sandbox distinction
  * Refactored default config file creation

* Some more small refactorings on shapes
afrisby
lbsa71 2007-08-06 10:48:40 +00:00
parent 6c03e9e50c
commit 9bdeb8af6f
7 changed files with 51 additions and 53 deletions

View File

@ -45,9 +45,6 @@ namespace OpenSim.Framework.Types
public string UserRecvKey = ""; public string UserRecvKey = "";
public bool isSandbox; public bool isSandbox;
public uint DefaultHomeLocX = 0;
public uint DefaultHomeLocY = 0;
public int HttpListenerPort = 9000; public int HttpListenerPort = 9000;
public int RemotingListenerPort = 8895; public int RemotingListenerPort = 8895;
@ -59,9 +56,22 @@ namespace OpenSim.Framework.Types
configMember.performConfigurationRetrieve(); configMember.performConfigurationRetrieve();
} }
public NetworkServersInfo( ) public NetworkServersInfo( uint defaultHomeLocX, uint defaultHomeLocY )
{ {
m_defaultHomeLocX = defaultHomeLocX;
m_defaultHomeLocY = defaultHomeLocY;
}
private uint? m_defaultHomeLocX;
public uint DefaultHomeLocX
{
get { return m_defaultHomeLocX.Value; }
}
private uint? m_defaultHomeLocY;
public uint DefaultHomeLocY
{
get { return m_defaultHomeLocY.Value; }
} }
public void loadConfigurationOptions() public void loadConfigurationOptions()
@ -94,10 +104,10 @@ namespace OpenSim.Framework.Types
this.RemotingListenerPort = (int)configuration_object; this.RemotingListenerPort = (int)configuration_object;
break; break;
case "DefaultLocationX": case "DefaultLocationX":
this.DefaultHomeLocX = (uint)configuration_object; this.m_defaultHomeLocX = (uint)configuration_object;
break; break;
case "DefaultLocationY": case "DefaultLocationY":
this.DefaultHomeLocY = (uint)configuration_object; this.m_defaultHomeLocY = (uint)configuration_object;
break; break;
case "GridServerURL": case "GridServerURL":
this.GridURL = (string)configuration_object; this.GridURL = (string)configuration_object;

View File

@ -21,6 +21,9 @@ namespace OpenSim.Framework.Types
{ {
//protected ShapeType m_type = ShapeType.Unknown; //protected ShapeType m_type = ShapeType.Unknown;
private static byte[] m_defaultTextureEntry;
public byte PCode; public byte PCode;
public ushort PathBegin; public ushort PathBegin;
public ushort PathEnd; public ushort PathEnd;
@ -60,9 +63,15 @@ namespace OpenSim.Framework.Types
} }
} }
static PrimitiveBaseShape()
{
m_defaultTextureEntry = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes();
}
public PrimitiveBaseShape() public PrimitiveBaseShape()
{ {
ExtraParams = new byte[1]; ExtraParams = new byte[1];
TextureEntry = m_defaultTextureEntry;
} }
//void returns need to change of course //void returns need to change of course
@ -91,29 +100,15 @@ namespace OpenSim.Framework.Types
{ {
get get
{ {
BoxShape primShape = new BoxShape(); BoxShape boxShape = new BoxShape();
primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); boxShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
primShape.PathBegin = 0;
primShape.PathEnd = 0;
primShape.PathScaleX = 0;
primShape.PathScaleY = 0;
primShape.PathShearX = 0;
primShape.PathShearY = 0;
primShape.PathSkew = 0;
primShape.ProfileBegin = 0;
primShape.ProfileEnd = 0;
primShape.ProfileHollow = 0;
primShape.PathRadiusOffset = 0;
primShape.PathRevolutions = 0;
primShape.PathTaperX = 0;
primShape.PathTaperY = 0;
primShape.PathTwist = 0;
primShape.PathTwistBegin = 0;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
primShape.TextureEntry = ntex.ToBytes();
return primShape; //boxShape.PathTaperX = 1;
//boxShape.PathTaperY = 1;
boxShape.PathSkew = 1;
return boxShape;
} }
} }
} }

View File

@ -120,30 +120,19 @@ namespace OpenSim
m_httpServer.AddStreamHandler(new SimStatusHandler()); m_httpServer.AddStreamHandler(new SimStatusHandler());
} }
if (m_sandbox) string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
if (!Directory.Exists(regionConfigPath))
{ {
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); Directory.CreateDirectory(regionConfigPath);
}
else
{
m_commsManager = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache);
} }
string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
string path = Path.Combine(Util.configDir(), "Regions");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string[] configFiles = Directory.GetFiles(path, "*.xml");
if (configFiles.Length == 0) if (configFiles.Length == 0)
{ {
string path2 = Path.Combine(Util.configDir(), "Regions"); CreateDefaultRegionInfoXml(Path.Combine(regionConfigPath, "default.xml"));
string path3 = Path.Combine(path2, "default.xml"); configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3);
configFiles = Directory.GetFiles(path, "*.xml");
} }
for (int i = 0; i < configFiles.Length; i++) for (int i = 0; i < configFiles.Length; i++)
@ -156,7 +145,6 @@ namespace OpenSim
m_localScenes.Add(scene); m_localScenes.Add(scene);
m_udpServers.Add(udpServer); m_udpServers.Add(udpServer);
m_regionData.Add(regionInfo); m_regionData.Add(regionInfo);
} }
@ -170,6 +158,11 @@ namespace OpenSim
} }
private static void CreateDefaultRegionInfoXml(string fileName)
{
new RegionInfo("DEFAULT REGION CONFIG", fileName);
}
protected override StorageManager CreateStorageManager(RegionInfo regionInfo) protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
{ {
return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName); return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName);

View File

@ -41,6 +41,7 @@ using libsecondlife;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Caches; using OpenSim.Framework.Communications.Caches;
using OpenSim.Region.Communications.Local;
namespace OpenSim.Region.ClientStack namespace OpenSim.Region.ClientStack
{ {
@ -78,6 +79,7 @@ namespace OpenSim.Region.ClientStack
m_httpServer.Start(); m_httpServer.Start();
m_inventoryCache = new InventoryCache(); m_inventoryCache = new InventoryCache();
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache);
} }
protected abstract void Initialize(); protected abstract void Initialize();

View File

@ -16,10 +16,10 @@ namespace OpenSim.Region.Communications.Local
private uint defaultHomeX ; private uint defaultHomeX ;
private uint defaultHomeY; private uint defaultHomeY;
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversData) public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo)
{ {
m_Parent = parent; m_Parent = parent;
this.serversInfo = serversData; this.serversInfo = serversInfo;
defaultHomeX = this.serversInfo.DefaultHomeLocX; defaultHomeX = this.serversInfo.DefaultHomeLocX;
defaultHomeY = this.serversInfo.DefaultHomeLocY; defaultHomeY = this.serversInfo.DefaultHomeLocY;
} }

View File

@ -35,8 +35,7 @@ namespace SimpleApp
StartLog(); StartLog();
m_networkServersInfo = new NetworkServersInfo( ); m_networkServersInfo = new NetworkServersInfo( 1000, 1000 );
LocalAssetServer assetServer = new LocalAssetServer(); LocalAssetServer assetServer = new LocalAssetServer();
assetServer.SetServerInfo("http://localhost:8003/", ""); assetServer.SetServerInfo("http://localhost:8003/", "");
@ -48,8 +47,6 @@ namespace SimpleApp
{ {
base.StartUp(); base.StartUp();
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache);
m_log.Notice(m_log.LineInfo); m_log.Notice(m_log.LineInfo);
ScenePresence.PhysicsEngineFlying = true; ScenePresence.PhysicsEngineFlying = true;

View File

@ -573,6 +573,7 @@
<Reference name="OpenSim.Framework"/> <Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/> <Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Communications"/> <Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Region.Communications.Local"/>
<Reference name="OpenSim.Region.Physics.Manager"/> <Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Framework.Servers"/> <Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Data"/> <Reference name="OpenSim.Framework.Data"/>