Formatting cleanup, minor refactoring, svn properties.

0.6.0-stable
Jeff Ames 2008-06-04 09:59:27 +00:00
parent 0a2d399cad
commit 4ec4e16c80
59 changed files with 851 additions and 834 deletions

View File

@ -120,7 +120,7 @@ namespace OpenSim.Data.MySQL
//m_log.Info("[ASSET DB]: Asset exists already, ignoring."); //m_log.Info("[ASSET DB]: Asset exists already, ignoring.");
return; return;
} }
MySqlCommand cmd = MySqlCommand cmd =
new MySqlCommand( new MySqlCommand(
"REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" +
@ -164,7 +164,7 @@ namespace OpenSim.Data.MySQL
override public bool ExistsAsset(LLUUID uuid) override public bool ExistsAsset(LLUUID uuid)
{ {
bool assetExists = false; bool assetExists = false;
lock (_dbConnection) lock (_dbConnection)
{ {
MySqlCommand cmd = MySqlCommand cmd =
@ -182,7 +182,7 @@ namespace OpenSim.Data.MySQL
{ {
assetExists = true; assetExists = true;
} }
dbReader.Close(); dbReader.Close();
cmd.Dispose(); cmd.Dispose();
} }
@ -195,8 +195,8 @@ namespace OpenSim.Data.MySQL
_dbConnection.Reconnect(); _dbConnection.Reconnect();
} }
} }
return assetExists; return assetExists;
} }
/// <summary> /// <summary>

View File

@ -137,6 +137,7 @@ namespace OpenSim.Framework
} }
} }
} }
[Obsolete("Using Obsolete to drive development is invalid. Obsolete presumes that something new has already been created to replace this.")] [Obsolete("Using Obsolete to drive development is invalid. Obsolete presumes that something new has already been created to replace this.")]
public uint[] GetAllCircuits(LLUUID agentId) public uint[] GetAllCircuits(LLUUID agentId)
{ {

View File

@ -40,14 +40,14 @@ namespace OpenSim.Framework.Servers
public abstract class BaseOpenSimServer public abstract class BaseOpenSimServer
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected ConsoleBase m_console; protected ConsoleBase m_console;
/// <summary> /// <summary>
/// Time at which this server was started /// Time at which this server was started
/// </summary> /// </summary>
protected DateTime m_startuptime; protected DateTime m_startuptime;
/// <summary> /// <summary>
/// Server version information. Usually VersionInfo + information about svn revision, operating system, etc. /// Server version information. Usually VersionInfo + information about svn revision, operating system, etc.
/// </summary> /// </summary>
@ -66,19 +66,19 @@ namespace OpenSim.Framework.Servers
public BaseOpenSimServer() public BaseOpenSimServer()
{ {
m_startuptime = DateTime.Now; m_startuptime = DateTime.Now;
m_version = VersionInfo.Version; m_version = VersionInfo.Version;
} }
/// <summary> /// <summary>
/// Performs initialisation of the scene, such as loading configuration from disk. /// Performs initialisation of the scene, such as loading configuration from disk.
/// </summary> /// </summary>
public virtual void Startup() public virtual void Startup()
{ {
m_log.Info("[STARTUP]: Beginning startup processing"); m_log.Info("[STARTUP]: Beginning startup processing");
EnhanceVersionInformation(); EnhanceVersionInformation();
m_log.Info("[STARTUP]: Version " + m_version + "\n"); m_log.Info("[STARTUP]: Version " + m_version + "\n");
} }
@ -86,9 +86,9 @@ namespace OpenSim.Framework.Servers
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
/// </summary> /// </summary>
public virtual void Shutdown() public virtual void Shutdown()
{ {
m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
Environment.Exit(0); Environment.Exit(0);
} }
@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers
Notice("show uptime - show server startup time and uptime."); Notice("show uptime - show server startup time and uptime.");
Notice("show version - show server version."); Notice("show version - show server version.");
Notice("shutdown - shutdown the server.\n"); Notice("shutdown - shutdown the server.\n");
break; break;
case "show": case "show":
@ -146,10 +146,10 @@ namespace OpenSim.Framework.Servers
Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString()); Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString());
Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString()); Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString());
break; break;
case "version": case "version":
m_console.Notice("This is " + m_version); m_console.Notice("This is " + m_version);
break; break;
} }
} }
@ -172,7 +172,7 @@ namespace OpenSim.Framework.Servers
protected void EnhanceVersionInformation() protected void EnhanceVersionInformation()
{ {
string buildVersion = string.Empty; string buildVersion = string.Empty;
// Add subversion revision information if available // Add subversion revision information if available
// FIXME: Making an assumption about the directory we're currently in - we do this all over the place // FIXME: Making an assumption about the directory we're currently in - we do this all over the place
// elsewhere as well // elsewhere as well
@ -227,6 +227,6 @@ namespace OpenSim.Framework.Servers
} }
m_version += ", OS " + OSString; m_version += ", OS " + OSString;
} }
} }
} }

View File

@ -90,7 +90,7 @@ namespace OpenSim.Framework
// see IXmlSerializable // see IXmlSerializable
public void ReadXml(XmlReader reader) public void ReadXml(XmlReader reader)
{ {
// m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node before actions, {0}", reader.Name); // m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node before actions, {0}", reader.Name);
if (!reader.IsEmptyElement) if (!reader.IsEmptyElement)
{ {
@ -114,7 +114,7 @@ namespace OpenSim.Framework
// of the element wrapping this object so that the rest of the serialization can complete normally. // of the element wrapping this object so that the rest of the serialization can complete normally.
reader.Read(); reader.Read();
// m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node after actions, {0}", reader.Name); // m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node after actions, {0}", reader.Name);
} }
// see IXmlSerializable // see IXmlSerializable

View File

@ -43,7 +43,7 @@ namespace OpenSim.Grid.GridServer
public class GridServerBase : BaseOpenSimServer, conscmd_callback public class GridServerBase : BaseOpenSimServer, conscmd_callback
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected GridConfig m_config; protected GridConfig m_config;
protected GridManager m_gridManager; protected GridManager m_gridManager;
protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); protected List<IGridPlugin> m_plugins = new List<IGridPlugin>();
@ -121,12 +121,12 @@ namespace OpenSim.Grid.GridServer
// Temporary hack to stop mono-addins scanning warnings from coming out on the console // Temporary hack to stop mono-addins scanning warnings from coming out on the console
TextWriter oldOutput = Console.Out; TextWriter oldOutput = Console.Out;
Console.SetOut(new StreamWriter(Stream.Null)); Console.SetOut(new StreamWriter(Stream.Null));
AddinManager.Initialize("."); AddinManager.Initialize(".");
AddinManager.Registry.Update(null); AddinManager.Registry.Update(null);
// Returns the console.writelines back to the console's stream // Returns the console.writelines back to the console's stream
Console.SetOut(oldOutput); Console.SetOut(oldOutput);
ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer"); ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer");
foreach (TypeExtensionNode node in nodes) foreach (TypeExtensionNode node in nodes)
@ -175,7 +175,7 @@ namespace OpenSim.Grid.GridServer
catch catch
{ {
} }
if (SimResponse == "OK") if (SimResponse == "OK")
{ {
m_simProfileManager.SimProfiles[sim.UUID].online = true; m_simProfileManager.SimProfiles[sim.UUID].online = true;
@ -187,11 +187,11 @@ namespace OpenSim.Grid.GridServer
} }
*/ */
} }
public override void Shutdown() public override void Shutdown()
{ {
foreach (IGridPlugin plugin in m_plugins) plugin.Close(); foreach (IGridPlugin plugin in m_plugins) plugin.Close();
base.Shutdown(); base.Shutdown();
} }
} }

View File

@ -67,12 +67,12 @@ namespace OpenSim.Grid.MessagingServer
UserConfig uc = new UserConfig(); UserConfig uc = new UserConfig();
uc.DatabaseConnect = cfg.DatabaseConnect; uc.DatabaseConnect = cfg.DatabaseConnect;
uc.DatabaseProvider = cfg.DatabaseProvider; uc.DatabaseProvider = cfg.DatabaseProvider;
m_userManager._config = uc; m_userManager._config = uc;
m_userManager.AddPlugin(cfg.DatabaseProvider, cfg.DatabaseConnect); m_userManager.AddPlugin(cfg.DatabaseProvider, cfg.DatabaseConnect);
} }
#region FriendList Methods #region FriendList Methods
@ -152,7 +152,7 @@ namespace OpenSim.Grid.MessagingServer
friendlistupdater.OnDone += PresenceUpdateDone; friendlistupdater.OnDone += PresenceUpdateDone;
WaitCallback cb = new WaitCallback(friendlistupdater.go); WaitCallback cb = new WaitCallback(friendlistupdater.go);
ThreadPool.QueueUserWorkItem(cb); ThreadPool.QueueUserWorkItem(cb);
} }
else else
{ {
@ -173,7 +173,7 @@ namespace OpenSim.Grid.MessagingServer
{ {
// we need to send out online status update, but the user is already subscribed // we need to send out online status update, but the user is already subscribed
} }
UserAgentData p2Handle = m_userManager.GetUserAgentData(friendpresence.agentData.AgentID); UserAgentData p2Handle = m_userManager.GetUserAgentData(friendpresence.agentData.AgentID);
if (p2Handle != null) if (p2Handle != null)
@ -196,7 +196,7 @@ namespace OpenSim.Grid.MessagingServer
// skip, agent doesn't appear to exist anymore // skip, agent doesn't appear to exist anymore
} }
//SendRegionPresenceUpdate(userpresence, friendpresence); //SendRegionPresenceUpdate(userpresence, friendpresence);
} }
@ -315,8 +315,8 @@ namespace OpenSim.Grid.MessagingServer
UserAgentData p2Handle = m_userManager.GetUserAgentData(friendd.agentData.AgentID); UserAgentData p2Handle = m_userManager.GetUserAgentData(friendd.agentData.AgentID);
if (p2Handle != null) if (p2Handle != null)
{ {
friendd.regionData.regionHandle = p2Handle.Handle; friendd.regionData.regionHandle = p2Handle.Handle;
PresenceInformer friendlistupdater = new PresenceInformer(); PresenceInformer friendlistupdater = new PresenceInformer();
friendlistupdater.presence1 = AgentData; friendlistupdater.presence1 = AgentData;
@ -328,11 +328,11 @@ namespace OpenSim.Grid.MessagingServer
friendlistupdater.OnGetRegionData += GetRegionInfo; friendlistupdater.OnGetRegionData += GetRegionInfo;
friendlistupdater.OnDone += PresenceUpdateDone; friendlistupdater.OnDone += PresenceUpdateDone;
WaitCallback cb3 = new WaitCallback(friendlistupdater.go); WaitCallback cb3 = new WaitCallback(friendlistupdater.go);
ThreadPool.QueueUserWorkItem(cb3); ThreadPool.QueueUserWorkItem(cb3);
} }
else else
@ -519,14 +519,14 @@ namespace OpenSim.Grid.MessagingServer
else else
{ {
// Don't lock the cache while we're looking up the region! // Don't lock the cache while we're looking up the region!
lookup = true; lookup = true;
} }
} }
if (lookup) if (lookup)
{ {
regionInfo = RequestRegionInfo(regionhandle); regionInfo = RequestRegionInfo(regionhandle);
if (regionInfo != null) if (regionInfo != null)
{ {
lock (m_regionInfoCache) lock (m_regionInfoCache)
@ -542,7 +542,7 @@ namespace OpenSim.Grid.MessagingServer
} }
} }
} }
return regionInfo; return regionInfo;
} }
@ -555,7 +555,7 @@ namespace OpenSim.Grid.MessagingServer
cachecount = m_regionInfoCache.Count; cachecount = m_regionInfoCache.Count;
m_regionInfoCache.Clear(); m_regionInfoCache.Clear();
} }
return cachecount; return cachecount;
} }

View File

@ -36,13 +36,13 @@ namespace OpenSim.Grid.MessagingServer
{ {
public delegate RegionProfileData GetRegionData(ulong region_handle); public delegate RegionProfileData GetRegionData(ulong region_handle);
public delegate void Done(PresenceInformer obj); public delegate void Done(PresenceInformer obj);
public class PresenceInformer public class PresenceInformer
{ {
public event GetRegionData OnGetRegionData; public event GetRegionData OnGetRegionData;
public event Done OnDone; public event Done OnDone;
private GetRegionData handlerGetRegionData = null; private GetRegionData handlerGetRegionData = null;
private Done handlerDone = null; private Done handlerDone = null;
@ -102,10 +102,10 @@ namespace OpenSim.Grid.MessagingServer
PresenceParams.Add("notify_id",UserToUpdate.agentData.AgentID.ToString()); PresenceParams.Add("notify_id",UserToUpdate.agentData.AgentID.ToString());
if (TalkingAbout.OnlineYN) if (TalkingAbout.OnlineYN)
PresenceParams.Add("status","TRUE"); PresenceParams.Add("status","TRUE");
else else
PresenceParams.Add("status","FALSE"); PresenceParams.Add("status","FALSE");
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();
@ -123,12 +123,12 @@ namespace OpenSim.Grid.MessagingServer
catch (WebException) catch (WebException)
{ {
m_log.WarnFormat("[INFORM]: failed notifying region {0} containing user {1} about {2}", whichRegion.regionName, UserToUpdate.agentData.firstname + " " + UserToUpdate.agentData.lastname, TalkingAbout.agentData.firstname + " " + TalkingAbout.agentData.lastname); m_log.WarnFormat("[INFORM]: failed notifying region {0} containing user {1} about {2}", whichRegion.regionName, UserToUpdate.agentData.firstname + " " + UserToUpdate.agentData.lastname, TalkingAbout.agentData.firstname + " " + TalkingAbout.agentData.lastname);
} }
} }
else else
{ {
m_log.Info("[PRESENCEUPDATER]: Region data was null skipping"); m_log.Info("[PRESENCEUPDATER]: Region data was null skipping");
} }
handlerDone = OnDone; handlerDone = OnDone;

View File

@ -44,7 +44,7 @@ namespace OpenSim.Grid.MessagingServer
public UserAgentData GetUserAgentData(LLUUID AgentID) public UserAgentData GetUserAgentData(LLUUID AgentID)
{ {
UserProfileData userProfile = GetUserProfile(AgentID); UserProfileData userProfile = GetUserProfile(AgentID);
if (userProfile != null) if (userProfile != null)
{ {
return userProfile.CurrentAgent; return userProfile.CurrentAgent;
@ -58,19 +58,19 @@ namespace OpenSim.Grid.MessagingServer
public override UserProfileData SetupMasterUser(string firstName, string lastName) public override UserProfileData SetupMasterUser(string firstName, string lastName)
{ {
//throw new Exception("The method or operation is not implemented."); //throw new Exception("The method or operation is not implemented.");
return null; return null;
} }
public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) public override UserProfileData SetupMasterUser(string firstName, string lastName, string password)
{ {
//throw new Exception("The method or operation is not implemented."); //throw new Exception("The method or operation is not implemented.");
return null; return null;
} }
public override UserProfileData SetupMasterUser(LLUUID uuid) public override UserProfileData SetupMasterUser(LLUUID uuid)
{ {
//throw new Exception("The method or operation is not implemented."); //throw new Exception("The method or operation is not implemented.");
return null; return null;
} }
} }
} }

View File

@ -224,14 +224,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw);
LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw);
LSL_Types.Quaternion a = new LSL_Types.Quaternion(); LSL_Types.Quaternion a = new LSL_Types.Quaternion();
//This multiplication doesnt compile, yet. a = a1 * a2 * a3; //This multiplication doesn't compile, yet. a = a1 * a2 * a3;
LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax*bw*cw + aw*by*cz, LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax*bw*cw + aw*by*cz,
aw*by*cw - ax*bw*cz, aw*bw*cz + ax*by*cw, aw*by*cw - ax*bw*cz, aw*bw*cz + ax*by*cw,
aw*bw*cw - ax*by*cz); aw*bw*cw - ax*by*cz);
LSL_Types.Quaternion c = new LSL_Types.Quaternion(); LSL_Types.Quaternion c = new LSL_Types.Quaternion();
//This addition doesnt compile yet c = a + b; //This addition doesn't compile yet c = a + b;
LSL_Types.Quaternion d = new LSL_Types.Quaternion(); LSL_Types.Quaternion d = new LSL_Types.Quaternion();
//This addition doesnt compile yet d = a - b; //This addition doesn't compile yet d = a - b;
if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) || if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) ||
(Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) || (Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) ||
(Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) || (Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) ||

View File

@ -430,9 +430,9 @@ namespace OpenSim.Grid.UserServer
if (requestData.Contains("avatar_uuid")) if (requestData.Contains("avatar_uuid"))
{ {
LLUUID guess = LLUUID.Zero; LLUUID guess = LLUUID.Zero;
Helpers.TryParse((string)requestData["avatar_uuid"],out guess); Helpers.TryParse((string)requestData["avatar_uuid"],out guess);
if (guess == LLUUID.Zero) if (guess == LLUUID.Zero)
{ {
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();
@ -444,7 +444,7 @@ namespace OpenSim.Grid.UserServer
{ {
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();
} }
// no agent??? // no agent???
if (userProfile.CurrentAgent == null) if (userProfile.CurrentAgent == null)
{ {
@ -456,7 +456,7 @@ namespace OpenSim.Grid.UserServer
responseData["session"]=userProfile.CurrentAgent.SessionID.ToString(); responseData["session"]=userProfile.CurrentAgent.SessionID.ToString();
if (userProfile.CurrentAgent.AgentOnline) if (userProfile.CurrentAgent.AgentOnline)
responseData["agent_online"]="TRUE"; responseData["agent_online"]="TRUE";
else else
responseData["agent_online"]="FALSE"; responseData["agent_online"]="FALSE";
response.Value = responseData; response.Value = responseData;

View File

@ -31,20 +31,20 @@ using log4net;
using Nini.Config; using Nini.Config;
namespace OpenSim namespace OpenSim
{ {
/// <summary> /// <summary>
/// Consoleless OpenSim region server /// Consoleless OpenSim region server
/// </summary> /// </summary>
public class OpenSimBackground : OpenSimBase public class OpenSimBackground : OpenSimBase
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false); private ManualResetEvent WorldHasComeToAnEnd = new ManualResetEvent(false);
public OpenSimBackground(IConfigSource configSource) : base(configSource) public OpenSimBackground(IConfigSource configSource) : base(configSource)
{ {
} }
/// <summary> /// <summary>
/// Performs initialisation of the scene, such as loading configuration from disk. /// Performs initialisation of the scene, such as loading configuration from disk.
/// </summary> /// </summary>
@ -65,8 +65,8 @@ namespace OpenSim
m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
WorldHasComeToAnEnd.WaitOne(); WorldHasComeToAnEnd.WaitOne();
} }
/// <summary> /// <summary>
/// Performs any last-minute sanity checking and shuts down the region server /// Performs any last-minute sanity checking and shuts down the region server
/// </summary> /// </summary>
@ -75,6 +75,6 @@ namespace OpenSim
WorldHasComeToAnEnd.Set(); WorldHasComeToAnEnd.Set();
base.Shutdown(); base.Shutdown();
} }
} }
} }

View File

@ -624,14 +624,14 @@ namespace OpenSim.Region.Communications.OGS1
LLUUID agentID = LLUUID.Zero; LLUUID agentID = LLUUID.Zero;
LLUUID RegionSecret = LLUUID.Zero; LLUUID RegionSecret = LLUUID.Zero;
Helpers.TryParse((string)requestData["agent_id"], out agentID); Helpers.TryParse((string)requestData["agent_id"], out agentID);
Helpers.TryParse((string)requestData["region_secret"], out RegionSecret); Helpers.TryParse((string)requestData["region_secret"], out RegionSecret);
ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret,message); m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret,message);
return new XmlRpcResponse(); return new XmlRpcResponse();
} }
@ -647,7 +647,7 @@ namespace OpenSim.Region.Communications.OGS1
try try
{ {
ch = new TcpChannel((int)NetworkServersInfo.RemotingListenerPort); ch = new TcpChannel((int)NetworkServersInfo.RemotingListenerPort);
ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this. ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesn't support this.
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -85,8 +85,8 @@ namespace OpenSim.Region.Communications.OGS1
(float) Convert.ToDecimal((string) data["home_look_z"])); (float) Convert.ToDecimal((string) data["home_look_z"]));
return userData; return userData;
} }
/// <summary> /// <summary>
/// Get a user agent from the user server /// Get a user agent from the user server
/// </summary> /// </summary>
@ -126,7 +126,7 @@ namespace OpenSim.Region.Communications.OGS1
{ {
userAgent.AgentOnline = false; userAgent.AgentOnline = false;
} }
return userAgent; return userAgent;
} }
catch (Exception e) catch (Exception e)
@ -259,7 +259,7 @@ namespace OpenSim.Region.Communications.OGS1
XmlRpcRequest req = new XmlRpcRequest("update_user_current_region", parameters); XmlRpcRequest req = new XmlRpcRequest("update_user_current_region", parameters);
XmlRpcResponse resp; XmlRpcResponse resp;
try try
{ {
resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
@ -278,8 +278,8 @@ namespace OpenSim.Region.Communications.OGS1
return; return;
} }
} }
if( resp == null ) if (resp == null)
{ {
m_log.Warn("[OSG1 USER SERVICES]: Got no response, Grid server may not be updated."); m_log.Warn("[OSG1 USER SERVICES]: Got no response, Grid server may not be updated.");
return; return;

View File

@ -644,7 +644,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
} }
catch (IOException) catch (IOException)
{ {
if (m_enabled) if (m_enabled)
{ {
m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)"); m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
Reconnect(); Reconnect();
@ -848,7 +848,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
public void Close() public void Close()
{ {
m_writer.WriteLine(String.Format("QUIT :{0} to {1} wormhole to {2} closing", m_writer.WriteLine(String.Format("QUIT :{0} to {1} wormhole to {2} closing",
m_nick, m_channel, m_server)); m_nick, m_channel, m_server));
m_writer.Flush(); m_writer.Flush();

View File

@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
#region IRegionModule Members #region IRegionModule Members
private bool gridmode = false; private bool gridmode = false;
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
@ -183,13 +183,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
} }
} }
} }
// Trusty OSG1 called method. This method also gets called from the FriendsModule // Trusty OSG1 called method. This method also gets called from the FriendsModule
// Turns out the sim has to send an instant message to the user to get it to show an accepted friend. // Turns out the sim has to send an instant message to the user to get it to show an accepted friend.
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="msg"></param> /// <param name="msg"></param>
private void OnGridInstantMessage(GridInstantMessage msg) private void OnGridInstantMessage(GridInstantMessage msg)
@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
/// Process a XMLRPC Grid Instant Message /// Process a XMLRPC Grid Instant Message
/// </summary> /// </summary>
/// <param name="request">XMLRPC parameters from_agent_id from_agent_session to_agent_id im_session_id timestamp /// <param name="request">XMLRPC parameters from_agent_id from_agent_session to_agent_id im_session_id timestamp
/// from_agent_name message dialog from_group offline parent_estate_id position_x position_y position_z region_id /// from_agent_name message dialog from_group offline parent_estate_id position_x position_y position_z region_id
/// binary_bucket region_handle</param> /// binary_bucket region_handle</param>
/// <returns>Nothing much</returns> /// <returns>Nothing much</returns>
protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request) protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request)
@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
uint timestamp = 0; uint timestamp = 0;
string fromAgentName = ""; string fromAgentName = "";
string message = ""; string message = "";
byte dialog = (byte)0; byte dialog = (byte)0;
bool fromGroup = false; bool fromGroup = false;
byte offline = (byte)0; byte offline = (byte)0;
uint ParentEstateID=0; uint ParentEstateID=0;
@ -237,14 +237,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
Hashtable requestData = (Hashtable)request.Params[0]; Hashtable requestData = (Hashtable)request.Params[0];
// Check if it's got all the data // Check if it's got all the data
if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session") if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session")
&& requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id") && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id")
&& requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name") && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name")
&& requestData.ContainsKey("message") && requestData.ContainsKey("dialog") && requestData.ContainsKey("message") && requestData.ContainsKey("dialog")
&& requestData.ContainsKey("from_group") && requestData.ContainsKey("from_group")
&& requestData.ContainsKey("offline") && requestData.ContainsKey("parent_estate_id") && requestData.ContainsKey("offline") && requestData.ContainsKey("parent_estate_id")
&& requestData.ContainsKey("position_x") && requestData.ContainsKey("position_y") && requestData.ContainsKey("position_x") && requestData.ContainsKey("position_y")
&& requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id") && requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id")
&& requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle")) && requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle"))
{ {
// Do the easy way of validating the UUIDs // Do the easy way of validating the UUIDs
@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
// Bytes don't transfer well over XMLRPC, so, we Base64 Encode them. // Bytes don't transfer well over XMLRPC, so, we Base64 Encode them.
byte[] dialogdata = Convert.FromBase64String((string)requestData["dialog"]); byte[] dialogdata = Convert.FromBase64String((string)requestData["dialog"]);
dialog = dialogdata[0]; dialog = dialogdata[0];
if ((string)requestData["from_group"] == "TRUE") if ((string)requestData["from_group"] == "TRUE")
fromGroup = true; fromGroup = true;
@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
gim.Position = new sLLVector3(Position); gim.Position = new sLLVector3(Position);
gim.binaryBucket = binaryBucket; gim.binaryBucket = binaryBucket;
// Trigger the Instant message in the scene. // Trigger the Instant message in the scene.
foreach (Scene scene in m_scenes) foreach (Scene scene in m_scenes)
{ {
@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
} }
} }
//OnGridInstantMessage(gim); //OnGridInstantMessage(gim);
} }
//Send response back to region calling if it was successful //Send response back to region calling if it was successful
@ -482,7 +482,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
else else
{ {
lookupAgent = true; lookupAgent = true;
} }
} }
@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
else else
{ {
// try again, but lookup user this time. // try again, but lookup user this time.
// Warning, this must call the Async version // Warning, this must call the Async version
// of this method or we'll be making thousands of threads // of this method or we'll be making thousands of threads
// The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync
// The version that spawns the thread is SendGridInstantMessageViaXMLRPC // The version that spawns the thread is SendGridInstantMessageViaXMLRPC
@ -686,7 +686,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
if (msg.fromGroup) if (msg.fromGroup)
gim["from_group"] = "TRUE"; gim["from_group"] = "TRUE";
else else
gim["from_group"] = "FALSE"; gim["from_group"] = "FALSE";
byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline; byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline;
gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None); gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None);

View File

@ -41,10 +41,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary> /// </summary>
public class ArchiveReadRequest public class ArchiveReadRequest
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
private Scene m_scene; private Scene m_scene;
private string m_loadPath; private string m_loadPath;
@ -55,22 +55,22 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
DearchiveRegion(); DearchiveRegion();
} }
protected void DearchiveRegion() protected void DearchiveRegion()
{ {
TarArchiveReader archive = new TarArchiveReader(m_loadPath); TarArchiveReader archive = new TarArchiveReader(m_loadPath);
string serializedPrims = string.Empty; string serializedPrims = string.Empty;
// Just test for now by reading first file // Just test for now by reading first file
string filePath = "ERROR"; string filePath = "ERROR";
byte[] data; byte[] data;
while ((data = archive.ReadEntry(out filePath)) != null) while ((data = archive.ReadEntry(out filePath)) != null)
{ {
m_log.DebugFormat( m_log.DebugFormat(
"[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); "[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath);
if (filePath.Equals(ArchiveConstants.PRIMS_PATH)) if (filePath.Equals(ArchiveConstants.PRIMS_PATH))
{ {
serializedPrims = m_asciiEncoding.GetString(data); serializedPrims = m_asciiEncoding.GetString(data);
@ -78,37 +78,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
else if (filePath.StartsWith(ArchiveConstants.TEXTURES_PATH)) else if (filePath.StartsWith(ArchiveConstants.TEXTURES_PATH))
{ {
// Right now we're nastily obtaining the lluuid from the filename // Right now we're nastily obtaining the lluuid from the filename
string rawId = filePath.Remove(0, ArchiveConstants.TEXTURES_PATH.Length); string rawId = filePath.Remove(0, ArchiveConstants.TEXTURES_PATH.Length);
rawId = rawId.Remove(rawId.Length - ArchiveConstants.TEXTURE_EXTENSION.Length); rawId = rawId.Remove(rawId.Length - ArchiveConstants.TEXTURE_EXTENSION.Length);
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId); m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", rawId);
// Not preserving asset name or description as of yet // Not preserving asset name or description as of yet
AssetBase asset = new AssetBase(new LLUUID(rawId), "imported name"); AssetBase asset = new AssetBase(new LLUUID(rawId), "imported name");
asset.Description = "imported description"; asset.Description = "imported description";
asset.Type = (sbyte)AssetType.Texture; asset.Type = (sbyte)AssetType.Texture;
asset.InvType = (sbyte)InventoryType.Texture; asset.InvType = (sbyte)InventoryType.Texture;
asset.Data = data; asset.Data = data;
m_scene.AssetCache.AddAsset(asset); m_scene.AssetCache.AddAsset(asset);
} }
} }
m_log.DebugFormat("[ARCHIVER]: Reached end of archive"); m_log.DebugFormat("[ARCHIVER]: Reached end of archive");
archive.Close(); archive.Close();
if (serializedPrims.Equals(string.Empty)) if (serializedPrims.Equals(string.Empty))
{ {
m_log.ErrorFormat("[ARCHIVER]: Archive did not contain a {0} file", ArchiveConstants.PRIMS_PATH); m_log.ErrorFormat("[ARCHIVER]: Archive did not contain a {0} file", ArchiveConstants.PRIMS_PATH);
return; return;
} }
// Reload serialized prims // Reload serialized prims
m_log.InfoFormat("[ARCHIVER]: Loading prim data"); m_log.InfoFormat("[ARCHIVER]: Loading prim data");
IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims)); serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
} }

View File

@ -80,16 +80,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{ {
// XXX: Not a great way to iterate through face textures, but there's no // XXX: Not a great way to iterate through face textures, but there's no
// other way to tell how many faces there actually are // other way to tell how many faces there actually are
//int i = 0; //int i = 0;
foreach (LLObject.TextureEntryFace texture in part.Shape.Textures.FaceTextures) foreach (LLObject.TextureEntryFace texture in part.Shape.Textures.FaceTextures)
{ {
if (texture != null) if (texture != null)
{ {
//m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
textureUuids[texture.TextureID] = 1; textureUuids[texture.TextureID] = 1;
} }
} }
foreach (TaskInventoryItem tit in part.TaskInventory.Values) foreach (TaskInventoryItem tit in part.TaskInventory.Values)
{ {
if (tit.Type == (int)InventoryType.Texture) if (tit.Type == (int)InventoryType.Texture)
@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
TarArchiveWriter archive = new TarArchiveWriter(); TarArchiveWriter archive = new TarArchiveWriter();
archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities); archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities);
// It appears that gtar, at least, doesn't need the intermediate directory entries in the tar // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar
//archive.AddDir("assets"); //archive.AddDir("assets");
@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
if (assets[uuid] != null) if (assets[uuid] != null)
{ {
archive.AddFile( archive.AddFile(
ArchiveConstants.TEXTURES_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION, ArchiveConstants.TEXTURES_PATH + uuid.ToString() + ArchiveConstants.TEXTURE_EXTENSION,
assets[uuid].Data); assets[uuid].Data);
} }
else else
@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
} }
archive.WriteTar(m_savePath); archive.WriteTar(m_savePath);
m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath);
} }
@ -232,11 +232,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
newThread.Start(); newThread.Start();
} }
} }
/// <summary> /// <summary>
/// Perform the callback on the original requester of the assets /// Perform the callback on the original requester of the assets
/// </summary> /// </summary>
protected void PerformAssetsRequestCallback() protected void PerformAssetsRequestCallback()
{ {
m_assetsRequestCallback(m_assets); m_assetsRequestCallback(m_assets);
} }

View File

@ -39,24 +39,24 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public class TarArchiveReader public class TarArchiveReader
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
/// <summary> /// <summary>
/// Binary reader for the underlying stream /// Binary reader for the underlying stream
/// </summary> /// </summary>
protected BinaryReader m_br; protected BinaryReader m_br;
/// <summary> /// <summary>
/// Used to trim off null chars /// Used to trim off null chars
/// </summary> /// </summary>
protected char[] m_nullCharArray = new char[] { '\0' }; protected char[] m_nullCharArray = new char[] { '\0' };
public TarArchiveReader(string archivePath) public TarArchiveReader(string archivePath)
{ {
m_br = new BinaryReader(new FileStream(archivePath, FileMode.Open)); m_br = new BinaryReader(new FileStream(archivePath, FileMode.Open));
} }
/// <summary> /// <summary>
/// Are we at the end of the archive? /// Are we at the end of the archive?
/// </summary> /// </summary>
@ -64,13 +64,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public bool AtEof() public bool AtEof()
{ {
// If we've reached the end of the archive we'll be in null block territory, which means // If we've reached the end of the archive we'll be in null block territory, which means
// the next byte will be 0 // the next byte will be 0
if (m_br.PeekChar() == 0) if (m_br.PeekChar() == 0)
return true; return true;
return false; return false;
} }
/// <summary> /// <summary>
/// Read the next entry in the tar file. /// Read the next entry in the tar file.
/// </summary> /// </summary>
@ -79,27 +79,27 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
public byte[] ReadEntry(out string filePath) public byte[] ReadEntry(out string filePath)
{ {
filePath = String.Empty; filePath = String.Empty;
if (AtEof()) if (AtEof())
return null; return null;
TarHeader header = ReadHeader(); TarHeader header = ReadHeader();
filePath = header.FilePath; filePath = header.FilePath;
byte[] data = m_br.ReadBytes(header.FileSize); byte[] data = m_br.ReadBytes(header.FileSize);
m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize); m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
// Read the rest of the empty padding in the 512 byte block // Read the rest of the empty padding in the 512 byte block
if (header.FileSize % 512 != 0) if (header.FileSize % 512 != 0)
{ {
int paddingLeft = 512 - (header.FileSize % 512); int paddingLeft = 512 - (header.FileSize % 512);
m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft); m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft);
m_br.ReadBytes(paddingLeft); m_br.ReadBytes(paddingLeft);
} }
return data; return data;
} }
@ -109,44 +109,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary> /// </summary>
/// <returns>A tar header struct.</returns> /// <returns>A tar header struct.</returns>
protected TarHeader ReadHeader() protected TarHeader ReadHeader()
{ {
TarHeader tarHeader = new TarHeader(); TarHeader tarHeader = new TarHeader();
byte[] header = m_br.ReadBytes(512); byte[] header = m_br.ReadBytes(512);
tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100);
tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray); tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray);
tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11); tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11);
return tarHeader; return tarHeader;
} }
public void Close() public void Close()
{ {
m_br.Close(); m_br.Close();
} }
/// <summary> /// <summary>
/// Convert octal bytes to a decimal representation /// Convert octal bytes to a decimal representation
/// </summary> /// </summary>
/// <param name="bytes"></param> /// <param name="bytes"></param>
/// <returns></returns> /// <returns></returns>
public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count) public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count)
{ {
string oString = m_asciiEncoding.GetString(bytes, startIndex, count); string oString = m_asciiEncoding.GetString(bytes, startIndex, count);
int d = 0; int d = 0;
foreach (char c in oString) foreach (char c in oString)
{ {
d <<= 3; d <<= 3;
d |= c - '0'; d |= c - '0';
} }
return d; return d;
} }
} }
public struct TarHeader public struct TarHeader
{ {
public string FilePath; public string FilePath;

View File

@ -34,30 +34,30 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
{ {
public interface IRegionSerialiser public interface IRegionSerialiser
{ {
List<string> SerialiseRegion(Scene scene, string saveDir); List<string> SerialiseRegion(Scene scene, string saveDir);
void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset); void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset);
void SavePrimsToXml(Scene scene, string fileName); void SavePrimsToXml(Scene scene, string fileName);
/// <summary> /// <summary>
/// Load prims from the xml2 format /// Load prims from the xml2 format
/// </summary> /// </summary>
/// <param name="scene"></param> /// <param name="scene"></param>
/// <param name="fileName"></param> /// <param name="fileName"></param>
void LoadPrimsFromXml2(Scene scene, string fileName); void LoadPrimsFromXml2(Scene scene, string fileName);
/// <summary> /// <summary>
/// Load prims from the xml2 format /// Load prims from the xml2 format
/// </summary> /// </summary>
/// <param name="scene"></param> /// <param name="scene"></param>
/// <param name="reader"></param> /// <param name="reader"></param>
void LoadPrimsFromXml2(Scene scene, TextReader reader); void LoadPrimsFromXml2(Scene scene, TextReader reader);
void SavePrimsToXml2(Scene scene, string fileName); void SavePrimsToXml2(Scene scene, string fileName);
void LoadGroupFromXml2String(Scene scene, string xmlString); void LoadGroupFromXml2String(Scene scene, string xmlString);
string SavePrimGroupToXML2String(SceneObjectGroup grp); string SavePrimGroupToXML2String(SceneObjectGroup grp);
} }
} }

View File

@ -56,14 +56,14 @@ namespace OpenSim.Region.Environment.Scenes
foreach (XmlNode aPrimNode in rootNode.ChildNodes) foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{ {
SceneObjectGroup obj = new SceneObjectGroup(scene, scene.RegionInfo.RegionHandle, aPrimNode.OuterXml); SceneObjectGroup obj = new SceneObjectGroup(scene, scene.RegionInfo.RegionHandle, aPrimNode.OuterXml);
if (newIDS) if (newIDS)
{ {
obj.ResetIDs(); obj.ResetIDs();
} }
//if we want this to be a import method then we need new uuids for the object to avoid any clashes //if we want this to be a import method then we need new uuids for the object to avoid any clashes
//obj.RegenerateFullIDs(); //obj.RegenerateFullIDs();
scene.AddSceneObject(obj); scene.AddSceneObject(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
LoadPrimsFromXml2(scene, new XmlTextReader(fileName)); LoadPrimsFromXml2(scene, new XmlTextReader(fileName));
} }
/// <summary> /// <summary>
/// Load prims from the xml2 format /// Load prims from the xml2 format
/// </summary> /// </summary>
@ -173,24 +173,24 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="scene"></param> /// <param name="scene"></param>
/// <param name="reader"></param> /// <param name="reader"></param>
protected static void LoadPrimsFromXml2(Scene scene, XmlTextReader reader) protected static void LoadPrimsFromXml2(Scene scene, XmlTextReader reader)
{ {
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
reader.WhitespaceHandling = WhitespaceHandling.None; reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader); doc.Load(reader);
reader.Close(); reader.Close();
XmlNode rootNode = doc.FirstChild; XmlNode rootNode = doc.FirstChild;
foreach (XmlNode aPrimNode in rootNode.ChildNodes) foreach (XmlNode aPrimNode in rootNode.ChildNodes)
{ {
CreatePrimFromXml(scene, aPrimNode.OuterXml); CreatePrimFromXml(scene, aPrimNode.OuterXml);
} }
} }
public static void CreatePrimFromXml(Scene scene, string xmlData) public static void CreatePrimFromXml(Scene scene, string xmlData)
{ {
SceneObjectGroup obj = new SceneObjectGroup(xmlData); SceneObjectGroup obj = new SceneObjectGroup(xmlData);
LLVector3 receivedVelocity = obj.RootPart.Velocity; LLVector3 receivedVelocity = obj.RootPart.Velocity;
//System.Console.WriteLine(obj.RootPart.Velocity.ToString()); //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
scene.AddSceneObjectFromStorage(obj); scene.AddSceneObjectFromStorage(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);

View File

@ -86,42 +86,42 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
#endregion #endregion
#region IRegionSerialiser Members #region IRegionSerialiser Members
public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) public void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset)
{ {
SceneXmlLoader.LoadPrimsFromXml(scene, fileName, newIDS, loadOffset); SceneXmlLoader.LoadPrimsFromXml(scene, fileName, newIDS, loadOffset);
} }
public void SavePrimsToXml(Scene scene, string fileName) public void SavePrimsToXml(Scene scene, string fileName)
{ {
SceneXmlLoader.SavePrimsToXml(scene, fileName); SceneXmlLoader.SavePrimsToXml(scene, fileName);
} }
public void LoadPrimsFromXml2(Scene scene, string fileName) public void LoadPrimsFromXml2(Scene scene, string fileName)
{ {
SceneXmlLoader.LoadPrimsFromXml2(scene, fileName); SceneXmlLoader.LoadPrimsFromXml2(scene, fileName);
} }
public void LoadPrimsFromXml2(Scene scene, TextReader reader) public void LoadPrimsFromXml2(Scene scene, TextReader reader)
{ {
SceneXmlLoader.LoadPrimsFromXml2(scene, reader); SceneXmlLoader.LoadPrimsFromXml2(scene, reader);
} }
public void SavePrimsToXml2(Scene scene, string fileName) public void SavePrimsToXml2(Scene scene, string fileName)
{ {
SceneXmlLoader.SavePrimsToXml2(scene, fileName); SceneXmlLoader.SavePrimsToXml2(scene, fileName);
} }
public void LoadGroupFromXml2String(Scene scene, string xmlString) public void LoadGroupFromXml2String(Scene scene, string xmlString)
{ {
SceneXmlLoader.LoadGroupFromXml2String(scene, xmlString); SceneXmlLoader.LoadGroupFromXml2String(scene, xmlString);
} }
public string SavePrimGroupToXML2String(SceneObjectGroup grp) public string SavePrimGroupToXML2String(SceneObjectGroup grp)
{ {
return SceneXmlLoader.SavePrimGroupToXML2String(grp); return SceneXmlLoader.SavePrimGroupToXML2String(grp);
} }
public List<string> SerialiseRegion(Scene scene, string saveDir) public List<string> SerialiseRegion(Scene scene, string saveDir)
{ {
List<string> results = new List<string>(); List<string> results = new List<string>();

View File

@ -627,7 +627,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Get Methods #region Get Methods
/// <summary> /// <summary>
/// Request a List of all scene presences in this scene. This is a new list, so no /// Request a List of all scene presences in this scene. This is a new list, so no
/// locking is required to iterate over it. /// locking is required to iterate over it.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>

View File

@ -1506,18 +1506,18 @@ namespace OpenSim.Region.Environment.Scenes
CrossPrimGroupIntoNewRegion(newRegionHandle, grp); CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
} }
public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp) public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
{ {
int primcrossingXMLmethod = 0; int primcrossingXMLmethod = 0;
if (newRegionHandle != 0) if (newRegionHandle != 0)
{ {
bool successYN = false; bool successYN = false;
successYN successYN
= m_sceneGridService.PrimCrossToNeighboringRegion( = m_sceneGridService.PrimCrossToNeighboringRegion(
newRegionHandle, grp.UUID, m_serialiser.SavePrimGroupToXML2String(grp), primcrossingXMLmethod); newRegionHandle, grp.UUID, m_serialiser.SavePrimGroupToXML2String(grp), primcrossingXMLmethod);
if (successYN) if (successYN)
{ {
// We remove the object here // We remove the object here
@ -1550,7 +1550,7 @@ namespace OpenSim.Region.Environment.Scenes
if (XMLMethod == 0) if (XMLMethod == 0)
{ {
m_serialiser.LoadGroupFromXml2String(this, objXMLData); m_serialiser.LoadGroupFromXml2String(this, objXMLData);
SceneObjectPart RootPrim = GetSceneObjectPart(primID); SceneObjectPart RootPrim = GetSceneObjectPart(primID);
if (RootPrim != null) if (RootPrim != null)
{ {
@ -2091,7 +2091,7 @@ namespace OpenSim.Region.Environment.Scenes
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
} }
} }
} }
/// <summary> /// <summary>

View File

@ -83,8 +83,8 @@ namespace OpenSim.Region.Environment.Scenes
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>(); Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
for (int i = 0; i < m_localScenes.Count; i++) for (int i = 0; i < m_localScenes.Count; i++)
{ {
// extract known shared modules from scene // extract known shared modules from scene
foreach(string k in m_localScenes[i].Modules.Keys) foreach (string k in m_localScenes[i].Modules.Keys)
{ {
if (m_localScenes[i].Modules[k].IsSharedModule && if (m_localScenes[i].Modules[k].IsSharedModule &&
!sharedModules.ContainsKey(k)) !sharedModules.ContainsKey(k))
@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes
// all regions/scenes are now closed, we can now safely // all regions/scenes are now closed, we can now safely
// close all shared modules // close all shared modules
foreach(IRegionModule mod in sharedModules.Values) foreach (IRegionModule mod in sharedModules.Values)
{ {
mod.Close(); mod.Close();
} }

View File

@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes
Vector3 normalpart = ipoint - vAbsolutePosition; Vector3 normalpart = ipoint - vAbsolutePosition;
returnresult.normal = normalpart / normalpart.Length; returnresult.normal = normalpart / normalpart.Length;
// It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesnt. // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesn't.
// I can write a function to do it.. but I like the fact that this one is Static. // I can write a function to do it.. but I like the fact that this one is Static.
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z); LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z);

View File

@ -89,7 +89,7 @@ namespace OpenSim.Region.Physics.Meshing
v.X *= (size.X * taperTopFactorX); v.X *= (size.X * taperTopFactorX);
v.Y *= (size.Y * taperTopFactorY); v.Y *= (size.Y * taperTopFactorY);
v.Z *= size.Z; v.Z *= size.Z;
//Push the top of the object over by the Top Shear amount //Push the top of the object over by the Top Shear amount
v.X += pushX * size.X; v.X += pushX * size.X;
v.Y += pushY * size.Y; v.Y += pushY * size.Y;
@ -165,7 +165,7 @@ namespace OpenSim.Region.Physics.Meshing
for (int i = 0; i < workingMiddle.vertices.Count; i++) for (int i = 0; i < workingMiddle.vertices.Count; i++)
{ {
int iNext = (i + 1); int iNext = i + 1;
if (workingMiddle.vertices[i] == null) // Can't make a simplex here if (workingMiddle.vertices[i] == null) // Can't make a simplex here
{ {
@ -200,7 +200,7 @@ namespace OpenSim.Region.Physics.Meshing
iLastNull = 0; iLastNull = 0;
for (int i = 0; i < workingPlus.vertices.Count; i++) for (int i = 0; i < workingPlus.vertices.Count; i++)
{ {
int iNext = (i + 1); int iNext = i + 1;
if (workingPlus.vertices[i] == null) // Can't make a simplex here if (workingPlus.vertices[i] == null) // Can't make a simplex here
{ {
@ -261,7 +261,7 @@ namespace OpenSim.Region.Physics.Meshing
float twistTotal = twistTop - twistBot; float twistTotal = twistTop - twistBot;
// if the profile has a lot of twist, add more layers otherwise the layers may overlap // if the profile has a lot of twist, add more layers otherwise the layers may overlap
// and the resulting mesh may be quite inaccurate. This method is arbitrary and doesnt // and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't
// accurately match the viewer // accurately match the viewer
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 1.5f) steps *= 2; if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 1.5f) steps *= 2;
if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 3.0f) steps *= 2; if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 3.0f) steps *= 2;
@ -291,7 +291,6 @@ namespace OpenSim.Region.Physics.Meshing
+ " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString()); + " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString());
System.Console.WriteLine("Extruder: PathScaleX: " + pathScaleX.ToString() + " pathScaleY: " + pathScaleY.ToString()); System.Console.WriteLine("Extruder: PathScaleX: " + pathScaleX.ToString() + " pathScaleY: " + pathScaleY.ToString());
#endif #endif
bool done = false; bool done = false;
do // loop through the length of the path and add the layers do // loop through the length of the path and add the layers
@ -319,12 +318,16 @@ namespace OpenSim.Region.Physics.Meshing
// apply the taper to the profile before any rotations // apply the taper to the profile before any rotations
if (xProfileScale != 1.0f || yProfileScale != 1.0f) if (xProfileScale != 1.0f || yProfileScale != 1.0f)
{
foreach (Vertex v in newLayer.vertices) foreach (Vertex v in newLayer.vertices)
if ( v != null ) {
if (v != null)
{ {
v.X *= xProfileScale; v.X *= xProfileScale;
v.Y *= yProfileScale; v.Y *= yProfileScale;
} }
}
}
float radiusScale; float radiusScale;
@ -332,8 +335,8 @@ namespace OpenSim.Region.Physics.Meshing
radiusScale = 1.0f - radius * percentOfPath; radiusScale = 1.0f - radius * percentOfPath;
else if (radius < 0.001f) else if (radius < 0.001f)
radiusScale = 1.0f + radius * (1.0f - percentOfPath); radiusScale = 1.0f + radius * (1.0f - percentOfPath);
else radiusScale = 1.0f; else
radiusScale = 1.0f;
#if SPAM #if SPAM
System.Console.WriteLine("Extruder: angle: " + angle.ToString() + " percentOfPath: " + percentOfPath.ToString() System.Console.WriteLine("Extruder: angle: " + angle.ToString() + " percentOfPath: " + percentOfPath.ToString()
@ -379,10 +382,12 @@ namespace OpenSim.Region.Physics.Meshing
} }
if (angle == startAngle) // the first layer, invert normals if (angle == startAngle) // the first layer, invert normals
{
foreach (Triangle t in newLayer.triangles) foreach (Triangle t in newLayer.triangles)
{ {
t.invertNormal(); t.invertNormal();
} }
}
result.Append(newLayer); result.Append(newLayer);
@ -397,7 +402,9 @@ namespace OpenSim.Region.Physics.Meshing
int iNext = (i + 1); int iNext = (i + 1);
if (lastLayer.vertices[i] == null) // cant make a simplex here if (lastLayer.vertices[i] == null) // cant make a simplex here
{
iLastNull = i + 1; iLastNull = i + 1;
}
else else
{ {
if (i == count - 1) // End of list if (i == count - 1) // End of list
@ -413,17 +420,17 @@ namespace OpenSim.Region.Physics.Meshing
} }
lastLayer = newLayer; lastLayer = newLayer;
// calc the angle for the next interation of the loop // calc the angle for the next interation of the loop
if (angle >= endAngle) if (angle >= endAngle)
{
done = true; done = true;
}
else else
{ {
angle = stepSize * ++step; angle = stepSize * ++step;
if (angle > endAngle) if (angle > endAngle)
angle = endAngle; angle = endAngle;
} }
} while (!done); // loop until all the layers in the path are completed } while (!done); // loop until all the layers in the path are completed
// scale the mesh to the desired size // scale the mesh to the desired size

View File

@ -178,7 +178,7 @@ namespace OpenSim.Region.ScriptEngine.Common
/// <summary> /// <summary>
/// accepts a valid LLUUID, -or- a name of an inventory item. /// accepts a valid LLUUID, -or- a name of an inventory item.
/// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found
/// in prim inventory. /// in prim inventory.
/// </summary> /// </summary>

View File

@ -39,9 +39,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{ {
public class Compiler public class Compiler
{ {
private static readonly log4net.ILog m_log private static readonly log4net.ILog m_log
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// * Uses "LSL2Converter" to convert LSL to C# if necessary. // * Uses "LSL2Converter" to convert LSL to C# if necessary.
// * Compiles C#-code into an assembly // * Compiles C#-code into an assembly
// * Returns assembly name ready for AppDomain load. // * Returns assembly name ready for AppDomain load.
@ -291,8 +291,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
if (enableCommanderLSL == true && l == enumCompileType.cs) if (enableCommanderLSL == true && l == enumCompileType.cs)
{ {
foreach (KeyValuePair<string, foreach (KeyValuePair<string,
ICommander> com ICommander> com
in m_scriptEngine.World.GetCommanders()) in m_scriptEngine.World.GetCommanders())
{ {
compileScript = com.Value.GenerateRuntimeAPI() + compileScript; compileScript = com.Value.GenerateRuntimeAPI() + compileScript;
@ -318,7 +318,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code"); m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code");
m_log.Debug(""); m_log.Debug("");
m_log.Debug(compileScript); m_log.Debug(compileScript);
return CompileFromDotNetText(compileScript, l); return CompileFromDotNetText(compileScript, l);
} }

View File

@ -75,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{ {
ListPair VFC = new ListPair(FunctionCode, new Variable()); ListPair VFC = new ListPair(FunctionCode, new Variable());
//Console.WriteLine("-------------------------") //Console.WriteLine("-------------------------")
//Console.WriteLine( FunctionCode.ToString()) //Console.WriteLine(FunctionCode.ToString())
//Console.WriteLine("-------------------------") //Console.WriteLine("-------------------------")
YPCompiler.convertFunctionCSharp(FunctionCode); YPCompiler.convertFunctionCSharp(FunctionCode);
//YPCompiler.convertStringCodesCSharp(VFC); //YPCompiler.convertStringCodesCSharp(VFC);

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -167,7 +167,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
return _name.GetHashCode(); return _name.GetHashCode();
} }
public string toQuotedString() public string toQuotedString()
{ {
if (_name.Length == 0) if (_name.Length == 0)
return "''"; return "''";

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
new TermArrayEqualityComparer(); new TermArrayEqualityComparer();
/// <summary> /// <summary>
/// To get the free variables, split off any existential qualifiers from Goal such as the X in /// To get the free variables, split off any existential qualifiers from Goal such as the X in
/// "X ^ f(Y)", get the set of unbound variables in Goal that are not qualifiers, then remove /// "X ^ f(Y)", get the set of unbound variables in Goal that are not qualifiers, then remove
/// the unbound variables that are qualifiers as well as the unbound variables in Template. /// the unbound variables that are qualifiers as well as the unbound variables in Template.
/// </summary> /// </summary>
@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
UnqualifiedGoal = YP.getValue(((Functor2)UnqualifiedGoal)._arg2); UnqualifiedGoal = YP.getValue(((Functor2)UnqualifiedGoal)._arg2);
} }
// Remember how many non-free variables there are so we can find the unique free variables // Remember how many non-free variables there are so we can find the unique free variables
// that are added. // that are added.
int nNonFreeVariables = variableSet.Count; int nNonFreeVariables = variableSet.Count;
YP.addUniqueVariables(UnqualifiedGoal, variableSet); YP.addUniqueVariables(UnqualifiedGoal, variableSet);
@ -116,8 +116,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
/// <summary> /// <summary>
/// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag. /// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag.
/// </summary> /// </summary>
/// <param name="bagArrayVariable">this is unified with the List<object> of matches for template that /// <param name="bagArrayVariable">this is unified with the List<object> of matches for template that
/// corresponds to the bindings for freeVariables. Be very careful: this does not unify with a Prolog /// corresponds to the bindings for freeVariables. Be very careful: this does not unify with a Prolog
/// list.</param> /// list.</param>
/// <returns></returns> /// <returns></returns>
public IEnumerable<bool> resultArray(Variable bagArrayVariable) public IEnumerable<bool> resultArray(Variable bagArrayVariable)

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -66,14 +66,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
/// <summary> /// <summary>
/// Return an Atom, Functor1, Functor2, Functor3 or Functor depending on the /// Return an Atom, Functor1, Functor2, Functor3 or Functor depending on the
/// length of args. /// length of args.
/// Note that this is different than the Functor constructor which requires /// Note that this is different than the Functor constructor which requires
/// the length of args to be greater than 3. /// the length of args to be greater than 3.
/// </summary> /// </summary>
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="args"></param> /// <param name="args"></param>
/// <returns></returns> /// <returns></returns>
public static object make(Atom name, object[] args) public static object make(Atom name, object[] args)
{ {
if (args.Length <= 0) if (args.Length <= 0)
return name; return name;

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
public object makeCopy(Variable.CopyStore copyStore) public object makeCopy(Variable.CopyStore copyStore)
{ {
return new Functor2(_name, YP.makeCopy(_arg1, copyStore), return new Functor2(_name, YP.makeCopy(_arg1, copyStore),
YP.makeCopy(_arg2, copyStore)); YP.makeCopy(_arg2, copyStore));
} }

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
_arg2 = arg2; _arg2 = arg2;
_arg3 = arg3; _arg3 = arg3;
} }
public Functor3(string name, object arg1, object arg2, object arg3) public Functor3(string name, object arg1, object arg2, object arg3)
: this(Atom.a(name), arg1, arg2, arg3) : this(Atom.a(name), arg1, arg2, arg3)
{ {

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
// If match has already indexed answers for a signature, we need to add // If match has already indexed answers for a signature, we need to add
// this to the existing indexed answers. // this to the existing indexed answers.
foreach(int signature in _gotAnswersForSignature.Keys) foreach (int signature in _gotAnswersForSignature.Keys)
indexAnswerForSignature(answerCopy, signature); indexAnswerForSignature(answerCopy, signature);
} }

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -64,7 +64,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
} }
/// <summary> /// <summary>
/// Return a ListPair version of array, where repeated elements /// Return a ListPair version of array, where repeated elements
/// (according to YP.termEqual) are removed. /// (according to YP.termEqual) are removed.
/// </summary> /// </summary>
/// <param name="array"></param> /// <param name="array"></param>
@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
} }
/// <summary> /// <summary>
/// Return a ListPair version of array, where repeated elements /// Return a ListPair version of array, where repeated elements
/// (according to YP.termEqual) are removed. /// (according to YP.termEqual) are removed.
/// </summary> /// </summary>
/// <param name="array"></param> /// <param name="array"></param>
@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
public static object make(object element1, object element2, object element3) public static object make(object element1, object element2, object element3)
{ {
return new ListPair(element1, return new ListPair(element1,
new ListPair(element2, new ListPair(element3, Atom.NIL))); new ListPair(element2, new ListPair(element3, Atom.NIL)));
} }

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -650,8 +650,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
if (term1TypeCode == -2) if (term1TypeCode == -2)
{ {
// Variable. // Variable.
// We always check for equality first because we want to be sure // We always check for equality first because we want to be sure
// that less than returns false if the terms are equal, in // that less than returns false if the terms are equal, in
// case that the less than check really behaves like less than or equal. // case that the less than check really behaves like less than or equal.
if ((Variable)Term1 != (Variable)Term2) if ((Variable)Term1 != (Variable)Term2)
// The hash code should be unique to a Variable object. // The hash code should be unique to a Variable object.
@ -694,8 +694,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
} }
/// <summary> /// <summary>
/// Type code is -2 if term is a Variable, 0 if it is an Atom, /// Type code is -2 if term is a Variable, 0 if it is an Atom,
/// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3, /// 1 if it is a Functor1, 2 if it is a Functor2, 3 if it is a Functor3,
/// 4 if it is Functor. /// 4 if it is Functor.
/// Otherwise, type code is -1. /// Otherwise, type code is -1.
/// This does not call YP.getValue(term). /// This does not call YP.getValue(term).
@ -1115,7 +1115,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
IndexedAnswers indexedAnswers; IndexedAnswers indexedAnswers;
if (!_predicatesStore.TryGetValue(nameArity, out clauses)) if (!_predicatesStore.TryGetValue(nameArity, out clauses))
{ {
// Create an IndexedAnswers as the first clause of the predicate. // Create an IndexedAnswers as the first clause of the predicate.
_predicatesStore[nameArity] = (clauses = new List<IClause>()); _predicatesStore[nameArity] = (clauses = new List<IClause>());
clauses.Add(indexedAnswers = new IndexedAnswers()); clauses.Add(indexedAnswers = new IndexedAnswers());
} }
@ -1135,7 +1135,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
List<IClause> clauses; List<IClause> clauses;
if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses)) if (!_predicatesStore.TryGetValue(new NameArity(name, arguments.Length), out clauses))
throw new UndefinedPredicateException throw new UndefinedPredicateException
("Undefined fact: " + name + "/" + arguments.Length, name, ("Undefined fact: " + name + "/" + arguments.Length, name,
arguments.Length); arguments.Length);
if (clauses.Count == 1) if (clauses.Count == 1)
@ -1209,7 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
} }
/// <summary> /// <summary>
/// Use YP.getFunctorName(Goal) and invoke the static method of this name in the /// Use YP.getFunctorName(Goal) and invoke the static method of this name in the
/// declaringClass, using arguments from YP.getFunctorArgs(Goal). /// declaringClass, using arguments from YP.getFunctorArgs(Goal).
/// Note that Goal must be a simple functor, not a complex expression. /// Note that Goal must be a simple functor, not a complex expression.
/// If not found, this throws UndefinedPredicateException. /// If not found, this throws UndefinedPredicateException.

View File

@ -1,20 +1,20 @@
/* /*
* Copyright (C) 2007-2008, Jeff Thompson * Copyright (C) 2007-2008, Jeff Thompson
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names of its contributors * * Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

View File

@ -184,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
List<Object> data = new List<Object>(); List<Object> data = new List<Object>();
Object[] listeners=m_Listener.GetSerializationData(itemID); Object[] listeners=m_Listener.GetSerializationData(itemID);
if(listeners.Length > 0) if (listeners.Length > 0)
{ {
data.Add("listener"); data.Add("listener");
data.Add(listeners.Length); data.Add(listeners.Length);
@ -192,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
Object[] timers=m_Timer.GetSerializationData(itemID); Object[] timers=m_Timer.GetSerializationData(itemID);
if(timers.Length > 0) if (timers.Length > 0)
{ {
data.Add("timer"); data.Add("timer");
data.Add(timers.Length); data.Add(timers.Length);
@ -200,7 +200,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
Object[] sensors=m_SensorRepeat.GetSerializationData(itemID); Object[] sensors=m_SensorRepeat.GetSerializationData(itemID);
if(sensors.Length > 0) if (sensors.Length > 0)
{ {
data.Add("sensor"); data.Add("sensor");
data.Add(sensors.Length); data.Add(sensors.Length);
@ -211,36 +211,36 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID,
Object[] data) Object[] data)
{ {
int idx=0; int idx = 0;
int len; int len;
while(idx < data.Length) while (idx < data.Length)
{ {
string type = data[idx].ToString(); string type = data[idx].ToString();
len = (int)data[idx+1]; len = (int)data[idx+1];
idx+=2; idx+=2;
if(len > 0) if (len > 0)
{ {
Object[] item = new Object[len]; Object[] item = new Object[len];
Array.Copy(data, idx, item, 0, len); Array.Copy(data, idx, item, 0, len);
idx+=len; idx+=len;
switch(type) switch (type)
{ {
case "listener": case "listener":
m_Listener.CreateFromData(localID, itemID, hostID, m_Listener.CreateFromData(localID, itemID, hostID,
item); item);
break; break;
case "timer": case "timer":
m_Timer.CreateFromData(localID, itemID, hostID, item); m_Timer.CreateFromData(localID, itemID, hostID, item);
break; break;
case "sensor": case "sensor":
m_SensorRepeat.CreateFromData(localID, itemID, hostID, m_SensorRepeat.CreateFromData(localID, itemID, hostID,
item); item);
break; break;
} }
} }
@ -249,12 +249,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#region Check llRemoteData channels #region Check llRemoteData channels
#endregion #endregion
#region Check llListeners #region Check llListeners
#endregion #endregion
/// <summary> /// <summary>

View File

@ -57,11 +57,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
} }
public LLUUID RegisterRequest(uint localID, LLUUID itemID, public LLUUID RegisterRequest(uint localID, LLUUID itemID,
string identifier) string identifier)
{ {
lock(DataserverRequests) lock (DataserverRequests)
{ {
if(DataserverRequests.ContainsKey(identifier)) if (DataserverRequests.ContainsKey(identifier))
return LLUUID.Zero; return LLUUID.Zero;
DataserverRequest ds = new DataserverRequest(); DataserverRequest ds = new DataserverRequest();
@ -84,9 +84,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
{ {
DataserverRequest ds; DataserverRequest ds;
lock(DataserverRequests) lock (DataserverRequests)
{ {
if(!DataserverRequests.ContainsKey(identifier)) if (!DataserverRequests.ContainsKey(identifier))
return; return;
ds=DataserverRequests[identifier]; ds=DataserverRequests[identifier];
@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
} }
m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID, m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID,
new XEventParams( "dataserver", new Object[] new XEventParams("dataserver", new Object[]
{ new LSL_Types.LSLString(ds.ID.ToString()), { new LSL_Types.LSLString(ds.ID.ToString()),
new LSL_Types.LSLString(reply)}, new LSL_Types.LSLString(reply)},
new XDetectParams[0])); new XDetectParams[0]));
@ -102,11 +102,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void RemoveEvents(uint localID, LLUUID itemID) public void RemoveEvents(uint localID, LLUUID itemID)
{ {
lock(DataserverRequests) lock (DataserverRequests)
{ {
foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values)) foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values))
{ {
if(ds.itemID == itemID) if (ds.itemID == itemID)
DataserverRequests.Remove(ds.handle); DataserverRequests.Remove(ds.handle);
} }
} }
@ -114,11 +114,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void ExpireRequests() public void ExpireRequests()
{ {
lock(DataserverRequests) lock (DataserverRequests)
{ {
foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values)) foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values))
{ {
if(ds.startTime > DateTime.Now.AddSeconds(30)) if (ds.startTime > DateTime.Now.AddSeconds(30))
DataserverRequests.Remove(ds.handle); DataserverRequests.Remove(ds.handle);
} }
} }

View File

@ -55,14 +55,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
public void AddObjectEvent(uint localID, string eventName, XDetectParams det) public void AddObjectEvent(uint localID, string eventName, XDetectParams det)
{ {
SceneObjectPart part = m_CmdManager.m_ScriptEngine.World. SceneObjectPart part = m_CmdManager.m_ScriptEngine.World.
GetSceneObjectPart(localID); GetSceneObjectPart(localID);
if(part == null) // Can't register events for non-prims if (part == null) // Can't register events for non-prims
return; return;
if(!part.ContainsScripts()) if (!part.ContainsScripts())
return; return;
} }
public void RemoveObjectEvent(uint localID, string eventName, LLUUID id) public void RemoveObjectEvent(uint localID, string eventName, LLUUID id)

View File

@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines) foreach (XEngine xe in XEngine.ScriptEngines)
{ {
if(xe.PostObjectEvent(httpInfo.localID, if (xe.PostObjectEvent(httpInfo.localID,
new XEventParams("http_response", new XEventParams("http_response",
resobj, new XDetectParams[0]))) resobj, new XDetectParams[0])))
break; break;

View File

@ -69,7 +69,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
private object SenseRepeatListLock = new object(); private object SenseRepeatListLock = new object();
public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID, public void SetSenseRepeatEvent(uint m_localID, LLUUID m_itemID,
string name, LLUUID keyID, int type, double range, double arc, double sec, SceneObjectPart host) string name, LLUUID keyID, int type, double range,
double arc, double sec, SceneObjectPart host)
{ {
Console.WriteLine("SetSensorEvent"); Console.WriteLine("SetSensorEvent");
@ -319,7 +320,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
new XDetectParams[SensedObjects.Length]; new XDetectParams[SensedObjects.Length];
int idx; int idx;
for(idx = 0 ; idx < SensedObjects.Length; idx++) for (idx = 0; idx < SensedObjects.Length; idx++)
{ {
detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]); detect[idx].Key=(LLUUID)(SensedObjects.Data[idx]);
} }
@ -339,7 +340,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (SenseRepeatClass ts in SenseRepeaters) foreach (SenseRepeatClass ts in SenseRepeaters)
{ {
if(ts.itemID == itemID) if (ts.itemID == itemID)
{ {
data.Add(ts.interval); data.Add(ts.interval);
data.Add(ts.name); data.Add(ts.name);
@ -353,18 +354,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
} }
public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID,
Object[] data) Object[] data)
{ {
SceneObjectPart part = SceneObjectPart part =
m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart( m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(
objectID); objectID);
if(part == null) if (part == null)
return; return;
int idx=0; int idx = 0;
while(idx < data.Length) while (idx < data.Length)
{ {
SenseRepeatClass ts = new SenseRepeatClass(); SenseRepeatClass ts = new SenseRepeatClass();
@ -380,12 +381,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
ts.host = part; ts.host = part;
ts.next = ts.next =
DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
SenseRepeaters.Add(ts); SenseRepeaters.Add(ts);
idx += 6; idx += 6;
} }
} }
} }
} }

View File

@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
{ {
foreach (TimerClass ts in Timers) foreach (TimerClass ts in Timers)
{ {
if(ts.itemID == itemID) if (ts.itemID == itemID)
{ {
data.Add(ts.interval); data.Add(ts.interval);
data.Add(ts.next-DateTime.Now.Ticks); data.Add(ts.next-DateTime.Now.Ticks);
@ -142,11 +142,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
} }
public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID, public void CreateFromData(uint localID, LLUUID itemID, LLUUID objectID,
Object[] data) Object[] data)
{ {
int idx=0; int idx = 0;
while(idx < data.Length) while (idx < data.Length)
{ {
TimerClass ts = new TimerClass(); TimerClass ts = new TimerClass();

View File

@ -71,10 +71,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines) foreach (XEngine xe in XEngine.ScriptEngines)
{ {
if(xe.PostScriptEvent( if (xe.PostScriptEvent(
rInfo.GetItemID(), new XEventParams( rInfo.GetItemID(), new XEventParams(
"remote_data", resobj, "remote_data", resobj,
new XDetectParams[0]))) new XDetectParams[0])))
break; break;
} }
@ -100,10 +100,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins
foreach (XEngine xe in XEngine.ScriptEngines) foreach (XEngine xe in XEngine.ScriptEngines)
{ {
if(xe.PostScriptEvent( if (xe.PostScriptEvent(
srdInfo.m_itemID, new XEventParams( srdInfo.m_itemID, new XEventParams(
"remote_data", resobj, "remote_data", resobj,
new XDetectParams[0]))) new XDetectParams[0])))
break; break;
} }

View File

@ -253,10 +253,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine( string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine(
m_scriptEngine.World.RegionInfo.RegionID.ToString(), m_scriptEngine.World.RegionInfo.RegionID.ToString(),
FilePrefix + "_compiled_" + asset + ".dll")); FilePrefix + "_compiled_" + asset + ".dll"));
// string OutFile = Path.Combine(ScriptEnginesPath, // string OutFile = Path.Combine(ScriptEnginesPath,
// FilePrefix + "_compiled_" + asset + ".dll"); // FilePrefix + "_compiled_" + asset + ".dll");
if(File.Exists(OutFile)) if (File.Exists(OutFile))
return OutFile; return OutFile;
if (!Directory.Exists(ScriptEnginesPath)) if (!Directory.Exists(ScriptEnginesPath))
@ -271,7 +271,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
if (!Directory.Exists(Path.Combine(ScriptEnginesPath, if (!Directory.Exists(Path.Combine(ScriptEnginesPath,
m_scriptEngine.World.RegionInfo.RegionID.ToString()))) m_scriptEngine.World.RegionInfo.RegionID.ToString())))
{ {
try try
{ {
@ -284,7 +284,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
enumCompileType l = DefaultCompileLanguage; enumCompileType l = DefaultCompileLanguage;
if (Script.StartsWith("//c#", true, CultureInfo.InvariantCulture)) if (Script.StartsWith("//c#", true, CultureInfo.InvariantCulture))
l = enumCompileType.cs; l = enumCompileType.cs;
if (Script.StartsWith("//vb", true, CultureInfo.InvariantCulture)) if (Script.StartsWith("//vb", true, CultureInfo.InvariantCulture))
@ -334,7 +333,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// End of insert // End of insert
switch (l) switch (l)
{ {
case enumCompileType.cs: case enumCompileType.cs:
@ -368,27 +366,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private static string CreateCSCompilerScript(string compileScript) private static string CreateCSCompilerScript(string compileScript)
{ {
compileScript = String.Empty + compileScript = String.Empty +
"using OpenSim.Region.ScriptEngine.XEngine.Script; using System.Collections.Generic;\r\n" + "using OpenSim.Region.ScriptEngine.XEngine.Script; using System.Collections.Generic;\r\n" +
String.Empty + "namespace SecondLife { " + String.Empty + "namespace SecondLife { " +
String.Empty + "public class Script : OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass { \r\n" + String.Empty + "public class Script : OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass { \r\n" +
@"public Script() { } " + @"public Script() { } " +
compileScript + compileScript +
"} }\r\n"; "} }\r\n";
return compileScript; return compileScript;
} }
private static string CreateVBCompilerScript(string compileScript) private static string CreateVBCompilerScript(string compileScript)
{ {
compileScript = String.Empty + compileScript = String.Empty +
"Imports OpenSim.Region.ScriptEngine.XEngine.Script: Imports System.Collections.Generic: " + "Imports OpenSim.Region.ScriptEngine.XEngine.Script: Imports System.Collections.Generic: " +
String.Empty + "NameSpace SecondLife:" + String.Empty + "NameSpace SecondLife:" +
String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass: " + String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.XEngine.Script.BuiltIn_Commands_BaseClass: " +
"\r\nPublic Sub New()\r\nEnd Sub: " + "\r\nPublic Sub New()\r\nEnd Sub: " +
compileScript + compileScript +
":End Class :End Namespace\r\n"; ":End Class :End Namespace\r\n";
return compileScript; return compileScript;
} }
@ -404,8 +400,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// Output assembly name // Output assembly name
scriptCompileCounter++; scriptCompileCounter++;
string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine( string OutFile = Path.Combine(ScriptEnginesPath, Path.Combine(
m_scriptEngine.World.RegionInfo.RegionID.ToString(), m_scriptEngine.World.RegionInfo.RegionID.ToString(),
FilePrefix + "_compiled_" + asset + ".dll")); FilePrefix + "_compiled_" + asset + ".dll"));
#if DEBUG #if DEBUG
// m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Starting compile of \"" + OutFile + "\"."); // m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Starting compile of \"" + OutFile + "\".");
#endif #endif
@ -490,8 +486,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (CompilerError CompErr in results.Errors) foreach (CompilerError CompErr in results.Errors)
{ {
errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) +
", Error Number: " + CompErr.ErrorNumber + ", Error Number: " + CompErr.ErrorNumber +
", '" + CompErr.ErrorText + "'\r\n"; ", '" + CompErr.ErrorText + "'\r\n";
} }
if (!File.Exists(OutFile)) if (!File.Exists(OutFile))
{ {
@ -499,7 +495,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
// //
// NO ERRORS, BUT NO COMPILED FILE // NO ERRORS, BUT NO COMPILED FILE
// //

View File

@ -199,7 +199,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void on_rez(uint localID, LLUUID itemID, int startParam) public void on_rez(uint localID, LLUUID itemID, int startParam)
{ {
myScriptEngine.PostObjectEvent(localID, new XEventParams( myScriptEngine.PostObjectEvent(localID, new XEventParams(
"on_rez",new object[] { "on_rez",new object[] {
new LSL_Types.LSLInteger(startParam)}, new LSL_Types.LSLInteger(startParam)},
new XDetectParams[0])); new XDetectParams[0]));
} }
@ -207,7 +207,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change) public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
{ {
myScriptEngine.PostObjectEvent(localID, new XEventParams( myScriptEngine.PostObjectEvent(localID, new XEventParams(
"control",new object[] { "control",new object[] {
new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLString(agentID.ToString()),
new LSL_Types.LSLInteger(held), new LSL_Types.LSLInteger(held),
new LSL_Types.LSLInteger(change)}, new LSL_Types.LSLInteger(change)},
@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string address, string subject, string message, int numLeft) string address, string subject, string message, int numLeft)
{ {
myScriptEngine.PostObjectEvent(localID, new XEventParams( myScriptEngine.PostObjectEvent(localID, new XEventParams(
"email",new object[] { "email",new object[] {
new LSL_Types.LSLString(timeSent), new LSL_Types.LSLString(timeSent),
new LSL_Types.LSLString(address), new LSL_Types.LSLString(address),
new LSL_Types.LSLString(subject), new LSL_Types.LSLString(subject),

View File

@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
// Save the flags we just computed and return the result // Save the flags we just computed and return the result
if(eventFlags != 0) if (eventFlags != 0)
m_stateEvents.Add(m_Script.State, eventFlags); m_stateEvents.Add(m_Script.State, eventFlags);
//Console.WriteLine("Returning {0:x}", eventFlags); //Console.WriteLine("Returning {0:x}", eventFlags);
@ -130,7 +130,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
#endif #endif
// Found // Found
ev.Invoke(m_Script, args); ev.Invoke(m_Script, args);
} }
} }
} }

View File

@ -111,8 +111,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if(text.Length > 1023) if (text.Length > 1023)
text=text.Substring(0, 1023); text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
@ -129,13 +129,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private LLUUID InventorySelf() private LLUUID InventorySelf()
{ {
LLUUID invItemID=new LLUUID(); LLUUID invItemID = new LLUUID();
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
{ {
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID) if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
{ {
invItemID=inv.Key; invItemID = inv.Key;
break; break;
} }
} }
@ -300,7 +300,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return angle; return angle;
} }
// Old implementation of llRot2Euler, now normalized // Old implementation of llRot2Euler, now normalized
public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
@ -322,7 +321,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Vector3(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); return new LSL_Types.Vector3(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)));
} }
// Xantor's newer llEuler2Rot() *try the second* inverted quaternions (-x,-y,-z,w) as LL seems to like // Xantor's newer llEuler2Rot() *try the second* inverted quaternions (-x,-y,-z,w) as LL seems to like
// New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler. // New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler.
@ -363,7 +361,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(x, y, z, s); return new LSL_Types.Quaternion(x, y, z, s);
} }
public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -388,6 +385,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return (new LSL_Types.Vector3(0, 0, 1) * r); return (new LSL_Types.Vector3(0, 0, 1) * r);
} }
public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
{ {
//A and B should both be normalized //A and B should both be normalized
@ -401,12 +399,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2)); return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2));
} }
public void llWhisper(int channelID, string text) public void llWhisper(int channelID, string text)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if(text.Length > 1023) if (text.Length > 1023)
text=text.Substring(0, 1023); text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
@ -419,8 +418,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if(text.Length > 1023) if (text.Length > 1023)
text=text.Substring(0, 1023); text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text), World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true);
@ -437,9 +436,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return; return;
} }
if (text.Length > 1023)
if(text.Length > 1023) text = text.Substring(0, 1023);
text=text.Substring(0, 1023);
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -486,7 +484,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID.TryParse(id, out keyID); LLUUID.TryParse(id, out keyID);
m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host); m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SetSenseRepeatEvent(m_localID, m_itemID, name, keyID, type, range, arc, rate, m_host);
} }
public void llSensorRemove() public void llSensorRemove()
{ {
@ -520,17 +518,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (SensedObject == null) if (SensedObject == null)
return String.Empty; return String.Empty;
return SensedObject.Name; return SensedObject.Name;
} }
public string llDetectedName(int number) public string llDetectedName(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number);
if(sensedUUID != null) if (sensedUUID != null)
return resolveName(sensedUUID); return resolveName(sensedUUID);
return String.Empty; return String.Empty;
} }
public LLUUID uuidDetectedKey(int number) public LLUUID uuidDetectedKey(int number)
{ {
@ -540,7 +537,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public EntityBase entityDetectedKey(int number) public EntityBase entityDetectedKey(int number)
{ {
LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number); LLUUID sensedUUID = m_ScriptEngine.GetDetectID(m_itemID, number);
if(sensedUUID != null) if (sensedUUID != null)
{ {
EntityBase SensedObject = null; EntityBase SensedObject = null;
lock (World.Entities) lock (World.Entities)
@ -567,7 +564,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// returns UUID of owner of object detected // returns UUID of owner of object detected
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
EntityBase SensedObject = entityDetectedKey(number); EntityBase SensedObject = entityDetectedKey(number);
if (SensedObject ==null) if (SensedObject == null)
return String.Empty; return String.Empty;
LLUUID SensedUUID = uuidDetectedKey(number); LLUUID SensedUUID = uuidDetectedKey(number);
if (World.GetScenePresence(SensedUUID) == null) if (World.GetScenePresence(SensedUUID) == null)
@ -575,7 +572,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// sensed object is not an avatar // sensed object is not an avatar
// so get the owner of the sensed object // so get the owner of the sensed object
SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID); SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID);
if (SOP != null) { return SOP.ObjectOwner.ToString(); } if (SOP != null)
{
return SOP.ObjectOwner.ToString();
}
} }
else else
{ {
@ -583,9 +583,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return SensedUUID.ToString(); return SensedUUID.ToString();
} }
return String.Empty; return String.Empty;
} }
public LSL_Types.LSLInteger llDetectedType(int number) public LSL_Types.LSLInteger llDetectedType(int number)
@ -599,14 +597,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID SensedUUID = uuidDetectedKey(number); LLUUID SensedUUID = uuidDetectedKey(number);
LSL_Types.Vector3 ZeroVector = new LSL_Types.Vector3(0, 0, 0); LSL_Types.Vector3 ZeroVector = new LSL_Types.Vector3(0, 0, 0);
if (World.GetScenePresence(SensedUUID) != null) mask |= 0x01; // actor if (World.GetScenePresence(SensedUUID) != null)
mask |= 0x01; // actor
if (SensedObject.Velocity.Equals(ZeroVector)) if (SensedObject.Velocity.Equals(ZeroVector))
mask |= 0x04; // passive non-moving mask |= 0x04; // passive non-moving
else else
mask |= 0x02; // active moving mask |= 0x02; // active moving
if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ...
return mask;
if (SensedObject is IScript)
mask |= 0x08; // Scripted. It COULD have one hidden ...
return mask;
} }
public LSL_Types.Vector3 llDetectedPos(int number) public LSL_Types.Vector3 llDetectedPos(int number)
@ -627,7 +629,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return new LSL_Types.Vector3(0, 0, 0); return new LSL_Types.Vector3(0, 0, 0);
return new LSL_Types.Vector3(SensedObject.Velocity.X, SensedObject.Velocity.Y, SensedObject.Velocity.Z); return new LSL_Types.Vector3(SensedObject.Velocity.X, SensedObject.Velocity.Y, SensedObject.Velocity.Z);
// return new LSL_Types.Vector3(); // return new LSL_Types.Vector3();
} }
public LSL_Types.Vector3 llDetectedGrab(int number) public LSL_Types.Vector3 llDetectedGrab(int number)
@ -702,8 +704,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.ScriptSetPhysicsStatus(true); m_host.ScriptSetPhysicsStatus(true);
else else
m_host.ScriptSetPhysicsStatus(false); m_host.ScriptSetPhysicsStatus(false);
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM) if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM)
{ {
if (value == 1) if (value == 1)
@ -711,27 +713,32 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else else
m_host.ScriptSetPhantomStatus(false); m_host.ScriptSetPhantomStatus(false);
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS)
{ {
m_host.AddFlag(LLObject.ObjectFlags.CastShadows); m_host.AddFlag(LLObject.ObjectFlags.CastShadows);
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X)
{ {
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X;
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y)
{ {
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y; statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y;
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z)
{ {
statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z; statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z;
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB)
{ {
NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE)
{ {
if (value == 1) if (value == 1)
@ -739,18 +746,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
else else
m_host.SetDieAtEdge(false); m_host.SetDieAtEdge(false);
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE)
{ {
NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
} }
if ((status & BuiltIn_Commands_BaseClass.STATUS_SANDBOX) == BuiltIn_Commands_BaseClass.STATUS_SANDBOX) if ((status & BuiltIn_Commands_BaseClass.STATUS_SANDBOX) == BuiltIn_Commands_BaseClass.STATUS_SANDBOX)
{ {
NotImplemented("llSetStatus - STATUS_SANDBOX"); NotImplemented("llSetStatus - STATUS_SANDBOX");
} }
if (statusrotationaxis != 0) if (statusrotationaxis != 0)
{ {
m_host.SetAxisRotation(statusrotationaxis, value); m_host.SetAxisRotation(statusrotationaxis, value);
} }
} }
@ -766,23 +775,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return 1; return 1;
} }
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_PHANTOM: case BuiltIn_Commands_BaseClass.STATUS_PHANTOM:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom) if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom)
{ {
return 1; return 1;
} }
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS: case BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS:
if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows) if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows)
{ {
return 1; return 1;
} }
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB: case BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB:
NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE:
if (m_host.GetDieAtEdge()) if (m_host.GetDieAtEdge())
return 1; return 1;
else else
@ -791,15 +803,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE:
NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_X: case BuiltIn_Commands_BaseClass.STATUS_ROTATE_X:
NotImplemented("llGetStatus - STATUS_ROTATE_X"); NotImplemented("llGetStatus - STATUS_ROTATE_X");
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y: case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y:
NotImplemented("llGetStatus - STATUS_ROTATE_Y"); NotImplemented("llGetStatus - STATUS_ROTATE_Y");
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z: case BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z:
NotImplemented("llGetStatus - STATUS_ROTATE_Z"); NotImplemented("llGetStatus - STATUS_ROTATE_Z");
return 0; return 0;
case BuiltIn_Commands_BaseClass.STATUS_SANDBOX: case BuiltIn_Commands_BaseClass.STATUS_SANDBOX:
NotImplemented("llGetStatus - STATUS_SANDBOX"); NotImplemented("llGetStatus - STATUS_SANDBOX");
return 0; return 0;
@ -2499,17 +2515,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string reply = String.Empty; string reply = String.Empty;
switch(data) switch (data)
{ {
case 1: // DATA_ONLINE (0|1) case 1: // DATA_ONLINE (0|1)
// TODO: implement fetching of this information // TODO: implement fetching of this information
// if(userProfile.CurrentAgent.AgentOnline) // if (userProfile.CurrentAgent.AgentOnline)
// reply = "1"; // reply = "1";
// else // else
reply = "0"; reply = "0";
break; break;
case 2: // DATA_NAME (First Last) case 2: // DATA_NAME (First Last)
reply = userProfile.FirstName+" "+userProfile.SurName; reply = userProfile.FirstName + " " + userProfile.SurName;
break; break;
case 3: // DATA_BORN (YYYY-MM-DD) case 3: // DATA_BORN (YYYY-MM-DD)
DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0);
@ -2529,8 +2545,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
LLUUID rq = LLUUID.Random(); LLUUID rq = LLUUID.Random();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.RegisterRequest(m_localID, m_Dataserver.RegisterRequest(m_localID,
m_itemID, rq.ToString()); m_itemID, rq.ToString());
m_ScriptEngine.m_ASYNCLSLCommandManager. m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(rq.ToString(), reply); m_Dataserver.DataserverReply(rq.ToString(), reply);
@ -2547,8 +2563,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (item.Type == 3 && item.Name == name) if (item.Type == 3 && item.Name == name)
{ {
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.RegisterRequest(m_localID, m_Dataserver.RegisterRequest(m_localID,
m_itemID, item.AssetID.ToString()); m_itemID, item.AssetID.ToString());
LLVector3 region = new LLVector3( LLVector3 region = new LLVector3(
World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocX * Constants.RegionSize,
@ -2565,8 +2581,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string reply = region.ToString(); string reply = region.ToString();
m_ScriptEngine.m_ASYNCLSLCommandManager. m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(i.ToString(), m_Dataserver.DataserverReply(i.ToString(),
reply); reply);
}, false); }, false);
return tid.ToString(); return tid.ToString();
@ -3314,25 +3330,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
switch (src[i]) switch (src[i])
{ {
case '<' : case '<':
parens++; parens++;
length++; length++;
break; break;
case '>' : case '>':
if (parens > 0) if (parens > 0)
parens--; parens--;
length++; length++;
break; break;
case ',' : case ',':
if (parens == 0) if (parens == 0)
{ {
result.Add(src.Substring(start,length).Trim()); result.Add(src.Substring(start,length).Trim());
start += length+1; start += length+1;
length = 0; length = 0;
} else }
else
{
length++; length++;
}
break; break;
default : default:
length++; length++;
break; break;
} }
@ -3341,7 +3360,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
result.Add(src.Substring(start,length).Trim()); result.Add(src.Substring(start,length).Trim());
return result; return result;
} }
/// <summary> /// <summary>
@ -5290,11 +5308,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (active[j]) if (active[j])
{ {
// scan all of the markers // scan all of the markers
if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1) if ((offset[j] = src.IndexOf((string)spcarray[j-seplen], beginning)) == -1)
{ {
// not present at all // not present at all
active[j] = false; active[j] = false;
} else }
else
{ {
// present and correct // present and correct
if (offset[j] < offset[best]) if (offset[j] < offset[best])
@ -5313,7 +5332,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
// no markers were found on this pass // no markers were found on this pass
// so we're pretty much done // so we're pretty much done
tokens.Add(src.Substring(beginning, srclen-beginning)); tokens.Add(src.Substring(beginning, srclen - beginning));
break; break;
} }
@ -5322,15 +5341,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
tokens.Add(src.Substring(beginning,offset[best]-beginning)); tokens.Add(src.Substring(beginning,offset[best]-beginning));
if (best<seplen) if (best < seplen)
{ {
beginning = offset[best]+((string)separray[best]).Length; beginning = offset[best] + ((string)separray[best]).Length;
} else }
{ else
beginning = offset[best]+((string)spcarray[best-seplen]).Length; {
tokens.Add(spcarray[best-seplen]); beginning = offset[best] + ((string)spcarray[best - seplen]).Length;
tokens.Add(spcarray[best - seplen]);
} }
} }
// This an awkward an not very intuitive boundary case. If the // This an awkward an not very intuitive boundary case. If the
@ -5475,60 +5494,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public string llRequestSimulatorData(string simulator, int data) public string llRequestSimulatorData(string simulator, int data)
{ {
try try
{
m_host.AddScriptLPS(1);
string reply = String.Empty;
RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator);
switch(data)
{ {
case 5: // DATA_SIM_POS m_host.AddScriptLPS(1);
if(info == null)
return LLUUID.Zero.ToString();
reply = new LSL_Types.Vector3(
info.RegionLocX * Constants.RegionSize,
info.RegionLocY * Constants.RegionSize,
0).ToString();
break;
case 6: // DATA_SIM_STATUS
if(info != null)
reply = "up"; // Duh!
else
reply = "unknown";
break;
case 7: // DATA_SIM_RATING
if(info == null)
return LLUUID.Zero.ToString();
int access = (int)info.EstateSettings.simAccess;
if(access == 21)
reply = "MATURE";
else if(access == 13)
reply = "MATURE";
else
reply = "UNKNOWN";
break;
default:
return LLUUID.Zero.ToString(); // Raise no event
}
LLUUID rq = LLUUID.Random();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. string reply = String.Empty;
RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator);
switch (data)
{
case 5: // DATA_SIM_POS
if (info == null)
return LLUUID.Zero.ToString();
reply = new LSL_Types.Vector3(
info.RegionLocX * Constants.RegionSize,
info.RegionLocY * Constants.RegionSize,
0).ToString();
break;
case 6: // DATA_SIM_STATUS
if (info != null)
reply = "up"; // Duh!
else
reply = "unknown";
break;
case 7: // DATA_SIM_RATING
if (info == null)
return LLUUID.Zero.ToString();
int access = (int)info.EstateSettings.simAccess;
if (access == 21)
reply = "MATURE";
else if (access == 13)
reply = "MATURE";
else
reply = "UNKNOWN";
break;
default:
return LLUUID.Zero.ToString(); // Raise no event
}
LLUUID rq = LLUUID.Random();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.RegisterRequest(m_localID, m_Dataserver.RegisterRequest(m_localID,
m_itemID, rq.ToString()); m_itemID, rq.ToString());
m_ScriptEngine.m_ASYNCLSLCommandManager. m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(rq.ToString(), reply); m_Dataserver.DataserverReply(rq.ToString(), reply);
return tid.ToString(); return tid.ToString();
} }
catch(Exception e) catch(Exception e)
{ {
Console.WriteLine(e.ToString()); Console.WriteLine(e.ToString());
return LLUUID.Zero.ToString(); return LLUUID.Zero.ToString();
} }
} }
public void llForceMouselook(int mouselook) public void llForceMouselook(int mouselook)
@ -5543,7 +5562,7 @@ return LLUUID.Zero.ToString();
LLUUID key = new LLUUID(); LLUUID key = new LLUUID();
if (LLUUID.TryParse(id,out key)) if (LLUUID.TryParse(id,out key))
{ {
return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass(); return (double) World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass();
} }
return 0; return 0;
} }
@ -5562,7 +5581,6 @@ return LLUUID.Zero.ToString();
public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
{ {
LSL_Types.list pref = null; LSL_Types.list pref = null;
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -5592,9 +5610,9 @@ return LLUUID.Zero.ToString();
pref = dest.GetSublist(0,start-1); pref = dest.GetSublist(0,start-1);
// Only add a suffix if there is something // Only add a suffix if there is something
// beyond the end index (it's inclusive too). // beyond the end index (it's inclusive too).
if (end+1 < dest.Length) if (end + 1 < dest.Length)
{ {
return pref + src + dest.GetSublist(end+1,-1); return pref + src + dest.GetSublist(end + 1, -1);
} }
else else
{ {
@ -5609,9 +5627,9 @@ return LLUUID.Zero.ToString();
// is removed. // is removed.
else else
{ {
if (end+1 < dest.Length) if (end + 1 < dest.Length)
{ {
return src + dest.GetSublist(end+1,-1); return src + dest.GetSublist(end + 1, -1);
} }
else else
{ {
@ -5627,7 +5645,7 @@ return LLUUID.Zero.ToString();
// might have been negative. // might have been negative.
else else
{ {
return dest.GetSublist(end+1,start-1)+src; return dest.GetSublist(end + 1, start - 1) + src;
} }
} }
@ -6250,7 +6268,7 @@ return LLUUID.Zero.ToString();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.RegisterRequest(m_localID, m_Dataserver.RegisterRequest(m_localID,
m_itemID, item.AssetID.ToString()); m_itemID, item.AssetID.ToString());
if(NotecardCache.IsCached(item.AssetID)) if (NotecardCache.IsCached(item.AssetID))
{ {
m_ScriptEngine.m_ASYNCLSLCommandManager. m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(item.AssetID.ToString(), m_Dataserver.DataserverReply(item.AssetID.ToString(),
@ -6286,7 +6304,7 @@ return LLUUID.Zero.ToString();
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager. LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.RegisterRequest(m_localID, m_Dataserver.RegisterRequest(m_localID,
m_itemID, item.AssetID.ToString()); m_itemID, item.AssetID.ToString());
if(NotecardCache.IsCached(item.AssetID)) if (NotecardCache.IsCached(item.AssetID))
{ {
m_ScriptEngine.m_ASYNCLSLCommandManager. m_ScriptEngine.m_ASYNCLSLCommandManager.
m_Dataserver.DataserverReply(item.AssetID.ToString(), m_Dataserver.DataserverReply(item.AssetID.ToString(),
@ -6329,13 +6347,13 @@ return LLUUID.Zero.ToString();
{ {
CacheCheck(); CacheCheck();
lock(m_Notecards) lock (m_Notecards)
{ {
if(m_Notecards.ContainsKey(assetID)) if (m_Notecards.ContainsKey(assetID))
return; return;
Notecard nc = new Notecard(); Notecard nc = new Notecard();
nc.lastRef=DateTime.Now; nc.lastRef = DateTime.Now;
nc.text = ParseText(text.Replace("\r", "").Split('\n')); nc.text = ParseText(text.Replace("\r", "").Split('\n'));
m_Notecards[assetID] = nc; m_Notecards[assetID] = nc;
} }
@ -6343,56 +6361,57 @@ return LLUUID.Zero.ToString();
private static string[] ParseText(string[] input) private static string[] ParseText(string[] input)
{ {
int idx=0; int idx = 0;
int level=0; int level = 0;
List<string> output = new List<string>(); List<string> output = new List<string>();
string[] words; string[] words;
while(idx < input.Length) while (idx < input.Length)
{ {
if(input[idx] == "{") if (input[idx] == "{")
{ {
level++; level++;
idx++; idx++;
continue; continue;
} }
if(input[idx]== "}")
if (input[idx]== "}")
{ {
level--; level--;
idx++; idx++;
continue; continue;
} }
switch(level) switch (level)
{ {
case 0: case 0:
words = input[idx].Split(' '); // Linden text ver words = input[idx].Split(' '); // Linden text ver
int version = int.Parse(words[3]); int version = int.Parse(words[3]);
if(version != 2) if (version != 2)
return new String[0]; return new String[0];
break; break;
case 1: case 1:
words = input[idx].Split(' '); words = input[idx].Split(' ');
if(words[0] == "LLEmbeddedItems") if (words[0] == "LLEmbeddedItems")
break; break;
if(words[0] == "Text") if (words[0] == "Text")
{ {
int len = int.Parse(words[2]); int len = int.Parse(words[2]);
idx++; idx++;
int count=-1; int count = -1;
while(count < len) while (count < len)
{ {
int l = input[idx].Length; int l = input[idx].Length;
string ln = input[idx]; string ln = input[idx];
int need = len-count-1; int need = len-count-1;
if(ln.Length > need) if (ln.Length > need)
ln=ln.Substring(0, need); ln = ln.Substring(0, need);
output.Add(ln); output.Add(ln);
count+=ln.Length+1; count += ln.Length + 1;
idx++; idx++;
} }
@ -6401,10 +6420,10 @@ return LLUUID.Zero.ToString();
break; break;
case 2: case 2:
words = input[idx].Split(' '); // count words = input[idx].Split(' '); // count
if(words[0] == "count") if (words[0] == "count")
{ {
int c = int.Parse(words[1]); int c = int.Parse(words[1]);
if(c > 0) if (c > 0)
return new String[0]; return new String[0];
break; break;
} }
@ -6417,7 +6436,7 @@ return LLUUID.Zero.ToString();
public static bool IsCached(LLUUID assetID) public static bool IsCached(LLUUID assetID)
{ {
lock(m_Notecards) lock (m_Notecards)
{ {
return m_Notecards.ContainsKey(assetID); return m_Notecards.ContainsKey(assetID);
} }
@ -6425,10 +6444,10 @@ return LLUUID.Zero.ToString();
public static int GetLines(LLUUID assetID) public static int GetLines(LLUUID assetID)
{ {
if(!IsCached(assetID)) if (!IsCached(assetID))
return -1; return -1;
lock(m_Notecards) lock (m_Notecards)
{ {
m_Notecards[assetID].lastRef = DateTime.Now; m_Notecards[assetID].lastRef = DateTime.Now;
return m_Notecards[assetID].text.Length; return m_Notecards[assetID].text.Length;
@ -6437,23 +6456,23 @@ return LLUUID.Zero.ToString();
public static string GetLine(LLUUID assetID, int line) public static string GetLine(LLUUID assetID, int line)
{ {
if(line < 0) if (line < 0)
return ""; return "";
string data; string data;
if(!IsCached(assetID)) if (!IsCached(assetID))
return ""; return "";
lock(m_Notecards) lock (m_Notecards)
{ {
m_Notecards[assetID].lastRef = DateTime.Now; m_Notecards[assetID].lastRef = DateTime.Now;
if(line >= m_Notecards[assetID].text.Length) if (line >= m_Notecards[assetID].text.Length)
return "\n\n\n"; return "\n\n\n";
data=m_Notecards[assetID].text[line]; data = m_Notecards[assetID].text[line];
if(data.Length > 255) if (data.Length > 255)
data = data.Substring(0, 255); data = data.Substring(0, 255);
return data; return data;
@ -6465,10 +6484,9 @@ return LLUUID.Zero.ToString();
foreach (LLUUID key in new List<LLUUID>(m_Notecards.Keys)) foreach (LLUUID key in new List<LLUUID>(m_Notecards.Keys))
{ {
Notecard nc = m_Notecards[key]; Notecard nc = m_Notecards[key];
if(nc.lastRef.AddSeconds(30) < DateTime.Now) if (nc.lastRef.AddSeconds(30) < DateTime.Now)
m_Notecards.Remove(key); m_Notecards.Remove(key);
} }
} }
} }
} }

View File

@ -37,25 +37,25 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public static Assembly OnAssemblyResolve(object sender, public static Assembly OnAssemblyResolve(object sender,
ResolveEventArgs args) ResolveEventArgs args)
{ {
if(!(sender is System.AppDomain)) if (!(sender is System.AppDomain))
return null; return null;
AppDomain myDomain = (AppDomain)sender; AppDomain myDomain = (AppDomain)sender;
string dirName = myDomain.FriendlyName; string dirName = myDomain.FriendlyName;
string[] pathList=new string[] {"bin", "ScriptEngines", string[] pathList = new string[] {"bin", "ScriptEngines",
Path.Combine("ScriptEngines", dirName)}; Path.Combine("ScriptEngines", dirName)};
string assemblyName = args.Name; string assemblyName = args.Name;
if(assemblyName.IndexOf(",") != -1) if (assemblyName.IndexOf(",") != -1)
assemblyName=args.Name.Substring(0, args.Name.IndexOf(",")); assemblyName = args.Name.Substring(0, args.Name.IndexOf(","));
foreach (string s in pathList) foreach (string s in pathList)
{ {
string path=Path.Combine(Directory.GetCurrentDirectory(), string path = Path.Combine(Directory.GetCurrentDirectory(),
Path.Combine(s, assemblyName))+".dll"; Path.Combine(s, assemblyName))+".dll";
if(File.Exists(path)) if (File.Exists(path))
return Assembly.LoadFrom(path); return Assembly.LoadFrom(path);
} }

View File

@ -106,7 +106,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
{ {
foreach (KeyValuePair<string, object> var in vars) foreach (KeyValuePair<string, object> var in vars)
{ {
if(m_Fields.ContainsKey(var.Key)) if (m_Fields.ContainsKey(var.Key))
{ {
m_Fields[var.Key].SetValue(this, var.Value); m_Fields[var.Key].SetValue(this, var.Value);
} }

View File

@ -1212,8 +1212,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public LSLInteger(Object o) public LSLInteger(Object o)
{ {
if(!(o is Int32)) if (!(o is Int32))
value=0; value = 0;
else else
value = (int)o; value = (int)o;
} }
@ -1327,11 +1327,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Script
public override bool Equals(object o) public override bool Equals(object o)
{ {
if(o is Int32) if (o is Int32)
{ {
return value == (Int32)o; return value == (Int32)o;
} }
if(o is LSLInteger) if (o is LSLInteger)
{ {
return value == ((LSLInteger)o).value; return value == ((LSLInteger)o).value;
} }

File diff suppressed because it is too large Load Diff