Formatting cleanup.

0.6.0-stable
Jeff Ames 2008-08-18 00:39:10 +00:00
parent 531f6c01eb
commit 6ef9d4da90
208 changed files with 2980 additions and 3163 deletions

View File

@ -56,8 +56,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
public string Version { get { return m_version; } }
public string Name { get { return m_name; } }
public void Initialise()
{
public void Initialise()
{
m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -512,7 +512,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
Hashtable requestData = (Hashtable) request.Params[0];
// check completeness
checkStringParameters(request, new string[] { "password", "user_firstname",
"user_lastname", "user_password" });
@ -603,7 +603,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
Hashtable requestData = (Hashtable) request.Params[0];
// check completeness
checkStringParameters(request, new string[] { "password", "user_firstname",
"user_lastname" });
@ -616,7 +616,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
string firstname = (string) requestData["user_firstname"];
string lastname = (string) requestData["user_lastname"];
string passwd = String.Empty;
uint? regX = null;
uint? regY = null;
@ -632,7 +632,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (null == userProfile)
throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname));
if (null != passwd)
if (null != passwd)
{
string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(passwd) + ":" + String.Empty);
userProfile.PasswordHash = md5PasswdHash;
@ -648,7 +648,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname,
m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", firstname, lastname,
userProfile.ID);
}
catch (Exception e)

View File

@ -23,7 +23,6 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
@ -44,14 +43,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <summary>
/// This class represents the current REST request. It
/// encapsulates the request/response state and takes care
/// encapsulates the request/response state and takes care
/// of response generation without exposing the REST handler
/// to the actual mechanisms involved.
///
/// This structure is created on entry to the Handler
/// method and is disposed of upon return. It is part of
/// the plug-in infrastructure, rather than the functionally
/// specific REST handler, and fundamental changes to
/// specific REST handler, and fundamental changes to
/// this should be reflected in the Rest HandlerVersion. The
/// object is instantiated, and may be extended by, any
/// given handler. See the inventory handler for an example
@ -100,7 +99,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal bool chunked = false;
// Authentication related state
internal bool authenticated = false;
// internal string scheme = Rest.AS_DIGEST;
// internal string scheme = Rest.AS_BASIC;
@ -132,7 +131,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
private static readonly string[] EmptyPath = { String.Empty };
// Session related tables. These are only needed if QOP is set to "auth-sess"
// and for now at least, it is not. Session related authentication is of
// and for now at least, it is not. Session related authentication is of
// questionable merit in the context of REST anyway, but it is, arguably, more
// secure.
@ -148,27 +147,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
private static Regex schema = new Regex("^\\s*(?<scheme>\\w+)\\s*.*",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static Regex basicParms = new Regex("^\\s*(?:\\w+)\\s+(?<pval>\\S+)\\s*",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static Regex digestParm1 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*\"(?<pval>[^\"]+)\"",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static Regex digestParm2 = new Regex("\\s*(?<parm>\\w+)\\s*=\\s*(?<pval>[^\\p{P}\\s]+)",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static Regex reuserPass = new Regex("(?<user>[^:]+):(?<pass>[\\S\\s]*)",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
// For efficiency, we create static instances of these objects
private static MD5 md5hash = MD5.Create();
private static StringComparer sc = StringComparer.OrdinalIgnoreCase;
// Constructor
internal RequestData(OSHttpRequest p_request, OSHttpResponse p_response, string p_qprefix)
{
@ -203,7 +202,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal bool IsAuthenticated
{
get
{
{
if (Rest.Authenticate)
{
if (!authenticated)
@ -223,7 +222,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// Realm, domain, etc.
///
/// This method checks to see if the current request is already
/// authenticated for this domain. If it is, then it returns
/// authenticated for this domain. If it is, then it returns
/// true. If it is not, then it issues a challenge to the client
/// and responds negatively to the request.
/// </summary>
@ -243,7 +242,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.DebugFormat("{0} Challenge reason: No authorization data", MsgId);
DoChallenge();
}
// So, we have authentication data, now we have to check to
// see what we got and whether or not it is valid for the
// current domain. To do this we need to interpret the data
@ -327,7 +326,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
foreach (Match m in matches)
{
authparms.Add("response",m.Groups["pval"].Value);
Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}",
Rest.Log.DebugFormat("{0} Parameter matched : {1} = {2}",
MsgId, "response", m.Groups["pval"].Value);
}
@ -369,7 +368,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
foreach (Match m in matches)
{
authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value);
Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}",
Rest.Log.DebugFormat("{0} String Parameter matched : {1} = {2}",
MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value);
}
@ -380,7 +379,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
foreach (Match m in matches)
{
authparms.Add(m.Groups["parm"].Value,m.Groups["pval"].Value);
Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}",
Rest.Log.DebugFormat("{0} Tokenized Parameter matched : {1} = {2}",
MsgId, m.Groups["parm"].Value,m.Groups["pval"].Value);
}
@ -417,7 +416,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!authparms.TryGetValue("nonce", out nonce) || nonce == null)
{
Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: nonce missing", MsgId);
break;
}
@ -428,7 +427,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
if (temp != opaque)
{
Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: bad opaque value", MsgId);
break;
}
}
@ -440,7 +439,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
if (temp != algorithm)
{
Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: bad algorithm value", MsgId);
break;
}
}
@ -457,7 +456,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!authparms.ContainsKey("cnonce"))
{
Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: cnonce missing", MsgId);
break;
}
@ -465,7 +464,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!authparms.TryGetValue("nc", out nck) || nck == null)
{
Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: cnonce counter missing", MsgId);
break;
}
@ -477,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (Rest.Hex2Int(ncl) >= Rest.Hex2Int(nck))
{
Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: bad cnonce counter", MsgId);
break;
}
cntable[nonce] = nck;
@ -497,12 +496,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// these MUST NOT be present.
if (authparms.ContainsKey("cnonce"))
{
Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce", MsgId);
break;
}
if (authparms.ContainsKey("nc"))
{
Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId);
Rest.Log.WarnFormat("{0} Authentication failed: invalid cnonce counter[2]", MsgId);
break;
}
}
@ -511,7 +510,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
authenticated = ValidateDigest(userName, nonce, cnonce, nck, authPrefix, response);
}
}
while (false);
}
@ -608,7 +607,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
// We don;t know the userid that will be used
// so we cannot make any authentication domain
// so we cannot make any authentication domain
// assumptions. So the prefix will determine
// this.
@ -624,7 +623,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
/// <summary>
/// This method provides validation in support of the BASIC
/// This method provides validation in support of the BASIC
/// authentication method. This is not normaly expected to be
/// used, but is included for completeness (and because I tried
/// it first).
@ -650,11 +649,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <summary>
/// This mechanism is used by the digest authetnication mechanism
/// to return the user's password. In fact, because the OpenSim
/// user's passwords are already hashed, and the HTTP mechanism
/// does not supply an open password, the hashed passwords cannot
/// user's passwords are already hashed, and the HTTP mechanism
/// does not supply an open password, the hashed passwords cannot
/// be used unless the cliemt has used the same salting mechanism
/// to has the password before using it in the authentication
/// algorithn. This is not inconceivable...
/// to has the password before using it in the authentication
/// algorithm. This is not inconceivable...
/// </summary>
private string getPassword(string user)
@ -665,12 +664,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
string last;
// Distinguish the parts, if necessary
if ((x=user.IndexOf(Rest.C_SPACE)) != -1)
{
first = user.Substring(0,x);
last = user.Substring(x+1);
}
}
else
{
first = user;
@ -712,12 +711,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
string last;
// Distinguish the parts, if necessary
if ((x=user.IndexOf(Rest.C_SPACE)) != -1)
{
first = user.Substring(0,x);
last = user.Substring(x+1);
}
}
else
{
first = user;
@ -733,9 +732,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
HA1 = HashToString(pass);
HA1 = HashToString(String.Format("{0}:{1}",HA1,udata.PasswordSalt));
return (0 == sc.Compare(HA1, udata.PasswordHash));
}
// Validate the request-digest
@ -784,7 +783,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
HA2 = HashToString(patt);
// Generate Digest
if (qop != String.Empty)
{
patt = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, nonce, nck, cnonce, qop, HA2);
@ -856,7 +855,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Fail(code, message, true);
}
// More adventurous. This failure also includes a
// More adventurous. This failure also includes a
// specified entity.
internal void Fail(int code, string message, string data)
@ -899,7 +898,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
fail = true;
Respond("Failure response");
RestException re = new RestException(message+" <"+code+">");
re.statusCode = code;
@ -918,7 +917,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Fail(Rest.HttpStatusCodeNotImplemented, Rest.HttpStatusDescNotImplemented);
}
// This MUST be called by an agent handler before it returns
// This MUST be called by an agent handler before it returns
// control to Handle, otherwise the request will be ignored.
// This is called implciitly for the REST stream handlers and
// is harmless if it is called twice.
@ -962,7 +961,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.DebugFormat("{0} XML Response handler extension EXIT", MsgId);
}
// If buffer != null, then we assume that
// If buffer != null, then we assume that
// this has already been done some other
// way. For example, transfer encoding might
// have been done.
@ -997,7 +996,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
// Set the status code & description. If nothing has been stored,
// Set the status code & description. If nothing has been stored,
// we consider that a success.
if (statusCode == 0)
@ -1011,7 +1010,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// For a redirect we need to set the relocation header accordingly
if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect ||
if (response.StatusCode == (int) Rest.HttpStatusCodeTemporaryRedirect ||
response.StatusCode == (int) Rest.HttpStatusCodePermanentRedirect)
{
Rest.Log.DebugFormat("{0} Re-direct location is {1}", MsgId, redirectLocation);
@ -1031,7 +1030,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// We've left the setting of handled' until the
// last minute because the header settings included
// above are pretty harmless. But everything from
// here on down probably leaves the response
// here on down probably leaves the response
// element unusable by anyone else.
handled = true;
@ -1046,7 +1045,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (buffer != null && buffer.Length != 0)
{
Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>",
Rest.Log.DebugFormat("{0} Entity buffer, length = {1} : <{2}>",
MsgId, buffer.Length, encoding.GetString(buffer));
response.OutputStream.Write(buffer, 0, buffer.Length);
}
@ -1066,17 +1065,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// Add a header to the table. We need to allow
// multiple instances of many of the headers.
// If the
// If the
internal void AddHeader(string hdr, string data)
{
if (Rest.DEBUG)
{
Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>",
Rest.Log.DebugFormat("{0} Adding header: <{1}: {2}>",
MsgId, hdr, data);
if (response.Headers.Get(hdr) != null)
{
Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>",
Rest.Log.DebugFormat("{0} Multipe {1} headers will be generated>",
MsgId, hdr);
}
}
@ -1093,7 +1092,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.DebugFormat("{0} Removing header: <{1}>", MsgId, hdr);
if (response.Headers.Get(hdr) == null)
{
Rest.Log.DebugFormat("{0} No such header existed",
Rest.Log.DebugFormat("{0} No such header existed",
MsgId, hdr);
}
}
@ -1110,7 +1109,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
for (int i=0;i<response.Headers.Count;i++)
{
Rest.Log.DebugFormat("{0} Header[{1}] : {2}", MsgId, i,
Rest.Log.DebugFormat("{0} Header[{1}] : {2}", MsgId, i,
response.Headers.Get(i));
}
}
@ -1144,7 +1143,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// If we succeeded in getting a path, perform any
// additional pre-processing required.
if (path != null)
if (path != null)
{
if (Rest.ExtendedEscape)
{
@ -1182,14 +1181,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
parameters = new string[0];
}
// Generate a debug list of the decoded parameters
if (Rest.DEBUG && prfxlen < path.Length-1)
{
Rest.Log.DebugFormat("{0} URI: Parameters: {1}", MsgId, path.Substring(prfxlen));
for (int i = 0; i < parameters.Length; i++)
{
{
Rest.Log.DebugFormat("{0} Parameter[{1}]: {2}", MsgId, i, parameters[i]);
}
}
@ -1197,11 +1196,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
return parameters.Length;
}
internal string[] PathNodes
{
get
{
{
if (pathNodes == null)
{
initUrl();
@ -1209,10 +1208,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
return pathNodes;
}
}
internal string BuildUrl(int first, int last)
{
if (pathNodes == null)
{
initUrl();

View File

@ -23,7 +23,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*/
using System;
@ -42,7 +42,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public class Rest
{
internal static readonly log4net.ILog Log =
internal static readonly log4net.ILog Log =
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
internal static bool DEBUG = Log.IsDebugEnabled;
@ -106,7 +106,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// supported by all servers. See Respond
/// to see how these are handled.
/// </summary>
// REST AGENT 1.0 interpretations
public const string GET = "get"; // information retrieval - server state unchanged
public const string HEAD = "head"; // same as get except only the headers are returned.
@ -138,7 +138,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public static readonly char C_PERIOD = '.';
public static readonly char C_COMMA = ',';
public static readonly char C_DQUOTE = '"';
public static readonly string CS_SPACE = " ";
public static readonly string CS_SLASH = "/";
public static readonly string CS_PATHSEP = "/";
@ -147,7 +147,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public static readonly string CS_PERIOD = ".";
public static readonly string CS_COMMA = ",";
public static readonly string CS_DQUOTE = "\"";
public static readonly char[] CA_SPACE = { C_SPACE };
public static readonly char[] CA_SLASH = { C_SLASH };
public static readonly char[] CA_PATHSEP = { C_PATHSEP };
@ -311,7 +311,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public const string AS_DIGEST = "Digest";
/// Supported Digest algorithms
public const string Digest_MD5 = "MD5"; // assumedd efault if omitted
public const string Digest_MD5Sess = "MD5-sess";
@ -359,7 +359,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
int val = 0;
int sum = 0;
string tmp = null;
if (hex != null)
{
tmp = hex.ToLower();
@ -446,20 +446,20 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
if (i % 4 == 0) Console.Write(" ");
// if (i%16 == 0) Console.Write(" ");
Console.Write(" ");
Console.Write(" ");
buffer[i % Rest.DumpLineSize] = ' ';
}
Console.WriteLine(" |"+(new String(buffer))+"|");
}
else
{
Console.Write("\n");
Console.Write("\n");
}
}
}
// Local exception type
public class RestException : Exception
@ -470,8 +470,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal string httpmethod;
internal string httppath;
public RestException(string msg) : base(msg)
{
public RestException(string msg) : base(msg)
{
}
}

View File

@ -23,7 +23,6 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using libsecondlife;
@ -40,10 +39,8 @@ using OpenSim.Framework.Communications.Cache;
namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
public class RestAssetServices : IRest
{
private bool enabled = false;
private string qPrefix = "assets";
@ -52,7 +49,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public RestAssetServices()
{
Rest.Log.InfoFormat("{0} Asset services initializing", MsgId);
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
@ -73,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
enabled = true;
Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId);
}
// Post-construction, pre-enabled initialization opportunity
@ -84,7 +79,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
// Called by the plug-in to halt REST processing. Local processing is
// disabled, and control blocks until all current processing has
// disabled, and control blocks until all current processing has
// completed. No new processing will be started
public void Close()
@ -111,14 +106,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
private void DoAsset(RequestData rparm)
{
if (!enabled) return;
if (!enabled)
return;
AssetRequestData rdata = (AssetRequestData) rparm;
Rest.Log.DebugFormat("{0} REST Asset handler ENTRY", MsgId);
// Now that we know this is a serious attempt to
// Now that we know this is a serious attempt to
// access inventory data, we should find out who
// is asking, and make sure they are authorized
// to do so. We need to validate the caller's
@ -129,9 +124,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// With the present HTTP server we can't use the
// builtin authentication mechanisms because they
// would be enforced for all in-bound requests.
// Instead we look at the headers ourselves and
// Instead we look at the headers ourselves and
// handle authentication directly.
try
{
if (!rdata.IsAuthenticated)
@ -144,13 +139,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (e.statusCode == Rest.HttpStatusCodeNotAuthorized)
{
Rest.Log.WarnFormat("{0} User not authenticated", MsgId);
Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId,
Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId,
rdata.request.Headers.Get("Authorization"));
}
else
{
Rest.Log.ErrorFormat("{0} User authentication failed", MsgId);
Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId,
Rest.Log.DebugFormat("{0} Authorization header: {1}", MsgId,
rdata.request.Headers.Get("Authorization"));
}
throw (e);
@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
case "post" :
case "delete" :
default :
Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}",
Rest.Log.WarnFormat("{0} Asset: Method not supported: {1}",
MsgId, rdata.method);
rdata.Fail(Rest.HttpStatusCodeBadRequest,
Rest.HttpStatusDescBadRequest);
@ -194,7 +189,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
private void DoGet(AssetRequestData rdata)
{
bool istexture = false;
Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
@ -204,13 +198,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (rdata.parameters.Length == 1)
{
LLUUID uuid = new LLUUID(rdata.parameters[0]);
AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture);
if (asset != null)
{
Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.parameters[0]);
rdata.initXmlWriter();
@ -227,19 +219,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length);
rdata.writer.WriteFullEndElement();
}
else
{
Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path);
rdata.Fail(Rest.HttpStatusCodeNotFound,
rdata.Fail(Rest.HttpStatusCodeNotFound,
Rest.HttpStatusDescNotFound);
}
}
rdata.Complete();
rdata.Respond("Asset " + rdata.method + ": Normal completion");
}
private void DoPut(AssetRequestData rdata)
@ -257,7 +247,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!xml.ReadToFollowing("Asset"))
{
Rest.Log.DebugFormat("{0} Invalid request data: <{1}>", MsgId, rdata.path);
rdata.Fail(Rest.HttpStatusCodeBadRequest,
rdata.Fail(Rest.HttpStatusCodeBadRequest,
Rest.HttpStatusDescBadRequest);
}
@ -275,13 +265,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
else
{
Rest.Log.DebugFormat("{0} Invalid parameters: <{1}>", MsgId, rdata.path);
rdata.Fail(Rest.HttpStatusCodeNotFound,
rdata.Fail(Rest.HttpStatusCodeNotFound,
Rest.HttpStatusDescNotFound);
}
rdata.Complete();
rdata.Respond("Asset " + rdata.method + ": Normal completion");
}
internal class AssetRequestData : RequestData
@ -291,6 +280,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
}
}
}
}

View File

@ -23,7 +23,6 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
@ -37,7 +36,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
public class RestHandler : RestPlugin, IHttpAgentHandler
{
/// <remarks>
/// The handler delegates are not noteworthy. The allocator allows
/// a given handler to optionally subclass the base RequestData
@ -66,10 +64,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <summary>
/// This static initializer scans the ASSEMBLY for classes that
/// export the IRest interface and builds a list of them. These
/// are later activated by the handler. To add a new handler it
/// are later activated by the handler. To add a new handler it
/// is only necessary to create a new services class that implements
/// the IRest interface, and recompile the handler. This gives
/// all of the build-time flexibility of a modular approach
/// all of the build-time flexibility of a modular approach
/// while not introducing yet-another module loader. Note that
/// multiple assembles can still be built, each with its own set
/// of handlers. Examples of services classes are RestInventoryServices
@ -78,13 +76,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
static RestHandler()
{
Module[] mods = Assembly.GetExecutingAssembly().GetModules();
foreach (Module m in mods)
{
Type[] types = m.GetTypes();
foreach (Type t in types)
foreach (Type t in types)
{
try
{
@ -100,7 +97,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
}
}
}
#endregion local static state
@ -109,13 +105,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <summary>
/// This routine loads all of the handlers discovered during
/// instance initialization.
/// instance initialization.
/// A table of all loaded and successfully constructed handlers
/// is built, and this table is then used by the constructor to
/// initialize each of the handlers in turn.
/// NOTE: The loading process does not automatically imply that
/// the handler has registered any kind of an interface, that
/// may be (optionally) done by the handler either during
/// the handler has registered any kind of an interface, that
/// may be (optionally) done by the handler either during
/// construction, or during initialization.
///
/// I was not able to make this code work within a constructor
@ -128,7 +124,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
if (!handlersLoaded)
{
ConstructorInfo ci;
Object ht;
@ -159,8 +154,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// Name is used to differentiate the message header.
public override string Name
{
public override string Name
{
get { return "HANDLER"; }
}
@ -173,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// We have to rename these because we want
// to be able to share the values with other
// classes in our assembly and the base
// classes in our assembly and the base
// names are protected.
internal string MsgId
@ -203,7 +198,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
try
{
// This plugin will only be enabled if the broader
// REST plugin mechanism is enabled.
@ -214,7 +208,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// IsEnabled is implemented by the base class and
// reflects an overall RestPlugin status
if (!IsEnabled)
if (!IsEnabled)
{
Rest.Log.WarnFormat("{0} Plugins are disabled", MsgId);
return;
@ -263,15 +257,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.DumpLineSize);
}
// Load all of the handlers present in the
// Load all of the handlers present in the
// assembly
// In principle, as we're an application plug-in,
// most of what needs to be done could be done using
// static resources, however the Open Sim plug-in
// model makes this an instance, so that's what we
// static resources, however the Open Sim plug-in
// model makes this an instance, so that's what we
// need to be.
// There is only one Communications manager per
// There is only one Communications manager per
// server, and by inference, only one each of the
// user, asset, and inventory servers. So we can cache
// those using a static initializer.
@ -314,13 +308,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message);
}
}
/// <summary>
/// In the interests of efficiency, and because we cannot determine whether
/// or not this instance will actually be harvested, we clobber the only
/// anchoring reference to the working state for this plug-in. What the
/// anchoring reference to the working state for this plug-in. What the
/// call to close does is irrelevant to this class beyond knowing that it
/// can nullify the reference when it returns.
/// To make sure everything is copacetic we make sure the primary interface
@ -329,7 +322,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public override void Close()
{
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
try
@ -337,12 +329,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
RemoveAgentHandler(Rest.Name, this);
}
catch (KeyNotFoundException){}
foreach (IRest handler in handlers)
{
handler.Close();
}
}
#endregion overriding methods
@ -380,7 +371,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
return true;
}
}
}
catch (Exception e)
{
@ -414,7 +404,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
for (int i = 0; i < request.Headers.Count; i++)
{
Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>",
Rest.Log.DebugFormat("{0} Header [{1}] : <{2}> = <{3}>",
MsgId, i, request.Headers.GetKey(i), request.Headers.Get(i));
}
Rest.Log.DebugFormat("{0} URI: {1}", MsgId, request.RawUrl);
@ -425,8 +415,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
try
{
handled = ( FindPathHandler(request, response) ||
FindStreamHandler(request, response) );
handled = FindPathHandler(request, response) ||
FindStreamHandler(request, response);
}
catch (Exception e)
{
@ -440,7 +430,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.DebugFormat("{0} EXIT", MsgId);
return handled;
}
#endregion interface methods
@ -488,7 +477,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
}
return rdata.handled;
}
/// <summary>
@ -501,13 +489,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public void AddStreamHandler(string httpMethod, string path, RestMethod method)
{
if (!IsEnabled)
{
return;
}
if (!path.StartsWith(Rest.Prefix))
if (!path.StartsWith(Rest.Prefix))
{
path = String.Format("{0}{1}", Rest.Prefix, path);
}
@ -525,7 +512,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path);
}
}
/// <summary>
@ -540,10 +526,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response)
{
RequestData rdata = null;
string bestMatch = null;
if (!IsEnabled)
{
return false;
@ -566,7 +551,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
if (!String.IsNullOrEmpty(bestMatch))
{
rdata = pathAllocators[bestMatch](request, response);
Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch);
@ -575,7 +559,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
pathHandlers[bestMatch](rdata);
}
// A plugin generated error indicates a request-related error
// that has been handled by the plugin.
@ -583,11 +567,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message);
}
}
return (rdata == null) ? false : rdata.handled;
}
/// <summary>
@ -597,7 +579,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra)
{
if (!IsEnabled)
{
return;
@ -619,8 +600,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
pathHandlers.Add(path, mh);
pathAllocators.Add(path, ra);
}
}
}

View File

@ -57,7 +57,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
_xmlNs = new XmlSerializerNamespaces();
_xmlNs.Add(String.Empty, String.Empty);
}
#region overriding properties
public override string Name
{
@ -90,7 +90,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
return;
}
m_log.InfoFormat("{0} REST region plugin enabled", MsgID);
// add REST method handlers
AddRestStreamHandler("GET", "/regions/", GetHandler);
AddRestStreamHandler("POST", "/regions/", PostHandler);

View File

@ -39,7 +39,7 @@ namespace OpenSim.Data
public abstract DataResponse AddProfile(RegionProfileData profile);
public abstract ReservationData GetReservationAtPoint(uint x, uint y);
public abstract DataResponse UpdateProfile(RegionProfileData profile);
public abstract void Initialise();
public abstract void Initialise(string connect);
public abstract void Dispose();

View File

@ -47,7 +47,7 @@ namespace OpenSim.Data
/// Initialises the interface
/// </summary>
void Initialise(string connect);
/// <summary>
/// Returns a sim profile from a regionHandle
/// </summary>
@ -100,7 +100,7 @@ namespace OpenSim.Data
ReservationData GetReservationAtPoint(uint x, uint y);
}
public class GridDataInitialiser : PluginInitialiserBase
{
private string connect;

View File

@ -73,7 +73,7 @@ namespace OpenSim.Data
/// </summary>
void Initialise(string connect);
}
public class LogDataInitialiser : PluginInitialiserBase
{
private string connect;

View File

@ -63,7 +63,7 @@ namespace OpenSim.Data.MSSQL
database.ExecuteResourceSql("CreateAssetsTable.sql");
return;
}
}
/// <summary>
@ -230,7 +230,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
/// Database provider version.
/// Database provider version.
/// </summary>
override public string Version
{
@ -238,7 +238,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
/// The name of this DB provider.
/// The name of this DB provider.
/// </summary>
override public string Name
{

View File

@ -51,8 +51,8 @@ namespace OpenSim.Data.MSSQL
private string m_regionsTableName;
override public void Initialise()
{
override public void Initialise()
{
m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -87,7 +87,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
///
///
/// </summary>
private void TestTables()
{
@ -114,7 +114,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
/// The name of this DB provider.
/// The name of this DB provider.
/// </summary>
/// <returns>A string containing the storage system name</returns>
override public string Name
@ -123,7 +123,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
/// Database provider version.
/// Database provider version.
/// </summary>
/// <returns>A string containing the storage system version</returns>
override public string Version
@ -209,7 +209,7 @@ namespace OpenSim.Data.MSSQL
{
return database.getRegionRow(reader);
}
}
catch (Exception e)
{

View File

@ -40,14 +40,14 @@ namespace OpenSim.Data.MSSQL
internal class MSSQLLogData : ILogDataPlugin
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The database manager
/// </summary>
public MSSQLManager database;
public void Initialise()
{
public void Initialise()
{
m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}

View File

@ -60,7 +60,7 @@ namespace OpenSim.Data.MSSQL
builder.UserID = userId;
builder.Password = password;
builder.ApplicationName = Assembly.GetEntryAssembly().Location;
connectionString = builder.ToString();
}
@ -117,7 +117,7 @@ namespace OpenSim.Data.MSSQL
//}
/// <summary>
///
///
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
@ -376,7 +376,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
///
///
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
@ -492,7 +492,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
///
///
/// </summary>
/// <param name="name"></param>
/// <returns></returns>

View File

@ -52,8 +52,8 @@ namespace OpenSim.Data.MSSQL
private string m_usersTableName;
private string m_userFriendsTableName;
public override void Initialise()
{
public override void Initialise()
{
m_log.Info("[MSSQLUserData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -99,11 +99,11 @@ namespace OpenSim.Data.MSSQL
TestTables();
}
public override void Dispose () {}
public override void Dispose () {}
/// <summary>
///
///
/// </summary>
/// <returns></returns>
private bool TestTables()
@ -205,7 +205,7 @@ namespace OpenSim.Data.MSSQL
{
adder.ExecuteNonQuery();
}
using (IDbCommand adder =
database.Query(
"INSERT INTO " + m_userFriendsTableName + " " +
@ -351,7 +351,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
///
///
/// </summary>
/// <param name="queryID"></param>
/// <param name="query"></param>
@ -379,7 +379,7 @@ namespace OpenSim.Data.MSSQL
user.firstName = (string)reader["username"];
user.lastName = (string)reader["lastname"];
returnlist.Add(user);
}
}
}
}
catch (Exception e)
@ -406,7 +406,7 @@ namespace OpenSim.Data.MSSQL
returnlist.Add(user);
}
}
}
}
catch (Exception e)
{
m_log.Error(e.ToString());

View File

@ -36,7 +36,7 @@ using log4net;
namespace OpenSim.Data
{
/// <summary>
/// <summary>
///
/// The Migration theory is based on the ruby on rails concept.
/// Each database driver is going to be allowed to have files in
@ -77,11 +77,11 @@ namespace OpenSim.Data
// private string _subtype;
private Assembly _assem;
private Regex _match;
private static readonly string _migrations_create = "create table migrations(name varchar(100), version int)";
// private static readonly string _migrations_init = "insert into migrations values('migrations', 1)";
// private static readonly string _migrations_find = "select version from migrations where name='migrations'";
public Migration(DbConnection conn, Assembly assem, string type)
{
_type = type;
@ -105,7 +105,7 @@ namespace OpenSim.Data
// clever, eh, we figure out which migrations version we are
int migration_version = FindVersion("migrations");
if (migration_version > 0)
if (migration_version > 0)
return;
// If not, create the migration tables
@ -130,14 +130,14 @@ namespace OpenSim.Data
m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!");
DbCommand cmd = _conn.CreateCommand();
foreach (KeyValuePair<int, string> kvp in migrations)
foreach (KeyValuePair<int, string> kvp in migrations)
{
int newversion = kvp.Key;
cmd.CommandText = kvp.Value;
// we need to up the command timeout to infinite as we might be doing long migrations.
cmd.CommandTimeout = 0;
cmd.ExecuteNonQuery();
if (version == 0)
{
InsertVersion(_type, newversion);
@ -158,7 +158,7 @@ namespace OpenSim.Data
// foreach (string s in names)
// {
// Match m = _match.Match(s);
// if (m.Success)
// if (m.Success)
// {
// int MigrationVersion = int.Parse(m.Groups[1].ToString());
// if (MigrationVersion > max)
@ -168,10 +168,10 @@ namespace OpenSim.Data
// return max;
// }
public int Version
public int Version
{
get { return FindVersion(_type); }
set {
set {
if (Version < 1)
{
InsertVersion(_type, value);
@ -179,11 +179,11 @@ namespace OpenSim.Data
else
{
UpdateVersion(_type, value);
}
}
}
}
private int FindVersion(string type)
private int FindVersion(string type)
{
int version = 0;
DbCommand cmd = _conn.CreateCommand();
@ -206,22 +206,22 @@ namespace OpenSim.Data
return version;
}
private void InsertVersion(string type, int version)
private void InsertVersion(string type, int version)
{
DbCommand cmd = _conn.CreateCommand();
cmd.CommandText = "insert into migrations(name, version) values('" + type + "', " + version + ")";
m_log.InfoFormat("[MIGRATIONS] Creating {0} at version {1}", type, version);
cmd.ExecuteNonQuery();
}
private void UpdateVersion(string type, int version)
private void UpdateVersion(string type, int version)
{
DbCommand cmd = _conn.CreateCommand();
cmd.CommandText = "update migrations set version=" + version + " where name='" + type + "'";
m_log.InfoFormat("[MIGRATIONS] Updating {0} to version {1}", type, version);
cmd.ExecuteNonQuery();
}
// private SortedList<int, string> GetAllMigrations()
// {
// return GetMigrationsAfter(0);
@ -261,4 +261,4 @@ namespace OpenSim.Data
return migrations;
}
}
}
}

View File

@ -144,11 +144,11 @@ namespace OpenSim.Data.MySQL
_dbConnection.GetTableVersion(tableList);
// if there is no table, return, migrations will handle it.
if (tableList["assets"] == null)
if (tableList["assets"] == null)
return;
// if there is a table, and we don't have a migration, set it to 1
if (m.Version == 0)
if (m.Version == 0)
m.Version = 1;
}
@ -272,12 +272,12 @@ namespace OpenSim.Data.MySQL
lock (_dbConnection)
{
_dbConnection.CheckConnection();
MySqlCommand cmd =
new MySqlCommand(
"SELECT id FROM assets WHERE id=?id",
_dbConnection.Connection);
cmd.Parameters.AddWithValue("?id", uuid.ToString());
try

View File

@ -51,7 +51,7 @@ namespace OpenSim.Data.MySQL
private string m_connectionString;
private long m_waitTimeout;
private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond;
private long m_lastConnectionUse;
private long m_lastConnectionUse;
private FieldInfo[] m_Fields;
private Dictionary<string, FieldInfo> m_FieldMap =
@ -83,13 +83,13 @@ namespace OpenSim.Data.MySQL
}
m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString);
//m_log.Info("[ESTATE DB]: MySql - connecting: "+m_connectionString);
m_connection = new MySqlConnection(m_connectionString);
m_connection.Open();
GetWaitTimeout();
GetWaitTimeout();
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_connection, assem, "EstateStore");
@ -106,7 +106,7 @@ namespace OpenSim.Data.MySQL
m_FieldMap[f.Name.Substring(2)] = f;
}
}
private string[] FieldList
{
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
@ -116,28 +116,28 @@ namespace OpenSim.Data.MySQL
{
MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect,
m_connection);
using (MySqlDataReader dbReader =
cmd.ExecuteReader(CommandBehavior.SingleRow))
{
if (dbReader.Read())
{
m_waitTimeout
m_waitTimeout
= Convert.ToInt32(dbReader["@@wait_timeout"]) *
TimeSpan.TicksPerSecond + m_waitTimeoutLeeway;
}
}
dbReader.Close();
cmd.Dispose();
}
}
m_lastConnectionUse = System.DateTime.Now.Ticks;
m_log.DebugFormat(
"[REGION DB]: Connection wait timeout {0} seconds",
m_waitTimeout / TimeSpan.TicksPerSecond);
m_waitTimeout / TimeSpan.TicksPerSecond);
}
protected void CheckConnection()
{
long timeNow = System.DateTime.Now.Ticks;
@ -145,17 +145,17 @@ namespace OpenSim.Data.MySQL
m_connection.State != ConnectionState.Open)
{
m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting");
lock (m_connection)
{
m_connection.Close();
m_connection = new MySqlConnection(m_connectionString);
m_connection.Open();
m_connection.Open();
}
}
m_lastConnectionUse = timeNow;
}
m_lastConnectionUse = timeNow;
}
public EstateSettings LoadEstateSettings(LLUUID regionID)
{
@ -210,7 +210,7 @@ namespace OpenSim.Data.MySQL
names.Remove("EstateID");
sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( ?"+String.Join(", ?", names.ToArray())+")";
cmd.CommandText = sql;
cmd.Parameters.Clear();
@ -318,7 +318,7 @@ namespace OpenSim.Data.MySQL
es.ClearBans();
CheckConnection();
MySqlCommand cmd = m_connection.CreateCommand();
cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID";
@ -344,18 +344,18 @@ namespace OpenSim.Data.MySQL
private void SaveBanList(EstateSettings es)
{
CheckConnection();
MySqlCommand cmd = m_connection.CreateCommand();
cmd.CommandText = "delete from estateban where EstateID = ?EstateID";
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( ?EstateID, ?bannedUUID )";
foreach (EstateBan b in es.EstateBans)
{
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
@ -369,18 +369,18 @@ namespace OpenSim.Data.MySQL
void SaveUUIDList(uint EstateID, string table, LLUUID[] data)
{
CheckConnection();
MySqlCommand cmd = m_connection.CreateCommand();
cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID";
cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString());
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( ?EstateID, ?uuid )";
foreach (LLUUID uuid in data)
{
cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString());
@ -396,7 +396,7 @@ namespace OpenSim.Data.MySQL
List<LLUUID> uuids = new List<LLUUID>();
CheckConnection();
MySqlCommand cmd = m_connection.CreateCommand();
cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID";
@ -414,7 +414,7 @@ namespace OpenSim.Data.MySQL
uuids.Add(uuid);
}
r.Close();
return uuids.ToArray();
}
}

View File

@ -49,8 +49,8 @@ namespace OpenSim.Data.MySQL
/// </summary>
private MySQLManager database;
override public void Initialise()
{
override public void Initialise()
{
m_log.Info("[MySQLGridData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -253,7 +253,7 @@ namespace OpenSim.Data.MySQL
return null;
}
}
/// <summary>
/// Returns a sim profile from it's UUID
/// </summary>

View File

@ -48,8 +48,8 @@ namespace OpenSim.Data.MySQL
/// </summary>
private MySQLManager database;
public void Initialise()
{
public void Initialise()
{
m_log.Info("[MySQLInventoryData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -81,7 +81,7 @@ namespace OpenSim.Data.MySQL
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
database =
new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
settingPort);
@ -147,7 +147,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="conn">MySQL connection handler</param>
/// <param name="m"></param>
@ -180,7 +180,7 @@ namespace OpenSim.Data.MySQL
// ... and set the version
if (m.Version == 0)
m.Version = 1;
}
#endregion
@ -290,7 +290,7 @@ namespace OpenSim.Data.MySQL
}
}
/// <summary>
/// see <see cref="InventoryItemBase.getUserRootFolder"/>
/// </summary>
@ -708,10 +708,10 @@ namespace OpenSim.Data.MySQL
* - We will only need to hit the database twice instead of n times.
* - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned
* by the same person, each user only has 1 inventory heirarchy
* - The returned list is not ordered, instead of breadth-first ordered
* - The returned list is not ordered, instead of breadth-first ordered
There are basically 2 usage cases for getFolderHeirarchy:
1) Getting the user's entire inventory heirarchy when they log in
2) Finding a subfolder heirarchy to delete when emptying the trash.
2) Finding a subfolder heirarchy to delete when emptying the trash.
This implementation will pull all inventory folders from the database, and then prune away any folder that
is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the
database than to make n requests. This pays off only if requested heirarchy is large.
@ -774,7 +774,7 @@ namespace OpenSim.Data.MySQL
while (reader.Read())
{
InventoryFolderBase curFolder = readInventoryFolder(reader);
if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling
if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling
hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list
else // else current folder has no known (yet) siblings
{

View File

@ -44,12 +44,12 @@ namespace OpenSim.Data.MySQL
/// </summary>
public MySQLManager database;
public void Initialise()
{
public void Initialise()
{
m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
/// <summary>
/// Artificial constructor called when the plugin is loaded
/// Uses the obsolete mysql_connection.ini if connect string is empty.
@ -100,7 +100,7 @@ namespace OpenSim.Data.MySQL
Dictionary<string, string> tableList = new Dictionary<string, string>();
tableList["logs"] = null;
database.GetTableVersion(tableList);
// migrations will handle it
if (tableList["logs"] == null)
return;

View File

@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL
private string connectionString;
private const string m_waitTimeoutSelect = "select @@wait_timeout";
/// <summary>
/// Wait timeout for our connection in ticks.
/// </summary>
@ -70,7 +70,7 @@ namespace OpenSim.Data.MySQL
/// <summary>
/// Holds the last tick time that the connection was used.
/// </summary>
private long m_lastConnectionUse;
private long m_lastConnectionUse;
/// <summary>
/// Initialises and creates a new MySQL connection and maintains it.
@ -172,7 +172,7 @@ namespace OpenSim.Data.MySQL
// inaccuracy.
m_lastConnectionUse = timeNow;
}
/// <summary>
/// Get the connection being used
/// </summary>
@ -287,14 +287,14 @@ namespace OpenSim.Data.MySQL
{
lock (dbcon)
{
CheckConnection();
CheckConnection();
MySqlCommand tablesCmd =
new MySqlCommand(
"SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname",
dbcon);
tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database);
using (MySqlDataReader tables = tablesCmd.ExecuteReader())
{
while (tables.Read())
@ -541,7 +541,7 @@ namespace OpenSim.Data.MySQL
LLUUID regionID = LLUUID.Zero;
LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero
retval.HomeRegionID = regionID;
retval.Created = Convert.ToInt32(reader["created"].ToString());
retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
@ -1124,7 +1124,7 @@ namespace OpenSim.Data.MySQL
sql += "?skirt_item, ?skirt_asset)";
bool returnval = false;
// we want to send in byte data, which means we can't just pass down strings
try {
MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand();
@ -1160,7 +1160,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString());
cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString());
cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString());
if (cmd.ExecuteNonQuery() > 0)
returnval = true;

View File

@ -53,27 +53,27 @@ namespace OpenSim.Data.MySQL
private const string m_terrainSelect = "select * from terrain limit 1";
private const string m_landSelect = "select * from land";
private const string m_landAccessListSelect = "select * from landaccesslist";
private const string m_regionSettingsSelect = "select * from regionsettings";
private const string m_regionSettingsSelect = "select * from regionsettings";
private const string m_waitTimeoutSelect = "select @@wait_timeout";
private MySqlConnection m_connection;
private string m_connectionString;
/// <summary>
/// Wait timeout for our connection in ticks.
/// </summary>
private long m_waitTimeout;
/// <summary>
/// Make our storage of the timeout this amount smaller than it actually is, to give us a margin on long
/// running database operations.
/// </summary>
private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond;
/// <summary>
/// Holds the last tick time that the connection was used.
/// </summary>
private long m_lastConnectionUse;
private long m_lastConnectionUse;
private DataSet m_dataSet;
private MySqlDataAdapter m_primDataAdapter;
@ -105,7 +105,7 @@ namespace OpenSim.Data.MySQL
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
m_dataSet = new DataSet();
int passPosition = 0;
@ -132,8 +132,8 @@ namespace OpenSim.Data.MySQL
m_log.Info("[REGION DB]: MySql - connecting: " + displayConnectionString);
m_connection = new MySqlConnection(m_connectionString);
m_connection.Open();
GetWaitTimeout();
GetWaitTimeout();
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
@ -177,12 +177,11 @@ namespace OpenSim.Data.MySQL
m_dataSet.Tables.Add(m_shapeTable);
SetupShapeCommands(m_shapeDataAdapter, m_connection);
m_shapeDataAdapter.Fill(m_shapeTable);
m_itemsTable = createItemsTable();
m_dataSet.Tables.Add(m_itemsTable);
SetupItemsCommands(m_itemsDataAdapter, m_connection);
m_itemsDataAdapter.Fill(m_itemsTable);
m_itemsTable = createItemsTable();
m_dataSet.Tables.Add(m_itemsTable);
SetupItemsCommands(m_itemsDataAdapter, m_connection);
m_itemsDataAdapter.Fill(m_itemsTable);
m_terrainTable = createTerrainTable();
m_dataSet.Tables.Add(m_terrainTable);
@ -205,58 +204,58 @@ namespace OpenSim.Data.MySQL
m_regionSettingsDataAdapter.Fill(m_regionSettingsTable);
}
}
/// <summary>
/// Get the wait_timeout value for our connection
/// </summary>
protected void GetWaitTimeout()
{
MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, m_connection);
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
{
if (dbReader.Read())
{
m_waitTimeout
m_waitTimeout
= Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway;
}
}
dbReader.Close();
cmd.Dispose();
}
}
m_lastConnectionUse = System.DateTime.Now.Ticks;
m_log.DebugFormat(
"[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond);
"[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond);
}
/// <summary>
/// Should be called before any db operation. This checks to see if the connection has not timed out
/// </summary>
protected void CheckConnection()
{
//m_log.Debug("[REGION DB]: Checking connection");
long timeNow = System.DateTime.Now.Ticks;
if (timeNow - m_lastConnectionUse > m_waitTimeout || m_connection.State != ConnectionState.Open)
{
m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting");
lock (m_connection)
{
m_connection.Close();
m_connection = new MySqlConnection(m_connectionString);
m_connection.Open();
m_connection.Open();
}
}
// Strictly, we should set this after the actual db operation. But it's more convenient to set here rather
// than require the code to call another method - the timeout leeway should be large enough to cover the
// inaccuracy.
m_lastConnectionUse = timeNow;
}
m_lastConnectionUse = timeNow;
}
/// <summary>
/// Given a list of tables, return the version of the tables, as seen in the database
/// </summary>
@ -271,7 +270,7 @@ namespace OpenSim.Data.MySQL
"SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname",
dbcon);
tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database);
CheckConnection();
using (MySqlDataReader tables = tablesCmd.ExecuteReader())
{
@ -465,7 +464,7 @@ namespace OpenSim.Data.MySQL
lock (m_dataSet)
{
CheckConnection();
CheckConnection();
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
m_log.Info("[REGION DB]: " +
"Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
@ -587,10 +586,10 @@ namespace OpenSim.Data.MySQL
using (cmd)
{
delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
CheckConnection();
delete.ExecuteNonQuery();
cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
cmd.Parameters.Add(new MySqlParameter("?Revision", revision));
cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter)));
@ -774,7 +773,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="regionUUID"></param>
/// <returns></returns>
@ -805,7 +804,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
public void Commit()
{
@ -845,7 +844,7 @@ namespace OpenSim.Data.MySQL
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
@ -1139,7 +1138,7 @@ namespace OpenSim.Data.MySQL
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1315,7 +1314,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1374,14 +1373,14 @@ namespace OpenSim.Data.MySQL
newData.UserLookAt = LLVector3.Zero;
m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
}
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
return newData;
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1395,7 +1394,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
@ -1419,7 +1418,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="prim"></param>
@ -1502,7 +1501,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="taskItem"></param>
@ -1532,7 +1531,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
private static void fillRegionSettingsRow(DataRow row, RegionSettings settings)
{
@ -1573,7 +1572,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="land"></param>
@ -1618,7 +1617,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="entry"></param>
@ -1631,7 +1630,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1694,7 +1693,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="prim"></param>
@ -1731,7 +1730,7 @@ namespace OpenSim.Data.MySQL
row["ProfileHollow"] = s.ProfileHollow;
row["Texture"] = s.TextureEntry;
row["ExtraParams"] = s.ExtraParams;
try
{
row["State"] = s.State;
@ -1754,7 +1753,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="prim"></param>
/// <param name="sceneGroupID"></param>
@ -1911,7 +1910,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="dt"></param>
/// <returns></returns>
@ -1973,7 +1972,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1994,7 +1993,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -2027,7 +2026,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -2038,7 +2037,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -2052,7 +2051,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -2063,7 +2062,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -2082,7 +2081,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="conn">MySQL connection handler</param>
// private static void InitDB(MySqlConnection conn)
@ -2174,7 +2173,7 @@ namespace OpenSim.Data.MySQL
// }
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
/// <param name="m"></param>

View File

@ -72,7 +72,7 @@ namespace OpenSim.Data.NHibernate
public object NullSafeGet(IDataReader rs, string[] names, object owner)
{
object quat = null;
int x = rs.GetOrdinal(names[0]);
int y = rs.GetOrdinal(names[1]);
int z = rs.GetOrdinal(names[2]);
@ -105,10 +105,10 @@ namespace OpenSim.Data.NHibernate
public SqlType[] SqlTypes
{
get { return new SqlType [] {
NHibernateUtil.Single.SqlType,
NHibernateUtil.Single.SqlType,
NHibernateUtil.Single.SqlType,
get { return new SqlType [] {
NHibernateUtil.Single.SqlType,
NHibernateUtil.Single.SqlType,
NHibernateUtil.Single.SqlType,
NHibernateUtil.Single.SqlType
}; }
}

View File

@ -70,7 +70,7 @@ namespace OpenSim.Data.NHibernate
public object NullSafeGet(IDataReader rs, string[] names, object owner)
{
object vector = null;
int x = rs.GetOrdinal(names[0]);
int y = rs.GetOrdinal(names[1]);
int z = rs.GetOrdinal(names[2]);

View File

@ -93,7 +93,7 @@ namespace OpenSim.Data.NHibernate
factory = cfg.BuildSessionFactory();
session = factory.OpenSession();
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore");
@ -111,7 +111,7 @@ namespace OpenSim.Data.NHibernate
{
m_log.ErrorFormat("[NHIBERNATE] no such asset {0}", uuid);
return null;
}
}
catch (Exception e)
{
m_log.Error("[NHIBERNATE] unexpected exception: ", e);
@ -121,7 +121,7 @@ namespace OpenSim.Data.NHibernate
private void Save(AssetBase asset)
{
try
try
{
// a is not used anywhere?
// AssetBase a = session.Load(typeof(AssetBase), asset.FullID) as AssetBase;

View File

@ -51,7 +51,7 @@ namespace OpenSim.Data.NHibernate
// "NHibernate.Driver.SqliteClientDriver";
// cfg.Properties[NHibernate.Cfg.Environment.ConnectionString] =
// "URI=file:opensim-nh.db,version=3";
// factory = cfg.BuildSessionFactory();
}

View File

@ -89,10 +89,10 @@ namespace OpenSim.Data.NHibernate
using (MemoryStream stream =
HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
cfg.AddInputStream(stream);
factory = cfg.BuildSessionFactory();
session = factory.OpenSession();
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore");
@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate
{
return null;
}
// This looks inefficient, but it turns out that it isn't
// based on trial runs with nhibernate 1.2
private void SaveOrUpdate(SceneObjectPart p)
@ -164,7 +164,7 @@ namespace OpenSim.Data.NHibernate
/// <param name="regionUUID">the region UUID</param>
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{
try
try
{
foreach (SceneObjectPart part in obj.Children.Values)
{
@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate
}
session.Flush();
}
catch (Exception e)
catch (Exception e)
{
m_log.Error("Can't save: ", e);
}
@ -196,7 +196,7 @@ namespace OpenSim.Data.NHibernate
group.AddPart(p);
group.RootPart = p;
}
else
else
{
group.AddPart(p);
}
@ -232,7 +232,7 @@ namespace OpenSim.Data.NHibernate
{
Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>();
List<SceneObjectGroup> ret = new List<SceneObjectGroup>();
ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart));
criteria.Add(Expression.Eq("RegionID", regionUUID));
criteria.AddOrder( Order.Asc("ParentID") );
@ -246,12 +246,12 @@ namespace OpenSim.Data.NHibernate
group.RootPart = p;
SOG.Add(p.ParentUUID, group);
}
else
else
{
SOG[p.ParentUUID].AddPart(p);
}
// get the inventory
ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem));
InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID));
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
@ -263,7 +263,7 @@ namespace OpenSim.Data.NHibernate
if (inventory.Count > 0)
p.RestoreInventoryItems(inventory);
}
foreach (SceneObjectGroup g in SOG.Values)
foreach (SceneObjectGroup g in SOG.Values)
{
ret.Add(g);
}
@ -304,7 +304,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="globalID"></param>
public void RemoveLandObject(LLUUID globalID)
@ -313,7 +313,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="parcel"></param>
public void StoreLandObject(ILandObject parcel)
@ -322,7 +322,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="regionUUID"></param>
/// <returns></returns>
@ -341,7 +341,7 @@ namespace OpenSim.Data.NHibernate
{
session.Flush();
}
/// <summary>
/// Load a region banlist
/// </summary>
@ -373,7 +373,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
@ -399,17 +399,17 @@ namespace OpenSim.Data.NHibernate
{
ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem));
criteria.Add(Expression.Eq("ParentPartID", primID));
try
try
{
foreach (TaskInventoryItem i in criteria.List())
{
session.Delete(i);
}
foreach (TaskInventoryItem i in items)
{
session.Save(i);
}
session.Flush();
}

View File

@ -53,8 +53,8 @@ namespace OpenSim.Data.NHibernate
private ISessionFactory factory;
private ISession session;
public override void Initialise()
{
public override void Initialise()
{
m_log.Info("[NHibernateUserData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -83,7 +83,7 @@ namespace OpenSim.Data.NHibernate
factory = cfg.BuildSessionFactory();
session = factory.OpenSession();
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "UserStore");
@ -97,7 +97,7 @@ namespace OpenSim.Data.NHibernate
{
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
}
catch (ObjectNotFoundException)
catch (ObjectNotFoundException)
{
user = null;
}
@ -109,12 +109,12 @@ namespace OpenSim.Data.NHibernate
{
UserProfileData user;
// TODO: I'm sure I'll have to do something silly here
try
try
{
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
user.CurrentAgent = GetAgentByUUID(uuid);
}
catch (ObjectNotFoundException)
}
catch (ObjectNotFoundException)
{
user = null;
}
@ -144,12 +144,12 @@ namespace OpenSim.Data.NHibernate
}
else
{
try
try
{
UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData;
session.Delete(old);
}
catch (ObjectNotFoundException)
catch (ObjectNotFoundException)
{
}
session.Save(agent);
@ -174,12 +174,12 @@ namespace OpenSim.Data.NHibernate
override public void AddNewUserAgent(UserAgentData agent)
{
try
try
{
UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData;
session.Delete(old);
}
catch (ObjectNotFoundException)
catch (ObjectNotFoundException)
{
}
session.Save(agent);
@ -287,9 +287,9 @@ namespace OpenSim.Data.NHibernate
public override void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
if (appearance == null)
if (appearance == null)
return;
appearance.Owner = user;
bool exists = ExistsAppearance(user);

View File

@ -32,21 +32,21 @@ using OpenSim.Framework;
using log4net;
using libsecondlife;
namespace OpenSim.Data.NHibernate
namespace OpenSim.Data.NHibernate
{
public class Terrain
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private double[,] map;
private LLUUID regionID;
public Terrain(LLUUID Region, double[,] array)
{
map = array;
regionID = Region;
}
public Terrain()
{
map = new double[Constants.RegionSize, Constants.RegionSize];
@ -65,7 +65,7 @@ namespace OpenSim.Data.NHibernate
get { return serializeTerrain(map); }
set { map = parseTerrain(value); }
}
public double[,] Doubles
{
get {return map;}
@ -76,7 +76,7 @@ namespace OpenSim.Data.NHibernate
{
double[,] terret = new double[256,256];
terret.Initialize();
MemoryStream str = new MemoryStream(data);
BinaryReader br = new BinaryReader(str);
try {
@ -87,7 +87,7 @@ namespace OpenSim.Data.NHibernate
terret[x, y] = br.ReadDouble();
}
}
}
}
catch (Exception e)
{
m_log.Error("Issue parsing Map", e);
@ -99,7 +99,7 @@ namespace OpenSim.Data.NHibernate
{
MemoryStream str = new MemoryStream((int)(65536 * sizeof (double)));
BinaryWriter bw = new BinaryWriter(str);
// TODO: COMPATIBILITY - Add byte-order conversions
for (int x = 0; x < 256; x++)
{
@ -108,11 +108,11 @@ namespace OpenSim.Data.NHibernate
double height = val[x, y];
if (height <= 0.0)
height = double.Epsilon;
bw.Write(height);
}
}
return str.ToArray();
}
}
}
}

View File

@ -141,7 +141,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
}
}
@ -155,7 +155,7 @@ namespace OpenSim.Data.SQLite
override public void UpdateAsset(AssetBase asset)
{
LogAssetLoad(asset);
lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
@ -167,7 +167,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
}
}
@ -269,7 +269,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -301,7 +301,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
// private static void InitDB(SqliteConnection conn)
@ -312,7 +312,7 @@ namespace OpenSim.Data.SQLite
// }
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
/// <param name="m"></param>
@ -331,10 +331,10 @@ namespace OpenSim.Data.SQLite
m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating");
return false;
}
// if the tables are here, and we don't have a migration,
// set it to 1, as we're migrating off of legacy bits
if (m.Version == 0)
if (m.Version == 0)
m.Version = 1;
return true;
@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite
#region IPlugin interface
/// <summary>
///
///
/// </summary>
override public string Version
{

View File

@ -55,12 +55,12 @@ namespace OpenSim.Data.SQLite
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
m_connection = new SqliteConnection(m_connectionString);
m_connection.Open();
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_connection, assem, "EstateStore");
m.Update();
@ -77,7 +77,7 @@ namespace OpenSim.Data.SQLite
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f;
}
private string[] FieldList
{
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
@ -134,7 +134,7 @@ namespace OpenSim.Data.SQLite
names.Remove("EstateID");
sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
cmd.CommandText = sql;
cmd.Parameters.Clear();
@ -272,16 +272,16 @@ namespace OpenSim.Data.SQLite
private void SaveBanList(EstateSettings es)
{
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
cmd.CommandText = "delete from estateban where EstateID = :EstateID";
cmd.Parameters.Add(":EstateID", es.EstateID.ToString());
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )";
foreach (EstateBan b in es.EstateBans)
{
cmd.Parameters.Add(":EstateID", es.EstateID.ToString());
@ -295,16 +295,16 @@ namespace OpenSim.Data.SQLite
void SaveUUIDList(uint EstateID, string table, LLUUID[] data)
{
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
cmd.CommandText = "delete from "+table+" where EstateID = :EstateID";
cmd.Parameters.Add(":EstateID", EstateID.ToString());
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )";
foreach (LLUUID uuid in data)
{
cmd.Parameters.Add(":EstateID", EstateID.ToString());
@ -336,7 +336,7 @@ namespace OpenSim.Data.SQLite
uuids.Add(uuid);
}
r.Close();
return uuids.ToArray();
}
}

View File

@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite
private SqliteDataAdapter invItemsDa;
private SqliteDataAdapter invFoldersDa;
public void Initialise()
{
public void Initialise()
{
m_log.Info("[SQLiteInventoryData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -105,7 +105,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="item"></param>
@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite
/// <returns>A string containing the DB provider version</returns>
public string Version
{
get
get
{
Module module = GetType().Module;
// string dllName = module.Assembly.ManifestModule.Name;
@ -419,10 +419,10 @@ namespace OpenSim.Data.SQLite
* - We will only need to hit the database twice instead of n times.
* - We assume the database is well-formed - no stranded/dangling folders, all folders in heirarchy owned
* by the same person, each user only has 1 inventory heirarchy
* - The returned list is not ordered, instead of breadth-first ordered
* - The returned list is not ordered, instead of breadth-first ordered
There are basically 2 usage cases for getFolderHeirarchy:
1) Getting the user's entire inventory heirarchy when they log in
2) Finding a subfolder heirarchy to delete when emptying the trash.
2) Finding a subfolder heirarchy to delete when emptying the trash.
This implementation will pull all inventory folders from the database, and then prune away any folder that
is not part of the requested sub-heirarchy. The theory is that it is cheaper to make 1 request from the
database than to make n requests. This pays off only if requested heirarchy is large.
@ -449,17 +449,17 @@ namespace OpenSim.Data.SQLite
folderRows = inventoryFolderTable.Select(selectExp);
}
if ( folderRows!=null && folderRows.GetLength(0)>=1 ) // No result means parent folder does not exist
if (folderRows != null && folderRows.GetLength(0) >= 1) // No result means parent folder does not exist
{ // or has no children
/* if we're querying the root folder, just return an unordered list of all folders in the user's
* inventory
*/
if (parentFolder.ParentID == LLUUID.Zero)
{
{
foreach (DataRow row in folderRows)
{
InventoryFolderBase curFolder = buildFolder(row);
if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy
if (curFolder.ID != parentID) // Return all folders except the parent folder of heirarchy
folders.Add(buildFolder(row));
}
} // If requesting root folder
@ -481,16 +481,16 @@ namespace OpenSim.Data.SQLite
InventoryFolderBase curFolder = buildFolder(row);
if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed
{
if ( hashtable.ContainsKey(curFolder.ParentID ) )
if (hashtable.ContainsKey(curFolder.ParentID))
{
// Current folder already has a sibling - append to sibling list
hashtable[curFolder.ParentID].Add( curFolder );
hashtable[curFolder.ParentID].Add(curFolder);
}
else {
List<InventoryFolderBase> siblingList = new List<InventoryFolderBase>();
siblingList.Add( curFolder );
siblingList.Add(curFolder);
// Current folder has no known (yet) siblings
hashtable.Add( curFolder.ParentID, siblingList );
hashtable.Add(curFolder.ParentID, siblingList);
}
}
} // For all inventory folders
@ -498,12 +498,12 @@ namespace OpenSim.Data.SQLite
// Note: Could release the ds lock here - we don't access folderRows or the database anymore.
// This is somewhat of a moot point as the callers of this function usually lock db anyways.
if ( hashtable.ContainsKey( parentID ) ) // if requested folder does have children
folders.AddRange( hashtable[parentID] );
if (hashtable.ContainsKey(parentID)) // if requested folder does have children
folders.AddRange(hashtable[parentID]);
// BreadthFirstSearch build inventory tree **Note: folders.Count is *not* static
for ( int i = 0; i < folders.Count; i++ )
if (hashtable.ContainsKey(folders[i].ID))
for (int i = 0; i < folders.Count; i++)
if (hashtable.ContainsKey(folders[i].ID))
folders.AddRange(hashtable[folders[i].ID]);
} // if requesting a subfolder heirarchy
@ -601,7 +601,7 @@ namespace OpenSim.Data.SQLite
/// Delete all items in the specified folder
/// </summary>
/// <param name="folderId">id of the folder, whose item content should be deleted</param>
/// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo>
/// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo>
private void deleteItemsInFolder(LLUUID folderId)
{
List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId));
@ -743,7 +743,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -765,7 +765,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -787,7 +787,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -804,7 +804,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="folder"></param>
@ -819,7 +819,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="folder"></param>
@ -836,7 +836,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
// private static void InitDB(SqliteConnection conn)
@ -852,7 +852,7 @@ namespace OpenSim.Data.SQLite
// }
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
/// <param name="m"></param>

View File

@ -501,7 +501,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="globalID"></param>
public void RemoveLandObject(LLUUID globalID)
@ -523,7 +523,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="parcel"></param>
public void StoreLandObject(ILandObject parcel)
@ -564,7 +564,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="regionUUID"></param>
/// <returns></returns>
@ -594,7 +594,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
public void Commit()
{
@ -629,7 +629,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1071,7 +1071,7 @@ namespace OpenSim.Data.SQLite
newData.UserLookAt =
new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
Convert.ToSingle(row["UserLookAtZ"]));
}
catch (InvalidCastException)
{
@ -1132,7 +1132,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
@ -1166,7 +1166,7 @@ namespace OpenSim.Data.SQLite
// }
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="prim"></param>
@ -1233,7 +1233,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="taskItem"></param>
@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="land"></param>
@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="entry"></param>
@ -1321,7 +1321,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -1376,7 +1376,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="prim"></param>
@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="prim"></param>
/// <param name="sceneGroupID"></param>
@ -1574,7 +1574,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="dt">Data Table</param>
/// <returns></returns>
@ -1631,7 +1631,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1650,7 +1650,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1694,7 +1694,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1705,7 +1705,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -1799,7 +1799,7 @@ namespace OpenSim.Data.SQLite
// }
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
/// <param name="m"></param>
@ -1845,8 +1845,8 @@ namespace OpenSim.Data.SQLite
// if we've gotten this far, and our version is still 0,
// it's because the migration was never done, so
// initialize to 1 just to sync up to where we should be.
if (m.Version == 0)
if (m.Version == 0)
m.Version = 1;
// pDa.Fill(tmpDS, "prims");

View File

@ -65,8 +65,8 @@ namespace OpenSim.Data.SQLite
private SqliteDataAdapter daf;
SqliteConnection g_conn;
public override void Initialise()
{
public override void Initialise()
{
m_log.Info("[SQLiteUserData]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException (Name);
}
@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite
Assembly assem = GetType().Assembly;
Migration m = new Migration(g_conn, assem, "UserStore");
// TODO: remove this after rev 6000
TestTables(conn, m);
@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite
return;
}
public override void Dispose () {}
public override void Dispose () {}
/// <summary>
/// see IUserDataPlugin,
@ -308,7 +308,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="queryID"></param>
/// <param name="query"></param>
@ -570,7 +570,7 @@ namespace OpenSim.Data.SQLite
}
return aa;
}
/// <summary>
/// Update a user appearence
/// </summary>
@ -802,7 +802,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="user"></param>
@ -853,7 +853,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
@ -881,7 +881,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="row"></param>
/// <param name="ua"></param>
@ -914,7 +914,7 @@ namespace OpenSim.Data.SQLite
**********************************************************************/
/// <summary>
///
///
/// </summary>
/// <param name="da"></param>
/// <param name="conn"></param>
@ -933,7 +933,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="daf"></param>
/// <param name="conn"></param>
@ -954,7 +954,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
private static void InitDB(SqliteConnection conn)
@ -990,7 +990,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="conn"></param>
/// <param name="m"></param>
@ -1016,7 +1016,7 @@ namespace OpenSim.Data.SQLite
return false;
}
if (m.Version == 0)
if (m.Version == 0)
m.Version = 1;
return true;

View File

@ -75,7 +75,7 @@ namespace OpenSim.Data
public abstract void AddAttachment(LLUUID user, LLUUID item);
public abstract void RemoveAttachment(LLUUID user, LLUUID item);
public abstract List<LLUUID> GetAttachments(LLUUID user);
public abstract string Version {get;}
public abstract string Name {get;}
public abstract void Initialise(string connect);

View File

@ -371,7 +371,7 @@ namespace OpenSim.Framework
VisualParams = (byte[])h["visual_params"];
Texture = new LLObject.TextureEntry((byte[])h["texture"], 0, ((byte[])h["texture"]).Length);
AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]);
m_wearables = new AvatarWearable[MAX_WEARABLES];
for (int i = 0; i < MAX_WEARABLES; i++)
{

View File

@ -380,7 +380,7 @@ namespace Opensim.Framework
default:
return;
}
Store(index, data, container);
}
@ -403,7 +403,7 @@ namespace Opensim.Framework
if ((m_Flags & CacheFlags.AllowUpdate) != 0)
{
item = GetItem(index);
item.hits++;
item.lastUsed = DateTime.Now;
if (m_DefaultTTL.Ticks != 0)

View File

@ -143,10 +143,10 @@ namespace OpenSim.Framework.Communications.Cache
public void Clear()
{
m_log.Info("[ASSET CACHE]: Clearing Asset cache");
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.ClearAssetCacheStatistics();
Initialize();
}
@ -365,9 +365,9 @@ namespace OpenSim.Framework.Communications.Cache
}
}
else
{
{
if (!Assets.ContainsKey(asset.FullID))
{
{
AssetInfo assetInf = new AssetInfo(asset);
Assets.Add(assetInf.FullID, assetInf);
@ -382,7 +382,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
/// <summary>
/// <summary>
/// Allows you to clear a specific asset by uuid out
/// of the asset cache. This is needed because the osdynamic
/// texture code grows the asset cache without bounds. The
@ -399,8 +399,8 @@ namespace OpenSim.Framework.Communications.Cache
if (Textures.ContainsKey(uuid))
{
Textures.Remove(uuid);
}
else if (Assets.ContainsKey(uuid))
}
else if (Assets.ContainsKey(uuid))
{
Assets.Remove(uuid);
}

View File

@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="req"></param>
/// <returns></returns>
/// <exception cref="System.Exception">
/// Thrown if the request failed for some other reason than that the
/// Thrown if the request failed for some other reason than that the
/// asset cannot be found.
/// </exception>
protected abstract AssetBase GetAsset(AssetRequest req);
@ -70,7 +70,7 @@ namespace OpenSim.Framework.Communications.Cache
protected virtual void ProcessRequest(AssetRequest req)
{
AssetBase asset;
try
{
asset = GetAsset(req);
@ -78,12 +78,12 @@ namespace OpenSim.Framework.Communications.Cache
catch (Exception e)
{
m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e);
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAssetServiceRequestFailure();
m_receiver.AssetNotFound(req.AssetID, req.IsTexture);
return;
}

View File

@ -91,8 +91,8 @@ namespace OpenSim.Framework.Communications.Cache
get { return m_session_id; }
set { m_session_id = value; }
}
private LLUUID m_session_id = LLUUID.Zero;
private LLUUID m_session_id = LLUUID.Zero;
/// <summary>
/// Constructor
/// </summary>
@ -172,7 +172,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
}
/// <summary>
/// Drop all cached inventory.
/// </summary>

View File

@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
rc.AddQueryParameter("texture");
rc.RequestMethod = "GET";
Stream s = rc.Request();
if (s.Length > 0)

View File

@ -37,19 +37,19 @@ namespace OpenSim.Framework.Communications.Cache
public class InventoryFolderImpl : InventoryFolderBase
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static readonly string PATH_DELIMITER = "/";
/// <summary>
/// Items that are contained in this folder
/// </summary>
public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
/// <summary>
/// Child folders that are contained in this folder
/// </summary>
public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
// Constructors
public InventoryFolderImpl(InventoryFolderBase folderbase)
{
@ -195,15 +195,15 @@ namespace OpenSim.Framework.Communications.Cache
return null;
}
/// <summary>
/// Find a folder given a PATH_DELIMITOR delimited path starting from this folder
///
///
/// This method does not handle paths that contain multiple delimitors
///
///
/// FIXME: We do not yet handle situations where folders have the same name. We could handle this by some
/// XPath like expression
///
///
/// FIXME: Delimitors which occur in names themselves are not currently escapable.
/// </summary>
/// <param name="path">
@ -214,7 +214,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if (path == string.Empty)
return this;
string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None);
lock (SubFolders)
@ -228,19 +228,19 @@ namespace OpenSim.Framework.Communications.Cache
return folder;
}
}
// We didn't find a folder with the given name
return null;
}
/// <summary>
/// Find an item given a PATH_DELIMITOR delimited path starting from this folder.
///
///
/// This method does not handle paths that contain multiple delimitors
///
///
/// FIXME: We do not yet handle situations where folders or items have the same name. We could handle this by some
/// XPath like expression
///
///
/// FIXME: Delimitors which occur in names themselves are not currently escapable.
/// </summary>
/// <param name="path">
@ -248,7 +248,7 @@ namespace OpenSim.Framework.Communications.Cache
/// </param>
/// <returns>null if the item is not found</returns>
public InventoryItemBase FindItemByPath(string path)
{
{
string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None);
if (components.Length == 1)
@ -263,7 +263,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
else
{
{
lock (SubFolders)
{
foreach (InventoryFolderImpl folder in SubFolders.Values)
@ -273,10 +273,10 @@ namespace OpenSim.Framework.Communications.Cache
}
}
}
// We didn't find an item or intermediate folder with the given name
return null;
}
}
/// <summary>
/// Return a copy of the list of child items in this folder

View File

@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications.Cache
m_log.WarnFormat(
"[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userId);
return false;
}

View File

@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Capabilities
mapLayer.Right = 5000;
mapLayer.Top = 5000;
mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006");
return mapLayer;
}
@ -783,7 +783,7 @@ namespace OpenSim.Framework.Communications.Capabilities
// TODO: probably make this a better set of extensions here
string extension = ".jp2";
if (m_invType != "image")
if (m_invType != "image")
{
extension = ".dat";
}

View File

@ -34,7 +34,7 @@ namespace OpenSim.Framework.Communications.Capabilities
public class LLSDRemoteParcelResponse
{
public LLUUID parcel_id;
public LLSDRemoteParcelResponse()
{
}

View File

@ -41,26 +41,26 @@ namespace OpenSim.Framework.Communications
public class CommunicationsManager
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<LLUUID, string[]> m_nameRequestCache = new Dictionary<LLUUID, string[]>();
public IUserService UserService
{
get { return m_userService; }
}
protected IUserService m_userService;
protected IUserService m_userService;
public IGridServices GridService
{
get { return m_gridService; }
}
protected IGridServices m_gridService;
protected IGridServices m_gridService;
public IInterRegionCommunications InterRegion
{
get { return m_interRegion; }
}
protected IInterRegionCommunications m_interRegion;
protected IInterRegionCommunications m_interRegion;
public UserProfileCacheService UserProfileCacheService
{
@ -68,36 +68,36 @@ namespace OpenSim.Framework.Communications
}
protected UserProfileCacheService m_userProfileCacheService;
// protected AgentAssetTransactionsManager m_transactionsManager;
// protected AgentAssetTransactionsManager m_transactionsManager;
// public AgentAssetTransactionsManager TransactionsManager
// {
// get { return m_transactionsManager; }
// }
// public AgentAssetTransactionsManager TransactionsManager
// {
// get { return m_transactionsManager; }
// }
public IAvatarService AvatarService
{
get { return m_avatarService; }
}
protected IAvatarService m_avatarService;
protected IAvatarService m_avatarService;
public AssetCache AssetCache
{
get { return m_assetCache; }
}
protected AssetCache m_assetCache;
protected AssetCache m_assetCache;
public IInterServiceInventoryServices InterServiceInventoryService
{
get { return m_interServiceInventoryService; }
}
}
protected IInterServiceInventoryServices m_interServiceInventoryService;
public NetworkServersInfo NetworkServersInfo
{
get { return m_networkServersInfo; }
}
protected NetworkServersInfo m_networkServersInfo;
protected NetworkServersInfo m_networkServersInfo;
/// <summary>
/// Constructor
@ -138,7 +138,7 @@ namespace OpenSim.Framework.Communications
return null;
}
}
public IInventoryServices InventoryService
{
get

View File

@ -33,7 +33,7 @@ namespace OpenSim.Framework.Communications
public interface IGridServices
{
string gdebugRegionName { get; set; }
/// <summary>
/// Register a region with the grid service.
/// </summary>
@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications
/// <returns></returns>
/// <exception cref="System.Exception">Thrown if region registration failed</exception>
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
bool DeregisterRegion(RegionInfo regionInfo);
/// <summary>
@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications
/// <param name="y"></param>
/// <returns></returns>
List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
RegionInfo RequestNeighbourInfo(ulong regionHandle);
RegionInfo RequestNeighbourInfo(LLUUID regionID);
RegionInfo RequestClosestRegion(string regionName);

View File

@ -32,22 +32,22 @@ namespace OpenSim.Framework.Communications
{
/// <summary>
/// Inventory operations used between grid services.
/// </summary>
/// </summary>
public interface IInterServiceInventoryServices
{
{
/// <summary>
/// Create a new inventory for the given user.
/// </summary>
/// <param name="user"></param>
/// <returns>true if the inventory was successfully created, false otherwise</returns>
bool CreateNewUserInventory(LLUUID user);
/// <summary>
/// Returns a list of all the folders in a given user's inventory.
/// </summary>
/// <param name="userId"></param>
/// <returns>A flat list of the user's inventory folder tree,
/// null if there is no inventory for this user</returns>
List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
}
}

View File

@ -41,12 +41,12 @@ namespace OpenSim.Framework.Communications
/// Defines all the operations one can perform on a user's inventory.
/// </summary>
public interface IInventoryServices
{
{
string Host
{
get;
}
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received

View File

@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications
{
get;
}
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
@ -102,14 +102,14 @@ namespace OpenSim.Framework.Communications
/// Does the given user have an inventory structure?
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
/// <returns></returns>
bool HasInventoryForUser(LLUUID userID);
/// <summary>
/// Retrieve the root inventory folder for the given user.
/// </summary>
/// <param name="userID"></param>
/// <returns>null if no root folder was found</returns>
InventoryFolderBase RequestRootFolder(LLUUID userID);
InventoryFolderBase RequestRootFolder(LLUUID userID);
}
}

View File

@ -53,14 +53,14 @@ namespace OpenSim.Framework.Communications
/// <param name="provider">The filename to the user server plugin DLL</param>
public void AddPlugin(string provider, string connect)
{
PluginLoader<IInventoryDataPlugin> loader =
PluginLoader<IInventoryDataPlugin> loader =
new PluginLoader<IInventoryDataPlugin> (new InventoryDataInitialiser (connect));
// loader will try to load all providers (MySQL, MSSQL, etc)
// loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "Provider" entry in the addin.xml
loader.Add ("/OpenSim/InventoryData", new PluginProviderFilter (provider));
loader.Load();
m_plugins = loader.Plugins;
}

View File

@ -79,7 +79,7 @@ namespace OpenSim.Framework.Communications
/// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param>
public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest);
/// <summary>
/// If the user is already logged in, try to notify the region that the user they've got is dead.
/// </summary>
@ -206,12 +206,11 @@ namespace OpenSim.Framework.Communications
userProfile.CurrentAgent.AgentOnline = false;
m_userManager.CommitAgent(ref userProfile);
// try to tell the region that their user is dead.
LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location");
// Reject the login
m_log.InfoFormat(
"[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in",
@ -293,7 +292,7 @@ namespace OpenSim.Framework.Communications
//return logResponse.ToXmlRpcResponse();
}
userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
CommitAgent(ref userProfile);
// If we reach this point, then the login has successfully logged onto the grid

View File

@ -57,11 +57,11 @@ namespace OpenSim.Framework.Communications
PluginLoader<IUserDataPlugin> loader =
new PluginLoader<IUserDataPlugin> (new UserDataInitialiser (connect));
// loader will try to load all providers (MySQL, MSSQL, etc)
// loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "Provider" entry in the addin.xml
loader.Add ("/OpenSim/UserData", new PluginProviderFilter (provider));
loader.Load();
_plugins = loader.Plugins;
}

View File

@ -46,7 +46,7 @@ namespace OpenSim.Framework.Configuration.XML
private void LoadDataToClass()
{
rootNode = doc.SelectSingleNode("Root");
rootNode = doc.SelectSingleNode("Root");
if (null == rootNode)
throw new Exception("Error: Invalid .xml File. Missing <Root>");
@ -135,4 +135,4 @@ namespace OpenSim.Framework.Configuration.XML
doc = null;
}
}
}
}

View File

@ -42,7 +42,7 @@ namespace OpenSim.Framework.Console
private readonly object m_syncRoot = new object();
public conscmd_callback m_cmdParser;
/// <summary>
/// The default prompt text.
/// </summary>
@ -249,7 +249,7 @@ namespace OpenSim.Framework.Console
{
line = System.Console.ReadLine();
}
return line;
}
catch (Exception e)

View File

@ -30,10 +30,10 @@ using System;
namespace OpenSim.Framework.Console
{
public delegate void ConsoleCommand(string[] comParams);
/// <summary>
/// Holder object for a new console plugin command
///
///
/// Override the methods like Run and IsHelpfull (but the defaults might work ok.)
/// </summary>
public class ConsolePluginCommand
@ -52,10 +52,10 @@ namespace OpenSim.Framework.Console
private string[] m_cmdText;
/// <summary>
/// Construct a new ConsolePluginCommand
///
/// Construct a new ConsolePluginCommand
///
/// for use with OpenSim.RegisterConsolePluginCommand(myCmd);
///
///
/// </summary>
/// <param name="command">in the form of "showme new commands"</param>
/// <param name="dlg">ommand delegate used in running</param>
@ -68,13 +68,13 @@ namespace OpenSim.Framework.Console
}
/// <summary>
/// Returns the match length this command has upon the 'cmdWithParams'
/// Returns the match length this command has upon the 'cmdWithParams'
/// At least a higher number for "show plugin status" then "show" would return
/// This is used to have multi length command verbs
///
///
/// @see OopenSim.RunPluginCommands
/// It will only run the one with the highest number
///
///
/// </summary>
public int matchLength(string cmdWithParams)
{
@ -106,8 +106,8 @@ namespace OpenSim.Framework.Console
}
currentParam++;
}
}
}
string[] sendCmdParams = cmdParams;
if (skipParams > 0)
{

View File

@ -39,7 +39,7 @@ namespace OpenSim.Framework.Console
{
override protected void Append(LoggingEvent le)
{
try
try
{
string loggingMessage = RenderLoggingEvent(le);
@ -47,7 +47,7 @@ namespace OpenSim.Framework.Console
Regex RE = new Regex(regex, RegexOptions.Multiline);
MatchCollection matches = RE.Matches(loggingMessage);
// Get some direct matches $1 $4 is a
if (matches.Count == 1)
{

View File

@ -37,7 +37,7 @@ namespace OpenSim.Framework
bool ExistsAsset(LLUUID uuid);
void Initialise(string connect);
}
public class AssetDataInitialiser : PluginInitialiserBase
{
private string connect;

View File

@ -62,7 +62,7 @@ namespace OpenSim.Framework
public delegate void ModifyTerrain(
float height, float seconds, byte size, byte action, float north, float west, float south, float east,
IClientAPI remoteClient);
public delegate void SetAppearance(byte[] texture, List<byte> visualParamList);
public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID);
@ -295,7 +295,7 @@ namespace OpenSim.Framework
public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
public delegate void RegionHandleRequest(IClientAPI remoteClient, LLUUID regionID);
public delegate void ParcelInfoRequest(IClientAPI remoteClient, LLUUID parcelID);
public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running);
@ -322,9 +322,9 @@ namespace OpenSim.Framework
ulong ActiveGroupPowers { get; }
ulong GetGroupPowers(LLUUID groupID);
string FirstName { get; }
string LastName { get; }
IScene Scene { get; }
@ -501,7 +501,7 @@ namespace OpenSim.Framework
event EstateDebugRegionRequest OnEstateDebugRegionRequest;
event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
event UUIDNameRequest OnUUIDGroupNameRequest;
event RegionHandleRequest OnRegionHandleRequest;
event ParcelInfoRequest OnParcelInfoRequest;
@ -724,10 +724,10 @@ namespace OpenSim.Framework
ClientInfo GetClientInfo();
void SetClientInfo(ClientInfo info);
void Terminate();
void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary<int, float> parameters);
void SendClearFollowCamProperties(LLUUID objectID);
void SendRegionHandle(LLUUID regoinID, ulong handle);
void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y);
}

View File

@ -132,7 +132,7 @@ namespace OpenSim.Framework
/// <param name="folder">The id of the folder</param>
void deleteInventoryFolder(LLUUID folder);
}
public class InventoryDataInitialiser : PluginInitialiserBase
{
private string connect;

View File

@ -38,7 +38,7 @@ namespace OpenSim.Framework
public PluginNotInitialisedException (string msg) : base(msg) {}
public PluginNotInitialisedException (string msg, Exception e) : base(msg, e) {}
}
/// <summary>
/// This interface, describes a generic plugin
/// </summary>
@ -63,17 +63,17 @@ namespace OpenSim.Framework
}
/// <summary>
/// Any plugins which need to pass parameters to their initialisers must
/// Any plugins which need to pass parameters to their initialisers must
/// inherit this class and use it to set the PluginLoader Initialiser property
/// </summary>
public class PluginInitialiserBase
{
// this would be a lot simpler if C# supported currying or typedefs
// default initialisation
public virtual void Initialise (IPlugin plugin)
{
plugin.Initialise();
plugin.Initialise();
}
}

View File

@ -170,7 +170,7 @@ namespace OpenSim.Framework
void RemoveAttachment(LLUUID user, LLUUID item);
List<LLUUID> GetAttachments(LLUUID user);
}
public class UserDataInitialiser : PluginInitialiserBase
{
private string connect;

View File

@ -39,7 +39,7 @@ namespace OpenSim.Framework
private uint _auctionID = 0; //Unemplemented. If set to 0, not being auctioned
private LLUUID _authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID
private Parcel.ParcelCategory _category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
private int _claimDate = 0;
private int _claimDate = 0;
private int _claimPrice = 0; //Unemplemented
private LLUUID _globalID = LLUUID.Zero;
private LLUUID _groupID = LLUUID.Zero; //Unemplemented
@ -77,7 +77,7 @@ namespace OpenSim.Framework
private LLUUID _snapshotID = LLUUID.Zero;
private LLVector3 _userLocation = new LLVector3();
private LLVector3 _userLookAt = new LLVector3();
public LLVector3 AABBMax {
get {
return _AABBMax;
@ -459,4 +459,4 @@ namespace OpenSim.Framework
return landData;
}
}
}
}

View File

@ -49,6 +49,6 @@ namespace OpenSim.Framework
{
}
}
}

View File

@ -47,7 +47,7 @@ namespace OpenSim.Framework
}
/// <summary>
/// Classes wishing to impose constraints on plugin loading must implement
/// Classes wishing to impose constraints on plugin loading must implement
/// this class and pass it to PluginLoader AddConstraint()
/// </summary>
public interface IPluginConstraint
@ -75,46 +75,46 @@ namespace OpenSim.Framework
private List<T> loaded = new List<T>();
private List<string> extpoints = new List<string>();
private PluginInitialiserBase initialiser;
private Dictionary<string,IPluginConstraint> constraints
private Dictionary<string,IPluginConstraint> constraints
= new Dictionary<string,IPluginConstraint>();
private Dictionary<string,IPluginFilter> filters
private Dictionary<string,IPluginFilter> filters
= new Dictionary<string,IPluginFilter>();
private static readonly ILog log
private static readonly ILog log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public PluginInitialiserBase Initialiser
{
set { initialiser = value; }
get { return initialiser; }
{
set { initialiser = value; }
get { return initialiser; }
}
public List<T> Plugins
{
get { return loaded; }
public List<T> Plugins
{
get { return loaded; }
}
public T Plugin
{
get { return (loaded.Count == 1)? loaded [0] : default (T); }
{
get { return (loaded.Count == 1)? loaded [0] : default (T); }
}
public PluginLoader ()
public PluginLoader ()
{
Initialiser = new PluginInitialiserBase();
initialise_plugin_dir_ (".");
}
public PluginLoader (PluginInitialiserBase init)
{
{
Initialiser = init;
initialise_plugin_dir_ (".");
}
public PluginLoader (PluginInitialiserBase init, string dir)
{
{
Initialiser = init;
initialise_plugin_dir_ (dir);
}
@ -123,7 +123,7 @@ namespace OpenSim.Framework
{
if (extpoints.Contains (extpoint))
return;
extpoints.Add (extpoint);
}
@ -156,7 +156,7 @@ namespace OpenSim.Framework
}
public void Load ()
{
{
foreach (string ext in extpoints)
{
log.Info("[PLUGINS]: Loading extension point " + ext);
@ -169,17 +169,17 @@ namespace OpenSim.Framework
}
IPluginFilter filter = null;
if (filters.ContainsKey (ext))
filter = filters [ext];
foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes (ext))
{
log.Info("[PLUGINS]: Trying plugin " + node.Path);
if ((filter != null) && (filter.Apply (node) == false))
continue;
T plugin = (T) node.CreateInstance();
Initialiser.Initialise (plugin);
Plugins.Add (plugin);
@ -219,7 +219,7 @@ namespace OpenSim.Framework
private void on_addinloaderror_(object sender, AddinErrorEventArgs args)
{
if (args.Exception == null)
log.Error ("[PLUGINS]: Plugin Error: "
log.Error ("[PLUGINS]: Plugin Error: "
+ args.Message);
else
log.Error ("[PLUGINS]: Plugin Error: "
@ -229,7 +229,7 @@ namespace OpenSim.Framework
private void clear_registry_ ()
{
// The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
// The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
// occasionally seems to corrupt its addin cache
// Hence, as a temporary solution we'll remove it before each startup
try
@ -252,7 +252,7 @@ namespace OpenSim.Framework
}
}
private static TextWriter prev_console_;
private static TextWriter prev_console_;
public void suppress_console_output_ (bool save)
{
if (save)
@ -262,7 +262,7 @@ namespace OpenSim.Framework
}
else
{
if (prev_console_ != null)
if (prev_console_ != null)
System.Console.SetOut(prev_console_);
}
}
@ -283,7 +283,7 @@ namespace OpenSim.Framework
public Type TypeObject
{
get
get
{
if (typeobj != null)
return typeobj;
@ -295,9 +295,9 @@ namespace OpenSim.Framework
}
}
public object CreateInstance ()
{
return Activator.CreateInstance (TypeObject);
public object CreateInstance ()
{
return Activator.CreateInstance (TypeObject);
}
}
@ -305,29 +305,29 @@ namespace OpenSim.Framework
/// Constraint that bounds the number of plugins to be loaded.
/// </summary>
public class PluginCountConstraint : IPluginConstraint
{
private int min;
private int max;
{
private int min;
private int max;
public PluginCountConstraint (int exact)
{
min = exact;
max = exact;
min = exact;
max = exact;
}
public PluginCountConstraint (int minimum, int maximum)
{
min = minimum;
max = maximum;
}
public PluginCountConstraint (int minimum, int maximum)
{
min = minimum;
max = maximum;
}
public string Message
{
get
{
return "The number of plugins is constrained to the interval ["
+ min + ", " + max + "]";
}
public string Message
{
get
{
return "The number of plugins is constrained to the interval ["
+ min + ", " + max + "]";
}
}
public bool Apply (string extpoint)
@ -340,7 +340,7 @@ namespace OpenSim.Framework
return true;
}
}
/// <summary>
/// Filters out which plugin to load based on its "Provider", which is name given by in the addin.xml
/// </summary>
@ -348,7 +348,7 @@ namespace OpenSim.Framework
{
private string provider;
public PluginProviderFilter (string p)
public PluginProviderFilter (string p)
{
provider = p;
}

View File

@ -128,7 +128,7 @@ namespace OpenSim.Framework
[XmlIgnore] private bool _flexiEntry = false;
[XmlIgnore] private bool _lightEntry = false;
[XmlIgnore] private bool _sculptEntry = false;
public byte ProfileCurve
{
get { return (byte)((byte)HollowShape | (byte)ProfileShape); }
@ -185,10 +185,10 @@ namespace OpenSim.Framework
[XmlIgnore]
public LLObject.TextureEntry Textures
{
get
{
get
{
//m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length);
return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length);
return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length);
}
set { m_textureEntry = value.ToBytes(); }
@ -198,12 +198,12 @@ namespace OpenSim.Framework
{
get { return m_textureEntry; }
set
{
if (value == null)
set
{
if (value == null)
m_textureEntry = new byte[1];
else
m_textureEntry = value;
else
m_textureEntry = value;
}
}
@ -302,7 +302,7 @@ namespace OpenSim.Framework
_profileBegin = LLObject.PackBeginCut(profileRange.X);
_profileEnd = LLObject.PackEndCut(profileRange.Y);
}
public byte[] ExtraParams
{
get
@ -941,7 +941,7 @@ namespace OpenSim.Framework
return data;
}
public void ReadFlexiData(byte[] data, int pos)
{
if (data.Length-pos >= 16)
@ -972,7 +972,7 @@ namespace OpenSim.Framework
_flexiForceZ = 0f;
}
}
public byte[] GetFlexiBytes()
{
byte[] data = new byte[16];
@ -991,7 +991,7 @@ namespace OpenSim.Framework
return data;
}
public void ReadLightData(byte[] data, int pos)
{
if (data.Length - pos >= 16)
@ -1021,7 +1021,7 @@ namespace OpenSim.Framework
_lightIntensity = 0f;
}
}
public byte[] GetLightBytes()
{
byte[] data = new byte[16];

View File

@ -47,7 +47,7 @@ namespace OpenSim.Framework
private RegionUp handlerRegionUp = null; // OnRegionUp;
private LogOffUser handlerLogOffUser = null;
private GetLandData handlerGetLandData = null;
#region IRegionCommsListener Members
public event ExpectUserDelegate OnExpectUser;
@ -228,13 +228,13 @@ namespace OpenSim.Framework
return false;
}
public LandData TriggerGetLandData(uint x, uint y)
{
handlerGetLandData = OnGetLandData;
if (handlerGetLandData != null)
return handlerGetLandData(x, y);
return null;
}
}

View File

@ -50,7 +50,7 @@ namespace OpenSim.Framework
set { m_httpPort = value; }
}
protected uint m_httpPort;
/// <summary>
/// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
/// </summary>
@ -58,17 +58,17 @@ namespace OpenSim.Framework
{
get { return m_serverURI; }
set { m_serverURI = value; }
}
}
protected string m_serverURI;
protected bool Allow_Alternate_Ports;
public bool m_allow_alternate_ports;
protected string m_externalHostName;
protected IPEndPoint m_internalEndPoint;
protected uint? m_regionLocX;
protected uint? m_regionLocY;
protected uint m_remotingPort;
protected uint m_remotingPort;
public LLUUID RegionID = LLUUID.Zero;
public string RemotingAddress;
@ -404,11 +404,11 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"(Sandbox Mode Only)Password for Master Avatar account",
MasterAvatarSandboxPassword, true);
configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
"Last Map UUID", lastMapUUID.ToString(), true);
configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
}
public void loadConfigurationOptions()
@ -454,15 +454,14 @@ namespace OpenSim.Framework
shouldMasterAvatarDetailsBeAsked);
configMember.addConfigurationOption("lastmap_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID,
"Last Map UUID", lastMapUUID.ToString(), true);
configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
}
public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
{
if (MasterAvatarAssignedUUID == LLUUID.Zero)
return MasterAvatarAssignedUUID == LLUUID.Zero;
{
return true;
}

View File

@ -139,7 +139,7 @@ namespace OpenSim.Framework
{
case "region_flags":
Simulator.RegionFlags flags = (Simulator.RegionFlags)(uint)value;
m_BlockTerraform =
(flags & Simulator.RegionFlags.BlockTerraform) != 0;
m_BlockFly =
@ -246,7 +246,7 @@ namespace OpenSim.Framework
}
private bool m_BlockTerraform = false;
public bool BlockTerraform
{
get { return m_BlockTerraform; }
@ -254,7 +254,7 @@ namespace OpenSim.Framework
}
private bool m_BlockFly = false;
public bool BlockFly
{
get { return m_BlockFly; }
@ -262,7 +262,7 @@ namespace OpenSim.Framework
}
private bool m_AllowDamage = false;
public bool AllowDamage
{
get { return m_AllowDamage; }
@ -270,7 +270,7 @@ namespace OpenSim.Framework
}
private bool m_RestrictPushing = false;
public bool RestrictPushing
{
get { return m_RestrictPushing; }
@ -278,7 +278,7 @@ namespace OpenSim.Framework
}
private bool m_AllowLandResell = true;
public bool AllowLandResell
{
get { return m_AllowLandResell; }
@ -286,7 +286,7 @@ namespace OpenSim.Framework
}
private bool m_AllowLandJoinDivide = true;
public bool AllowLandJoinDivide
{
get { return m_AllowLandJoinDivide; }
@ -294,7 +294,7 @@ namespace OpenSim.Framework
}
private bool m_BlockShowInSearch = false;
public bool BlockShowInSearch
{
get { return m_BlockShowInSearch; }
@ -302,7 +302,7 @@ namespace OpenSim.Framework
}
private int m_AgentLimit = 40;
public int AgentLimit
{
get { return m_AgentLimit; }
@ -310,7 +310,7 @@ namespace OpenSim.Framework
}
private double m_ObjectBonus = 1.0;
public double ObjectBonus
{
get { return m_ObjectBonus; }
@ -318,7 +318,7 @@ namespace OpenSim.Framework
}
private int m_Maturity = 1;
public int Maturity
{
get { return m_Maturity; }
@ -326,7 +326,7 @@ namespace OpenSim.Framework
}
private bool m_DisableScripts = false;
public bool DisableScripts
{
get { return m_DisableScripts; }
@ -334,7 +334,7 @@ namespace OpenSim.Framework
}
private bool m_DisableCollisions = false;
public bool DisableCollisions
{
get { return m_DisableCollisions; }
@ -342,7 +342,7 @@ namespace OpenSim.Framework
}
private bool m_DisablePhysics = false;
public bool DisablePhysics
{
get { return m_DisablePhysics; }
@ -350,7 +350,7 @@ namespace OpenSim.Framework
}
private LLUUID m_TerrainTexture1 = LLUUID.Zero;
public LLUUID TerrainTexture1
{
get { return m_TerrainTexture1; }
@ -358,7 +358,7 @@ namespace OpenSim.Framework
}
private LLUUID m_TerrainTexture2 = LLUUID.Zero;
public LLUUID TerrainTexture2
{
get { return m_TerrainTexture2; }
@ -366,7 +366,7 @@ namespace OpenSim.Framework
}
private LLUUID m_TerrainTexture3 = LLUUID.Zero;
public LLUUID TerrainTexture3
{
get { return m_TerrainTexture3; }
@ -374,7 +374,7 @@ namespace OpenSim.Framework
}
private LLUUID m_TerrainTexture4 = LLUUID.Zero;
public LLUUID TerrainTexture4
{
get { return m_TerrainTexture4; }
@ -382,7 +382,7 @@ namespace OpenSim.Framework
}
private double m_Elevation1NW = 10;
public double Elevation1NW
{
get { return m_Elevation1NW; }
@ -390,7 +390,7 @@ namespace OpenSim.Framework
}
private double m_Elevation2NW = 60;
public double Elevation2NW
{
get { return m_Elevation2NW; }
@ -398,7 +398,7 @@ namespace OpenSim.Framework
}
private double m_Elevation1NE = 10;
public double Elevation1NE
{
get { return m_Elevation1NE; }
@ -406,7 +406,7 @@ namespace OpenSim.Framework
}
private double m_Elevation2NE = 60;
public double Elevation2NE
{
get { return m_Elevation2NE; }
@ -414,7 +414,7 @@ namespace OpenSim.Framework
}
private double m_Elevation1SE = 10;
public double Elevation1SE
{
get { return m_Elevation1SE; }
@ -422,7 +422,7 @@ namespace OpenSim.Framework
}
private double m_Elevation2SE = 60;
public double Elevation2SE
{
get { return m_Elevation2SE; }
@ -430,7 +430,7 @@ namespace OpenSim.Framework
}
private double m_Elevation1SW = 10;
public double Elevation1SW
{
get { return m_Elevation1SW; }
@ -438,7 +438,7 @@ namespace OpenSim.Framework
}
private double m_Elevation2SW = 60;
public double Elevation2SW
{
get { return m_Elevation2SW; }
@ -446,7 +446,7 @@ namespace OpenSim.Framework
}
private double m_WaterHeight = 20;
public double WaterHeight
{
get { return m_WaterHeight; }
@ -454,7 +454,7 @@ namespace OpenSim.Framework
}
private double m_TerrainRaiseLimit = 100;
public double TerrainRaiseLimit
{
get { return m_TerrainRaiseLimit; }
@ -462,7 +462,7 @@ namespace OpenSim.Framework
}
private double m_TerrainLowerLimit = -100;
public double TerrainLowerLimit
{
get { return m_TerrainLowerLimit; }
@ -470,7 +470,7 @@ namespace OpenSim.Framework
}
private bool m_UseEstateSun = true;
public bool UseEstateSun
{
get { return m_UseEstateSun; }
@ -478,7 +478,7 @@ namespace OpenSim.Framework
}
private bool m_Sandbox = false;
public bool Sandbox
{
get { return m_Sandbox; }
@ -502,7 +502,7 @@ namespace OpenSim.Framework
}
private bool m_FixedSun = false;
public bool FixedSun
{
get { return m_FixedSun; }
@ -510,7 +510,7 @@ namespace OpenSim.Framework
}
private double m_SunPosition = 0.0;
public double SunPosition
{
get { return m_SunPosition; }
@ -518,7 +518,7 @@ namespace OpenSim.Framework
}
private LLUUID m_Covenant = LLUUID.Zero;
public LLUUID Covenant
{
get { return m_Covenant; }

View File

@ -172,7 +172,7 @@ namespace OpenSim.Framework.Servers
OSHttpResponse response = new OSHttpResponse(context.Response);
// This is the REST agent interface. We require an agent to properly identify
// itself. If the REST handler recognizes the prefix it will attempt to
// itself. If the REST handler recognizes the prefix it will attempt to
// satisfy the request. If it is not recognizable, and no damage has occurred
// the request can be passed through to the other handlers. This is a low
// probability event; if a request is matched it is normally expected to be
@ -650,7 +650,7 @@ namespace OpenSim.Framework.Servers
}
response.AddHeader("Content-type", contentType);
byte[] buffer;
if (!contentType.Contains("image"))

View File

@ -89,7 +89,7 @@ namespace OpenSim.Framework.Servers
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
m_periodicDiagnosticsTimer.Enabled = true;
// Add ourselves to thread monitoring. This thread will go on to become the console listening thread
Thread.CurrentThread.Name = "ConsoleThread";
ThreadTracker.Add(Thread.CurrentThread);
@ -102,15 +102,15 @@ namespace OpenSim.Framework.Servers
{
StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
sb.Append(GetUptimeReport());
if (m_stats != null)
{
sb.Append(m_stats.Report());
}
m_log.Debug(sb);
}
/// <summary>
/// Return a report about the uptime of this server
/// </summary>
@ -120,10 +120,10 @@ namespace OpenSim.Framework.Servers
StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now));
sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime));
sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime));
return sb.ToString();
}
/// <summary>
/// Set the level of log notices being echoed to the console
/// </summary>
@ -133,7 +133,7 @@ namespace OpenSim.Framework.Servers
ILoggerRepository repository = LogManager.GetRepository();
IAppender[] appenders = repository.GetAppenders();
OpenSimAppender consoleAppender = null;
foreach (IAppender appender in appenders)
{
if (appender.Name == "Console")
@ -142,13 +142,13 @@ namespace OpenSim.Framework.Servers
break;
}
}
if (null == consoleAppender)
{
Notice("No appender named Console found (see the log4net config file for this executable)!");
return;
}
if (setParams.Length > 0)
{
Level consoleLevel = repository.LevelMap[setParams[0]];
@ -160,12 +160,12 @@ namespace OpenSim.Framework.Servers
"{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
setParams[0]));
}
// If there is no threshold set then the threshold is effectively everything.
Level thresholdLevel
= (null != consoleAppender.Threshold ? consoleAppender.Threshold : log4net.Core.Level.All);
Notice(String.Format("Console log level is {0}", thresholdLevel));
Notice(String.Format("Console log level is {0}", thresholdLevel));
}
/// <summary>
@ -203,7 +203,7 @@ namespace OpenSim.Framework.Servers
Notice("");
Notice("quit - equivalent to shutdown.");
Notice("set log level [level] - change the console logging level only. For example, off or debug.");
Notice("set log level [level] - change the console logging level only. For example, off or debug.");
Notice("show info - show server information (e.g. startup path).");
if (m_stats != null)
@ -219,7 +219,7 @@ namespace OpenSim.Framework.Servers
case "set":
Set(cmdparams);
break;
case "show":
if (cmdparams.Length > 0)
{
@ -232,8 +232,8 @@ namespace OpenSim.Framework.Servers
Shutdown();
break;
}
}
}
/// <summary>
/// Set an OpenSim parameter
/// </summary>
@ -245,15 +245,15 @@ namespace OpenSim.Framework.Servers
// Temporary while we only have one command which takes at least two parameters
if (setArgs.Length < 2)
return;
if (setArgs[0] == "log" && setArgs[1] == "level")
{
string[] setParams = new string[setArgs.Length - 2];
Array.Copy(setArgs, 2, setParams, 0, setArgs.Length - 2);
SetConsoleLogLevel(setParams);
SetConsoleLogLevel(setParams);
}
}
}
/// <summary>
/// Outputs to the console information about the region
@ -276,7 +276,7 @@ namespace OpenSim.Framework.Servers
Notice(m_stats.Report());
}
break;
case "threads":
List<Thread> threads = ThreadTracker.GetThreads();
if (threads == null)
@ -291,7 +291,7 @@ namespace OpenSim.Framework.Servers
Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString());
}
}
break;
break;
case "uptime":
Notice(GetUptimeReport());
@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers
Notice("Version: " + m_version);
break;
}
}
}
/// <summary>
/// Console output is only possible if a console has been established.

View File

@ -72,21 +72,21 @@ namespace OpenSim.Framework.Servers
/// Regular expression used to match against method of
/// the incoming HTTP request. If you want to match any string
/// either use '.*' or null. To match on the empty string use
/// '^$'.
/// '^$'.
/// </summary>
public virtual Regex Method
{
get { return _method; }
}
protected Regex _method;
/// <summary>
/// Regular expression used to match against path of the
/// incoming HTTP request. If you want to match any string
/// either use '.*' or null. To match on the emtpy string use
/// '^$'.
/// </summary>
public virtual Regex Path
public virtual Regex Path
{
get { return _path; }
}
@ -97,7 +97,7 @@ namespace OpenSim.Framework.Servers
/// allowing us to match on URI query fields.
/// </summary>
public virtual Dictionary<string, Regex> Query
{
{
get { return _query; }
}
protected Dictionary<string, Regex> _query;
@ -107,7 +107,7 @@ namespace OpenSim.Framework.Servers
/// allowing us to match on HTTP header fields.
/// </summary>
public virtual Dictionary<string, Regex> Headers
{
{
get { return _headers; }
}
protected Dictionary<string, Regex> _headers;
@ -137,7 +137,7 @@ namespace OpenSim.Framework.Servers
/// <param name="contentType">null or content type
/// regex</param>
/// <param name="whitelist">null or IP address regex</param>
public OSHttpHandler(Regex method, Regex path, Dictionary<string, Regex> query,
public OSHttpHandler(Regex method, Regex path, Dictionary<string, Regex> query,
Dictionary<string, Regex> headers, Regex contentType, Regex whitelist)
{
_method = method;
@ -155,7 +155,7 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Process an incoming OSHttpRequest that matched our
/// requirements.
/// requirements.
/// </summary>
/// <returns>
/// OSHttpHandlerResult.Pass if we are after all not
@ -180,4 +180,4 @@ namespace OpenSim.Framework.Servers
return sw.ToString();
}
}
}
}

View File

@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers
/// <param name="headers">null or dictionary with header
/// regexs</param>
/// <param name="whitelist">null or IP address whitelist</param>
public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path,
public OSHttpHttpHandler(GenericHTTPMethod handler, Regex method, Regex path,
Dictionary<string, Regex> query,
Dictionary<string, Regex> headers, Regex whitelist)
: base(method, path, query, headers, new Regex(@"^text/html", RegexOptions.IgnoreCase | RegexOptions.Compiled),
@ -71,7 +71,7 @@ namespace OpenSim.Framework.Servers
/// Instantiate an HTTP handler.
/// </summary>
/// <param name="handler">a GenericHTTPMethod</param>
public OSHttpHttpHandler(GenericHTTPMethod handler)
public OSHttpHttpHandler(GenericHTTPMethod handler)
: this(handler, new Regex(@"^GET$", RegexOptions.IgnoreCase | RegexOptions.Compiled), null, null, null, null)
{
}
@ -79,7 +79,7 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Invoked by OSHttpRequestPump.
/// </summary>
public override OSHttpHandlerResult Process(OSHttpRequest request)
public override OSHttpHandlerResult Process(OSHttpRequest request)
{
// call handler method
Hashtable responseData = _handler(request.Query);
@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers
}
response.AddHeader("Content-type", contentType);
byte[] buffer;
if (!contentType.Contains("image"))
@ -142,4 +142,4 @@ namespace OpenSim.Framework.Servers
return OSHttpHandlerResult.Done;
}
}
}
}

View File

@ -38,42 +38,35 @@ namespace OpenSim.Framework.Servers
{
public class OSHttpRequest
{
public string[] AcceptTypes
{
get { return _acceptTypes; }
}
private string[] _acceptTypes;
public Encoding ContentEncoding
{
get { return _contentEncoding; }
}
private Encoding _contentEncoding;
public long ContentLength
{
get { return _contentLength64; }
}
private long _contentLength64;
public long ContentLength64
{
get { return ContentLength; }
}
public string ContentType
{
get { return _contentType; }
}
private string _contentType;
// public CookieCollection Cookies
// {
// get { return _cookies; }
@ -92,63 +85,54 @@ namespace OpenSim.Framework.Servers
}
private string _httpMethod;
public Stream InputStream
{
get { return _inputStream; }
}
private Stream _inputStream;
// public bool IsSecureConnection
// {
// get { return _isSecureConnection; }
// }
// private bool _isSecureConnection;
// public bool IsAuthenticated
// {
// get { return _isAuthenticated; }
// }
// private bool _isAuthenticated;
public bool HasEntityBody
{
get { return _hasbody; }
}
private bool _hasbody;
public bool KeepAlive
{
get { return _keepAlive; }
}
private bool _keepAlive;
public string RawUrl
{
get { return _rawUrl; }
}
private string _rawUrl;
public Uri Url
{
get { return _url; }
}
private Uri _url;
public string UserAgent
{
get { return _userAgent; }
}
private string _userAgent;
public NameValueCollection QueryString
{
get { return _queryString; }
@ -161,28 +145,24 @@ namespace OpenSim.Framework.Servers
}
private Hashtable _query;
public IPEndPoint RemoteIPEndPoint
{
get { return _ipEndPoint; }
}
private IPEndPoint _ipEndPoint;
internal HttpRequest HttpRequest
{
get { return _request; }
}
private HttpRequest _request;
internal HttpClientContext HttpClientContext
{
get { return _context; }
}
private HttpClientContext _context;
/// <summary>
/// Internal whiteboard for handlers to store temporary stuff
/// into.
@ -193,12 +173,10 @@ namespace OpenSim.Framework.Servers
}
private Dictionary<string, object> _whiteboard = new Dictionary<string, object>();
public OSHttpRequest()
{
}
public OSHttpRequest(HttpListenerRequest req)
{
_acceptTypes = req.AcceptTypes;

View File

@ -39,7 +39,6 @@ using System.Threading;
using log4net;
using HttpServer;
namespace OpenSim.Framework.Servers
{
/// <summary>
@ -58,13 +57,12 @@ namespace OpenSim.Framework.Servers
protected Thread _engine;
private int _id;
public string EngineID
{
get { return String.Format("{0} pump {1}", _server.EngineID, _id); }
}
public OSHttpRequestPump(OSHttpServer server, OSHttpRequestQueue queue, int id)
{
_server = server;
@ -77,7 +75,6 @@ namespace OpenSim.Framework.Servers
_engine.Start();
ThreadTracker.Add(_engine);
}
public static OSHttpRequestPump[] Pumps(OSHttpServer server, OSHttpRequestQueue queue, int poolSize)
@ -104,21 +101,22 @@ namespace OpenSim.Framework.Servers
public void Engine()
{
OSHttpRequest req = null;
while (true)
{
try {
try
{
// dequeue an OSHttpRequest from OSHttpServer's
// request queue
// request queue
req = _queue.Dequeue();
// get a copy of the list of registered handlers
List<OSHttpHandler> handlers = _server.OSHttpHandlers;
// prune list and have it sorted from most
// specific to least specific
handlers = MatchHandlers(req, handlers);
// process req: we try each handler in turn until
// we are either out of handlers or get back a
// Pass or Done
@ -126,18 +124,18 @@ namespace OpenSim.Framework.Servers
foreach (OSHttpHandler h in handlers)
{
rc = h.Process(req);
// Pass: handler did not process the request,
// try next handler
if (OSHttpHandlerResult.Pass == rc) continue;
// Handled: handler has processed the request
if (OSHttpHandlerResult.Done == rc) break;
// hmm, something went wrong
throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc));
}
if (OSHttpHandlerResult.Unprocessed == rc)
{
_log.InfoFormat("[{0}] OSHttpHandler: no handler registered for {1}", EngineID, req);
@ -190,7 +188,7 @@ namespace OpenSim.Framework.Servers
if (null != remote)
{
Match epm = h.IPEndPointWhitelist.Match(remote.ToString());
if (!epm.Success)
if (!epm.Success)
{
scoredHandlers.Remove(h);
continue;
@ -201,7 +199,7 @@ namespace OpenSim.Framework.Servers
if (null != h.Method)
{
Match m = h.Method.Match(req.HttpMethod);
if (!m.Success)
if (!m.Success)
{
scoredHandlers.Remove(h);
continue;
@ -213,7 +211,7 @@ namespace OpenSim.Framework.Servers
if (null != h.Path)
{
Match m = h.Path.Match(req.RawUrl);
if (!m.Success)
if (!m.Success)
{
scoredHandlers.Remove(h);
continue;
@ -272,14 +270,15 @@ namespace OpenSim.Framework.Servers
{
return 0;
}
// does the content of collection[tag] match
// the supplied regex?
Match cm = regexs[tag].Match(collection[tag]);
if (!cm.Success) {
if (!cm.Success)
{
return 0;
}
// ok: matches
matched++;
continue;
@ -288,7 +287,7 @@ namespace OpenSim.Framework.Servers
return matched;
}
[ConditionalAttribute("DEBUGGING")]
[ConditionalAttribute("DEBUGGING")]
private void LogDumpHandlerList(List<OSHttpHandler> l)
{
_log.DebugFormat("[{0}] OSHttpHandlerList dump:", EngineID);

View File

@ -40,7 +40,7 @@ namespace OpenSim.Framework.Servers
{
private object _syncObject = new object();
new public void Enqueue(OSHttpRequest req)
new public void Enqueue(OSHttpRequest req)
{
lock (_syncObject)
{
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers
Monitor.Pulse(_syncObject);
}
}
new public OSHttpRequest Dequeue()
{
OSHttpRequest req = null;
@ -65,4 +65,4 @@ namespace OpenSim.Framework.Servers
return req;
}
}
}
}

View File

@ -56,15 +56,15 @@ namespace OpenSim.Framework.Servers
/// </summary>
/// <remarks>
/// Setting this property will also set IsContentTypeSet to
/// true.
/// true.
/// </remarks>
public string ContentType
{
get
{
get
{
if (HttpServer)
return _httpResponse.ContentType;
else
else
return _httpListenerResponse.ContentType;
}
set
@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers
/// </summary>
public long ContentLength
{
get
{
get
{
if (HttpServer)
return _httpResponse.ContentLength;
else
else
return _httpListenerResponse.ContentLength64;
}
set
@ -130,11 +130,11 @@ namespace OpenSim.Framework.Servers
/// </summary>
public Encoding ContentEncoding
{
get
{
get
{
if (HttpServer)
return _httpResponse.Encoding;
else
else
return _httpListenerResponse.ContentEncoding;
}
@ -142,7 +142,7 @@ namespace OpenSim.Framework.Servers
{
if (HttpServer)
_httpResponse.Encoding = value;
else
else
_httpListenerResponse.ContentEncoding = value;
}
}
@ -152,8 +152,8 @@ namespace OpenSim.Framework.Servers
/// </summary>
public WebHeaderCollection Headers
{
get
{
get
{
if (HttpServer)
return null;
else
@ -166,10 +166,10 @@ namespace OpenSim.Framework.Servers
/// </summary>
public bool KeepAlive
{
get
{
get
{
if (HttpServer)
return _httpResponse.Connection == ConnectionType.KeepAlive;
return _httpResponse.Connection == ConnectionType.KeepAlive;
else
return _httpListenerResponse.KeepAlive;
}
@ -178,7 +178,7 @@ namespace OpenSim.Framework.Servers
{
if (HttpServer)
_httpResponse.Connection = ConnectionType.KeepAlive;
else
else
_httpListenerResponse.KeepAlive = value;
}
}
@ -191,8 +191,8 @@ namespace OpenSim.Framework.Servers
/// </remarks>
public Stream OutputStream
{
get
{
get
{
if (HttpServer)
return _httpResponse.Body;
else
@ -205,10 +205,10 @@ namespace OpenSim.Framework.Servers
/// </summary>
public Stream Body
{
get
{
get
{
if (HttpServer)
return _httpResponse.Body;
return _httpResponse.Body;
throw new Exception("[OSHttpResponse] mixed .NET and HttpServer access");
}
}
@ -228,18 +228,18 @@ namespace OpenSim.Framework.Servers
}
}
/// <summary>
/// Chunk transfers.
/// </summary>
public bool SendChunked
{
get
{
get
{
if (HttpServer)
return _httpResponse.Chunked;
else
return _httpListenerResponse.SendChunked;
return _httpListenerResponse.SendChunked;
}
set
@ -256,12 +256,12 @@ namespace OpenSim.Framework.Servers
/// </summary>
public int StatusCode
{
get
{
get
{
if (HttpServer)
return (int)_httpResponse.Status;
else
return _httpListenerResponse.StatusCode;
else
return _httpListenerResponse.StatusCode;
}
set
@ -279,12 +279,12 @@ namespace OpenSim.Framework.Servers
/// </summary>
public string StatusDescription
{
get
{
get
{
if (HttpServer)
return _httpResponse.Reason;
else
return _httpListenerResponse.StatusDescription;
return _httpListenerResponse.StatusDescription;
}
set
@ -331,7 +331,7 @@ namespace OpenSim.Framework.Servers
/// object.
/// </summary
/// <param name="req">Incoming OSHttpRequest to which we are
/// replying</param>
/// replying</param>
public OSHttpResponse(OSHttpRequest req)
{
_httpResponse = new HttpResponse(req.HttpClientContext, req.HttpRequest);
@ -343,7 +343,7 @@ namespace OpenSim.Framework.Servers
/// <param name="key">string containing the header field
/// name</param>
/// <param name="value">string containing the header field
/// value</param>
/// value</param>
public void AddHeader(string key, string value)
{
if (HttpServer)
@ -361,8 +361,8 @@ namespace OpenSim.Framework.Servers
{
_httpResponse.Body.Flush();
_httpResponse.Send();
}
else
}
else
{
OutputStream.Close();
}

View File

@ -80,7 +80,7 @@ namespace OpenSim.Framework.Servers
get { return _isSecure; }
}
public int QueueSize
public int QueueSize
{
get { return _pumps.Length; }
}
@ -91,7 +91,7 @@ namespace OpenSim.Framework.Servers
protected List<OSHttpHandler> _httpHandlers = new List<OSHttpHandler>();
public List<OSHttpHandler> OSHttpHandlers
{
get
get
{
lock (_httpHandlers)
{
@ -175,7 +175,7 @@ namespace OpenSim.Framework.Servers
_listener.RequestHandler += OnHttpRequest;
_listener.Start(QueueSize);
_log.InfoFormat("[{0}] HTTP server started", EngineID);
lock (_syncObject) Monitor.Wait(_syncObject);
}
catch (Exception ex)
@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
/// and regular expressions to match against header values</param>
public void AddHandler(OSHttpHandler handler)
{
lock (_httpHandlers)
lock (_httpHandlers)
{
if (_httpHandlers.Contains(handler))
{

View File

@ -54,16 +54,16 @@ namespace OpenSim.Framework.Servers
protected bool XmlRpcMethodMatch(OSHttpRequest req)
{
XmlRpcRequest xmlRpcRequest = null;
// check whether req is already reified
// if not: reify (and post to whiteboard)
try
try
{
if (req.Whiteboard.ContainsKey("xmlrequest"))
{
xmlRpcRequest = req.Whiteboard["xmlrequest"] as XmlRpcRequest;
}
else
else
{
StreamReader body = new StreamReader(req.InputStream);
string requestBody = body.ReadToEnd();
@ -76,22 +76,22 @@ namespace OpenSim.Framework.Servers
_log.ErrorFormat("[OSHttpXmlRpcHandler] failed to deserialize XmlRpcRequest from {0}", req.ToString());
return false;
}
// check against methodName
if ((null != xmlRpcRequest)
&& !String.IsNullOrEmpty(xmlRpcRequest.MethodName)
if ((null != xmlRpcRequest)
&& !String.IsNullOrEmpty(xmlRpcRequest.MethodName)
&& xmlRpcRequest.MethodName == _methodName)
{
_log.DebugFormat("[OSHttpXmlRpcHandler] located handler {0} for {1}", _methodName, req.ToString());
return true;
}
return false;
}
// contains handler for processing XmlRpc Request
private XmlRpcMethod _handler;
// contains XmlRpc method name
private string _methodName;
@ -112,9 +112,9 @@ namespace OpenSim.Framework.Servers
/// can be null, in which case they are not taken into account
/// when the handler is being looked up.
/// </remarks>
public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path,
public OSHttpXmlRpcHandler(XmlRpcMethod handler, string methodName, Regex path,
Dictionary<string, Regex> headers, Regex whitelist)
: base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers,
: base(new Regex(@"^POST$", RegexOptions.IgnoreCase | RegexOptions.Compiled), path, null, headers,
new Regex(@"^(text|application)/xml", RegexOptions.IgnoreCase | RegexOptions.Compiled),
whitelist)
{
@ -138,7 +138,7 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Invoked by OSHttpRequestPump.
/// </summary>
public override OSHttpHandlerResult Process(OSHttpRequest request)
public override OSHttpHandlerResult Process(OSHttpRequest request)
{
XmlRpcResponse xmlRpcResponse;
string responseString;
@ -148,13 +148,13 @@ namespace OpenSim.Framework.Servers
OSHttpResponse resp = new OSHttpResponse(request);
try
try
{
// reified XmlRpcRequest must still be on the whiteboard
XmlRpcRequest xmlRpcRequest = request.Whiteboard["xmlrequest"] as XmlRpcRequest;
xmlRpcResponse = _handler(xmlRpcRequest);
responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
resp.ContentType = "text/xml";
byte[] buffer = Encoding.UTF8.GetBytes(responseString);
@ -176,4 +176,4 @@ namespace OpenSim.Framework.Servers
return OSHttpHandlerResult.Done;
}
}
}
}

View File

@ -151,7 +151,7 @@ namespace OpenSim.Framework.Servers
private CheckIdentityMethod m_smethod;
public RestDeserialiseSecureHandler(
string httpMethod, string path,
string httpMethod, string path,
RestDeserialiseMethod<TRequest, TResponse> method, CheckIdentityMethod smethod)
: base(httpMethod, path)
{
@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers
/// <param name="method"></param>
/// <param name="tmethod"></param>
private RestDeserialiseMethod<TRequest, TResponse> m_method;
/// <summary>
/// The method used to check whether a request is trusted.
/// </summary>

View File

@ -24,10 +24,10 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Text;
namespace OpenSim.Framework.Statistics
{
/// <summary>
@ -44,7 +44,7 @@ namespace OpenSim.Framework.Statistics
string.Format(
"Allocated to OpenSim : {0} MB" + Environment.NewLine,
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
return sb.ToString();
}
}

View File

@ -40,7 +40,7 @@ namespace OpenSim.Framework.Statistics
public class SimExtraStatsCollector : BaseStatsCollector
{
private long abnormalClientThreadTerminations;
private long assetsInCache;
private long texturesInCache;
private long assetCacheMemoryUsage;
@ -49,7 +49,7 @@ namespace OpenSim.Framework.Statistics
private long assetServiceRequestFailures;
private long inventoryServiceRetrievalFailures;
private float timeDilation;
private float simFps;
private float physicsFps;
@ -70,8 +70,8 @@ namespace OpenSim.Framework.Statistics
private float pendingDownloads;
private float pendingUploads;
private float activeScripts;
private float scriptLinesPerSecond;
private float scriptLinesPerSecond;
/// <summary>
/// Number of times that a client thread terminated because of an exception
/// </summary>
@ -79,7 +79,7 @@ namespace OpenSim.Framework.Statistics
/// <summary>
/// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
/// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
/// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
/// haven't yet been implemented... :)
/// </summary>
public long AssetsInCache { get { return assetsInCache; } }
@ -101,19 +101,19 @@ namespace OpenSim.Framework.Statistics
/// as a failure
/// </summary>
public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
/// <summary>
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not
/// cover situations where the inventory service accepts the request but never returns any data, since
/// we do not yet timeout this situation.
/// </summary>
public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <summary>
/// Retrieve the total frame time (in ms) of the last frame
/// </summary>
//public float TotalFrameTime { get { return totalFrameTime; } }
/// <summary>
/// Retrieve the physics update component (in ms) of the last frame
/// </summary>
@ -124,7 +124,7 @@ namespace OpenSim.Framework.Statistics
/// </summary>
private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors
= new Dictionary<LLUUID, PacketQueueStatsCollector>();
public void AddAbnormalClientThreadTermination()
{
abnormalClientThreadTerminations++;
@ -146,7 +146,7 @@ namespace OpenSim.Framework.Statistics
textureCacheMemoryUsage += image.Data.Length;
}
}
/// <summary>
/// Signal that the asset cache can be cleared.
/// </summary>
@ -167,7 +167,7 @@ namespace OpenSim.Framework.Statistics
{
assetServiceRequestFailures++;
}
public void AddInventoryServiceRetrievalFailure()
{
inventoryServiceRetrievalFailures++;
@ -199,18 +199,18 @@ namespace OpenSim.Framework.Statistics
packetQueueStatsCollectors.Remove(uuid);
}
}
/// <summary>
/// This is the method on which the classic sim stats reporter (which collects stats for
/// This is the method on which the classic sim stats reporter (which collects stats for
/// client purposes) sends information to listeners.
/// </summary>
/// <param name="pack"></param>
public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket)
public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket)
{
// FIXME: Really shouldn't rely on the probably arbitrary order in which
// stats are packed into the packet
timeDilation = statsPacket.Stat[0].StatValue;
simFps = statsPacket.Stat[1].StatValue;
simFps = statsPacket.Stat[1].StatValue;
physicsFps = statsPacket.Stat[2].StatValue;
agentUpdates = statsPacket.Stat[3].StatValue;
rootAgents = statsPacket.Stat[4].StatValue;
@ -231,7 +231,7 @@ namespace OpenSim.Framework.Statistics
activeScripts = statsPacket.Stat[19].StatValue;
scriptLinesPerSecond = statsPacket.Stat[20].StatValue;
}
/// <summary>
/// Report back collected statistical information.
/// </summary>
@ -248,10 +248,10 @@ Texture cache contains {2,6} texture assets using {3,10} K
Blocked client requests for missing textures: {4}
Asset service request failures: {5}"+ Environment.NewLine,
AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0),
TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0),
TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0),
BlockedMissingTextureRequests,
AssetServiceRequestFailures));
sb.Append(Environment.NewLine);
sb.Append("CONNECTION STATISTICS");
sb.Append(Environment.NewLine);
@ -267,7 +267,7 @@ Asset service request failures: {5}"+ Environment.NewLine,
string.Format(
"Initial inventory caching failures: {0}" + Environment.NewLine,
InventoryServiceRetrievalFailures));
sb.Append(Environment.NewLine);
sb.Append("FRAME STATISTICS");
sb.Append(Environment.NewLine);
@ -278,18 +278,18 @@ Asset service request failures: {5}"+ Environment.NewLine,
"{0,6:0.00} {1,6:0} {2,6:0.0} {3,6:0.0} {4,6:0} {5,6:0} {6,6:0} {7,6:0} {8,6:0} {9,6:0}",
timeDilation, simFps, physicsFps, agentUpdates, rootAgents,
childAgents, totalPrims, activePrims, activeScripts, scriptLinesPerSecond));
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
// There is no script frame time currently because we don't yet collect it
sb.Append("PktsIn PktOut PendDl PendUl UnackB TotlFt NetFt PhysFt OthrFt AgntFt ImgsFt");
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
"{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}",
inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime,
netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime));
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
/*
sb.Append(Environment.NewLine);
@ -311,7 +311,7 @@ Asset service request failures: {5}"+ Environment.NewLine,
*/
sb.Append(base.Report());
return sb.ToString();
}
}

View File

@ -226,7 +226,7 @@ namespace OpenSim.Framework
private LLUUID _permsGranter;
private int _permsMask;
private int _type = 0;
public LLUUID AssetID {
get {
return _assetID;
@ -437,4 +437,4 @@ namespace OpenSim.Framework
_parentPartID = partID;
}
}
}
}

View File

@ -716,7 +716,7 @@ namespace OpenSim.Framework
XmlRpcRequest client = new XmlRpcRequest(methodName, args);
return client.Send(url, 6000);
}
// used for RemoteParcelRequest (for "About Landmark")
public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) {
byte[] bytes = {
@ -726,7 +726,7 @@ namespace OpenSim.Framework
(byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y };
return new LLUUID(bytes, 0);
}
public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) {
byte[] bytes = parcelID.GetBytes();
regionHandle = Helpers.BytesToUInt64(bytes);

View File

@ -83,7 +83,7 @@ namespace OpenSim.Grid.AssetServer
public override void Startup()
{
base.Startup();
AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml")));
m_log.Info("[ASSET]: Setting up asset DB");
@ -115,17 +115,17 @@ namespace OpenSim.Grid.AssetServer
public IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect)
{
PluginLoader<IAssetProviderPlugin> loader =
PluginLoader<IAssetProviderPlugin> loader =
new PluginLoader<IAssetProviderPlugin> (new AssetDataInitialiser (connect));
// loader will try to load all providers (MySQL, MSSQL, etc)
// loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "Provider" entry in the addin.xml
loader.Add ("/OpenSim/AssetData", new PluginProviderFilter (provider));
loader.Load();
return loader.Plugin;
}
public void setupDB(AssetConfig config)
{
try

View File

@ -40,17 +40,17 @@ namespace OpenSim.Grid.Communications.OGS1
public class OGS1InterServiceInventoryService : IInterServiceInventoryServices
{
protected Uri m_inventoryServerUrl;
public OGS1InterServiceInventoryService(Uri inventoryServerUrl)
{
m_inventoryServerUrl = inventoryServerUrl;
}
/// <summary>
/// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
/// <returns></returns>
public bool CreateNewUserInventory(LLUUID userId)
{
return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>(

View File

@ -61,20 +61,20 @@ namespace OpenSim.Grid.GridServer
/// <param name="provider">The name of the grid server plugin DLL</param>
public void AddPlugin(string provider, string connect)
{
PluginLoader<IGridDataPlugin> gridloader =
PluginLoader<IGridDataPlugin> gridloader =
new PluginLoader<IGridDataPlugin> (new GridDataInitialiser (connect));
PluginLoader<ILogDataPlugin> logloader =
PluginLoader<ILogDataPlugin> logloader =
new PluginLoader<ILogDataPlugin> (new LogDataInitialiser (connect));
// loader will try to load all providers (MySQL, MSSQL, etc)
// loader will try to load all providers (MySQL, MSSQL, etc)
// unless it is constrainted to the correct "Provider" entry in the addin.xml
gridloader.Add ("/OpenSim/GridData", new PluginProviderFilter (provider));
logloader.Add ("/OpenSim/LogData", new PluginProviderFilter (provider));
gridloader.Load();
logloader.Load();
_plugins = gridloader.Plugins;
_logplugins = logloader.Plugins;
}
@ -382,7 +382,7 @@ namespace OpenSim.Grid.GridServer
string logMsg = e.Message;
if (e.InnerException != null)
logMsg += ", " + e.InnerException.Message;
m_log.WarnFormat("[LOGIN END]: {0}", logMsg);
return e.XmlRpcErrorResponse;

View File

@ -34,7 +34,7 @@ namespace OpenSim.Grid.GridServer
{
void Initialise(GridServerBase gridServer);
}
public class GridPluginInitialiser : PluginInitialiserBase
{
private GridServerBase server;

View File

@ -84,12 +84,12 @@ namespace OpenSim.Grid.InventoryServer
{
return true;
}
}
}
m_log.WarnFormat(
"[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources",
peer);
"[GRID AGENT INVENTORY]: Rejecting request since source {0} was not in the list of trusted sources",
peer);
return false;
}
else
@ -110,7 +110,7 @@ namespace OpenSim.Grid.InventoryServer
if (m_doLookup)
{
m_log.InfoFormat("[GRID AGENT INVENTORY]: checking authed session {0} {1}", session_id, avatar_id);
if (m_session_cache.getCachedSession(session_id, avatar_id) == null)
{
// cache miss, ask userserver
@ -137,7 +137,7 @@ namespace OpenSim.Grid.InventoryServer
m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache");
return true;
}
m_log.Warn("[GRID AGENT INVENTORY]: unknown session_id, request rejected");
return false;
}

View File

@ -65,7 +65,7 @@ namespace OpenSim.Grid.InventoryServer
public override void Startup()
{
base.Startup();
InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
m_inventoryService = new GridInventoryService(config.UserServerURL);

View File

@ -43,10 +43,10 @@ namespace OpenGridServices.Manager
{
case Gtk.ResponseType.Ok:
MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text);
break;
break;
case Gtk.ResponseType.Cancel:
break;
break;
}
this.Hide();
}

View File

@ -41,9 +41,9 @@ namespace OpenGridServices.Manager
private string ServerURL;
public LLUUID SessionID;
public bool connected=false;
public RegionBlock[][] WorldMap;
public bool Connect(string GridServerURL, string username, string password)
{
try
@ -76,14 +76,14 @@ namespace OpenGridServices.Manager
return false;
}
}
public void DownloadMap()
{
System.Net.WebClient mapdownloader = new WebClient();
Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist");
RegionBlock TempRegionData;
XmlDocument doc = new XmlDocument();
doc.Load(regionliststream);
regionliststream.Close();
@ -105,12 +105,12 @@ namespace OpenGridServices.Manager
}
}
}
public bool RestartServer()
{
return true;
}
public bool ShutdownServer()
{
try
@ -137,7 +137,7 @@ namespace OpenGridServices.Manager
return false;
}
}
public void DisconnectServer()
{
this.connected=false;

View File

@ -38,9 +38,9 @@ namespace OpenGridServices.Manager
public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>();
private static Thread OperationsRunner;
private static GridServerConnectionManager gridserverConn;
private static MainWindow win;
public static void DoMainLoop()
@ -79,7 +79,7 @@ namespace OpenGridServices.Manager
win.SetStatus("Could not connect");
}
break;
case "restart_gridserver":
win.SetStatus("Restarting grid server...");
if (gridserverConn.RestartServer())
@ -93,7 +93,7 @@ namespace OpenGridServices.Manager
win.SetStatus("Error restarting grid server!!!");
}
break;
case "shutdown_gridserver":
win.SetStatus("Shutting down grid server...");
if (gridserverConn.ShutdownServer())
@ -108,7 +108,7 @@ namespace OpenGridServices.Manager
win.SetStatus("Could not shutdown grid server!!!");
}
break;
case "disconnect_gridserver":
gridserverConn.DisconnectServer();
win.SetGridServerConnected(false);

View File

@ -83,14 +83,12 @@ namespace OpenSim.Grid.MessagingServer
public override void Startup()
{
base.Startup();
Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml")));
m_log.Info("[REGION]: Starting HTTP process");
m_httpServer = new BaseHttpServer(Cfg.HttpPort);
msgsvc = new MessageService(Cfg);
if (msgsvc.registerWithUserServer())
@ -123,7 +121,6 @@ namespace OpenSim.Grid.MessagingServer
switch (what)
{
case "user":
try
{
//userID =
@ -161,8 +158,6 @@ namespace OpenSim.Grid.MessagingServer
m_console.Notice("Region cache cleared! Cleared " + entries.ToString() + " entries");
break;
}
}
public override void Shutdown()

View File

@ -62,7 +62,7 @@ namespace OpenSim.Grid.MessagingServer
}
return result;
}
public int Count
{
get

View File

@ -45,7 +45,6 @@ namespace OpenSim.Grid.ScriptServer
regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer,
moduleLoader, dumpAssetsToFile, physicalPrim, sendTasksToChild, config, "")
{
}
// What does a scene have to do? :P

View File

@ -57,7 +57,7 @@ namespace OpenSim.Grid.ScriptServer
internal TCPServer m_TCPServer;
internal TRPC_Remote RPC;
public ScriptServerMain()
public ScriptServerMain()
{
m_console = CreateConsole();
@ -68,7 +68,6 @@ namespace OpenSim.Grid.ScriptServer
Engine = ScriptEngines.LoadEngine("DotNetEngine");
Engine.InitializeEngine(null, null, false, Engine.GetScriptManager());
// Set up server
//m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine");

View File

@ -90,7 +90,7 @@ namespace OpenSim.Grid.UserServer
public override void Startup()
{
base.Startup();
Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
m_stats = StatsManager.StartCollectingUserStats();
@ -101,11 +101,11 @@ namespace OpenSim.Grid.UserServer
m_gridInfoService = new GridInfoService();
m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl);
m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl);
m_loginService = new UserLoginService(
m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
m_messagesService = new MessageServersConnector();
m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation;
@ -151,7 +151,6 @@ namespace OpenSim.Grid.UserServer
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
m_httpServer.AddStreamHandler(
new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod));
@ -188,7 +187,7 @@ namespace OpenSim.Grid.UserServer
tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty);
LLUUID userID = new LLUUID();
try
{
userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
@ -199,7 +198,7 @@ namespace OpenSim.Grid.UserServer
}
try
{
{
if (!m_interServiceInventoryService.CreateNewUserInventory(userID))
{
throw new Exception(
@ -245,9 +244,9 @@ namespace OpenSim.Grid.UserServer
// requester.ReturnResponseVal = TestResponse;
// requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser);
SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>(
"POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser);
break;
"POST", Cfg.InventoryUrl + "RootFolders/", m_lastCreatedUser);
break;
case "logoff-user":
if (cmdparams.Length >= 3)
@ -279,7 +278,7 @@ namespace OpenSim.Grid.UserServer
m_loginService.LogOffUser(theUser, message);
theUser.CurrentAgent.AgentOnline = false;
m_loginService.CommitAgent(ref theUser);
}
else

View File

@ -46,7 +46,7 @@ namespace OpenSim.Grid.UserServer
public class UserLoginService : LoginService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected IInterServiceInventoryServices m_inventoryService;
public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
@ -63,7 +63,7 @@ namespace OpenSim.Grid.UserServer
m_config = config;
m_inventoryService = inventoryService;
}
public override void LogOffUser(UserProfileData theUser, string message)
{
RegionProfileData SimInfo = null;
@ -72,7 +72,7 @@ namespace OpenSim.Grid.UserServer
SimInfo = RegionProfileData.RequestSimProfileData(
theUser.CurrentAgent.Handle, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
if (SimInfo == null)
{
m_log.Error("[GRID]: Region user was in isn't currently logged in");
@ -84,7 +84,7 @@ namespace OpenSim.Grid.UserServer
m_log.Error("[GRID]: Unable to look up region to log user off");
return;
}
// Prepare notification
Hashtable SimParams = new Hashtable();
SimParams["agent_id"] = theUser.ID.ToString();
@ -101,7 +101,7 @@ namespace OpenSim.Grid.UserServer
m_log.InfoFormat(
"[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}",
SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName);
try
{
XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams);
@ -306,8 +306,6 @@ namespace OpenSim.Grid.UserServer
theUser.FirstName, theUser.SurName);
}
}
}
}
catch (Exception)
@ -419,7 +417,7 @@ namespace OpenSim.Grid.UserServer
else
{
response.CreateDeadRegionResponse();
}
}
}
catch (Exception e)
@ -432,11 +430,11 @@ namespace OpenSim.Grid.UserServer
// See LoginService
protected override InventoryData GetInventorySkeleton(LLUUID userID)
{
{
m_log.DebugFormat(
"[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}",
m_config.InventoryUrl, userID);
List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID);
if (null == folders || folders.Count == 0)

Some files were not shown because too many files have changed in this diff Show More