* Rex merge, Tests and Tools directory
parent
63586ae9b2
commit
0b7a9035f2
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using NUnit.Framework.Constraints;
|
||||
|
||||
namespace OpenSim.Tests.Common
|
||||
{
|
||||
public abstract class ANumericalToleranceConstraint : Constraint
|
||||
{
|
||||
protected double _tolerance;
|
||||
|
||||
public ANumericalToleranceConstraint(double tolerance)
|
||||
{
|
||||
if (tolerance < 0)
|
||||
{
|
||||
throw new ArgumentException("Tolerance cannot be negative.");
|
||||
}
|
||||
_tolerance = tolerance;
|
||||
}
|
||||
|
||||
protected bool IsWithinDoubleConstraint(double doubleValue, double baseValue)
|
||||
{
|
||||
if (doubleValue >= baseValue - _tolerance && doubleValue <= baseValue + _tolerance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using NUnit.Framework.Constraints;
|
||||
using OpenSim.Tests.Common;
|
||||
|
||||
namespace OpenSim.Tests.Common
|
||||
{
|
||||
public class DoubleToleranceConstraint : ANumericalToleranceConstraint
|
||||
{
|
||||
|
||||
private double _baseValue;
|
||||
private double _valueToBeTested;
|
||||
|
||||
public DoubleToleranceConstraint(double baseValue, double tolerance) : base(tolerance)
|
||||
{
|
||||
_baseValue = baseValue;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Test whether the constraint is satisfied by a given value
|
||||
///</summary>
|
||||
///<param name="valueToBeTested">The value to be tested</param>
|
||||
///<returns>
|
||||
///True for success, false for failure
|
||||
///</returns>
|
||||
public override bool Matches(object valueToBeTested)
|
||||
{
|
||||
if (valueToBeTested == null)
|
||||
{
|
||||
throw new ArgumentException("Constraint cannot be used upon null values.");
|
||||
}
|
||||
if( valueToBeTested.GetType() != typeof(double))
|
||||
{
|
||||
throw new ArgumentException("Constraint cannot be used upon non double-values.");
|
||||
}
|
||||
|
||||
_valueToBeTested = (double)valueToBeTested;
|
||||
|
||||
return IsWithinDoubleConstraint(_valueToBeTested, _baseValue );
|
||||
}
|
||||
|
||||
public override void WriteDescriptionTo(MessageWriter writer)
|
||||
{
|
||||
writer.WriteExpectedValue(string.Format("A value {0} within tolerance of plus or minus {1}",_baseValue,_tolerance));
|
||||
}
|
||||
|
||||
public override void WriteActualValueTo(MessageWriter writer)
|
||||
{
|
||||
writer.WriteActualValue(_valueToBeTested);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Tests.Common
|
||||
{
|
||||
public delegate void TestDelegate();
|
||||
|
||||
public class TestHelper
|
||||
{
|
||||
public static bool AssertThisDelegateCausesArgumentException(TestDelegate d)
|
||||
{
|
||||
try
|
||||
{
|
||||
d();
|
||||
}
|
||||
catch(ArgumentException e)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using libsecondlife;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace OpenSim.Tests.Common
|
||||
{
|
||||
public class VectorToleranceConstraint : ANumericalToleranceConstraint
|
||||
{
|
||||
private LLVector3 _baseValue;
|
||||
private LLVector3 _valueToBeTested;
|
||||
|
||||
public VectorToleranceConstraint(LLVector3 baseValue, double tolerance) : base(tolerance)
|
||||
{
|
||||
_baseValue = baseValue;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Test whether the constraint is satisfied by a given value
|
||||
///</summary>
|
||||
///<param name="valueToBeTested">The value to be tested</param>
|
||||
///<returns>
|
||||
///True for success, false for failure
|
||||
///</returns>
|
||||
public override bool Matches(object valueToBeTested)
|
||||
{
|
||||
if (valueToBeTested == null)
|
||||
{
|
||||
throw new ArgumentException("Constraint cannot be used upon null values.");
|
||||
}
|
||||
if (valueToBeTested.GetType() != typeof (LLVector3))
|
||||
{
|
||||
throw new ArgumentException("Constraint cannot be used upon non vector values.");
|
||||
}
|
||||
|
||||
_valueToBeTested = (LLVector3) valueToBeTested;
|
||||
|
||||
if ( IsWithinDoubleConstraint(_valueToBeTested.X,_baseValue.X) &&
|
||||
IsWithinDoubleConstraint(_valueToBeTested.Y,_baseValue.Y) &&
|
||||
IsWithinDoubleConstraint(_valueToBeTested.Z,_baseValue.Z) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void WriteDescriptionTo(MessageWriter writer)
|
||||
{
|
||||
writer.WriteExpectedValue(
|
||||
string.Format("A value {0} within tolerance of plus or minus {1}", _baseValue, _tolerance));
|
||||
}
|
||||
|
||||
public override void WriteActualValueTo(MessageWriter writer)
|
||||
{
|
||||
writer.WriteActualValue(_valueToBeTested);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
<<<<<<< .working
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -33,3 +34,68 @@ using System.Runtime.InteropServices;
|
|||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
=======
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
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("Inventory")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Lauridsen")]
|
||||
[assembly: AssemblyProduct("Inventory")]
|
||||
[assembly: AssemblyCopyright("Copyright © Lauridsen 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("2330add7-08a2-4f33-9ab8-74894fe7e3dd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
>>>>>>> .merge-right.r3604
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
@ -52,10 +52,10 @@ namespace OpenSim.Test.Inventory
|
|||
[TestFixtureSetUp]
|
||||
public void SetupInventoryTest()
|
||||
{
|
||||
|
||||
_agent_1_id = LLUUID.Random();
|
||||
|
||||
MainLog.Instance = new LogBase("UnitTest.log", "TEST", null, false);
|
||||
MainConsole.Instance = new ConsoleBase("TEST", null);
|
||||
|
||||
// _dbPlugin = new SQLiteInventoryStore();
|
||||
_dbPlugin = new MySQLInventoryData();
|
||||
_dbPlugin.Initialise();
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using libsecondlife;
|
||||
using NUnit.Framework;
|
||||
using NUnit.Framework.SyntaxHelpers;
|
||||
|
||||
using OpenSim.Tests.Common;
|
||||
|
||||
namespace OpenSim.Framework.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class UtilTests
|
||||
{
|
||||
[Test]
|
||||
public void VectorOperationTests()
|
||||
{
|
||||
LLVector3 v1, v2;
|
||||
double expectedDistance;
|
||||
double expectedMagnitude;
|
||||
double lowPrecisionTolerance = 0.001;
|
||||
|
||||
//Lets test a simple case of <0,0,0> and <5,5,5>
|
||||
{
|
||||
v1 = new LLVector3(0, 0, 0);
|
||||
v2 = new LLVector3(5, 5, 5);
|
||||
expectedDistance = 8.66;
|
||||
Assert.That(Util.GetDistanceTo(v1, v2),
|
||||
new DoubleToleranceConstraint(expectedDistance, lowPrecisionTolerance),
|
||||
"Calculated distance between two vectors was not within tolerances.");
|
||||
|
||||
expectedMagnitude = 0;
|
||||
Assert.That(Util.GetMagnitude(v1), Is.EqualTo(0), "Magnitude of null vector was not zero.");
|
||||
|
||||
expectedMagnitude = 8.66;
|
||||
Assert.That(Util.GetMagnitude(v2),
|
||||
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
|
||||
"Magnitude of vector was incorrect.");
|
||||
|
||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
||||
Assert.That(causesArgumentException, Is.True,
|
||||
"Getting magnitude of null vector did not cause argument exception.");
|
||||
|
||||
LLVector3 expectedNormalizedVector = new LLVector3(.577f, .577f, .577f);
|
||||
double expectedNormalizedMagnitude = 1;
|
||||
LLVector3 normalizedVector = Util.GetNormalizedVector(v2);
|
||||
Assert.That(normalizedVector,
|
||||
new VectorToleranceConstraint(expectedNormalizedVector, lowPrecisionTolerance),
|
||||
"Normalized vector generated from vector was not what was expected.");
|
||||
Assert.That(Util.GetMagnitude(normalizedVector),
|
||||
new DoubleToleranceConstraint(expectedNormalizedMagnitude, lowPrecisionTolerance),
|
||||
"Normalized vector generated from vector does not have magnitude of 1.");
|
||||
}
|
||||
|
||||
//Lets test a simple case of <0,0,0> and <0,0,0>
|
||||
{
|
||||
v1 = new LLVector3(0, 0, 0);
|
||||
v2 = new LLVector3(0, 0, 0);
|
||||
expectedDistance = 0;
|
||||
Assert.That(Util.GetDistanceTo(v1, v2),
|
||||
new DoubleToleranceConstraint(expectedDistance, lowPrecisionTolerance),
|
||||
"Calculated distance between two vectors was not within tolerances.");
|
||||
|
||||
expectedMagnitude = 0;
|
||||
Assert.That(Util.GetMagnitude(v1), Is.EqualTo(0), "Magnitude of null vector was not zero.");
|
||||
|
||||
expectedMagnitude = 0;
|
||||
Assert.That(Util.GetMagnitude(v2),
|
||||
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
|
||||
"Magnitude of vector was incorrect.");
|
||||
|
||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
||||
Assert.That(causesArgumentException, Is.True,
|
||||
"Getting magnitude of null vector did not cause argument exception.");
|
||||
|
||||
d = delegate() { Util.GetNormalizedVector(v2); };
|
||||
causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
||||
Assert.That(causesArgumentException, Is.True,
|
||||
"Getting magnitude of null vector did not cause argument exception.");
|
||||
}
|
||||
|
||||
//Lets test a simple case of <0,0,0> and <-5,-5,-5>
|
||||
{
|
||||
v1 = new LLVector3(0, 0, 0);
|
||||
v2 = new LLVector3(-5, -5, -5);
|
||||
expectedDistance = 8.66;
|
||||
Assert.That(Util.GetDistanceTo(v1, v2),
|
||||
new DoubleToleranceConstraint(expectedDistance, lowPrecisionTolerance),
|
||||
"Calculated distance between two vectors was not within tolerances.");
|
||||
|
||||
expectedMagnitude = 0;
|
||||
Assert.That(Util.GetMagnitude(v1), Is.EqualTo(0), "Magnitude of null vector was not zero.");
|
||||
|
||||
expectedMagnitude = 8.66;
|
||||
Assert.That(Util.GetMagnitude(v2),
|
||||
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
|
||||
"Magnitude of vector was incorrect.");
|
||||
|
||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
||||
Assert.That(causesArgumentException, Is.True,
|
||||
"Getting magnitude of null vector did not cause argument exception.");
|
||||
|
||||
LLVector3 expectedNormalizedVector = new LLVector3(-.577f, -.577f, -.577f);
|
||||
double expectedNormalizedMagnitude = 1;
|
||||
LLVector3 normalizedVector = Util.GetNormalizedVector(v2);
|
||||
Assert.That(normalizedVector,
|
||||
new VectorToleranceConstraint(expectedNormalizedVector, lowPrecisionTolerance),
|
||||
"Normalized vector generated from vector was not what was expected.");
|
||||
Assert.That(Util.GetMagnitude(normalizedVector),
|
||||
new DoubleToleranceConstraint(expectedNormalizedMagnitude, lowPrecisionTolerance),
|
||||
"Normalized vector generated from vector does not have magnitude of 1.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenSim.Tests.UserServer.Stress
|
||||
{
|
||||
/// <summary>
|
||||
/// In the future this class will programatically stress test the user server
|
||||
/// </summary>
|
||||
public class UserServerStressTest
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
System.Console.WriteLine("Aborting - not yet functional");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,19 +47,19 @@ namespace OpenSim.Tools.Export
|
|||
// AddinManager.Initialize(".");
|
||||
// AddinManager.Registry.Update(null);
|
||||
|
||||
// TODO: this really sucks, but given the way we do
|
||||
// logging in OpenSim, we need to establish a log up front
|
||||
|
||||
MainLog.Instance = CreateLog();
|
||||
MainConsole.Instance = CreateConsole();
|
||||
|
||||
sman = new StorageManager(
|
||||
startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"),
|
||||
startup.GetString("storage_connection_string", "")
|
||||
startup.GetString("storage_connection_string", String.Empty),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
OpenSimExport export = new OpenSimExport(InitConfig(args));
|
||||
RegionInfo reg = new RegionInfo("Sara Jane", "Regions/1000-1000.xml",false);
|
||||
|
||||
|
@ -70,17 +70,11 @@ namespace OpenSim.Tools.Export
|
|||
}
|
||||
}
|
||||
|
||||
protected LogBase CreateLog()
|
||||
protected ConsoleBase CreateConsole()
|
||||
{
|
||||
if (!Directory.Exists(Util.logDir()))
|
||||
{
|
||||
Directory.CreateDirectory(Util.logDir());
|
||||
}
|
||||
|
||||
return new LogBase((Path.Combine(Util.logDir(), "export.log")), "Export", null, true);
|
||||
return new ConsoleBase("Export", null);
|
||||
}
|
||||
|
||||
|
||||
private static IniConfigSource InitConfig(string[] args)
|
||||
{
|
||||
Console.WriteLine("Good");
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
@ -98,15 +98,11 @@ namespace LaunchSLClient
|
|||
this.Text = "OpenSim Client Launcher";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
|
@ -42,33 +43,112 @@ namespace LaunchSLClient
|
|||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
const string deepGridUrl = "http://user.deepgrid.com:8002/";
|
||||
const string osGridUrl = "http://www.osgrid.org:8002/";
|
||||
const string openLifeGridUrl = "http://logingrid.net:8002";
|
||||
|
||||
string gridUrl = "";
|
||||
string sandboxUrl = "";
|
||||
string deepGridUrl = "http://user.deepgrid.com:8002/";
|
||||
string osGridUrl = "http://www.osgrid.org:8002/";
|
||||
string runUrl = "";
|
||||
string runLine = "";
|
||||
Object exeFlags;
|
||||
Object exePath;
|
||||
string exeFlags = "";
|
||||
string exePath = "";
|
||||
|
||||
|
||||
public Form1()
|
||||
private void addLocalSandbox(ref ArrayList menuItems)
|
||||
{
|
||||
InitializeComponent();
|
||||
ArrayList menuItems=new ArrayList();
|
||||
menuItems.Add("Please select one:");
|
||||
string sandboxHostName = "";
|
||||
string sandboxPort = "";
|
||||
Object simPath = null;
|
||||
FileInfo defaultFile;
|
||||
StreamReader stream;
|
||||
// build sandbox URL from Regions\default.xml
|
||||
// this is highly dependant on a standard default.xml
|
||||
if (File.Exists(@"Regions\default.xml"))
|
||||
{
|
||||
string sandboxHostName = "";
|
||||
string sandboxPort = "";
|
||||
string text;
|
||||
|
||||
Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*");
|
||||
|
||||
FileInfo defaultFile = new FileInfo(@"Regions\default.xml");
|
||||
StreamReader stream = defaultFile.OpenText();
|
||||
do
|
||||
{
|
||||
text = stream.ReadLine();
|
||||
if (text == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
MatchCollection theMatches = myRegex.Matches(text);
|
||||
foreach (Match theMatch in theMatches)
|
||||
{
|
||||
if (theMatch.Length != 0)
|
||||
{
|
||||
sandboxHostName = theMatch.Groups["name"].ToString();
|
||||
sandboxPort = theMatch.Groups["port"].ToString();
|
||||
}
|
||||
}
|
||||
} while (text != null);
|
||||
|
||||
stream.Close();
|
||||
sandboxUrl = "http:\\" + sandboxHostName + ":" + sandboxPort;
|
||||
menuItems.Add("Local Sandbox");
|
||||
}
|
||||
}
|
||||
|
||||
private void addLocalGrid(ref ArrayList menuItems)
|
||||
{
|
||||
//build local grid URL from network_servers_information.xml
|
||||
// this is highly dependant on a standard default.xml
|
||||
if (File.Exists(@"network_servers_information.xml"))
|
||||
{
|
||||
string text;
|
||||
FileInfo defaultFile = new FileInfo(@"network_servers_information.xml");
|
||||
Regex myRegex = new Regex(".*UserServerURL=\\\"(?<url>.*?)\\\".*");
|
||||
StreamReader stream = defaultFile.OpenText();
|
||||
|
||||
do
|
||||
{
|
||||
text = stream.ReadLine();
|
||||
if (text == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
foreach (Match theMatch in myRegex.Matches(text))
|
||||
{
|
||||
if (theMatch.Length != 0)
|
||||
{
|
||||
gridUrl = theMatch.Groups["url"].ToString();
|
||||
}
|
||||
}
|
||||
} while (text != null);
|
||||
stream.Close();
|
||||
if (gridUrl != null)
|
||||
{
|
||||
menuItems.Add("Local Grid Server");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addLocalSims(ref ArrayList menuItems)
|
||||
{
|
||||
// find opensim directory
|
||||
RegistryKey exeKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\OpenSim\OpenSim");
|
||||
if (exeKey != null)
|
||||
{
|
||||
Object simPath = exeKey.GetValue("Path");
|
||||
|
||||
Directory.SetCurrentDirectory(simPath.ToString()); //this should be set to wherever we decide to put the binaries
|
||||
|
||||
addLocalSandbox(ref menuItems);
|
||||
addLocalGrid(ref menuItems);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No OpenSim installed. Showing public grids only", "No OpenSim");
|
||||
}
|
||||
}
|
||||
|
||||
private void getClient(ref string exePath, ref string runLine, ref string exeFlags)
|
||||
{
|
||||
// get executable path from registry
|
||||
//
|
||||
RegistryKey regKey;
|
||||
RegistryKey exeKey;
|
||||
regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Linden Research, Inc.\SecondLife");
|
||||
RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Linden Research, Inc.\SecondLife");
|
||||
if (regKey == null)
|
||||
{
|
||||
regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Linden Research, Inc.\SecondLife");
|
||||
|
@ -77,108 +157,35 @@ namespace LaunchSLClient
|
|||
throw new LauncherException("Can't find Second Life. Are you sure it is installed?", "LauncherException.Form1");
|
||||
}
|
||||
}
|
||||
Object exe = regKey.GetValue("Exe");
|
||||
exeFlags = regKey.GetValue("Flags");
|
||||
exePath = regKey.GetValue("");
|
||||
runLine = exePath.ToString() + "\\" + exe.ToString();
|
||||
string exe = regKey.GetValue("Exe").ToString();
|
||||
exeFlags = regKey.GetValue("Flags").ToString();
|
||||
exePath = regKey.GetValue("").ToString();
|
||||
runLine = exePath + "\\" + exe;
|
||||
Registry.LocalMachine.Flush();
|
||||
Registry.LocalMachine.Close();
|
||||
}
|
||||
|
||||
// find opensim directory
|
||||
//
|
||||
exeKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\OpenSim\OpenSim");
|
||||
if (exeKey != null)
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
ArrayList menuItems = new ArrayList();
|
||||
|
||||
simPath = exeKey.GetValue("Path");
|
||||
getClient(ref exePath, ref runLine, ref exeFlags);
|
||||
|
||||
// build sandbox URL from Regions\default.xml
|
||||
// this is highly dependant on a standard default.xml
|
||||
//
|
||||
Directory.SetCurrentDirectory(simPath.ToString()); //this should be set to wherever we decide to put the binaries
|
||||
string text;
|
||||
Regex myRegex = new Regex(".*internal_ip_port=\\\"(?<port>.*?)\\\".*external_host_name=\\\"(?<name>.*?)\\\".*");
|
||||
if (File.Exists(@"Regions\default.xml"))
|
||||
{
|
||||
defaultFile = new FileInfo(@"Regions\default.xml");
|
||||
stream = defaultFile.OpenText();
|
||||
do
|
||||
{
|
||||
text = stream.ReadLine();
|
||||
if (text == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
MatchCollection theMatches = myRegex.Matches(text);
|
||||
foreach (Match theMatch in theMatches)
|
||||
{
|
||||
if (theMatch.Length != 0)
|
||||
{
|
||||
sandboxHostName = theMatch.Groups["name"].ToString();
|
||||
sandboxPort = theMatch.Groups["port"].ToString();
|
||||
}
|
||||
}
|
||||
} while (text != null);
|
||||
stream.Close();
|
||||
sandboxUrl = "http:\\" + sandboxHostName + ":" + sandboxPort;
|
||||
menuItems.Add("Local Sandbox");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No OpenSim config files found. Please run OpenSim and finish configuration to run a local sim. Showing public grids only", "No OpenSim");
|
||||
}
|
||||
menuItems.Add("Please select one:");
|
||||
|
||||
|
||||
//build local grid URL from network_servers_information.xml
|
||||
// this is highly dependant on a standard default.xml
|
||||
//
|
||||
myRegex = new Regex(".*UserServerURL=\\\"(?<url>.*?)\\\".*");
|
||||
if (File.Exists(@"network_servers_information.xml"))
|
||||
{
|
||||
defaultFile = new FileInfo(@"network_servers_information.xml");
|
||||
|
||||
|
||||
stream = defaultFile.OpenText();
|
||||
do
|
||||
{
|
||||
text = stream.ReadLine();
|
||||
if (text == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
MatchCollection theMatches = myRegex.Matches(text);
|
||||
foreach (Match theMatch in theMatches)
|
||||
{
|
||||
if (theMatch.Length != 0)
|
||||
{
|
||||
gridUrl = theMatch.Groups["url"].ToString();
|
||||
}
|
||||
}
|
||||
} while (text != null);
|
||||
stream.Close();
|
||||
if (gridUrl != null)
|
||||
{
|
||||
menuItems.Add("Local Grid Server");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("No OpenSim installed. Showing public grids only", "No OpenSim");
|
||||
}
|
||||
addLocalSims(ref menuItems);
|
||||
|
||||
menuItems.Add("OSGrid - www.osgrid.org");
|
||||
menuItems.Add("DeepGrid - www.deepgrid.com");
|
||||
menuItems.Add("OpenlifeGrid - www.openlifegrid.com");
|
||||
menuItems.Add("Linden Labs - www.secondlife.com");
|
||||
|
||||
// We don't have a proper login uri for SL grid
|
||||
// menuItems.Add("Linden Labs - www.secondlife.com");
|
||||
comboBox1.DataSource=menuItems;
|
||||
comboBox1.DataSource = menuItems;
|
||||
}
|
||||
|
||||
private void radioButton1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
@ -188,8 +195,8 @@ namespace LaunchSLClient
|
|||
if (comboBox1.Text == "Local Grid Server") { runUrl = " -loginuri " + gridUrl; }
|
||||
if (comboBox1.Text == "DeepGrid - www.deepgrid.com") { runUrl = " -loginuri " + deepGridUrl; }
|
||||
if (comboBox1.Text == "OSGrid - www.osgrid.org") { runUrl = " -loginuri " + osGridUrl; }
|
||||
if (comboBox1.Text == "OpenlifeGrid - www.openlifegrid.com") { runUrl = " -loginuri " + openLifeGridUrl; }
|
||||
if (comboBox1.Text == "Linden Labs - www.secondlife.com") { runUrl = ""; }
|
||||
if (comboBox1.Text == "OpenlifeGrid - www.openlifegrid.com") { runUrl = " -loginuri http://logingrid.net:8002"; }
|
||||
|
||||
System.Diagnostics.Process proc = new System.Diagnostics.Process();
|
||||
proc.StartInfo.FileName = runLine;
|
|
@ -0,0 +1,152 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{FFC2EE60-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>LaunchSLClient</AssemblyName>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<RootNamespace>LaunchSLClient</RootNamespace>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Win32">
|
||||
<HintPath>Microsoft.Win32.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<HintPath>System.Collections.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.Generic">
|
||||
<HintPath>System.Collections.Generic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel">
|
||||
<HintPath>System.ComponentModel.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<HintPath>System.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics">
|
||||
<HintPath>System.Diagnostics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<HintPath>System.Drawing.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO">
|
||||
<HintPath>System.IO.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text">
|
||||
<HintPath>System.Text.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.RegularExpressions">
|
||||
<HintPath>System.Text.RegularExpressions.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<HintPath>System.Windows.Forms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LauncherException.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<DependentUpon>Properties\Resources.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<DependentUpon>Properties\Settings.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ReferencePath>C:\OpenSim\trunk3\bin\</ReferencePath>
|
||||
<LastOpenVersion>9.0.21022</LastOpenVersion>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectTrust>0</ProjectTrust>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
</Project>
|
|
@ -1,79 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{50FD2DCD-2E2D-413C-8260-D9CD22405895}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LaunchSLClient</RootNamespace>
|
||||
<AssemblyName>LaunchSLClient</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LauncherException.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -1,33 +0,0 @@
|
|||
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("LaunchSLClient")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Home")]
|
||||
[assembly: AssemblyProduct("LaunchSLClient")]
|
||||
[assembly: AssemblyCopyright("Copyright © Home 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("b08c6904-e6cc-4d9c-8d24-feb0464b1648")]
|
||||
|
||||
// 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")]
|
|
@ -25,6 +25,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
@ -33,7 +34,6 @@ namespace LaunchSLClient
|
|||
{
|
||||
class LauncherException : ApplicationException
|
||||
{
|
||||
|
||||
private const string CUSTOMMESSAGE = "The SL Client Launcher has failed with the following error: ";
|
||||
|
||||
private LauncherException() { }
|
|
@ -25,11 +25,11 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
namespace LaunchSLClient
|
||||
{
|
||||
static class Program
|
||||
|
@ -40,7 +40,6 @@ namespace LaunchSLClient
|
|||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Application.EnableVisualStyles();
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
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("LaunchSLClient")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Home")]
|
||||
[assembly: AssemblyProduct("LaunchSLClient")]
|
||||
[assembly: AssemblyCopyright("Copyright © Home 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("b08c6904-e6cc-4d9c-8d24-feb0464b1648")]
|
||||
|
||||
// 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")]
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{595D67F3-B413-4A43-8568-5B5930E3B31D}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenSim._32BitLaunch</RootNamespace>
|
||||
<AssemblyName>OpenSim.32BitLaunch</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Region\Application\OpenSim.csproj">
|
||||
<Project>{AC9EB8AB-0000-0000-0000-000000000000}</Project>
|
||||
<Name>OpenSim</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenSim._32BitLaunch
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
System.Console.WriteLine("32-bit OpenSim executor");
|
||||
System.Console.WriteLine("-----------------------");
|
||||
System.Console.WriteLine("");
|
||||
System.Console.WriteLine("This application is compiled for 32-bit CPU and will run under WOW32 or similar.");
|
||||
System.Console.WriteLine("All 64-bit incompatibilities should be gone.");
|
||||
System.Console.WriteLine("");
|
||||
System.Threading.Thread.Sleep(300);
|
||||
try
|
||||
{
|
||||
OpenSim.Application.Main(args);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Console.WriteLine("OpenSim threw an exception:");
|
||||
System.Console.WriteLine(ex.ToString());
|
||||
System.Console.WriteLine("");
|
||||
System.Console.WriteLine("Application will now terminate!");
|
||||
System.Console.WriteLine("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
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.32BitLaunch")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.32BitLaunch")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2008")]
|
||||
[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("5072e919-46ab-47e6-8a63-08108324ccdf")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -1,4 +1,32 @@
|
|||
using System.Reflection;
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -10,7 +38,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenSim.GUI")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) Contributors, http://opensimulator.org/
|
||||
See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the OpenSim Project nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,7 +1,7 @@
|
|||
!include "MUI.nsh"
|
||||
|
||||
Name "OpenSim"
|
||||
OutFile "OpenSim Setup 0.4.exe"
|
||||
OutFile "OpenSim Setup 0.5.exe"
|
||||
|
||||
CRCCheck On
|
||||
|
||||
|
|
|
@ -0,0 +1,238 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using Nini.Config;
|
||||
using System.Threading;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
|
||||
namespace pCampBot
|
||||
{
|
||||
/// <summary>
|
||||
/// Thread/Bot manager for the application
|
||||
/// </summary>
|
||||
public class BotManager : conscmd_callback
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected ConsoleBase m_console;
|
||||
protected List<PhysicsBot> m_lBot;
|
||||
protected Thread[] m_td;
|
||||
protected bool m_verbose = true;
|
||||
protected Random somthing = new Random(System.Environment.TickCount);
|
||||
protected int numbots = 0;
|
||||
protected IConfig Previous_config;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor Creates MainConsole.Instance to take commands and provide the place to write data
|
||||
/// </summary>
|
||||
public BotManager()
|
||||
{
|
||||
m_console = CreateConsole();
|
||||
MainConsole.Instance = m_console;
|
||||
m_lBot = new List<PhysicsBot>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Startup number of bots specified in the starting arguments
|
||||
/// </summary>
|
||||
/// <param name="botcount">How many bots to start up</param>
|
||||
/// <param name="cs">The configuration for the bots to use</param>
|
||||
public void dobotStartup(int botcount, IConfig cs)
|
||||
{
|
||||
Previous_config = cs;
|
||||
m_td = new Thread[botcount];
|
||||
for (int i = 0; i < botcount; i++)
|
||||
{
|
||||
startupBot(i, cs);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add additional bots (and threads) to our bot pool
|
||||
/// </summary>
|
||||
/// <param name="botcount">How Many of them to add</param>
|
||||
public void addbots(int botcount)
|
||||
{
|
||||
int len = m_td.Length;
|
||||
Thread[] m_td2 = new Thread[len + botcount];
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
m_td2[i] = m_td[i];
|
||||
}
|
||||
m_td = m_td2;
|
||||
int newlen = len + botcount;
|
||||
for (int i = len; i < newlen; i++)
|
||||
{
|
||||
startupBot(i, Previous_config);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This starts up the bot and stores the thread for the bot in the thread array
|
||||
/// </summary>
|
||||
/// <param name="pos">The position in the thread array to stick the bot's thread</param>
|
||||
/// <param name="cs">Configuration of the bot</param>
|
||||
public void startupBot(int pos, IConfig cs)
|
||||
{
|
||||
PhysicsBot pb = new PhysicsBot(cs);
|
||||
|
||||
pb.OnConnected += handlebotEvent;
|
||||
pb.OnDisconnected += handlebotEvent;
|
||||
if (cs.GetString("firstname", "random") == "random") pb.firstname = CreateRandomName();
|
||||
if (cs.GetString("lastname", "random") == "random") pb.lastname = CreateRandomName();
|
||||
|
||||
m_td[pos] = new Thread(pb.startup);
|
||||
m_td[pos].Name = "CampBot_" + pos;
|
||||
m_td[pos].IsBackground = true;
|
||||
m_td[pos].Start();
|
||||
m_lBot.Add(pb);
|
||||
OpenSim.Framework.ThreadTracker.Add(m_td[pos]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a random name for the bot
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string CreateRandomName()
|
||||
{
|
||||
string returnstring = "";
|
||||
string chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
returnstring += chars.Substring(somthing.Next(chars.Length),1);
|
||||
}
|
||||
return returnstring;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// High level connnected/disconnected events so we can keep track of our threads by proxy
|
||||
/// </summary>
|
||||
/// <param name="callbot"></param>
|
||||
/// <param name="eventt"></param>
|
||||
public void handlebotEvent(PhysicsBot callbot, EventType eventt)
|
||||
{
|
||||
switch (eventt)
|
||||
{
|
||||
case EventType.CONNECTED:
|
||||
m_log.Info("[ " + callbot.firstname + " " + callbot.lastname + "]: Connected");
|
||||
numbots++;
|
||||
break;
|
||||
case EventType.DISCONNECTED:
|
||||
m_log.Info("[ " + callbot.firstname + " " + callbot.lastname + "]: Disconnected");
|
||||
m_td[m_lBot.IndexOf(callbot)].Abort();
|
||||
numbots--;
|
||||
if (numbots >1)
|
||||
Environment.Exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shutting down all bots
|
||||
/// </summary>
|
||||
public void doBotShutdown()
|
||||
{
|
||||
foreach (PhysicsBot pb in m_lBot)
|
||||
{
|
||||
pb.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Standard CreateConsole routine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected ConsoleBase CreateConsole()
|
||||
{
|
||||
return new ConsoleBase("Region", this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// I don't think the bots use this..
|
||||
/// </summary>
|
||||
/// <param name="commandParams"></param>
|
||||
/// <param name="pos"></param>
|
||||
/// <returns></returns>
|
||||
private string CombineParams(string[] commandParams, int pos)
|
||||
{
|
||||
string result = String.Empty;
|
||||
for (int i = pos; i < commandParams.Length; i++)
|
||||
{
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
result = result.TrimEnd(' ');
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void RunCmd(string command, string[] cmdparams)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
case "shutdown":
|
||||
m_console.Warn("BOTMANAGER", "Shutting down bots");
|
||||
doBotShutdown();
|
||||
break;
|
||||
case "quit":
|
||||
m_console.Warn("DANGER", "This should only be used to quit the program if you've already used the shutdown command and the program hasn't quit");
|
||||
Environment.Exit(0);
|
||||
break;
|
||||
case "addbots":
|
||||
int newbots = 0;
|
||||
Helpers.TryParse(cmdparams[0], out newbots);
|
||||
|
||||
if (newbots > 0)
|
||||
addbots(newbots);
|
||||
break;
|
||||
case "help":
|
||||
m_console.Notice("HELP", "\nshutdown - graceful shutdown\naddbots <n> - adds n bots to the test\nquit - forcequits, dangerous if you have not already run shutdown");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Required method to implement the conscmd_callback interface
|
||||
/// </summary>
|
||||
/// <param name="ShowWhat"></param>
|
||||
public void Show(string ShowWhat)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using Nini.Config;
|
||||
using System.Threading;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace pCampBot
|
||||
{
|
||||
public class PhysicsBot
|
||||
{
|
||||
public delegate void AnEvent(PhysicsBot callbot, EventType someevent); // event delegate for bot events
|
||||
public IConfig startupConfig; // bot config, passed from BotManager
|
||||
|
||||
public string firstname;
|
||||
public string lastname;
|
||||
public string password;
|
||||
public string loginURI;
|
||||
|
||||
public event AnEvent OnConnected;
|
||||
public event AnEvent OnDisconnected;
|
||||
|
||||
protected Timer m_action; // Action Timer
|
||||
|
||||
protected Random somthing = new Random(System.Environment.TickCount);// We do stuff randomly here
|
||||
|
||||
//New instance of a SecondLife client
|
||||
public SecondLife client = new SecondLife();
|
||||
|
||||
protected string[] talkarray;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="bsconfig">nini config for the bot</param>
|
||||
public PhysicsBot(IConfig bsconfig)
|
||||
{
|
||||
startupConfig = bsconfig;
|
||||
readconfig();
|
||||
talkarray = readexcuses();
|
||||
}
|
||||
|
||||
//We do our actions here. This is where one would
|
||||
//add additional steps and/or things the bot should do
|
||||
|
||||
void m_action_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
//client.Throttle.Task = 500000f;
|
||||
//client.Throttle.Set();
|
||||
int walkorrun = somthing.Next(4); // Randomize between walking and running. The greater this number,
|
||||
// the greater the bot's chances to walk instead of run.
|
||||
if (walkorrun == 0)
|
||||
{
|
||||
client.Self.Movement.AlwaysRun = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
client.Self.Movement.AlwaysRun = false;
|
||||
}
|
||||
|
||||
LLVector3 pos = client.Self.SimPosition;
|
||||
LLVector3 newpos = new LLVector3(somthing.Next(255), somthing.Next(255), somthing.Next(255));
|
||||
client.Self.Movement.TurnToward(newpos);
|
||||
|
||||
for (int i = 0; i < 2000; i++)
|
||||
{
|
||||
client.Self.Movement.AtPos = true;
|
||||
Thread.Sleep(somthing.Next(25, 75)); // Makes sure the bots keep walking for this time.
|
||||
}
|
||||
client.Self.Jump();
|
||||
|
||||
string randomf = talkarray[somthing.Next(talkarray.Length)];
|
||||
if (talkarray.Length > 1 && randomf.Length > 1)
|
||||
client.Self.Chat(randomf, 0, ChatType.Normal);
|
||||
|
||||
//Thread.Sleep(somthing.Next(1, 10)); // Apparently its better without it right now.
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the Nini config and initialize
|
||||
/// </summary>
|
||||
public void readconfig()
|
||||
{
|
||||
firstname = startupConfig.GetString("firstname", "random");
|
||||
lastname = startupConfig.GetString("lastname", "random");
|
||||
password = startupConfig.GetString("password", "12345");
|
||||
loginURI = startupConfig.GetString("loginuri", "http://10.1.1.5:9000");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells LibSecondLife to logout and disconnect. Raises the disconnect events once it finishes.
|
||||
/// </summary>
|
||||
public void shutdown()
|
||||
{
|
||||
client.Network.Logout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is the bot startup loop.
|
||||
/// </summary>
|
||||
public void startup()
|
||||
{
|
||||
client.Settings.LOGIN_SERVER = loginURI;
|
||||
client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected);
|
||||
client.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.Network_OnConnected);
|
||||
client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(this.Network_OnDisconnected);
|
||||
if (client.Network.Login(firstname, lastname, password, "pCampBot", "Your name"))
|
||||
{
|
||||
|
||||
if (OnConnected != null)
|
||||
{
|
||||
m_action = new Timer(somthing.Next(1000, 10000));
|
||||
m_action.Elapsed += new System.Timers.ElapsedEventHandler(m_action_Elapsed);
|
||||
m_action.Start();
|
||||
OnConnected(this, EventType.CONNECTED);
|
||||
client.Self.Jump();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Error(firstname + " " + lastname, "Can't login: " + client.Network.LoginMessage);
|
||||
if (OnDisconnected != null)
|
||||
{
|
||||
OnDisconnected(this, EventType.DISCONNECTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Network_OnConnected(object sender)
|
||||
{
|
||||
if (OnConnected != null)
|
||||
{
|
||||
OnConnected(this, EventType.CONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
public void Simulator_Connected(object sender)
|
||||
{
|
||||
}
|
||||
|
||||
public void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
|
||||
{
|
||||
if (OnDisconnected != null)
|
||||
{
|
||||
OnDisconnected(this, EventType.DISCONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
public string[] readexcuses()
|
||||
{
|
||||
string allexcuses = "";
|
||||
|
||||
string file = Path.Combine(Util.configDir(), "pCampBotSentences.txt");
|
||||
if (File.Exists(file))
|
||||
{
|
||||
StreamReader csr = File.OpenText(file);
|
||||
allexcuses = csr.ReadToEnd();
|
||||
csr.Close();
|
||||
}
|
||||
|
||||
return allexcuses.Split(Environment.NewLine.ToCharArray());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
This is the PhysicsCamperbot libslBot tester.
|
||||
|
||||
This is designed to be run in standalone mode with authorize accounts
|
||||
turned off as a way to stress test the simulator. It creates <N>
|
||||
clients that log in, randomly jump/walk around, and say excuses from
|
||||
the BOFH.
|
||||
|
||||
*** WARNING ***
|
||||
Using this bot on a public grid could get you banned permanently, so
|
||||
just say No! to griefing!
|
||||
|
||||
----- Setup -----
|
||||
Linux: To build, in the main opensim directory, run:
|
||||
./runprebuild.sh
|
||||
nant
|
||||
|
||||
Windows: Run the prebuild.bat in the main opensim directory and then
|
||||
open the created solution and compile it.
|
||||
|
||||
pCampBot.exe will end up in the regular opensim/bin folder
|
||||
|
||||
----- Running the bot -----
|
||||
|
||||
windows: pCampBot.exe -botcount <N> -loginuri <URI>
|
||||
*nix: mono pCampBot.exe -botcount <N> -loginuri <URI>
|
||||
|
||||
The names it produces are random by default, however, you can specify
|
||||
either a firstname or a lastname in the command line also.
|
||||
|
||||
ex: pCampBot.exe -botcount <N> -loginuri <URI> -lastname <lastname>
|
||||
|
||||
If you specify both a firstname *and* a lastname, you'll likely run
|
||||
into trouble unless you're only running a single bot. In that case,
|
||||
there's also a password option.
|
||||
|
||||
pCampBot.exe -botcount 1 -loginuri http://somegrid.com:8002 -firstname SomeDude -lastname SomeDude -password GobbleDeGook
|
||||
|
||||
----- Commands -----
|
||||
|
||||
The bot has console commands:
|
||||
help - lists the console commands and what they do
|
||||
shutdown - gracefully shuts down the bots
|
||||
quit - forcefully shuts things down leaving stuff unclean
|
||||
addbots N - adds N number of random bots. (replace 'N' with a number)
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using Nini.Config;
|
||||
using System.Threading;
|
||||
using OpenSim.Framework.Console;
|
||||
|
||||
namespace pCampBot
|
||||
{
|
||||
/// <summary>
|
||||
/// Event Types from the BOT. Add new events here
|
||||
/// </summary>
|
||||
public enum EventType:int
|
||||
{
|
||||
NONE = 0,
|
||||
CONNECTED = 1,
|
||||
DISCONNECTED = 2
|
||||
}
|
||||
|
||||
public class pCampBot
|
||||
{
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
//Set up our nifty config.. thanks to nini
|
||||
ArgvConfigSource cs = new ArgvConfigSource(args);
|
||||
|
||||
cs.AddSwitch("Startup", "botcount");
|
||||
cs.AddSwitch("Startup", "loginuri");
|
||||
cs.AddSwitch("Startup", "firstname");
|
||||
cs.AddSwitch("Startup", "lastname");
|
||||
cs.AddSwitch("Startup", "password");
|
||||
|
||||
IConfig ol = cs.Configs["Startup"];
|
||||
int botcount = ol.GetInt("botcount", 1);
|
||||
BotManager bm = new BotManager();
|
||||
|
||||
//startup specified number of bots. 1 is the default
|
||||
bm.dobotStartup(botcount, ol);
|
||||
while (true)
|
||||
{
|
||||
MainConsole.Instance.Prompt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue