Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Commit

Permalink
Last remaining user-visible references to OpenSim and/or Inworldz swe…
Browse files Browse the repository at this point in the history
…pt away.

This is the most complex change so far in this process.
For these changes the VersionInfo file was just the ticket, and that was easy, just needed some tuning.

llGetEnv did get some potentially backwards compatibility breaking changes however - see Issue #51 for the place to discuss those.

I also cleaned out a lot of local duplication and unneeded function-call passing of the version string.  In one location I may have broken ownership rules by giving Phlox direct access to VersionInfo, I'm not 100% certain.

Overall I attempted to try and keep the goals of each of these version and product name calls the same, just centralizing where they got that information from.  The main idea being that the more direct the access, the easier it is to determine what the effects are for any given change.  For example, previously it was a bear to find all the places changing the version string format would effect, now it's as simple as looking at where VersionInfo is used.
  • Loading branch information
kf6kjg committed Oct 16, 2015
1 parent 048f563 commit 37bcad1
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 58 deletions.
7 changes: 4 additions & 3 deletions InWorldz/InWorldz.Phlox.Engine/LSLSystemAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
using System.Threading;
using System.Web;
using Nini.Config;
using log4net;
using log4net;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Geom;
using OpenSim.Framework.Servers;
using OpenSim.Region.CoreModules;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.CoreModules.World.Land;
using OpenSim.Region.CoreModules.World.Terrain;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Physics.Manager.Vehicle;
Expand Down Expand Up @@ -11489,7 +11490,7 @@ public string llRequestSimulatorData(string simulator, int data)
if (simulator == World.RegionInfo.RegionName)
reply = m_host.ParentGroup.Scene.GetSimulatorVersion();
else
reply = "InWorldz";
reply = VersionInfo.SoftwareName;
break;
default:
// ScriptSleep(1000);
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Base/OpenSimBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ protected override Scene CreateScene(RegionInfo regionInfo, StorageManager stora
return new Scene(
regionInfo, m_commsManager, sceneGridService,
storageManager, m_moduleLoader, m_configSettings.PhysicalPrim,
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
m_configSettings.See_into_region_from_neighbor, m_config.Source);
}

# region Setup methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public GridInfoService()

private void loadGridInfo(IConfigSource configSource)
{
_info["platform"] = "OpenSim";
_info["platform"] = VersionInfo.SoftwareName;
try
{
IConfig startupCfg = configSource.Configs["Startup"];
Expand Down
18 changes: 6 additions & 12 deletions OpenSim/Framework/Servers/BaseOpenSimServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public abstract class BaseOpenSimServer
/// </summary>
protected string m_startupDirectory = Environment.CurrentDirectory;

/// <summary>
/// Server version information. Usually VersionInfo + information about svn revision, operating system, etc.
/// </summary>
protected string m_version;

protected string m_pidFile = String.Empty;

/// <summary>
Expand All @@ -104,8 +99,7 @@ public BaseHttpServer HttpServer
public BaseOpenSimServer()
{
m_startuptime = DateTime.Now;
m_version = VersionInfo.Version;


// Random uuid for private data
m_osSecret = UUID.Random().ToString();

Expand Down Expand Up @@ -306,7 +300,7 @@ public virtual void Startup()
StartupSpecific();

// Report the version number near the end so you can still see it after startup.
m_log.Info("[STARTUP]: Version: " + m_version + "\n");
m_log.Info("[STARTUP]: Version: " + VersionInfo.FullVersion + "\n");

TimeSpan timeTaken = DateTime.Now - m_startuptime;
m_log.InfoFormat("[STARTUP]: Startup took {0}m {1}s", timeTaken.Minutes, timeTaken.Seconds);
Expand Down Expand Up @@ -395,7 +389,7 @@ public virtual void HandleShow(string module, string[] cmd)
switch (showParams[0])
{
case "info":
Notice("Version: " + m_version);
Notice("Version: " + VersionInfo.FullVersion);
Notice("Startup directory: " + m_startupDirectory);
break;

Expand All @@ -415,7 +409,7 @@ public virtual void HandleShow(string module, string[] cmd)
case "version":
Notice(
String.Format(
"Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion));
"Version: {0} (interface version {1})", VersionInfo.FullVersion, VersionInfo.MajorInterfaceVersion));
break;
}
}
Expand Down Expand Up @@ -487,11 +481,11 @@ public string StatReport(OSHttpRequest httpRequest)
// If we catch a request for "callback", wrap the response in the value for jsonp
if( httpRequest.QueryString["callback"] != null)
{
return httpRequest.QueryString["callback"] + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version ) + ");";
return httpRequest.QueryString["callback"] + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , VersionInfo.FullVersion ) + ");";
}
else
{
return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version );
return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , VersionInfo.FullVersion );
}
}

Expand Down
18 changes: 15 additions & 3 deletions OpenSim/Framework/Servers/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class VersionInfo
/// This is name of the software product (separate from the grid it is running on).
/// This should not be changed.
/// </summary>
public readonly static string SoftwareName = "Halcyon";
public readonly static string SoftwareName = "Halcyon Server";

private static string _version = null; // Change the AssemblyVersion above.
private static string _revision = null; // Autogenerated by the build process due to '*'.
Expand Down Expand Up @@ -87,14 +87,26 @@ public static string ShortVersion
/// This is the full version, with revision info, such as "Halcyon 1.2.3 R151131".
/// This is the one requested by most of the software, and passed in RegionInfo to viewers.
/// </summary>
public static string Version
public static string FullVersion
{
get {
_Initialize();
return ShortVersion + " R" + Revision;
}
}


/// <summary>
/// This is the version value without the software name but with revision info, such as "1.2.3.151131".
/// </summary>
/// Mostly used by the scripting system and therefore is best to follow LL's format which seems to be "Major.Minor.Update.Revision".
public static string Version
{
get {
_Initialize();
return _version + "." + Revision;
}
}

/// <value>
/// This is the external interface version. It is separate from the externally-visible version info.
///
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Grid/GridServer.Modules/GridMessagingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public GridMessagingModule()
{
}

public void Initialize(string opensimVersion, IRegionProfileService gridDBService, IGridServiceCore gridCore, GridConfig config)
public void Initialize(IRegionProfileService gridDBService, IGridServiceCore gridCore, GridConfig config)
{
//m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService;
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Grid/GridServer.Modules/GridRestModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public GridRestModule()
{
}

public void Initialize(string opensimVersion, GridDBService gridDBService, IGridServiceCore gridCore, GridConfig config)
public void Initialize(GridDBService gridDBService, IGridServiceCore gridCore, GridConfig config)
{
//m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService;
Expand Down
9 changes: 3 additions & 6 deletions OpenSim/Grid/GridServer.Modules/GridServerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public class GridServerPlugin : IGridPlugin

protected GridDBService m_gridDBService;

protected string m_version;

protected GridConfig m_config;

protected IGridServiceCore m_core;
Expand All @@ -61,7 +59,6 @@ public void Initialize(GridServerBase gridServer)
{
m_core = gridServer;
m_config = gridServer.Config;
m_version = gridServer.Version;
m_console = MainConsole.Instance;

AddConsoleCommands();
Expand Down Expand Up @@ -99,13 +96,13 @@ protected virtual void SetupGridServices()
// RegisterInterface<GridDBService>(m_gridDBService);

m_gridMessageModule = new GridMessagingModule();
m_gridMessageModule.Initialize(m_version, m_gridDBService, m_core, m_config);
m_gridMessageModule.Initialize(m_gridDBService, m_core, m_config);

m_gridXmlRpcModule = new GridXmlRpcModule();
m_gridXmlRpcModule.Initialize(m_version, m_gridDBService, m_core, m_config);
m_gridXmlRpcModule.Initialize(m_gridDBService, m_core, m_config);

m_gridRestModule = new GridRestModule();
m_gridRestModule.Initialize(m_version, m_gridDBService, m_core, m_config);
m_gridRestModule.Initialize(m_gridDBService, m_core, m_config);

m_gridMessageModule.PostInitialize();
m_gridXmlRpcModule.PostInitialize();
Expand Down
11 changes: 3 additions & 8 deletions OpenSim/Grid/GridServer.Modules/GridXmlRpcModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public class GridXmlRpcModule
protected GridConfig m_config;

protected IMessagingServerDiscovery m_messagingServerMapper;
/// <value>
/// Used to notify old regions as to which OpenSim version to upgrade to
/// </value>
private string m_opensimVersion;

protected BaseHttpServer m_httpServer;

Expand All @@ -71,9 +67,8 @@ public GridXmlRpcModule()
{
}

public void Initialize(string opensimVersion, IRegionProfileService gridDBService, IGridServiceCore gridCore, GridConfig config)
public void Initialize(IRegionProfileService gridDBService, IGridServiceCore gridCore, GridConfig config)
{
m_opensimVersion = opensimVersion;
m_gridDBService = gridDBService;
m_gridCore = gridCore;
m_config = config;
Expand Down Expand Up @@ -302,8 +297,8 @@ public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request, IPEndPoi
String.Format(
"Your region service implements OGS1 interface version {0}"
+ " but this grid requires that the region implement OGS1 interface version {1} to connect."
+ " Try changing to OpenSimulator {2}",
majorInterfaceVersion, VersionInfo.MajorInterfaceVersion, m_opensimVersion));
+ " Try changing to {2}",
majorInterfaceVersion, VersionInfo.MajorInterfaceVersion, VersionInfo.ShortVersion));
}

existingSim = m_gridDBService.GetRegion(sim.regionHandle);
Expand Down
5 changes: 0 additions & 5 deletions OpenSim/Grid/GridServer/GridServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public GridConfig Config
get { return m_config; }
}

public string Version
{
get { return m_version; }
}

protected List<IGridPlugin> m_plugins = new List<IGridPlugin>();

public void Work()
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private C5.HashedLinkedList<SceneObjectPart> m_primTerseUpdates

private int m_animationSequenceNumber = 1;

private readonly byte[] m_channelVersion = Utils.StringToBytes("OpenSimulator Server"); // Dummy value needed by libSL
private readonly byte[] m_channelVersion = Utils.StringToBytes(VersionInfo.SoftwareName); // Dummy value needed by libSL

private static readonly Dictionary<string, UUID> s_defaultAnimations = new Dictionary<string, UUID>();

Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private string Report()
args["TimeZoneOffs"] = OSD.FromReal(utcOffset.TotalHours);
args["UxTime"] = OSD.FromInteger(Util.ToUnixTime(DateTime.Now));
args["Memory"] = OSD.FromReal(Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
args["Version"] = OSD.FromString(VersionInfo.Version);
args["Version"] = OSD.FromString(VersionInfo.FullVersion);

string strBuffer = "";
strBuffer = OSDParser.SerializeJsonString(args);
Expand Down
21 changes: 7 additions & 14 deletions OpenSim/Region/Framework/Scenes/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
//using System.Drawing;
//using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Timers;
Expand Down Expand Up @@ -201,8 +203,6 @@ public int CompareTo(PotentialTimedReturn other)

private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>();

protected string m_simulatorVersion = "InWorldz Server";

protected ModuleLoader m_moduleLoader;
protected StorageManager m_storageManager;
public CommunicationsManager CommsManager;
Expand Down Expand Up @@ -414,7 +414,7 @@ public Scene(RegionInfo regInfo,
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
StorageManager storeManager,
ModuleLoader moduleLoader, bool physicalPrim,
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
bool SeeIntoRegionFromNeighbor, IConfigSource config)
{
m_config = config;

Expand Down Expand Up @@ -471,8 +471,6 @@ public Scene(RegionInfo regInfo,

StatsReporter.SetObjectCapacity(objectCapacity);

m_simulatorVersion = simulatorVersion;

IConfig netConfig = m_config.Configs["Network"];

this.GridSendKey = netConfig.GetString("grid_send_key");
Expand Down Expand Up @@ -849,21 +847,16 @@ protected virtual void RegisterDefaultSceneEvents()
m_eventManager.OnPermissionError += dm.SendAlertToUser;
}

public override string GetSimulatorVersion()
{
return m_simulatorVersion;
}

public string GetEnv(string name)
{
string ret = "";
switch (name)
{
case "sim_channel": // Get the region's channel string, for example "Second Life Server".
ret = "InWorldz Server";
case "sim_channel": // Get the region's channel string, for example "Second Life Server". Does not change across grids as this is about the simulator software.
ret = VersionInfo.SoftwareName;
break;
case "sim_version": // Get the region's version number string, for example "10.11.30.215699".
ret = m_simulatorVersion;
case "sim_version": // Get the region's version number string, for example "10.11.30.215699". Does not change across grids as this is about the simulator software.
ret = VersionInfo.Version;
break;
case "frame_number": // (integer) Get the frame number of the simulator, for example "42042".
ret = m_frame.ToString();
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Region/Framework/Scenes/SceneBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public virtual bool PresenceChildStatus(UUID avatarID)

public virtual string GetSimulatorVersion()
{
return "OpenSimulator Server";
return VersionInfo.FullVersion;
}

#endregion
Expand Down
1 change: 1 addition & 0 deletions prebuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,7 @@
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Region.Framework"/>
Expand Down

0 comments on commit 37bcad1

Please sign in to comment.