* Some refactorings.

* Added shell of new Python scripting engine. Similar in design to the one used by Rex, but will be structured at a region rather than object level, also is a region module.
0.6.0-stable
Adam Frisby 2008-05-08 04:34:02 +00:00
parent d8aaf2ccf1
commit 80cbd468ea
11 changed files with 173 additions and 7 deletions

View File

@ -195,7 +195,7 @@ namespace OpenSim.Grid.UserServer
}
}
catch (WebException e)
catch (WebException)
{
m_log.ErrorFormat(
"[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}",

View File

@ -2862,8 +2862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected virtual void RegisterLocalPacketHandlers()
{
AddLocalPacketHandler(PacketType.LogoutRequest, Logout);
//BUG: Causes NullReferenceException FIXME.
// AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect);
AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect);
AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached);
AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate);
AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest);

View File

@ -0,0 +1,36 @@
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("Python")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Python")]
[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("5bd55f67-385d-4a43-893a-b5d2ea43f07d")]
// 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")]

View File

@ -0,0 +1,21 @@
using System;
using System.Reflection;
using log4net;
namespace OpenSim.Region.Modules.Python.PythonAPI
{
class Console
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public void WriteLine(string txt)
{
m_log.Info(txt);
}
public void WriteLine(string txt, params Object[] e)
{
m_log.Info(String.Format(txt, e));
}
}
}

View File

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Security.Policy;
using System.Text;
using IronPython.Hosting;
using log4net;
using Nini.Config;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Modules.Python
{
class PythonModule : IRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private PythonEngine m_python;
public void Initialise(Scene scene, IConfigSource source)
{
}
public void PostInitialise()
{
/*
m_log.Info("[PYTHON] Initialising IronPython engine.");
m_python = new PythonEngine();
m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python");
*/
}
public void Close()
{
}
public string Name
{
get { return "PythonModule"; }
}
public bool IsSharedModule
{
get { return true; }
}
}
}

View File

@ -138,8 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
}
private static int privateThreadCount = 0;
// TODO: unused
// private static int privateThreadCount = 0;
// private Thread StartScriptLoadUnloadThread()
// {
// Thread t = new Thread(ScriptLoadUnloadThreadLoop);

View File

@ -1007,10 +1007,16 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
m_log.ErrorFormat("[SPLITSCENE] [LocalUpdatePacket] ScenePresence is missing... ({0})", agentID.ToString());
return;
}
if (((LLClientView) pre.ControllingClient).IsActive)
if (pre.ControllingClient is LLClientView)
{
pre.ControllingClient.OutPacket(packet, throttlePacketType);
if (((LLClientView)pre.ControllingClient).IsActive)
{
((LLClientView)pre.ControllingClient).OutPacket(packet, throttlePacketType);
}
else
{
PacketPool.Instance.ReturnPacket(packet);
}
}
else
{

View File

@ -0,0 +1,28 @@
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributors patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
See FAQ.html for answers to frequently asked questions about this license.

BIN
bin/IronMath.dll Normal file

Binary file not shown.

BIN
bin/IronPython.dll Normal file

Binary file not shown.

View File

@ -863,6 +863,34 @@
</Files>
</Project>
<Project name="OpenSim.Region.Modules.Python" path="OpenSim/Region/Modules/Python" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../../bin/</ReferencePath>
<Reference name="System" localCopy="false"/>
<Reference name="libsecondlife.dll"/>
<Reference name="IronPython.dll"/>
<Reference name="IronMath.dll"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Data.Base" />
<Reference name="OpenSim.Region.Environment"/>
<Reference name="Nini.dll" />
<Reference name="log4net"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects" path="OpenSim/Region/Modules/Terrain/Extensions/DefaultEffects" type="Library">
<Configuration name="Debug">
<Options>