Merge branch 'master' of /var/git/opensim/

viewer-2-initial-appearance
opensim mirror account 2010-10-26 21:10:12 -07:00
commit d6771ed4d5
9 changed files with 37 additions and 63 deletions

View File

@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
} }
(scene as Scene).EventManager.TriggerOnChatToClients( (scene as Scene).EventManager.TriggerOnChatToClients(
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
} }
static private Vector3 CenterOfRegion = new Vector3(128, 128, 30); static private Vector3 CenterOfRegion = new Vector3(128, 128, 30);

View File

@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (filePath == ArchiveConstants.CONTROL_FILE_PATH) if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
{ {
LoadControlFile(filePath, data); LoadControlFile(filePath, data);
} }
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
{ {
if (LoadAsset(filePath, data)) if (LoadAsset(filePath, data))
@ -479,11 +479,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <param name="path"></param> /// <param name="path"></param>
/// <param name="data"></param> /// <param name="data"></param>
protected void LoadControlFile(string path, byte[] data) protected void LoadControlFile(string path, byte[] data)
{ {
XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
XElement archiveElement = doc.Element("archive"); XElement archiveElement = doc.Element("archive");
int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
string version = string.Format("{0}.{1}", majorVersion, minorVersion); string version = string.Format("{0}.{1}", majorVersion, minorVersion);
if (majorVersion > MAX_MAJOR_VERSION) if (majorVersion > MAX_MAJOR_VERSION)
@ -492,7 +492,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
string.Format( 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", "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)); majorVersion, MAX_MAJOR_VERSION));
} }
m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
} }

View File

@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public void Execute() public void Execute()
{ {
try try
{ {
InventoryFolderBase inventoryFolder = null; InventoryFolderBase inventoryFolder = null;
InventoryItemBase inventoryItem = null; InventoryItemBase inventoryItem = null;
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID); InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
// Write out control file. This has to be done first so that subsequent loaders will see this file first // 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 // 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_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
if (inventoryFolder != null) if (inventoryFolder != null)
{ {

View File

@ -199,13 +199,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
majorVersion = 1; majorVersion = 1;
minorVersion = 0; minorVersion = 0;
} }
*/ */
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
// if (majorVersion == 1) // 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");
// } // }
@ -232,6 +232,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
sw.Close(); sw.Close();
return s; return s;
} }
} }
} }

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

View File

@ -296,7 +296,7 @@ namespace OpenSim.Region.Framework.Scenes
/// ChatToClientsEvent is triggered via ChatModule (or /// ChatToClientsEvent is triggered via ChatModule (or
/// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a /// 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.) /// received chat message if they satisfy various conditions (within audible range, etc.)
/// </summary> /// </summary>
public delegate void ChatToClientsEvent( public delegate void ChatToClientsEvent(
UUID senderID, HashSet<UUID> receiverIDs, UUID senderID, HashSet<UUID> receiverIDs,
string message, ChatTypeEnum type, Vector3 fromPos, string fromName, string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
@ -1636,8 +1636,8 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace); e.Message, e.StackTrace);
} }
} }
} }
} }
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
{ {

View File

@ -804,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader) private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader)
{ {
byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry")); 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) private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader)

View File

@ -220,7 +220,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
groupID, groupMembers.Count); groupID, groupMembers.Count);
foreach (GroupMembersData member in groupMembers) foreach (GroupMembersData member in groupMembers)
{ {
if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
{ {
// Don't deliver messages to people who have dropped this session // 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) 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) private void OnNewClient(IClientAPI client)

View File

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