mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
* Make version information common to all servers
* Now all servers respond to the "show version" command on the console
This commit is contained in:
@@ -98,6 +98,7 @@ namespace OpenSim
|
||||
}
|
||||
|
||||
private static bool _IsHandlingException = false; // Make sure we don't go recursive on ourself
|
||||
|
||||
/// <summary>
|
||||
/// Global exception handler -- all unhandlet exceptions end up here :)
|
||||
/// </summary>
|
||||
|
||||
@@ -54,11 +54,6 @@ namespace OpenSim
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Holds a human readable build version for this server.
|
||||
/// </summary>
|
||||
protected string buildVersion;
|
||||
|
||||
protected string proxyUrl;
|
||||
protected int proxyOffset = 0;
|
||||
|
||||
@@ -358,73 +353,12 @@ namespace OpenSim
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enhance the version string with extra information if it's available.
|
||||
/// </summary>
|
||||
protected void EnhanceVersionInformation()
|
||||
{
|
||||
// Add subversion revision information if available
|
||||
string svnFileName = "../.svn/entries";
|
||||
string inputLine;
|
||||
int strcmp;
|
||||
|
||||
if (File.Exists(svnFileName))
|
||||
{
|
||||
StreamReader EntriesFile = File.OpenText(svnFileName);
|
||||
inputLine = EntriesFile.ReadLine();
|
||||
while (inputLine != null)
|
||||
{
|
||||
// using the dir svn revision at the top of entries file
|
||||
strcmp = String.Compare(inputLine, "dir");
|
||||
if (strcmp == 0)
|
||||
{
|
||||
buildVersion = EntriesFile.ReadLine();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputLine = EntriesFile.ReadLine();
|
||||
}
|
||||
}
|
||||
EntriesFile.Close();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(buildVersion))
|
||||
{
|
||||
VersionInfo.Version += ", SVN build r" + buildVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
VersionInfo.Version += ", SVN build revision not available";
|
||||
}
|
||||
|
||||
// Add operating system information if available
|
||||
string OSString = "";
|
||||
|
||||
if (System.Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
{
|
||||
OSString = System.Environment.OSVersion.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
OSString = Util.ReadEtcIssue();
|
||||
}
|
||||
if (OSString.Length > 45)
|
||||
{
|
||||
OSString = OSString.Substring(0, 45);
|
||||
}
|
||||
|
||||
VersionInfo.Version += ", OS " + OSString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs initialisation of the scene, such as loading configuration from disk.
|
||||
/// </summary>
|
||||
protected void InternalStartUp()
|
||||
{
|
||||
EnhanceVersionInformation();
|
||||
|
||||
m_log.Info("[STARTUP]: OpenSim version: " + VersionInfo.Version + "\n");
|
||||
m_log.Info("[STARTUP]: Version " + m_version + "\n");
|
||||
|
||||
m_stats = StatsManager.StartCollectingSimExtraStats();
|
||||
|
||||
@@ -658,13 +592,14 @@ namespace OpenSim
|
||||
new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache,
|
||||
storageManager, m_httpServer,
|
||||
m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_see_into_region_from_neighbor, m_config,
|
||||
VersionInfo.Version);
|
||||
m_version);
|
||||
|
||||
}
|
||||
|
||||
public void handleRestartRegion(RegionInfo whichRegion)
|
||||
{
|
||||
m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager");
|
||||
|
||||
// Shutting down the client server
|
||||
bool foundClientServer = false;
|
||||
int clientServerElement = 0;
|
||||
|
||||
@@ -253,7 +253,6 @@ namespace OpenSim
|
||||
m_console.Notice("show assets - show state of asset cache.");
|
||||
m_console.Notice("show users - show info about connected users.");
|
||||
m_console.Notice("show modules - shows info about loaded modules.");
|
||||
m_console.Notice("show version - show the running build version.");
|
||||
m_console.Notice("show regions - show running region information.");
|
||||
m_console.Notice("threads - list threads");
|
||||
m_console.Notice("config set section field value - set a config value");
|
||||
@@ -661,17 +660,6 @@ namespace OpenSim
|
||||
scene.RegionInfo.RegionLocY);
|
||||
});
|
||||
break;
|
||||
|
||||
case "version":
|
||||
if (!string.IsNullOrEmpty(buildVersion))
|
||||
{
|
||||
m_console.Notice("The build version is: r" + buildVersion);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_console.Notice("The build version is not available");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OpenSim
|
||||
{
|
||||
/// <summary>
|
||||
/// Exists purely to hold version information.
|
||||
/// </summary>
|
||||
public class VersionInfo
|
||||
{
|
||||
public static string Version = "trunk (post 0.5.7)";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user