Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim

This commit is contained in:
Diva Canto
2009-08-17 13:27:22 -07:00
10 changed files with 120 additions and 36 deletions

View File

@@ -70,14 +70,14 @@ namespace OpenSim
protected bool m_autoCreateClientStack = true;
/// <summary>
/// <value>
/// The file used to load and save prim backup xml if no filename has been specified
/// </summary>
/// </value>
protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
/// <summary>
/// <value>
/// The file used to load and save an opensimulator archive if no filename has been specified
/// </summary>
/// </value>
protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
public ConfigSettings ConfigurationSettings

View File

@@ -83,6 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
internal string _accessPassword = String.Empty;
internal Regex AccessPasswordRegex = null;
internal List<string> ExcludeList = new List<string>();
internal string AccessPassword
{
get { return _accessPassword; }
@@ -210,8 +211,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
m_log.DebugFormat("[IRC-Channel-{0}] PingDelay : <{1}>", cs.idn, cs.PingDelay);
cs.AccessPassword = Substitute(rs, config.GetString("access_password", cs.AccessPassword));
m_log.DebugFormat("[IRC-Channel-{0}] AccessPassword : <{1}>", cs.idn, cs.AccessPassword);
string[] excludes = config.GetString("exclude_list", "").Trim().Split(new Char[] { ',' });
cs.ExcludeList = new List<string>(excludes.Length);
foreach(string name in excludes)
{
cs.ExcludeList.Add(name.Trim().ToLower());
}
// Fail if fundamental information is still missing
if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null)

View File

@@ -145,7 +145,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
if (enabled && (cs.irc.Enabled) && (cs.irc.Connected) && (cs.ClientReporting))
{
m_log.InfoFormat("[IRC-Region {0}]: {1} has left", Region, client.Name);
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name));
//Check if this person is excluded from IRC
if (!cs.ExcludeList.Contains(client.Name.ToLower()))
{
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has left", client.Name));
}
}
client.OnLogout -= OnClientLoggedOut;
client.OnConnectionClosed -= OnClientLoggedOut;
@@ -209,7 +213,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
{
string clientName = String.Format("{0} {1}", presence.Firstname, presence.Lastname);
m_log.DebugFormat("[IRC-Region {0}] {1} has arrived", Region, clientName);
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName));
//Check if this person is excluded from IRC
if (!cs.ExcludeList.Contains(clientName.ToLower()))
{
cs.irc.PrivMsg(cs.NoticeMessageFormat, cs.irc.Nick, Region, String.Format("{0} has arrived", clientName));
}
}
}
}

View File

@@ -211,25 +211,39 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
if (script.StartsWith("//MRM:C#"))
{
if (m_scene.GetSceneObjectPart(localID).OwnerID != m_scene.RegionInfo.MasterAvatarAssignedUUID
||
m_scene.GetSceneObjectPart(localID).CreatorID != m_scene.RegionInfo.MasterAvatarAssignedUUID)
return;
if (m_config.GetBoolean("OwnerOnly", true))
if (m_scene.GetSceneObjectPart(localID).OwnerID != m_scene.RegionInfo.MasterAvatarAssignedUUID
|| m_scene.GetSceneObjectPart(localID).CreatorID != m_scene.RegionInfo.MasterAvatarAssignedUUID)
return;
script = ConvertMRMKeywords(script);
try
{
m_log.Info("[MRM] Found C# MRM - Starting in AppDomain with " + m_config.GetString("permissionLevel", "Internet") + "-level security.");
AppDomain target;
if (m_config.GetBoolean("Sandboxed", true))
{
m_log.Info("[MRM] Found C# MRM - Starting in AppDomain with " +
m_config.GetString("SandboxLevel", "Internet") + "-level security.");
string domainName = UUID.Random().ToString();
AppDomain target = CreateRestrictedDomain(m_config.GetString("permissionLevel", "Internet"),
domainName);
string domainName = UUID.Random().ToString();
target = CreateRestrictedDomain(m_config.GetString("SandboxLevel", "Internet"),
domainName);
}
else
{
m_log.Info("[MRM] Found C# MRM - Starting in current AppDomain");
m_log.Warn(
"[MRM] Security Risk: AppDomain is run in current context. Use only in trusted environments.");
target = AppDomain.CurrentDomain;
}
m_log.Info("[MRM] Unwrapping into target AppDomain");
MRMBase mmb = (MRMBase) target.CreateInstanceFromAndUnwrap(
CompileFromDotNetText(script, itemID.ToString()),
"OpenSim.MiniModule");
m_log.Info("[MRM] Initialising MRM Globals");
InitializeMRM(mmb, localID, itemID);
m_scripts[itemID] = mmb;

View File

@@ -91,24 +91,45 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public bool Bright
{
get { return GetTexface().Fullbright; }
set { throw new System.NotImplementedException(); }
set
{
Primitive.TextureEntry tex = m_parent.Shape.Textures;
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
texface.Fullbright = value;
tex.FaceTextures[m_face] = texface;
m_parent.UpdateTexture(tex);
}
}
public double Bloom
{
get { return GetTexface().Glow; }
set { throw new System.NotImplementedException(); }
set
{
Primitive.TextureEntry tex = m_parent.Shape.Textures;
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
texface.Glow = (float) value;
tex.FaceTextures[m_face] = texface;
m_parent.UpdateTexture(tex);
}
}
public bool Shiny
{
get { return GetTexface().Shiny != Shininess.None; }
set { throw new System.NotImplementedException(); }
set
{
Primitive.TextureEntry tex = m_parent.Shape.Textures;
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
texface.Shiny = value ? Shininess.High : Shininess.None;
tex.FaceTextures[m_face] = texface;
m_parent.UpdateTexture(tex);
}
}
public bool BumpMap
{
get { throw new System.NotImplementedException(); }
get { return GetTexface().Bump == Bumpiness.None; }
set { throw new System.NotImplementedException(); }
}
}

View File

@@ -25,17 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.Security;
using OpenMetaverse;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces;
using log4net;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
class SPAvatar : System.MarshalByRefObject, IAvatar
@@ -60,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public string Name
{
get { return GetSP().Name; }
set { throw new InvalidOperationException("Avatar Names are a read-only property."); }
set { throw new SecurityException("Avatar Names are a read-only property."); }
}
public UUID GlobalID