diff options
author | Justin Clarke Casey | 2008-05-07 16:48:29 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-07 16:48:29 +0000 |
commit | 5afe6c3ed97b1b04013f564e144e96ba07674107 (patch) | |
tree | a9c77ef1717897fc8d1b31694430441c1a439fa0 /OpenSim/Region/Application/OpenSimMainConsole.cs | |
parent | * Move shutdown processing to base OpenSimServer, overriding the method where... (diff) | |
download | opensim-SC-5afe6c3ed97b1b04013f564e144e96ba07674107.zip opensim-SC-5afe6c3ed97b1b04013f564e144e96ba07674107.tar.gz opensim-SC-5afe6c3ed97b1b04013f564e144e96ba07674107.tar.bz2 opensim-SC-5afe6c3ed97b1b04013f564e144e96ba07674107.tar.xz |
From: Kurt Taylor <krtaylor@us.ibm.com>
Implements the show version command.
If you type show version at the console, you will get the revision that opensim is running, assuming you have the .svn/entries file in your base directory (e.g. you are running from code extracted from our SVN repository)
A patch to also send this to the client should follow shortly
Diffstat (limited to 'OpenSim/Region/Application/OpenSimMainConsole.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMainConsole.cs | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs index b213ed2..ab835ba 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSimMainConsole.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim | |||
55 | 55 | ||
56 | private string m_timedScript = "disabled"; | 56 | private string m_timedScript = "disabled"; |
57 | private Timer m_scriptTimer; | 57 | private Timer m_scriptTimer; |
58 | 58 | private string buildVersion = null; | |
59 | 59 | ||
60 | public OpenSimMainConsole(IConfigSource configSource) | 60 | public OpenSimMainConsole(IConfigSource configSource) |
61 | : base(configSource) | 61 | : base(configSource) |
@@ -113,6 +113,41 @@ namespace OpenSim | |||
113 | m_scriptTimer.Elapsed += RunAutoTimerScript; | 113 | m_scriptTimer.Elapsed += RunAutoTimerScript; |
114 | } | 114 | } |
115 | PrintFileToConsole("startuplogo.txt"); | 115 | PrintFileToConsole("startuplogo.txt"); |
116 | |||
117 | // Set BuildVersion String for Show version command | ||
118 | string svnFileName = "../.svn/entries"; | ||
119 | string inputLine = null; | ||
120 | int strcmp; | ||
121 | |||
122 | if (File.Exists(svnFileName)) | ||
123 | { | ||
124 | StreamReader EntriesFile = File.OpenText(svnFileName); | ||
125 | inputLine = EntriesFile.ReadLine(); | ||
126 | while (inputLine != null) | ||
127 | { | ||
128 | // using the dir svn revision at the top of entries file | ||
129 | strcmp = String.Compare(inputLine, "dir"); | ||
130 | if (strcmp == 0) | ||
131 | { | ||
132 | buildVersion = EntriesFile.ReadLine(); | ||
133 | break; | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | inputLine = EntriesFile.ReadLine(); | ||
138 | } | ||
139 | } | ||
140 | EntriesFile.Close(); | ||
141 | } | ||
142 | |||
143 | if ((buildVersion != null) && (buildVersion.Length > 0)) | ||
144 | { | ||
145 | m_log.Info("OpenSim " + VersionInfo.Version + " r" + buildVersion + "\n"); | ||
146 | } | ||
147 | else | ||
148 | { | ||
149 | m_log.Info("OpenSim " + VersionInfo.Version + "\n"); | ||
150 | } | ||
116 | } | 151 | } |
117 | 152 | ||
118 | protected ConsoleBase CreateConsole() | 153 | protected ConsoleBase CreateConsole() |
@@ -280,7 +315,8 @@ namespace OpenSim | |||
280 | m_console.Notice("show assets - show state of asset cache."); | 315 | m_console.Notice("show assets - show state of asset cache."); |
281 | m_console.Notice("show users - show info about connected users."); | 316 | m_console.Notice("show users - show info about connected users."); |
282 | m_console.Notice("show modules - shows info about loaded modules."); | 317 | m_console.Notice("show modules - shows info about loaded modules."); |
283 | m_console.Notice("show stats - statistical information for this server not displayed in the client"); | 318 | m_console.Notice("show stats - statistical information for this server"); |
319 | m_console.Notice("show version - show the running build version."); | ||
284 | m_console.Notice("threads - list threads"); | 320 | m_console.Notice("threads - list threads"); |
285 | m_console.Notice("config set section field value - set a config value"); | 321 | m_console.Notice("config set section field value - set a config value"); |
286 | m_console.Notice("config get section field - get a config value"); | 322 | m_console.Notice("config get section field - get a config value"); |
@@ -639,7 +675,18 @@ namespace OpenSim | |||
639 | { | 675 | { |
640 | m_console.Notice("Extra sim statistics collection has not been enabled"); | 676 | m_console.Notice("Extra sim statistics collection has not been enabled"); |
641 | } | 677 | } |
642 | break; | 678 | break; |
679 | |||
680 | case "version": | ||
681 | if ((buildVersion != null) && (buildVersion.Length > 0)) | ||
682 | { | ||
683 | m_console.Notice("The build version is: r" + buildVersion); | ||
684 | } | ||
685 | else | ||
686 | { | ||
687 | m_console.Notice("The build version is not available"); | ||
688 | } | ||
689 | break; | ||
643 | } | 690 | } |
644 | } | 691 | } |
645 | 692 | ||