-- Trying to get trunk to run from first build

* Collected required dll's into /bin
* Moved timer start for great justice
* Added some Writes to Console, and a Status field
* Added dumb NullPhysicsScene and NullPhysicsActor that kicks in if Physics Plugin not specified
* Svn-ignored a shitload
adam
lbsa71 2007-03-13 08:55:47 +00:00
parent a299fde68c
commit 0587158f92
8 changed files with 273 additions and 43 deletions

View File

@ -8,7 +8,7 @@
<ProjectGuid>{B063760D-DB8D-4F64-B6FE-335FAD1E650A}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\..\bin\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>True</DebugSymbols>

View File

@ -71,7 +71,7 @@ namespace OpenSim
private PhysicsManager physManager;
private System.Timers.Timer timer1 = new System.Timers.Timer();
private string ConfigDll = "SimConfig.dll";
private string _physicsEngine = "PhysX";
private string _physicsEngine = "";
public bool sandbox = false;
public bool loginserver = false;
@ -83,13 +83,18 @@ namespace OpenSim
ServerConsole.MainConsole.Instance = new MServerConsole(ServerConsole.ConsoleBase.ConsoleType.Local,"",0);
sim = new OpenSim_Main();
sim.sandbox = false;
sim.loginserver = false;
sim._physicsEngine = "";
for (int i = 0; i < args.Length; i++)
{
if(args[i] == "-sandbox")
{
sim.sandbox = true;
}
if(args[i] == "-loginserver")
{
sim.loginserver = true;
@ -136,9 +141,6 @@ namespace OpenSim
private void Startup() {
startuptime=DateTime.Now;
timer1.Enabled = true;
timer1.Interval = 100;
timer1.Elapsed +=new ElapsedEventHandler( this.Timer1Tick );
// We check our local database first, then the grid for config options
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Loading configuration");
@ -150,7 +152,11 @@ namespace OpenSim
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - We are " + cfg.RegionName + " at " + cfg.RegionLocX.ToString() + "," + cfg.RegionLocY.ToString());
ServerConsole.MainConsole.Instance.WriteLine("Initialising world");
local_world = cfg.LoadWorld();
timer1.Enabled = true;
timer1.Interval = 100;
timer1.Elapsed += new ElapsedEventHandler(this.Timer1Tick);
this.physManager = new PhysicsSystem.PhysicsManager();
this.physManager.LoadPlugins();
ServerConsole.MainConsole.Instance.WriteLine("Main.cs:Startup() - Starting up messaging system");

View File

@ -61,6 +61,7 @@ namespace OpenSim
ConsType = constype;
switch(constype) {
case ConsoleType.Local:
Console.WriteLine("ServerConsole.cs - creating new local console");
Console.WriteLine("Logs will be saved to current directory in opensim-console.log");
Log=File.AppendText("opensim-console.log");
@ -75,22 +76,30 @@ namespace OpenSim
default:
Console.WriteLine("ServerConsole.cs - what are you smoking? that isn't a valid console type!");
break;
}
}
}
public override void Close() {
Log.WriteLine("OpenSim shutdown at " + DateTime.Now.ToString());
Log.Close();
}
// You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here
public override void WriteLine(string Line) {
Log.WriteLine(Line);
Console.WriteLine(Line);
return;
}
public override string ReadLine() {
public override void Write(string format, params object[] args)
{
Log.Write(format, args);
Console.Write(format, args);
return;
}
public override void WriteLine(string format, params object[] args)
{
Log.WriteLine(format, args);
Console.WriteLine(format, args);
return;
}
public override string ReadLine()
{
string TempStr=Console.ReadLine();
Log.WriteLine(TempStr);
return TempStr;
@ -102,12 +111,6 @@ namespace OpenSim
return TempInt;
}
public override void Write(string Line) {
Console.Write(Line);
Log.Write(Line);
return;
}
// Displays a command prompt and waits for the user to enter a string, then returns that string
public override string CmdPrompt(string prompt) {
this.Write(prompt);
@ -196,7 +199,13 @@ namespace OpenSim
string[] cmdparams=(string[])tempstrarray;
RunCmd(cmd,cmdparams);
}
}
public override void SetStatus(string status)
{
Console.Write( status + "\r" );
}
}
}

View File

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("opensim")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Playahead AB")]
[assembly: AssemblyProduct("opensim")]
[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1d09756b-a461-4302-b6fe-15c455317909")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -35,6 +35,9 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\bin\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
@ -73,16 +76,26 @@
<Compile Include="VersionInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="GridServers" />
<Folder Include="Assets" />
<ProjectReference Include="GridInterfaces\GridInterfaces.csproj">
<Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
<Name>GridInterfaces</Name>
</ProjectReference>
<ProjectReference Include="LocalServers\LocalGridServers\LocalGridServers.csproj">
<Project>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</Project>
<Name>LocalGridServers</Name>
</ProjectReference>
<ProjectReference Include="LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj">
<Project>{74784F23-B0FD-484C-82C1-96C0215733DC}</Project>
<Name>Db4LocalStorage</Name>
</ProjectReference>
<ProjectReference Include="physics\PhysicsManager.csproj">
<Project>{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}</Project>
<Name>PhysicsManager</Name>
</ProjectReference>
<ProjectReference Include="RemoteServers\RemoteGridServers\RemoteGridServers.csproj">
<Project>{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}</Project>
<Name>RemoteGridServers</Name>
</ProjectReference>
<ProjectReference Include="ServerConsole\ServerConsole\ServerConsole.csproj">
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
<Name>ServerConsole</Name>

View File

@ -43,12 +43,7 @@ namespace ServerConsole
instance = value;
}
}
public MainConsole()
{
}
}
}
public abstract class ConsoleBase
{
@ -60,16 +55,15 @@ namespace ServerConsole
}
public abstract void Close();
// You know what ReadLine() and WriteLine() do, right? And Read() and Write()? Right, you do actually know C#, right? Are you actually a programmer? Do you know english? Do you find my sense of humour in comments irritating? Good, glad you're still here
public abstract void WriteLine(string Line) ;
public abstract void Write(string format, params object[] args);
public abstract void WriteLine(string format, params object[] args);
public abstract string ReadLine();
public abstract int Read() ;
public abstract void Write(string Line) ;
// Displays a command prompt and waits for the user to enter a string, then returns that string
public abstract string CmdPrompt(string prompt) ;
@ -87,5 +81,7 @@ namespace ServerConsole
// Displays a prompt to the user and then runs the command they entered
public abstract void MainConsolePrompt() ;
}
public abstract void SetStatus( string status );
}
}

62
src/opensim.sln Normal file
View File

@ -0,0 +1,62 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second-server", "Second-server.csproj", "{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridInterfaces", "GridInterfaces\GridInterfaces.csproj", "{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManager", "physics\PhysicsManager.csproj", "{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerConsole", "ServerConsole\ServerConsole\ServerConsole.csproj", "{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalGridServers", "LocalServers\LocalGridServers\LocalGridServers.csproj", "{D7F0395B-FADC-4936-80A0-D95AACE92F62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteGridServers", "RemoteServers\RemoteGridServers\RemoteGridServers.csproj", "{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimConfig", "Config\SimConfig\SimConfig.csproj", "{B063760D-DB8D-4F64-B6FE-335FAD1E650A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Db4LocalStorage", "LocalStorage\Db4LocalStorage\Db4LocalStorage.csproj", "{74784F23-B0FD-484C-82C1-96C0215733DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}.Release|Any CPU.Build.0 = Release|Any CPU
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}.Release|Any CPU.Build.0 = Release|Any CPU
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C86A846-7977-4EE7-A8DC-DD487FA5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}.Release|Any CPU.Build.0 = Release|Any CPU
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7F0395B-FADC-4936-80A0-D95AACE92F62}.Release|Any CPU.Build.0 = Release|Any CPU
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF0E7E62-34F4-4AB2-BDBD-AFC63224A7E5}.Release|Any CPU.Build.0 = Release|Any CPU
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B063760D-DB8D-4F64-B6FE-335FAD1E650A}.Release|Any CPU.Build.0 = Release|Any CPU
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74784F23-B0FD-484C-82C1-96C0215733DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74784F23-B0FD-484C-82C1-96C0215733DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -46,15 +46,21 @@ namespace PhysicsSystem
public PhysicsScene GetPhysicsScene(string engineName)
{
if(_plugins.ContainsKey(engineName))
if( String.IsNullOrEmpty( engineName ) )
{
return new NullPhysicsScene();
}
if(_plugins.ContainsKey(engineName))
{
ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName);
return _plugins[engineName].GetScene();
}
else
{
ServerConsole.MainConsole.Instance.WriteLine("couldn't find physicsEngine: "+ engineName);
return null;
string error = String.Format("couldn't find physicsEngine: {0}", engineName);
ServerConsole.MainConsole.Instance.WriteLine( error );
throw new ArgumentException( error );
}
}
@ -108,6 +114,14 @@ namespace PhysicsSystem
public abstract class PhysicsScene
{
public static PhysicsScene Null
{
get
{
return new NullPhysicsScene();
}
}
public abstract PhysicsActor AddAvatar(PhysicsVector position);
public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size);
@ -124,8 +138,49 @@ namespace PhysicsSystem
}
}
public class NullPhysicsScene : PhysicsScene
{
private static int m_workIndicator;
public override PhysicsActor AddAvatar(PhysicsVector position)
{
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position );
return PhysicsActor.Null;
}
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size );
return PhysicsActor.Null;
}
public override void Simulate(float timeStep)
{
m_workIndicator = ( m_workIndicator + 1 ) % 10;
ServerConsole.MainConsole.Instance.SetStatus( m_workIndicator.ToString() );
}
public override void GetResults()
{
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()" );
}
public override void SetTerrain(float[] heightMap)
{
ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length );
}
public override bool IsThreaded
{
get { return false; }
}
}
public abstract class PhysicsActor
{
public static readonly PhysicsActor Null = new NullPhysicsActor();
public abstract PhysicsVector Position
{
get;
@ -153,7 +208,61 @@ namespace PhysicsSystem
public abstract void SetMomentum(PhysicsVector momentum);
}
public class PhysicsVector
public class NullPhysicsActor : PhysicsActor
{
public override PhysicsVector Position
{
get
{
return PhysicsVector.Zero;
}
set
{
return;
}
}
public override PhysicsVector Velocity
{
get
{
return PhysicsVector.Zero;
}
set
{
return;
}
}
public override PhysicsVector Acceleration
{
get { return PhysicsVector.Zero; }
}
public override bool Flying
{
get
{
return false;
}
set
{
return;
}
}
public override void AddForce(PhysicsVector force)
{
return;
}
public override void SetMomentum(PhysicsVector momentum)
{
return;
}
}
public class PhysicsVector
{
public float X;
public float Y;
@ -170,5 +279,7 @@ namespace PhysicsSystem
Y = y;
Z = z;
}
public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f);
}
}