Merge branch 'opensim-master' into dev-appearance

viewer-2-initial-appearance
Master ScienceSim 2010-10-28 09:09:42 -07:00
commit f2c1d0e34f
28 changed files with 273 additions and 130 deletions

View File

@ -112,6 +112,7 @@ namespace OpenSim.Framework.Serialization
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"; // Not sure if we'll ever see this
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml";
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this
@ -135,6 +136,7 @@ namespace OpenSim.Framework.Serialization
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"] = (sbyte)AssetType.LostAndFoundFolder;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object;
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder;

View File

@ -3423,7 +3423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
avp.Sender.IsTrial = false;
avp.Sender.ID = agentID;
m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
//m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
OutPacket(avp, ThrottleOutPacketType.Task);
}

View File

@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// sanity check:
if (c.Sender == null)
{
m_log.ErrorFormat("[CHAT] OnChatFromClient from {0} has empty Sender field!", sender);
m_log.ErrorFormat("[CHAT]: OnChatFromClient from {0} has empty Sender field!", sender);
return;
}
@ -220,17 +220,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
if (message.Length >= 1000) // libomv limit
message = message.Substring(0, 1000);
// m_log.DebugFormat("[CHAT]: DCTA: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, c.Type, sourceType);
// m_log.DebugFormat(
// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
HashSet<UUID> receiverIDs = new HashSet<UUID>();
foreach (Scene s in m_scenes)
{
s.ForEachScenePresence(
delegate(ScenePresence presence)
{
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
receiverIDs.Add(presence.UUID);
}
);
}
(scene as Scene).EventManager.TriggerOnChatToClients(
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
}
static private Vector3 CenterOfRegion = new Vector3(128, 128, 30);
@ -269,6 +277,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
HashSet<UUID> receiverIDs = new HashSet<UUID>();
((Scene)c.Scene).ForEachScenePresence(
delegate(ScenePresence presence)
{
@ -286,16 +296,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
receiverIDs.Add(presence.UUID);
});
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
}
protected virtual void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
/// <summary>
/// Try to send a message to the given presence
/// </summary>
/// <param name="presence">The receiver</param>
/// <param name="fromPos"></param>
/// <param name="regionPos">/param>
/// <param name="fromAgentID"></param>
/// <param name="fromName"></param>
/// <param name="type"></param>
/// <param name="message"></param>
/// <param name="src"></param>
/// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a
/// precondition</returns>
protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
UUID fromAgentID, string fromName, ChatTypeEnum type,
string message, ChatSourceType src)
{
// don't send stuff to child agents
if (presence.IsChildAgent) return;
if (presence.IsChildAgent) return false;
Vector3 fromRegionPos = fromPos + regionPos;
Vector3 toRegionPos = presence.AbsolutePosition +
@ -308,12 +334,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
type == ChatTypeEnum.Say && dis > m_saydistance ||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
{
return;
return false;
}
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully);
return true;
}
}
}

View File

@ -33,6 +33,7 @@ using System.Reflection;
using System.Threading;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
@ -50,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version
/// bumps here should be compatible.
/// </summary>
public static int MAX_MAJOR_VERSION = 0;
protected TarArchiveReader archive;
private UserAccount m_userInfo;
@ -133,7 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
{
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
{
LoadControlFile(filePath, data);
}
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
{
if (LoadAsset(filePath, data))
successfulAssetRestores++;
@ -461,5 +472,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return false;
}
}
/// <summary>
/// Load control file
/// </summary>
/// <param name="path"></param>
/// <param name="data"></param>
protected void LoadControlFile(string path, byte[] data)
{
XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
XElement archiveElement = doc.Element("archive");
int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
string version = string.Format("{0}.{1}", majorVersion, minorVersion);
if (majorVersion > MAX_MAJOR_VERSION)
{
throw new Exception(
string.Format(
"The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
majorVersion, MAX_MAJOR_VERSION));
}
m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
}
}
}

View File

@ -123,9 +123,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
try
{
// We're almost done. Just need to write out the control file now
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
m_archiveWriter.Close();
}
catch (Exception e)
@ -277,6 +274,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_archiveWriter = new TarArchiveWriter(m_saveStream);
// Write out control file. This has to be done first so that subsequent loaders will see this file first
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
if (inventoryFolder != null)
{
m_log.DebugFormat(
@ -399,13 +401,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <returns></returns>
public static string Create0p1ControlFile()
{
int majorVersion = 0, minorVersion = 1;
m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
xtw.Formatting = Formatting.Indented;
xtw.WriteStartDocument();
xtw.WriteStartElement("archive");
xtw.WriteAttributeString("major_version", "0");
xtw.WriteAttributeString("minor_version", "1");
xtw.WriteAttributeString("major_version", majorVersion.ToString());
xtw.WriteAttributeString("minor_version", minorVersion.ToString());
xtw.WriteEndElement();
xtw.Flush();

View File

@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version
/// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version
/// bumps here should be compatible.
/// </summary>
public static int MAX_MAJOR_VERSION = 0;
@ -481,17 +481,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// </summary>
/// <param name="path"></param>
/// <param name="data"></param>
private void LoadControlFile(string path, byte[] data)
protected void LoadControlFile(string path, byte[] data)
{
//Create the XmlNamespaceManager.
NameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
// Create the XmlParserContext.
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
XmlTextReader xtr
= new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
@ -530,10 +524,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString();
}
}
}
currentRegionSettings.Save();
}
}
}
}

View File

@ -171,7 +171,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
// Write out control file
// Write out control file. This has to be done first so that subsequent loaders will see this file first
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options));
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
@ -198,13 +199,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
majorVersion = 1;
minorVersion = 0;
}
}
*/
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
// if (majorVersion == 1)
// {
// m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR");
// m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR");
// }
@ -231,6 +232,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
sw.Close();
return s;
}
}
}
}

View File

@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.ErrorFormat(
"[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT);
m_log.Error("[ARCHIVER]: OAR save aborted.");
m_log.Error("[ARCHIVER]: OAR save aborted. PLEASE DO NOT USE THIS OAR, IT WILL BE INCOMPLETE.");
}
catch (Exception e)
{

View File

@ -44,10 +44,8 @@ namespace OpenSim.Region.CoreModules
/// it is not based on ~06:00 == Sun Rise. Rather it is based on 00:00 being sun-rise.
/// </summary>
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//
// Global Constants used to determine where in the sky the sun is
//
@ -108,26 +106,25 @@ namespace OpenSim.Region.CoreModules
private Scene m_scene = null;
// Calculated Once in the lifetime of a region
private long TicksToEpoch; // Elapsed time for 1/1/1970
private uint SecondsPerSunCycle; // Length of a virtual day in RW seconds
private uint SecondsPerYear; // Length of a virtual year in RW seconds
private double SunSpeed; // Rate of passage in radians/second
private double SeasonSpeed; // Rate of change for seasonal effects
// private double HoursToRadians; // Rate of change for seasonal effects
private long TicksUTCOffset = 0; // seconds offset from UTC
private long TicksToEpoch; // Elapsed time for 1/1/1970
private uint SecondsPerSunCycle; // Length of a virtual day in RW seconds
private uint SecondsPerYear; // Length of a virtual year in RW seconds
private double SunSpeed; // Rate of passage in radians/second
private double SeasonSpeed; // Rate of change for seasonal effects
// private double HoursToRadians; // Rate of change for seasonal effects
private long TicksUTCOffset = 0; // seconds offset from UTC
// Calculated every update
private float OrbitalPosition; // Orbital placement at a point in time
private double HorizonShift; // Axis offset to skew day and night
private double TotalDistanceTravelled; // Distance since beginning of time (in radians)
private double SeasonalOffset; // Seaonal variation of tilt
private float Magnitude; // Normal tilt
// private double VWTimeRatio; // VW time as a ratio of real time
private float OrbitalPosition; // Orbital placement at a point in time
private double HorizonShift; // Axis offset to skew day and night
private double TotalDistanceTravelled; // Distance since beginning of time (in radians)
private double SeasonalOffset; // Seaonal variation of tilt
private float Magnitude; // Normal tilt
// private double VWTimeRatio; // VW time as a ratio of real time
// Working values
private Vector3 Position = Vector3.Zero;
private Vector3 Velocity = Vector3.Zero;
private Quaternion Tilt = new Quaternion(1.0f, 0.0f, 0.0f, 0.0f);
private Quaternion Tilt = new Quaternion(1.0f, 0.0f, 0.0f, 0.0f);
// Used to fix the sun in the sky so it doesn't move based on current time
private bool m_SunFixed = false;
@ -135,8 +132,6 @@ namespace OpenSim.Region.CoreModules
private const int TICKS_PER_SECOND = 10000000;
// Current time in elapsed seconds since Jan 1st 1970
private ulong CurrentTime
{
@ -149,8 +144,6 @@ namespace OpenSim.Region.CoreModules
// Time in seconds since UTC to use to calculate sun position.
ulong PosTime = 0;
/// <summary>
/// Calculate the sun's orbital position and its velocity.
/// </summary>
@ -202,7 +195,6 @@ namespace OpenSim.Region.CoreModules
PosTime += (ulong)(((CurDayPercentage - 0.5) / .5) * NightSeconds);
}
}
}
TotalDistanceTravelled = SunSpeed * PosTime; // distance measured in radians
@ -251,7 +243,6 @@ namespace OpenSim.Region.CoreModules
Velocity.X = 0;
Velocity.Y = 0;
Velocity.Z = 0;
}
else
{
@ -271,9 +262,7 @@ namespace OpenSim.Region.CoreModules
private float GetCurrentTimeAsLindenSunHour()
{
if (m_SunFixed)
{
return m_SunFixedHour + 6;
}
return GetCurrentSunHour() + 6.0f;
}
@ -297,8 +286,6 @@ namespace OpenSim.Region.CoreModules
m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand);
}
TimeZone local = TimeZone.CurrentTimeZone;
TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset);
@ -325,13 +312,11 @@ namespace OpenSim.Region.CoreModules
// must hard code to ~.5 to match sun position in LL based viewers
m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night);
// Scales the sun hours 0...12 vs 12...24, essentially makes daylight hours longer/shorter vs nighttime hours
m_DayTimeSunHourScale = config.Configs["Sun"].GetDouble("day_time_sun_hour_scale", d_DayTimeSunHourScale);
// Update frequency in frames
m_UpdateInterval = config.Configs["Sun"].GetInt("update_interval", d_frame_mod);
}
catch (Exception e)
{
@ -391,10 +376,8 @@ namespace OpenSim.Region.CoreModules
}
scene.RegisterModuleInterface<ISunModule>(this);
}
public void PostInitialise()
{
}
@ -402,7 +385,7 @@ namespace OpenSim.Region.CoreModules
public void Close()
{
ready = false;
// Remove our hooks
m_scene.EventManager.OnFrame -= SunUpdate;
m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
@ -419,6 +402,7 @@ namespace OpenSim.Region.CoreModules
{
get { return false; }
}
#endregion
#region EventManager Events
@ -446,9 +430,7 @@ namespace OpenSim.Region.CoreModules
public void SunUpdate()
{
if (((m_frame++ % m_UpdateInterval) != 0) || !ready || m_SunFixed || !receivedEstateToolsSunUpdate)
{
return;
}
GenSunPos(); // Generate shared values once
@ -467,7 +449,7 @@ namespace OpenSim.Region.CoreModules
}
/// <summary>
///
///
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="FixedTime">Is the sun's position fixed?</param>
@ -484,7 +466,6 @@ namespace OpenSim.Region.CoreModules
while (FixedSunHour < 0)
FixedSunHour += 24;
m_SunFixedHour = FixedSunHour;
m_SunFixed = FixedSun;
@ -499,14 +480,12 @@ namespace OpenSim.Region.CoreModules
// When sun settings are updated, we should update all clients with new settings.
SunUpdateToAllClients();
m_log.DebugFormat("[SUN]: PosTime : {0}", PosTime.ToString());
}
}
#endregion
private void SunUpdateToAllClients()
{
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
@ -553,7 +532,6 @@ namespace OpenSim.Region.CoreModules
{
float ticksleftover = CurrentTime % SecondsPerSunCycle;
return (24.0f * (ticksleftover / SecondsPerSunCycle));
}
@ -666,7 +644,6 @@ namespace OpenSim.Region.CoreModules
// When sun settings are updated, we should update all clients with new settings.
SunUpdateToAllClients();
}
return Output;

View File

@ -292,6 +292,17 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat);
public event ChatFromClientEvent OnChatFromClient;
/// <summary>
/// ChatToClientsEvent is triggered via ChatModule (or
/// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
/// received chat message if they satisfy various conditions (within audible range, etc.)
/// </summary>
public delegate void ChatToClientsEvent(
UUID senderID, HashSet<UUID> receiverIDs,
string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
ChatSourceType src, ChatAudibleLevel level);
public event ChatToClientsEvent OnChatToClients;
/// <summary>
/// ChatBroadcastEvent is called via Scene when a broadcast chat message
/// from world comes in
@ -1603,6 +1614,30 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
public void TriggerOnChatToClients(
UUID senderID, HashSet<UUID> receiverIDs,
string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
ChatSourceType src, ChatAudibleLevel level)
{
ChatToClientsEvent handler = OnChatToClients;
if (handler != null)
{
foreach (ChatToClientsEvent d in handler.GetInvocationList())
{
try
{
d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
{

View File

@ -593,8 +593,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.OnSendStatsResult += SendSimStatsPackets;
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity);
// Old
/*
m_simulatorVersion = simulatorVersion
@ -2390,7 +2388,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
m_log.WarnFormat("[SCENE]: Problem casting object: {0}", e.Message);
m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString());
return false;
}
@ -3273,7 +3271,6 @@ namespace OpenSim.Region.Framework.Scenes
m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
}
/// <summary>
/// Do the work necessary to initiate a new user connection for a particular scene.
/// At the moment, this consists of setting up the caps infrastructure
@ -3285,6 +3282,23 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>True if the region accepts this agent. False if it does not. False will
/// also return a reason.</returns>
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
{
return NewUserConnection(agent, teleportFlags, out reason, true);
}
/// <summary>
/// Do the work necessary to initiate a new user connection for a particular scene.
/// At the moment, this consists of setting up the caps infrastructure
/// The return bool should allow for connections to be refused, but as not all calling paths
/// take proper notice of it let, we allowed banned users in still.
/// </summary>
/// <param name="agent">CircuitData of the agent who is connecting</param>
/// <param name="reason">Outputs the reason for the false response on this string</param>
/// <param name="requirePresenceLookup">True for normal presence. False for NPC
/// or other applications where a full grid/Hypergrid presence may not be required.</param>
/// <returns>True if the region accepts this agent. False if it does not. False will
/// also return a reason.</returns>
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
{
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
@ -3334,16 +3348,18 @@ namespace OpenSim.Region.Framework.Scenes
if (sp == null) // We don't have an [child] agent here already
{
try
if (requirePresenceLookup)
{
if (!VerifyUserPresence(agent, out reason))
try
{
if (!VerifyUserPresence(agent, out reason))
return false;
}
catch (Exception e)
{
m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
return false;
}
catch (Exception e)
{
m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message);
return false;
}
}
try
@ -3353,7 +3369,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message);
m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString());
return false;
}

View File

@ -406,11 +406,14 @@ namespace OpenSim.Region.Framework.Scenes
public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
{
EntityBase entity;
if (!Entities.TryGetValue(uuid, out entity) && entity is SceneObjectGroup)
if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
return false;
SceneObjectGroup grp = (SceneObjectGroup)entity;
if (entity == null)
return false;
if (!resultOfObjectLinked)
{
m_numPrim -= grp.PrimCount;

View File

@ -804,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader)
{
byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry"));
shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length);
shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length);
}
private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader)
@ -1426,7 +1426,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
reader.ReadStartElement(name);
vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x
vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or Y
vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y
vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z
reader.ReadEndElement();
@ -1501,15 +1501,28 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
reader.ReadStartElement(name, String.Empty); // Shape
string nodeName = string.Empty;
while (reader.NodeType != XmlNodeType.EndElement)
{
nodeName = reader.Name;
//m_log.DebugFormat("[XXX] Processing: {0}", reader.Name);
ShapeXmlProcessor p = null;
if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p))
p(shape, reader);
{
try
{
p(shape, reader);
}
catch (Exception e)
{
m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e);
if (reader.NodeType == XmlNodeType.EndElement)
reader.Read();
}
}
else
{
// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name);
// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name);
reader.ReadOuterXml();
}
}

View File

@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_activeScripts = 0;
private int m_scriptLinesPerSecond = 0;
private int objectCapacity = 45000;
private int m_objectCapacity = 45000;
private Scene m_scene;
@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene = scene;
ReportingRegion = scene.RegionInfo;
m_objectCapacity = scene.RegionInfo.ObjectCapacity;
m_report.AutoReset = true;
m_report.Interval = statsUpdatesEveryMS;
m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
@ -271,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
SimStats simStats
= new SimStats(
ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
handlerSendStatResult = OnSendStatsResult;
if (handlerSendStatResult != null)
@ -435,11 +436,6 @@ namespace OpenSim.Region.Framework.Scenes
m_activeScripts = count;
}
public void SetObjectCapacity(int objects)
{
objectCapacity = objects;
}
/// <summary>
/// This is for llGetRegionFPS
/// </summary>

View File

@ -220,7 +220,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
groupID, groupMembers.Count);
foreach (GroupMembersData member in groupMembers)
{
{
if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
{
// Don't deliver messages to people who have dropped this session
@ -266,7 +266,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
void OnClientLogin(IClientAPI client)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
}
private void OnNewClient(IClientAPI client)

View File

@ -32,7 +32,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
class ExtensionHandler : IExtension
class ExtensionHandler : IExtension
{
private readonly Dictionary<Type, object> m_instances;

View File

@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private readonly Dictionary<UUID,MRMBase> m_scripts = new Dictionary<UUID, MRMBase>();
private readonly Dictionary<Type,object> m_extensions = new Dictionary<Type, object>();
@ -77,7 +77,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
m_log.Info("[MRM] Enabling MRM Module");
m_scene = scene;
// when hidden, we don't listen for client initiated script events
// only making the MRM engine available for region modules
if (!source.Configs["MRM"].GetBoolean("Hidden", false))
@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
scene.EventManager.OnRezScript += EventManager_OnRezScript;
scene.EventManager.OnStopScript += EventManager_OnStopScript;
}
scene.EventManager.OnFrame += EventManager_OnFrame;
scene.RegisterModuleInterface<IMRMModule>(this);
@ -291,7 +291,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID)
{
m_log.Info("[MRM] Created MRM Instance");
IWorld world;
@ -304,7 +303,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public void PostInitialise()
{
}
public void Close()
@ -350,7 +348,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (!Directory.Exists(tmp))
Directory.CreateDirectory(tmp);
m_log.Info("MRM 2");
try
@ -396,8 +393,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
parameters.IncludeDebugInformation = true;
string rootPath =
Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
List<string> libraries = new List<string>();
string[] lines = Script.Split(new string[] {"\n"}, StringSplitOptions.RemoveEmptyEntries);

View File

@ -83,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
// private int m_stipend = 1000;
// private int ObjectCapacity = 45000;
private int ObjectCount = 0;
private int PriceEnergyUnit = 0;
private int PriceGroupCreate = 0;
@ -135,7 +134,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
public void AddRegion(Scene scene)
{
// Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
if (m_enabled)
{
scene.RegisterModuleInterface<IMoneyModule>(this);

View File

@ -287,7 +287,7 @@ namespace OpenSim.Region.Physics.Meshing
long start = 0;
using (MemoryStream data = new MemoryStream(primShape.SculptData))
{
meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data, true);
meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data);
start = data.Position;
}
@ -324,7 +324,7 @@ namespace OpenSim.Region.Physics.Meshing
byte[] decompressedBuf = outMs.GetBuffer();
decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf, true);
decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf);
}
}
}
@ -349,6 +349,7 @@ namespace OpenSim.Region.Physics.Meshing
OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3();
OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3();
ushort faceIndexOffset = (ushort)coords.Count;
byte[] posBytes = subMeshMap["Position"].AsBinary();
for (int i = 0; i < posBytes.Length; i += 6)
@ -368,9 +369,9 @@ namespace OpenSim.Region.Physics.Meshing
byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary();
for (int i = 0; i < triangleBytes.Length; i += 6)
{
ushort v1 = Utils.BytesToUInt16(triangleBytes, i);
ushort v2 = Utils.BytesToUInt16(triangleBytes, i + 2);
ushort v3 = Utils.BytesToUInt16(triangleBytes, i + 4);
ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset);
ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset);
ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset);
Face f = new Face(v1, v2, v3);
faces.Add(f);
}

View File

@ -6892,7 +6892,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
{
llSetLinkPrimitiveParams(linknumber, rules);
m_host.AddScriptLPS(1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts)
SetPrimParams(part, rules);
}
protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
@ -7262,6 +7267,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case (int)ScriptBaseClass.PRIM_NAME:
if (remain < 1)
return;
string primName = rules.GetLSLStringItem(idx++);
part.Name = primName;
break;
case (int)ScriptBaseClass.PRIM_DESC:
if (remain < 1)
return;
string primDesc = rules.GetLSLStringItem(idx++);
part.Description = primDesc;
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
if (remain < 1)
return;
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr));
break;
}
}
@ -7808,6 +7831,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
textColor.B));
res.Add(new LSL_Float(textColor.A));
break;
case (int)ScriptBaseClass.PRIM_NAME:
res.Add(part.Name);
break;
case (int)ScriptBaseClass.PRIM_DESC:
res.Add(part.Description);
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W));
break;
}
}
return res;
@ -8404,6 +8436,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
for (j = 0; j < seplen; j++)
{
if (separray[j].ToString() == String.Empty)
active[j] = false;
if (active[j])
{
// scan all of the markers
@ -8432,6 +8467,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
{
if (spcarray[j-seplen].ToString() == String.Empty)
active[j] = false;
if (active[j])
{
// scan all of the markers
@ -9090,10 +9128,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// do that one last, it will cause a ParcelPropertiesUpdate
landObject.SetMediaUrl(url);
// now send to all (non-child) agents
// now send to all (non-child) agents in the parcel
World.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!sp.IsChildAgent)
if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
{
sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
landData.MediaID,
@ -9123,10 +9161,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// the commandList contained a start/stop/... command, too
if (presence == null)
{
// send to all (non-child) agents
// send to all (non-child) agents in the parcel
World.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!sp.IsChildAgent)
if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
{
sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
(ParcelMediaCommandEnum)commandToSend,

View File

@ -316,6 +316,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_POINT_LIGHT = 23; // Huh?
public const int PRIM_GLOW = 25;
public const int PRIM_TEXT = 26;
public const int PRIM_NAME = 27;
public const int PRIM_DESC = 28;
public const int PRIM_ROT_LOCAL = 29;
public const int PRIM_TEXGEN_DEFAULT = 0;
public const int PRIM_TEXGEN_PLANAR = 1;

View File

@ -135,17 +135,17 @@
</member>
<member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.Byte[])">
<summary>
Deserializes binary LLSD
</summary>
<param name="binaryData"></param>
<returns></returns>
<param name="binaryData">Serialized data</param>
<returns>OSD containting deserialized data</returns>
</member>
<member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.IO.Stream)">
<summary>
Deserializes binary LLSD
</summary>
<param name="stream"></param>
<returns></returns>
<param name="stream">Stream to read the data from</param>
<returns>OSD containting deserialized data</returns>
</member>
<member name="M:OpenMetaverse.StructuredData.OSDParser.SerializeLLSDBinary(OpenMetaverse.StructuredData.OSD)">
<summary>

Binary file not shown.

View File

@ -10318,12 +10318,13 @@
<param name="targetID">target avatars <seealso cref="T:OpenMetaverse.UUID"/> to lure</param>
<param name="message">custom message to send with invitation</param>
</member>
<member name="M:OpenMetaverse.AgentManager.TeleportLureRespond(OpenMetaverse.UUID,System.Boolean)">
<member name="M:OpenMetaverse.AgentManager.TeleportLureRespond(OpenMetaverse.UUID,OpenMetaverse.UUID,System.Boolean)">
<summary>
Respond to a teleport lure by either accepting it and initiating
the teleport, or denying it
</summary>
<param name="requesterID"><seealso cref="T:OpenMetaverse.UUID"/> of the avatar sending the lure</param>
<param name="sessionID">IM session <seealso cref="T:OpenMetaverse.UUID"/> of the incoming lure request</param>
<param name="accept">true to accept the lure, false to decline it</param>
</member>
<member name="M:OpenMetaverse.AgentManager.UpdateProfile(OpenMetaverse.Avatar.AvatarProperties)">
@ -19866,9 +19867,6 @@
<member name="F:OpenMetaverse.AppearanceManager.WEARABLES_PER_LAYER">
<summary>Total number of wearables per bake layer</summary>
</member>
<member name="F:OpenMetaverse.AppearanceManager.AVATAR_TEXTURE_COUNT">
<summary>Total number of textures on an avatar, baked or not</summary>
</member>
<member name="F:OpenMetaverse.AppearanceManager.BakeIndexToTextureIndex">
<summary>Mapping between BakeType and AvatarTextureIndex</summary>
</member>
@ -20315,6 +20313,9 @@
<member name="F:OpenMetaverse.AppearanceManager.TextureData.Color">
<summary>Tint that should be applied to the texture</summary>
</member>
<member name="F:OpenMetaverse.AppearanceManager.TextureData.TextureIndex">
<summary>Where on avatar does this texture belong</summary>
</member>
<member name="T:OpenMetaverse.AgentWearablesReplyEventArgs">
<summary>Contains the Event data returned from the data server from an AgentWearablesRequest</summary>
</member>

Binary file not shown.

Binary file not shown.

View File

@ -1387,6 +1387,7 @@
<Reference name="System"/>
<Reference name="System.Core"/>
<Reference name="System.Xml"/>
<Reference name="System.Xml.Linq"/>
<Reference name="System.Drawing"/>
<Reference name="System.Web"/>
<Reference name="NDesk.Options" path="../../../bin/"/>