diff options
author | lbsa71 | 2007-03-27 08:10:15 +0000 |
---|---|---|
committer | lbsa71 | 2007-03-27 08:10:15 +0000 |
commit | a4fc6b5fbba7fd9a7b147b11a0d1c3ded1834d54 (patch) | |
tree | 560961306b9d80636d8ec976c05fcb8b54304f33 /OpenSim.RegionServer | |
parent | Heightfield needs fixing, or i'll re-implement it (probably actually the coll... (diff) | |
download | opensim-SC-a4fc6b5fbba7fd9a7b147b11a0d1c3ded1834d54.zip opensim-SC-a4fc6b5fbba7fd9a7b147b11a0d1c3ded1834d54.tar.gz opensim-SC-a4fc6b5fbba7fd9a7b147b11a0d1c3ded1834d54.tar.bz2 opensim-SC-a4fc6b5fbba7fd9a7b147b11a0d1c3ded1834d54.tar.xz |
* Now there's one Console class, and instead the apps responds to cmd's and show's
* Removed Golden Future TCP/SimChat options
* Moved Ode.NET.dll to bin and changed prebuild accordingly (due to Prebuild limitations)
* Normalized some namespaces
* Added FxCop project
* Added (temp disabled) Servers project (for great justice)
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/ConsoleCmds.cs | 0 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSim.RegionServer.csproj | 11 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSim.RegionServer.dll.build | 139 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 53 | ||||
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 2 | ||||
-rw-r--r-- | OpenSim.RegionServer/SimConsole.cs | 211 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 2 |
7 files changed, 131 insertions, 287 deletions
diff --git a/OpenSim.RegionServer/ConsoleCmds.cs b/OpenSim.RegionServer/ConsoleCmds.cs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/OpenSim.RegionServer/ConsoleCmds.cs | |||
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj index 2b19e20..2455f79 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj +++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj | |||
@@ -3,7 +3,7 @@ | |||
3 | <ProjectType>Local</ProjectType> | 3 | <ProjectType>Local</ProjectType> |
4 | <ProductVersion>8.0.50727</ProductVersion> | 4 | <ProductVersion>8.0.50727</ProductVersion> |
5 | <SchemaVersion>2.0</SchemaVersion> | 5 | <SchemaVersion>2.0</SchemaVersion> |
6 | <ProjectGuid>{A88526E3-397A-479D-93E1-8865F3336A87}</ProjectGuid> | 6 | <ProjectGuid>{4171D545-81F5-4C64-AD29-6D7414C38181}</ProjectGuid> |
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | 7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | 8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
9 | <ApplicationIcon></ApplicationIcon> | 9 | <ApplicationIcon></ApplicationIcon> |
@@ -82,19 +82,19 @@ | |||
82 | <ItemGroup> | 82 | <ItemGroup> |
83 | <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | 83 | <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> |
84 | <Name>OpenSim.Framework.Console</Name> | 84 | <Name>OpenSim.Framework.Console</Name> |
85 | <Project>{F5AD51E9-CF59-4C70-A586-CBD161EBB85F}</Project> | 85 | <Project>{7AED7536-7D6B-4E28-8016-B5A554C663B4}</Project> |
86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
87 | <Private>False</Private> | 87 | <Private>False</Private> |
88 | </ProjectReference> | 88 | </ProjectReference> |
89 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> | 89 | <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> |
90 | <Name>OpenSim.Physics.Manager</Name> | 90 | <Name>OpenSim.Physics.Manager</Name> |
91 | <Project>{12F74CC6-E820-4716-8A34-A7B67B9EB3CC}</Project> | 91 | <Project>{0AAA0EEB-1F2C-4B4B-9BFA-7C3E45BCD348}</Project> |
92 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 92 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
93 | <Private>False</Private> | 93 | <Private>False</Private> |
94 | </ProjectReference> | 94 | </ProjectReference> |
95 | <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> | 95 | <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> |
96 | <Name>OpenSim.Framework</Name> | 96 | <Name>OpenSim.Framework</Name> |
97 | <Project>{26E437F6-BA50-44CD-BB44-E911E25CA88C}</Project> | 97 | <Project>{90D4F7AF-D75E-4DE8-A0E1-70CC242B31A1}</Project> |
98 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | 98 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> |
99 | <Private>False</Private> | 99 | <Private>False</Private> |
100 | </ProjectReference> | 100 | </ProjectReference> |
@@ -103,6 +103,9 @@ | |||
103 | <Compile Include="AgentAssetUpload.cs"> | 103 | <Compile Include="AgentAssetUpload.cs"> |
104 | <SubType>Code</SubType> | 104 | <SubType>Code</SubType> |
105 | </Compile> | 105 | </Compile> |
106 | <Compile Include="ConsoleCmds.cs"> | ||
107 | <SubType>Code</SubType> | ||
108 | </Compile> | ||
106 | <Compile Include="Grid.cs"> | 109 | <Compile Include="Grid.cs"> |
107 | <SubType>Code</SubType> | 110 | <SubType>Code</SubType> |
108 | </Compile> | 111 | </Compile> |
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index dced3ae..37e4c3a 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build | |||
@@ -1,69 +1,70 @@ | |||
1 | <?xml version="1.0" ?> | 1 | <?xml version="1.0" ?> |
2 | <project name="OpenSim.RegionServer" default="build"> | 2 | <project name="OpenSim.RegionServer" default="build"> |
3 | <target name="build"> | 3 | <target name="build"> |
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | 4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> |
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | 5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> |
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | 6 | <copy todir="${project::get-base-directory()}/${build.dir}"> |
7 | <fileset basedir="${project::get-base-directory()}"> | 7 | <fileset basedir="${project::get-base-directory()}"> |
8 | </fileset> | 8 | </fileset> |
9 | </copy> | 9 | </copy> |
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | 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.RegionServer" dynamicprefix="true" > | 11 | <resources prefix="OpenSim.RegionServer" dynamicprefix="true" > |
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="AgentAssetUpload.cs" /> | 14 | <include name="AgentAssetUpload.cs" /> |
15 | <include name="Grid.cs" /> | 15 | <include name="ConsoleCmds.cs" /> |
16 | <include name="OpenSimApplication.cs" /> | 16 | <include name="Grid.cs" /> |
17 | <include name="OpenSimMain.cs" /> | 17 | <include name="OpenSimApplication.cs" /> |
18 | <include name="OpenSimRoot.cs" /> | 18 | <include name="OpenSimMain.cs" /> |
19 | <include name="QueItem.cs" /> | 19 | <include name="OpenSimRoot.cs" /> |
20 | <include name="SimClient.cs" /> | 20 | <include name="QueItem.cs" /> |
21 | <include name="SimConsole.cs" /> | 21 | <include name="SimClient.cs" /> |
22 | <include name="VersionInfo.cs" /> | 22 | <include name="SimConsole.cs" /> |
23 | <include name="Assets/AssetCache.cs" /> | 23 | <include name="VersionInfo.cs" /> |
24 | <include name="Assets/InventoryCache.cs" /> | 24 | <include name="Assets/AssetCache.cs" /> |
25 | <include name="CAPS/SimHttp.cs" /> | 25 | <include name="Assets/InventoryCache.cs" /> |
26 | <include name="UserServer/LocalUserProfileManager.cs" /> | 26 | <include name="CAPS/SimHttp.cs" /> |
27 | <include name="UserServer/LoginServer.cs" /> | 27 | <include name="types/Mesh.cs" /> |
28 | <include name="types/Mesh.cs" /> | 28 | <include name="types/Triangle.cs" /> |
29 | <include name="types/Triangle.cs" /> | 29 | <include name="UserServer/LocalUserProfileManager.cs" /> |
30 | <include name="world/Avatar.cs" /> | 30 | <include name="UserServer/LoginServer.cs" /> |
31 | <include name="world/AvatarAnimations.cs" /> | 31 | <include name="world/Avatar.cs" /> |
32 | <include name="world/Entity.cs" /> | 32 | <include name="world/AvatarAnimations.cs" /> |
33 | <include name="world/Primitive.cs" /> | 33 | <include name="world/Entity.cs" /> |
34 | <include name="world/ScriptEngine.cs" /> | 34 | <include name="world/Primitive.cs" /> |
35 | <include name="world/SurfacePatch.cs" /> | 35 | <include name="world/ScriptEngine.cs" /> |
36 | <include name="world/World.cs" /> | 36 | <include name="world/SurfacePatch.cs" /> |
37 | <include name="world/scripting/IScript.cs" /> | 37 | <include name="world/World.cs" /> |
38 | </sources> | 38 | <include name="world/scripting/IScript.cs" /> |
39 | <references basedir="${project::get-base-directory()}"> | 39 | </sources> |
40 | <lib> | 40 | <references basedir="${project::get-base-directory()}"> |
41 | <include name="${project::get-base-directory()}" /> | 41 | <lib> |
42 | <include name="${project::get-base-directory()}/${build.dir}" /> | 42 | <include name="${project::get-base-directory()}" /> |
43 | </lib> | 43 | <include name="${project::get-base-directory()}/${build.dir}" /> |
44 | <include name="System.dll" /> | 44 | </lib> |
45 | <include name="System.Xml.dll" /> | 45 | <include name="System.dll" /> |
46 | <include name="../bin/libsecondlife.dll" /> | 46 | <include name="System.Xml.dll" /> |
47 | <include name="../bin/Axiom.MathLib.dll" /> | 47 | <include name="../bin/libsecondlife.dll" /> |
48 | <include name="../bin/Db4objects.Db4o.dll" /> | 48 | <include name="../bin/Axiom.MathLib.dll" /> |
49 | <include name="../OpenSim.Framework.Console/${build.dir}/OpenSim.Framework.Console.dll" /> | 49 | <include name="../bin/Db4objects.Db4o.dll" /> |
50 | <include name="../OpenSim.Physics/Manager/${build.dir}/OpenSim.Physics.Manager.dll" /> | 50 | <include name="../OpenSim.Framework.Console/${build.dir}/OpenSim.Framework.Console.dll" /> |
51 | <include name="../OpenSim.Framework/${build.dir}/OpenSim.Framework.dll" /> | 51 | <include name="../OpenSim.Physics/Manager/${build.dir}/OpenSim.Physics.Manager.dll" /> |
52 | </references> | 52 | <include name="../OpenSim.Framework/${build.dir}/OpenSim.Framework.dll" /> |
53 | </csc> | 53 | </references> |
54 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> | 54 | </csc> |
55 | <mkdir dir="${project::get-base-directory()}/../bin/"/> | 55 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> |
56 | <copy todir="${project::get-base-directory()}/../bin/"> | 56 | <mkdir dir="${project::get-base-directory()}/../bin/"/> |
57 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | 57 | <copy todir="${project::get-base-directory()}/../bin/"> |
58 | <include name="*.dll"/> | 58 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > |
59 | <include name="*.exe"/> | 59 | <include name="*.dll"/> |
60 | </fileset> | 60 | <include name="*.exe"/> |
61 | </copy> | 61 | </fileset> |
62 | </target> | 62 | </copy> |
63 | <target name="clean"> | 63 | </target> |
64 | <delete dir="${bin.dir}" failonerror="false" /> | 64 | <target name="clean"> |
65 | <delete dir="${obj.dir}" failonerror="false" /> | 65 | <delete dir="${bin.dir}" failonerror="false" /> |
66 | </target> | 66 | <delete dir="${obj.dir}" failonerror="false" /> |
67 | <target name="doc" description="Creates documentation."> | 67 | </target> |
68 | </target> | 68 | <target name="doc" description="Creates documentation."> |
69 | </project> | 69 | </target> |
70 | </project> | ||
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index cb184e8..e26f200 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs | |||
@@ -48,7 +48,7 @@ using OpenSim.Physics.Manager; | |||
48 | 48 | ||
49 | namespace OpenSim | 49 | namespace OpenSim |
50 | { | 50 | { |
51 | public class OpenSimMain : OpenSimApplication | 51 | public class OpenSimMain : OpenSimApplication, conscmd_callback |
52 | { | 52 | { |
53 | private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); | 53 | private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); |
54 | private PhysicsManager physManager; | 54 | private PhysicsManager physManager; |
@@ -67,8 +67,12 @@ namespace OpenSim | |||
67 | public bool sandbox = false; | 67 | public bool sandbox = false; |
68 | public bool loginserver = false; | 68 | public bool loginserver = false; |
69 | 69 | ||
70 | protected ConsoleBase m_console; | ||
71 | |||
70 | public OpenSimMain() | 72 | public OpenSimMain() |
71 | { | 73 | { |
74 | m_console = new ConsoleBase("region-console.log", "Region", this); | ||
75 | OpenSim.Framework.Console.MainConsole.Instance = m_console; | ||
72 | } | 76 | } |
73 | 77 | ||
74 | public override void StartUp() | 78 | public override void StartUp() |
@@ -246,6 +250,53 @@ namespace OpenSim | |||
246 | { | 250 | { |
247 | OpenSimRoot.Instance.LocalWorld.Update(); | 251 | OpenSimRoot.Instance.LocalWorld.Update(); |
248 | } | 252 | } |
253 | |||
254 | public void RunCmd(string command, string[] cmdparams) | ||
255 | { | ||
256 | switch (command) | ||
257 | { | ||
258 | case "help": | ||
259 | m_console.WriteLine("show users - show info about connected users"); | ||
260 | m_console.WriteLine("shutdown - disconnect all clients and shutdown"); | ||
261 | m_console.WriteLine("regenerate - regenerate the sim's terrain"); | ||
262 | break; | ||
263 | |||
264 | case "show": | ||
265 | Show(cmdparams[0]); | ||
266 | break; | ||
267 | |||
268 | case "regenerate": | ||
269 | OpenSimRoot.Instance.LocalWorld.RegenerateTerrain(); | ||
270 | break; | ||
271 | |||
272 | case "shutdown": | ||
273 | OpenSimRoot.Instance.Shutdown(); | ||
274 | break; | ||
275 | } | ||
276 | } | ||
277 | |||
278 | public void Show(string ShowWhat) | ||
279 | { | ||
280 | switch (ShowWhat) | ||
281 | { | ||
282 | case "uptime": | ||
283 | m_console.WriteLine("OpenSim has been running since " + OpenSimRoot.Instance.startuptime.ToString()); | ||
284 | m_console.WriteLine("That is " + (DateTime.Now - OpenSimRoot.Instance.startuptime).ToString()); | ||
285 | break; | ||
286 | case "users": | ||
287 | OpenSim.world.Avatar TempAv; | ||
288 | m_console.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP")); | ||
289 | foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys) | ||
290 | { | ||
291 | if (OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar") | ||
292 | { | ||
293 | TempAv = (OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID]; | ||
294 | m_console.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); | ||
295 | } | ||
296 | } | ||
297 | break; | ||
298 | } | ||
299 | } | ||
249 | } | 300 | } |
250 | 301 | ||
251 | 302 | ||
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index c6a9407..d463c75 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -490,7 +490,7 @@ namespace OpenSim | |||
490 | } | 490 | } |
491 | } | 491 | } |
492 | 492 | ||
493 | //ServerConsole.MainConsole.Instance.WriteLine("OUT: \n" + Pack.ToString()); | 493 | //MainConsole.Instance.WriteLine("OUT: \n" + Pack.ToString()); |
494 | 494 | ||
495 | byte[] ZeroOutBuffer = new byte[4096]; | 495 | byte[] ZeroOutBuffer = new byte[4096]; |
496 | byte[] sendbuffer; | 496 | byte[] sendbuffer; |
diff --git a/OpenSim.RegionServer/SimConsole.cs b/OpenSim.RegionServer/SimConsole.cs index d6d5e44..e69de29 100644 --- a/OpenSim.RegionServer/SimConsole.cs +++ b/OpenSim.RegionServer/SimConsole.cs | |||
@@ -1,211 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) OpenSim project, http://sim.opensecondlife.org/ | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions are met: | ||
6 | * * Redistributions of source code must retain the above copyright | ||
7 | * notice, this list of conditions and the following disclaimer. | ||
8 | * * Redistributions in binary form must reproduce the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer in the | ||
10 | * documentation and/or other materials provided with the distribution. | ||
11 | * * Neither the name of the <organization> nor the | ||
12 | * names of its contributors may be used to endorse or promote products | ||
13 | * derived from this software without specific prior written permission. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY | ||
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Threading; | ||
32 | using System.IO; | ||
33 | using System.Net; | ||
34 | using libsecondlife; | ||
35 | using libsecondlife.Packets; | ||
36 | using OpenSim.Framework.Console; | ||
37 | |||
38 | namespace OpenSim | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Description of ServerConsole. | ||
42 | /// </summary> | ||
43 | public class SimConsole : ConsoleBase | ||
44 | { | ||
45 | |||
46 | private ConsoleType ConsType; | ||
47 | StreamWriter Log; | ||
48 | |||
49 | |||
50 | // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!! | ||
51 | // constype - the type of console to use (see enum ConsoleType) | ||
52 | // sparam - depending on the console type: | ||
53 | // TCP - the IP to bind to (127.0.0.1 if blank) | ||
54 | // Local - param ignored | ||
55 | // SimChat - the AgentID of this sim's admin | ||
56 | // and for the iparam: | ||
57 | // TCP - the port to bind to | ||
58 | // Local - param ignored | ||
59 | // SimChat - the chat channel to accept commands from | ||
60 | public SimConsole(ConsoleType constype, string sparam, int iparam) { | ||
61 | ConsType = constype; | ||
62 | switch(constype) { | ||
63 | case ConsoleType.Local: | ||
64 | |||
65 | Console.WriteLine("ServerConsole.cs - creating new local console"); | ||
66 | Console.WriteLine("Logs will be saved to current directory in opensim-console.log"); | ||
67 | Log=File.AppendText("opensim-console.log"); | ||
68 | Log.WriteLine("========================================================================"); | ||
69 | //Log.WriteLine("OpenSim " + VersionInfo.Version + " Started at " + DateTime.Now.ToString()); | ||
70 | break; | ||
71 | case ConsoleType.TCP: | ||
72 | break; | ||
73 | case ConsoleType.SimChat: | ||
74 | break; | ||
75 | |||
76 | default: | ||
77 | Console.WriteLine("ServerConsole.cs - what are you smoking? that isn't a valid console type!"); | ||
78 | break; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | public override void Close() { | ||
83 | Log.WriteLine("OpenSim shutdown at " + DateTime.Now.ToString()); | ||
84 | Log.Close(); | ||
85 | } | ||
86 | |||
87 | public override void Write(string format, params object[] args) | ||
88 | { | ||
89 | Log.Write(format, args); | ||
90 | Console.Write(format, args); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | public override void WriteLine(string format, params object[] args) | ||
95 | { | ||
96 | Log.WriteLine(format, args); | ||
97 | Console.WriteLine(format, args); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | public override string ReadLine() | ||
102 | { | ||
103 | string TempStr=Console.ReadLine(); | ||
104 | Log.WriteLine(TempStr); | ||
105 | return TempStr; | ||
106 | } | ||
107 | |||
108 | public override int Read() { | ||
109 | int TempInt= Console.Read(); | ||
110 | Log.Write((char)TempInt); | ||
111 | return TempInt; | ||
112 | } | ||
113 | |||
114 | // Displays a command prompt and waits for the user to enter a string, then returns that string | ||
115 | public override string CmdPrompt(string prompt) { | ||
116 | this.Write(prompt); | ||
117 | return this.ReadLine(); | ||
118 | } | ||
119 | |||
120 | // Displays a command prompt and returns a default value if the user simply presses enter | ||
121 | public override string CmdPrompt(string prompt, string defaultresponse) { | ||
122 | string temp=CmdPrompt(prompt); | ||
123 | if(temp=="") { | ||
124 | return defaultresponse; | ||
125 | } else { | ||
126 | return temp; | ||
127 | } | ||
128 | } | ||
129 | |||
130 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options | ||
131 | public override string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) { | ||
132 | bool itisdone=false; | ||
133 | string temp=CmdPrompt(prompt,defaultresponse); | ||
134 | while(itisdone==false) { | ||
135 | if((temp==OptionA) || (temp==OptionB)) { | ||
136 | itisdone=true; | ||
137 | } else { | ||
138 | this.WriteLine("Valid options are " + OptionA + " or " + OptionB); | ||
139 | temp=CmdPrompt(prompt,defaultresponse); | ||
140 | } | ||
141 | } | ||
142 | return temp; | ||
143 | } | ||
144 | |||
145 | // Runs a command with a number of parameters | ||
146 | public override Object RunCmd(string Cmd, string[] cmdparams) { | ||
147 | switch(Cmd) { | ||
148 | case "help": | ||
149 | this.WriteLine("show users - show info about connected users"); | ||
150 | this.WriteLine("shutdown - disconnect all clients and shutdown"); | ||
151 | this.WriteLine("regenerate - regenerate the sim's terrain"); | ||
152 | break; | ||
153 | |||
154 | case "show": | ||
155 | ShowCommands(cmdparams[0]); | ||
156 | break; | ||
157 | |||
158 | case "regenerate": | ||
159 | OpenSimRoot.Instance.LocalWorld.RegenerateTerrain(); | ||
160 | break; | ||
161 | |||
162 | case "shutdown": | ||
163 | OpenSimRoot.Instance.Shutdown(); | ||
164 | break; | ||
165 | } | ||
166 | return null; | ||
167 | } | ||
168 | |||
169 | // Shows data about something | ||
170 | public override void ShowCommands(string ShowWhat) { | ||
171 | switch(ShowWhat) { | ||
172 | case "uptime": | ||
173 | this.WriteLine("OpenSim has been running since " + OpenSimRoot.Instance.startuptime.ToString()); | ||
174 | this.WriteLine("That is " + (DateTime.Now-OpenSimRoot.Instance.startuptime).ToString()); | ||
175 | break; | ||
176 | case "users": | ||
177 | OpenSim.world.Avatar TempAv; | ||
178 | this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP")); | ||
179 | foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys) { | ||
180 | if(OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString()== "OpenSim.world.Avatar") | ||
181 | { | ||
182 | TempAv=(OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID]; | ||
183 | this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); | ||
184 | } | ||
185 | } | ||
186 | break; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | // Displays a prompt to the user and then runs the command they entered | ||
191 | public override void MainConsolePrompt() { | ||
192 | string[] tempstrarray; | ||
193 | string tempstr = this.CmdPrompt("OpenSim-" + OpenSimRoot.Instance.Cfg.RegionHandle.ToString() + " # "); | ||
194 | tempstrarray = tempstr.Split(' '); | ||
195 | string cmd=tempstrarray[0]; | ||
196 | Array.Reverse(tempstrarray); | ||
197 | Array.Resize<string>(ref tempstrarray,tempstrarray.Length-1); | ||
198 | Array.Reverse(tempstrarray); | ||
199 | string[] cmdparams=(string[])tempstrarray; | ||
200 | RunCmd(cmd,cmdparams); | ||
201 | } | ||
202 | |||
203 | |||
204 | public override void SetStatus(string status) | ||
205 | { | ||
206 | Console.Write( status + "\r" ); | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | |||
211 | |||
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 06a673a..e6d8921 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.world | |||
34 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); | 34 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); |
35 | TerrainManager = new TerrainManager(new SecondLife()); | 35 | TerrainManager = new TerrainManager(new SecondLife()); |
36 | Avatar.SetupTemplate("avatar-template.dat"); | 36 | Avatar.SetupTemplate("avatar-template.dat"); |
37 | // ServerConsole.MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); | 37 | // MainConsole.Instance.WriteLine("World.cs - Creating script engine instance"); |
38 | // Initialise this only after the world has loaded | 38 | // Initialise this only after the world has loaded |
39 | // Scripts = new ScriptEngine(this); | 39 | // Scripts = new ScriptEngine(this); |
40 | Avatar.LoadAnims(); | 40 | Avatar.LoadAnims(); |