diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim.Framework.Console/ConsoleBase.cs | 24 | ||||
-rw-r--r-- | OpenSim.Framework/Util.cs | 15 |
2 files changed, 13 insertions, 26 deletions
diff --git a/OpenSim.Framework.Console/ConsoleBase.cs b/OpenSim.Framework.Console/ConsoleBase.cs index c72af45..6a1c53c 100644 --- a/OpenSim.Framework.Console/ConsoleBase.cs +++ b/OpenSim.Framework.Console/ConsoleBase.cs | |||
@@ -19,25 +19,13 @@ namespace OpenSim.Framework.Console | |||
19 | StreamWriter Log; | 19 | StreamWriter Log; |
20 | public conscmd_callback cmdparser; | 20 | public conscmd_callback cmdparser; |
21 | public string componentname; | 21 | public string componentname; |
22 | private bool disableOutput; | 22 | private bool m_silent; |
23 | 23 | ||
24 | // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!! | 24 | public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent ) |
25 | // constype - the type of console to use (see enum ConsoleType) | ||
26 | // sparam - depending on the console type: | ||
27 | // TCP - the IP to bind to (127.0.0.1 if blank) | ||
28 | // Local - param ignored | ||
29 | // and for the iparam: | ||
30 | // TCP - the port to bind to | ||
31 | // Local - param ignored | ||
32 | // LogFile - duh | ||
33 | // componentname - which component of the OGS system? (user, asset etc) | ||
34 | // cmdparser - a reference to a conscmd_callback object | ||
35 | |||
36 | public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool disableSystemConsole ) | ||
37 | { | 25 | { |
38 | this.componentname = componentname; | 26 | this.componentname = componentname; |
39 | this.cmdparser = cmdparser; | 27 | this.cmdparser = cmdparser; |
40 | this.disableOutput = disableSystemConsole; | 28 | this.m_silent = silent; |
41 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); | 29 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); |
42 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); | 30 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); |
43 | Log = File.AppendText(LogFile); | 31 | Log = File.AppendText(LogFile); |
@@ -62,7 +50,7 @@ namespace OpenSim.Framework.Console | |||
62 | { | 50 | { |
63 | Log.WriteLine(format, args); | 51 | Log.WriteLine(format, args); |
64 | Log.Flush(); | 52 | Log.Flush(); |
65 | if(!disableOutput) | 53 | if(!m_silent) |
66 | { | 54 | { |
67 | System.Console.WriteLine(format, args); | 55 | System.Console.WriteLine(format, args); |
68 | } | 56 | } |
@@ -73,7 +61,7 @@ namespace OpenSim.Framework.Console | |||
73 | { | 61 | { |
74 | Log.WriteLine(format, args); | 62 | Log.WriteLine(format, args); |
75 | Log.Flush(); | 63 | Log.Flush(); |
76 | if (!disableOutput) | 64 | if (!m_silent) |
77 | { | 65 | { |
78 | System.Console.WriteLine(format, args); | 66 | System.Console.WriteLine(format, args); |
79 | } | 67 | } |
diff --git a/OpenSim.Framework/Util.cs b/OpenSim.Framework/Util.cs index 17ca611..5bf7ff9 100644 --- a/OpenSim.Framework/Util.cs +++ b/OpenSim.Framework/Util.cs | |||
@@ -36,15 +36,15 @@ namespace OpenSim.Framework.Utilities | |||
36 | return id; | 36 | return id; |
37 | } | 37 | } |
38 | 38 | ||
39 | public static int fast_distance2d(int x, int y) | 39 | //public static int fast_distance2d(int x, int y) |
40 | { | 40 | //{ |
41 | x = System.Math.Abs(x); | 41 | // x = System.Math.Abs(x); |
42 | y = System.Math.Abs(y); | 42 | // y = System.Math.Abs(y); |
43 | 43 | ||
44 | int min = System.Math.Min(x, y); | 44 | // int min = System.Math.Min(x, y); |
45 | 45 | ||
46 | return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | 46 | // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); |
47 | } | 47 | //} |
48 | 48 | ||
49 | public static string FieldToString(byte[] bytes) | 49 | public static string FieldToString(byte[] bytes) |
50 | { | 50 | { |
@@ -130,5 +130,4 @@ namespace OpenSim.Framework.Utilities | |||
130 | 130 | ||
131 | } | 131 | } |
132 | } | 132 | } |
133 | |||
134 | } | 133 | } |