aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Framework.Console
diff options
context:
space:
mode:
Diffstat (limited to 'Common/OpenSim.Framework.Console')
-rw-r--r--Common/OpenSim.Framework.Console/AssemblyInfo.cs58
-rw-r--r--Common/OpenSim.Framework.Console/ConsoleBase.cs220
-rw-r--r--Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs39
-rw-r--r--Common/OpenSim.Framework.Console/MainConsole.cs49
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj89
-rw-r--r--Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build42
6 files changed, 0 insertions, 497 deletions
diff --git a/Common/OpenSim.Framework.Console/AssemblyInfo.cs b/Common/OpenSim.Framework.Console/AssemblyInfo.cs
deleted file mode 100644
index 8f715d2..0000000
--- a/Common/OpenSim.Framework.Console/AssemblyInfo.cs
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System.Reflection;
29using System.Runtime.CompilerServices;
30using System.Runtime.InteropServices;
31
32// Information about this assembly is defined by the following
33// attributes.
34//
35// change them to the information which is associated with the assembly
36// you compile.
37
38[assembly: AssemblyTitle("ServerConsole")]
39[assembly: AssemblyDescription("")]
40[assembly: AssemblyConfiguration("")]
41[assembly: AssemblyCompany("")]
42[assembly: AssemblyProduct("ServerConsole")]
43[assembly: AssemblyCopyright("")]
44[assembly: AssemblyTrademark("")]
45[assembly: AssemblyCulture("")]
46
47// This sets the default COM visibility of types in the assembly to invisible.
48// If you need to expose a type to COM, use [ComVisible(true)] on that type.
49[assembly: ComVisible(false)]
50
51// The assembly version has following format :
52//
53// Major.Minor.Build.Revision
54//
55// You can specify all values by your own or you can build default build and revision
56// numbers with the '*' character (the default):
57
58[assembly: AssemblyVersion("1.0.*")]
diff --git a/Common/OpenSim.Framework.Console/ConsoleBase.cs b/Common/OpenSim.Framework.Console/ConsoleBase.cs
deleted file mode 100644
index 30854fe..0000000
--- a/Common/OpenSim.Framework.Console/ConsoleBase.cs
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.IO;
30
31namespace OpenSim.Framework.Console
32{
33 public enum LogPriority : int
34 {
35 CRITICAL,
36 HIGH,
37 MEDIUM,
38 NORMAL,
39 LOW,
40 VERBOSE,
41 EXTRAVERBOSE
42 }
43
44 public class ConsoleBase
45 {
46 StreamWriter Log;
47 public conscmd_callback cmdparser;
48 public string componentname;
49 private bool m_silent;
50
51 public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent )
52 {
53 this.componentname = componentname;
54 this.cmdparser = cmdparser;
55 this.m_silent = silent;
56 System.Console.WriteLine("ServerConsole.cs - creating new local console");
57 System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
58 Log = File.AppendText(LogFile);
59 Log.WriteLine("========================================================================");
60 Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
61 }
62
63 public void Close()
64 {
65 Log.WriteLine("Shutdown at " + DateTime.Now.ToString());
66 Log.Close();
67 }
68
69 public void Write(string format, params object[] args)
70 {
71 Notice(format,args);
72 return;
73 }
74
75 public void Warn(string format, params object[] args)
76 {
77 WriteNewLine(ConsoleColor.Yellow, format, args);
78 return;
79 }
80
81 public void Notice(string format, params object[] args)
82 {
83 WriteNewLine(ConsoleColor.White, format, args);
84 return;
85 }
86
87 public void Error(string format, params object[] args)
88 {
89 WriteNewLine(ConsoleColor.Red, format, args);
90 return;
91 }
92
93 public void Verbose(string format, params object[] args)
94 {
95 WriteNewLine(ConsoleColor.Gray, format, args);
96 return;
97 }
98
99 public void Status(string format, params object[] args)
100 {
101 WriteNewLine(ConsoleColor.Blue, format, args);
102 return;
103 }
104
105 private void WriteNewLine(System.ConsoleColor color, string format, params object[] args)
106 {
107 Log.WriteLine(format, args);
108 Log.Flush();
109 if (!m_silent)
110 {
111 try
112 {
113 System.Console.ForegroundColor = color;
114 System.Console.WriteLine(format, args);
115 System.Console.ResetColor();
116 } // Because mono and old debian sucks.
117 catch (System.ArgumentNullException)
118 {
119 System.Console.WriteLine(format, args);
120 }
121 }
122 return;
123 }
124
125 public string ReadLine()
126 {
127 string TempStr = System.Console.ReadLine();
128 Log.WriteLine(TempStr);
129 return TempStr;
130 }
131
132 public int Read()
133 {
134 int TempInt = System.Console.Read();
135 Log.Write((char)TempInt);
136 return TempInt;
137 }
138
139 // Displays a prompt and waits for the user to enter a string, then returns that string
140 // Done with no echo and suitable for passwords
141 public string PasswdPrompt(string prompt)
142 {
143 // FIXME: Needs to be better abstracted
144 Log.WriteLine(prompt);
145 this.Write(prompt);
146 ConsoleColor oldfg = System.Console.ForegroundColor;
147 System.Console.ForegroundColor = System.Console.BackgroundColor;
148 string temp = System.Console.ReadLine();
149 System.Console.ForegroundColor = oldfg;
150 return temp;
151 }
152
153 // Displays a command prompt and waits for the user to enter a string, then returns that string
154 public string CmdPrompt(string prompt)
155 {
156 this.Write(String.Format("{0}: ", prompt));
157 return this.ReadLine();
158 }
159
160 // Displays a command prompt and returns a default value if the user simply presses enter
161 public string CmdPrompt(string prompt, string defaultresponse)
162 {
163 string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse ));
164 if (temp == "")
165 {
166 return defaultresponse;
167 }
168 else
169 {
170 return temp;
171 }
172 }
173
174 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options
175 public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB)
176 {
177 bool itisdone = false;
178 string temp = CmdPrompt(prompt, defaultresponse);
179 while (itisdone == false)
180 {
181 if ((temp == OptionA) || (temp == OptionB))
182 {
183 itisdone = true;
184 }
185 else
186 {
187 Notice("Valid options are " + OptionA + " or " + OptionB);
188 temp = CmdPrompt(prompt, defaultresponse);
189 }
190 }
191 return temp;
192 }
193
194 // Runs a command with a number of parameters
195 public Object RunCmd(string Cmd, string[] cmdparams)
196 {
197 cmdparser.RunCmd(Cmd, cmdparams);
198 return null;
199 }
200
201 // Shows data about something
202 public void ShowCommands(string ShowWhat)
203 {
204 cmdparser.Show(ShowWhat);
205 }
206
207 public void MainConsolePrompt()
208 {
209 string[] tempstrarray;
210 string tempstr = this.CmdPrompt(this.componentname + "# ");
211 tempstrarray = tempstr.Split(' ');
212 string cmd = tempstrarray[0];
213 Array.Reverse(tempstrarray);
214 Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1);
215 Array.Reverse(tempstrarray);
216 string[] cmdparams = (string[])tempstrarray;
217 RunCmd(cmd, cmdparams);
218 }
219 }
220}
diff --git a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs b/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
deleted file mode 100644
index e3847be..0000000
--- a/Common/OpenSim.Framework.Console/ConsoleCallbacksBase.cs
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Framework.Console
33{
34 public interface conscmd_callback
35 {
36 void RunCmd(string cmd, string[] cmdparams);
37 void Show(string ShowWhat);
38 }
39}
diff --git a/Common/OpenSim.Framework.Console/MainConsole.cs b/Common/OpenSim.Framework.Console/MainConsole.cs
deleted file mode 100644
index 01aa3d1..0000000
--- a/Common/OpenSim.Framework.Console/MainConsole.cs
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29
30namespace OpenSim.Framework.Console
31{
32 public class MainConsole {
33
34 private static ConsoleBase instance;
35
36 public static ConsoleBase Instance
37 {
38 get
39 {
40 return instance;
41 }
42 set
43 {
44 instance = value;
45 }
46 }
47 }
48
49}
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
deleted file mode 100644
index 7af0eca..0000000
--- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
+++ /dev/null
@@ -1,89 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{A7CD0630-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.Framework.Console</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.Framework.Console</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 </ItemGroup>
66 <ItemGroup>
67 </ItemGroup>
68 <ItemGroup>
69 <Compile Include="AssemblyInfo.cs">
70 <SubType>Code</SubType>
71 </Compile>
72 <Compile Include="ConsoleBase.cs">
73 <SubType>Code</SubType>
74 </Compile>
75 <Compile Include="ConsoleCallbacksBase.cs">
76 <SubType>Code</SubType>
77 </Compile>
78 <Compile Include="MainConsole.cs">
79 <SubType>Code</SubType>
80 </Compile>
81 </ItemGroup>
82 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
83 <PropertyGroup>
84 <PreBuildEvent>
85 </PreBuildEvent>
86 <PostBuildEvent>
87 </PostBuildEvent>
88 </PropertyGroup>
89</Project>
diff --git a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
deleted file mode 100644
index 9a03b54..0000000
--- a/Common/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build
+++ /dev/null
@@ -1,42 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.Framework.Console" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.Framework.Console" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="ConsoleBase.cs" />
16 <include name="ConsoleCallbacksBase.cs" />
17 <include name="MainConsole.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="System.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>