aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorRobert Adams2015-09-08 04:54:16 -0700
committerRobert Adams2015-09-08 04:54:16 -0700
commite5367d822be9b05e74c859afe2d2956a3e95aa33 (patch)
treee904050a30715df587aa527d7f313755177726a7 /OpenSim/Region/CoreModules/Framework
parentadd lost admin_reset_land method (diff)
parentDeleted access control spec from [LoginService] section of standalone config.... (diff)
downloadopensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.zip
opensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.gz
opensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.bz2
opensim-SC_OLD-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.xz
Merge of ubitworkvarnew with opensim/master as of 20150905.
This integrates the OpenSim refactoring to make physics, etc into modules. AVN physics hasn't been moved to new location. Does not compile yet. Merge branch 'osmaster' into mbworknew1
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs3
-rwxr-xr-xOpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs181
5 files changed, 3 insertions, 186 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 9a57599..3cbde62 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -36,7 +36,7 @@ using OpenSim.Framework.Client;
36using OpenSim.Framework.Monitoring; 36using OpenSim.Framework.Monitoring;
37using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Region.Physics.Manager; 39using OpenSim.Region.PhysicsModules.SharedBase;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41 41
42using GridRegion = OpenSim.Services.Interfaces.GridRegion; 42using GridRegion = OpenSim.Services.Interfaces.GridRegion;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs
index 54ec751..e3c6c0d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs
@@ -38,7 +38,7 @@ using OpenSim.Framework.Capabilities;
38using OpenSim.Framework.Client; 38using OpenSim.Framework.Client;
39using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.Physics.Manager; 41using OpenSim.Region.PhysicsModules.SharedBase;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43using GridRegion = OpenSim.Services.Interfaces.GridRegion; 43using GridRegion = OpenSim.Services.Interfaces.GridRegion;
44 44
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index c64ab44..1d91165 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Data;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Serialization; 38using OpenSim.Framework.Serialization;
39using OpenSim.Framework.Serialization.External; 39using OpenSim.Framework.Serialization.External;
40using OpenSim.Framework.Communications;
41using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; 40using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
42using OpenSim.Region.CoreModules.Framework.InventoryAccess; 41using OpenSim.Region.CoreModules.Framework.InventoryAccess;
43using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
index d10c9b4..862f0b7 100644
--- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
@@ -30,7 +30,6 @@ using System.IO;
30using System.Reflection; 30using System.Reflection;
31 31
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Communications;
34 33
35using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; 34using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
36using OpenSim.Region.Framework; 35using OpenSim.Region.Framework;
@@ -159,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
159 } 158 }
160 159
161 RegionInfo regInfo = new RegionInfo(); 160 RegionInfo regInfo = new RegionInfo();
162 Scene m_MockScene = new Scene(regInfo, null); 161 Scene m_MockScene = new Scene(regInfo);
163 LocalInventoryService invService = new LocalInventoryService(lib); 162 LocalInventoryService invService = new LocalInventoryService(lib);
164 m_MockScene.RegisterModuleInterface<IInventoryService>(invService); 163 m_MockScene.RegisterModuleInterface<IInventoryService>(invService);
165 m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService); 164 m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService);
diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs
deleted file mode 100755
index a176958..0000000
--- a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.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 OpenSimulator 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;
30using System.Text;
31using log4net;
32
33namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging
34{
35 /// <summary>
36 /// Class for writing a high performance, high volume log file.
37 /// Sometimes, to debug, one has a high volume logging to do and the regular
38 /// log file output is not appropriate.
39 /// Create a new instance with the parameters needed and
40 /// call Write() to output a line. Call Close() when finished.
41 /// If created with no parameters, it will not log anything.
42 /// </summary>
43 public class LogWriter : IDisposable
44 {
45 public bool Enabled { get; private set; }
46
47 private string m_logDirectory = ".";
48 private int m_logMaxFileTimeMin = 5; // 5 minutes
49 public String LogFileHeader { get; set; }
50
51 private StreamWriter m_logFile = null;
52 private TimeSpan m_logFileLife;
53 private DateTime m_logFileEndTime;
54 private Object m_logFileWriteLock = new Object();
55 private bool m_flushWrite;
56
57 // set externally when debugging. If let 'null', this does not write any error messages.
58 public ILog ErrorLogger = null;
59 private string LogHeader = "[LOG WRITER]";
60
61 /// <summary>
62 /// Create a log writer that will not write anything. Good for when not enabled
63 /// but the write statements are still in the code.
64 /// </summary>
65 public LogWriter()
66 {
67 Enabled = false;
68 m_logFile = null;
69 }
70
71 /// <summary>
72 /// Create a log writer instance.
73 /// </summary>
74 /// <param name="dir">The directory to create the log file in. May be 'null' for default.</param>
75 /// <param name="headr">The characters that begin the log file name. May be 'null' for default.</param>
76 /// <param name="maxFileTime">Maximum age of a log file in minutes. If zero, will set default.</param>
77 /// <param name="flushWrite">Whether to do a flush after every log write. Best left off but
78 /// if one is looking for a crash, this is a good thing to turn on.</param>
79 public LogWriter(string dir, string headr, int maxFileTime, bool flushWrite)
80 {
81 m_logDirectory = dir == null ? "." : dir;
82
83 LogFileHeader = headr == null ? "log-" : headr;
84
85 m_logMaxFileTimeMin = maxFileTime;
86 if (m_logMaxFileTimeMin < 1)
87 m_logMaxFileTimeMin = 5;
88
89 m_logFileLife = new TimeSpan(0, m_logMaxFileTimeMin, 0);
90 m_logFileEndTime = DateTime.Now + m_logFileLife;
91
92 m_flushWrite = flushWrite;
93
94 Enabled = true;
95 }
96 // Constructor that assumes flushWrite is off.
97 public LogWriter(string dir, string headr, int maxFileTime) : this(dir, headr, maxFileTime, false)
98 {
99 }
100
101 public void Dispose()
102 {
103 this.Close();
104 }
105
106 public void Close()
107 {
108 Enabled = false;
109 if (m_logFile != null)
110 {
111 m_logFile.Close();
112 m_logFile.Dispose();
113 m_logFile = null;
114 }
115 }
116
117 public void Write(string line, params object[] args)
118 {
119 if (!Enabled) return;
120 Write(String.Format(line, args));
121 }
122
123 public void Flush()
124 {
125 if (!Enabled) return;
126 if (m_logFile != null)
127 {
128 m_logFile.Flush();
129 }
130 }
131
132 public void Write(string line)
133 {
134 if (!Enabled) return;
135 try
136 {
137 lock (m_logFileWriteLock)
138 {
139 DateTime now = DateTime.UtcNow;
140 if (m_logFile == null || now > m_logFileEndTime)
141 {
142 if (m_logFile != null)
143 {
144 m_logFile.Close();
145 m_logFile.Dispose();
146 m_logFile = null;
147 }
148
149 // First log file or time has expired, start writing to a new log file
150 m_logFileEndTime = now + m_logFileLife;
151 string path = (m_logDirectory.Length > 0 ? m_logDirectory
152 + System.IO.Path.DirectorySeparatorChar.ToString() : "")
153 + String.Format("{0}{1}.log", LogFileHeader, now.ToString("yyyyMMddHHmmss"));
154 m_logFile = new StreamWriter(File.Open(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite));
155 }
156 if (m_logFile != null)
157 {
158 StringBuilder buff = new StringBuilder(line.Length + 25);
159 buff.Append(now.ToString("yyyyMMddHHmmssfff"));
160 // buff.Append(now.ToString("yyyyMMddHHmmss"));
161 buff.Append(",");
162 buff.Append(line);
163 buff.Append("\r\n");
164 m_logFile.Write(buff.ToString());
165 if (m_flushWrite)
166 m_logFile.Flush();
167 }
168 }
169 }
170 catch (Exception e)
171 {
172 if (ErrorLogger != null)
173 {
174 ErrorLogger.ErrorFormat("{0}: FAILURE WRITING TO LOGFILE: {1}", LogHeader, e);
175 }
176 Enabled = false;
177 }
178 return;
179 }
180 }
181}