Merge branch 'master' into vehicles
commit
0374f1b144
|
@ -55,12 +55,12 @@ namespace OpenSim.Data.MySQL
|
||||||
AuthenticationData ret = new AuthenticationData();
|
AuthenticationData ret = new AuthenticationData();
|
||||||
ret.Data = new Dictionary<string, object>();
|
ret.Data = new Dictionary<string, object>();
|
||||||
|
|
||||||
using (MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID"))
|
MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID");
|
||||||
{
|
|
||||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||||
|
|
||||||
using (IDataReader result = ExecuteReader(cmd))
|
IDataReader result = ExecuteReader(cmd);
|
||||||
{
|
|
||||||
if (result.Read())
|
if (result.Read())
|
||||||
{
|
{
|
||||||
ret.PrincipalID = principalID;
|
ret.PrincipalID = principalID;
|
||||||
|
@ -82,13 +82,15 @@ namespace OpenSim.Data.MySQL
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(result, cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
|
CloseDBConnection(result, cmd);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool Store(AuthenticationData data)
|
public bool Store(AuthenticationData data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,14 +40,15 @@ namespace OpenSim.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MySqlFramework
|
public class MySqlFramework
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog m_log =
|
||||||
|
log4net.LogManager.GetLogger(
|
||||||
|
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
protected MySqlConnection m_Connection;
|
protected MySqlConnection m_Connection;
|
||||||
|
|
||||||
protected MySqlFramework(string connectionString)
|
protected MySqlFramework(string connectionString)
|
||||||
{
|
{
|
||||||
m_Connection = new MySqlConnection(connectionString);
|
m_Connection = new MySqlConnection(connectionString);
|
||||||
|
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +83,8 @@ namespace OpenSim.Data.MySQL
|
||||||
errorSeen = true;
|
errorSeen = true;
|
||||||
|
|
||||||
m_Connection.Close();
|
m_Connection.Close();
|
||||||
MySqlConnection newConnection = (MySqlConnection)
|
MySqlConnection newConnection =
|
||||||
((ICloneable)m_Connection).Clone();
|
(MySqlConnection)((ICloneable)m_Connection).Clone();
|
||||||
m_Connection.Dispose();
|
m_Connection.Dispose();
|
||||||
m_Connection = newConnection;
|
m_Connection = newConnection;
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
|
@ -104,14 +105,19 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
protected IDataReader ExecuteReader(MySqlCommand cmd)
|
protected IDataReader ExecuteReader(MySqlCommand cmd)
|
||||||
{
|
{
|
||||||
MySqlConnection newConnection = (MySqlConnection)
|
MySqlConnection newConnection =
|
||||||
((ICloneable)m_Connection).Clone();
|
(MySqlConnection)((ICloneable)m_Connection).Clone();
|
||||||
|
|
||||||
newConnection.Open();
|
newConnection.Open();
|
||||||
|
|
||||||
cmd.Connection = newConnection;
|
cmd.Connection = newConnection;
|
||||||
|
|
||||||
return cmd.ExecuteReader();
|
return cmd.ExecuteReader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void CloseDBConnection(IDataReader reader, MySqlCommand cmd)
|
||||||
|
{
|
||||||
|
reader.Close();
|
||||||
|
cmd.Connection.Close();
|
||||||
|
cmd.Connection.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,8 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
retList.Add(ret);
|
retList.Add(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(result, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retList;
|
return retList;
|
||||||
|
|
|
@ -64,13 +64,13 @@ namespace OpenSim.Data.MySQL
|
||||||
if (scopeID != UUID.Zero)
|
if (scopeID != UUID.Zero)
|
||||||
command += " and ScopeID = ?scopeID";
|
command += " and ScopeID = ?scopeID";
|
||||||
|
|
||||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
MySqlCommand cmd = new MySqlCommand(command);
|
||||||
{
|
|
||||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||||
|
|
||||||
using (IDataReader result = ExecuteReader(cmd))
|
IDataReader result = ExecuteReader(cmd);
|
||||||
{
|
|
||||||
if (result.Read())
|
if (result.Read())
|
||||||
{
|
{
|
||||||
ret.PrincipalID = principalID;
|
ret.PrincipalID = principalID;
|
||||||
|
@ -97,13 +97,15 @@ namespace OpenSim.Data.MySQL
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CloseDBConnection(result, cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
|
CloseDBConnection(result, cmd);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool Store(UserAccountData data)
|
public bool Store(UserAccountData data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -318,11 +318,11 @@ namespace OpenSim.Framework.Communications
|
||||||
HttpWebResponse errorResponse = e.Response as HttpWebResponse;
|
HttpWebResponse errorResponse = e.Response as HttpWebResponse;
|
||||||
if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
|
if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
|
||||||
{
|
{
|
||||||
m_log.Warn("[ASSET] Asset not found (404)");
|
m_log.Warn("[REST CLIENT] Resource not found (404)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.Error("[ASSET] Error fetching asset from asset server");
|
m_log.Error("[REST CLIENT] Error fetching resource from server " + _request.Address.ToString());
|
||||||
m_log.Debug(e.ToString());
|
m_log.Debug(e.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ namespace OpenSim.Framework.Servers
|
||||||
List<Thread> threads = ThreadTracker.GetThreads();
|
List<Thread> threads = ThreadTracker.GetThreads();
|
||||||
if (threads == null)
|
if (threads == null)
|
||||||
{
|
{
|
||||||
sb.Append("Thread tracking is only enabled in DEBUG mode.");
|
sb.Append("OpenSim thread tracking is only enabled in DEBUG mode.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -264,6 +264,12 @@ namespace OpenSim.Framework.Servers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
|
||||||
|
ThreadPool.GetAvailableThreads(out workers, out ports);
|
||||||
|
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
|
||||||
|
|
||||||
|
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
|
||||||
|
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,14 +28,21 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
using log4net;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Servers.HttpServer
|
namespace OpenSim.Framework.Servers.HttpServer
|
||||||
{
|
{
|
||||||
public class SynchronousRestFormsRequester
|
public class SynchronousRestFormsRequester
|
||||||
{
|
{
|
||||||
|
private static readonly ILog m_log =
|
||||||
|
LogManager.GetLogger(
|
||||||
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform a synchronous REST request.
|
/// Perform a synchronous REST request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -72,8 +79,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
requestStream = request.GetRequestStream();
|
requestStream = request.GetRequestStream();
|
||||||
requestStream.Write(buffer.ToArray(), 0, length);
|
requestStream.Write(buffer.ToArray(), 0, length);
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
m_log.DebugFormat("[FORMS]: exception occured on sending request {0}", e.Message);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -102,7 +110,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
respstring = reader.ReadToEnd();
|
respstring = reader.ReadToEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[FORMS]: exception occured on receiving reply {0}", e.Message);
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (respStream != null)
|
if (respStream != null)
|
||||||
|
@ -114,6 +125,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
catch (System.InvalidOperationException)
|
catch (System.InvalidOperationException)
|
||||||
{
|
{
|
||||||
// This is what happens when there is invalid XML
|
// This is what happens when there is invalid XML
|
||||||
|
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
|
||||||
}
|
}
|
||||||
return respstring;
|
return respstring;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
J2KImage imgrequest;
|
J2KImage imgrequest;
|
||||||
|
|
||||||
// Do a linear search for this texture download
|
// Do a linear search for this texture download
|
||||||
lock (m_priorityQueue)
|
lock (m_syncRoot)
|
||||||
m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest);
|
m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest);
|
||||||
|
|
||||||
if (imgrequest != null)
|
if (imgrequest != null)
|
||||||
|
@ -99,7 +99,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (m_priorityQueue)
|
lock (m_syncRoot)
|
||||||
m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
|
m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
@ -211,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
J2KImage image = null;
|
J2KImage image = null;
|
||||||
|
|
||||||
lock (m_priorityQueue)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (m_priorityQueue.Count > 0)
|
if (m_priorityQueue.Count > 0)
|
||||||
|
@ -230,15 +230,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
image.PriorityQueueHandle = null;
|
image.PriorityQueueHandle = null;
|
||||||
|
|
||||||
lock (m_priorityQueue)
|
lock (m_syncRoot)
|
||||||
|
try
|
||||||
|
{
|
||||||
m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
|
m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
|
||||||
}
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
void RemoveImageFromQueue(J2KImage image)
|
void RemoveImageFromQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
|
lock (m_syncRoot)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (m_priorityQueue)
|
|
||||||
m_priorityQueue.Delete(image.PriorityQueueHandle);
|
m_priorityQueue.Delete(image.PriorityQueueHandle);
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
@ -246,7 +250,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
void UpdateImageInQueue(J2KImage image)
|
void UpdateImageInQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_priorityQueue)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); }
|
try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); }
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
{
|
{
|
||||||
if (maximalSize <= 0 || maximalCount <= 0)
|
if (maximalSize <= 0 || maximalCount <= 0)
|
||||||
{
|
{
|
||||||
Log.Info("[ASSET CACHE]: Cenome asset cache is not enabled.");
|
//Log.Debug("[ASSET CACHE]: Cenome asset cache is not enabled.");
|
||||||
m_enabled = false;
|
m_enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
CnmSynchronizedCache<string, AssetBase>.Synchronized(new CnmMemoryCache<string, AssetBase>(
|
CnmSynchronizedCache<string, AssetBase>.Synchronized(new CnmMemoryCache<string, AssetBase>(
|
||||||
maximalSize, maximalCount, expirationTime));
|
maximalSize, maximalCount, expirationTime));
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
Log.InfoFormat(
|
Log.DebugFormat(
|
||||||
"[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})",
|
"[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})",
|
||||||
maximalSize,
|
maximalSize,
|
||||||
maximalCount,
|
maximalCount,
|
||||||
|
@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
|
|
||||||
if (m_getCount == m_debugEpoch)
|
if (m_getCount == m_debugEpoch)
|
||||||
{
|
{
|
||||||
Log.InfoFormat(
|
Log.DebugFormat(
|
||||||
"[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes",
|
"[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes",
|
||||||
m_cachedCount,
|
m_cachedCount,
|
||||||
m_getCount,
|
m_getCount,
|
||||||
|
@ -333,7 +333,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string name = moduleConfig.GetString("AssetCaching");
|
string name = moduleConfig.GetString("AssetCaching");
|
||||||
Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
|
//Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
|
||||||
|
|
||||||
if (name != Name)
|
if (name != Name)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
if (moduleConfig != null)
|
if (moduleConfig != null)
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("AssetCaching");
|
string name = moduleConfig.GetString("AssetCaching");
|
||||||
m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
|
//m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
|
||||||
|
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -636,11 +636,8 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
m_log.InfoFormat("[FLOTSAM ASSET CACHE] flotsamcache clearfile - Remove all assets cached on disk");
|
m_log.InfoFormat("[FLOTSAM ASSET CACHE] flotsamcache clearfile - Remove all assets cached on disk");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
if (moduleConfig != null)
|
if (moduleConfig != null)
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("AssetCaching");
|
string name = moduleConfig.GetString("AssetCaching");
|
||||||
m_log.DebugFormat("[ASSET CACHE] name = {0} (this module's name: {1}). Sync? ", name, Name, m_Cache.IsSynchronized);
|
//m_log.DebugFormat("[ASSET CACHE] name = {0} (this module's name: {1}). Sync? ", name, Name, m_Cache.IsSynchronized);
|
||||||
|
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,6 +206,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
|
|
||||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||||
{
|
{
|
||||||
|
GridRegion region = null;
|
||||||
|
|
||||||
|
// First see if it's a neighbour, even if it isn't on this sim.
|
||||||
|
// Neighbour data is cached in memory, so this is fast
|
||||||
|
foreach (RegionCache rcache in m_LocalCache.Values)
|
||||||
|
{
|
||||||
|
region = rcache.GetRegionByPosition(x, y);
|
||||||
|
if (region != null)
|
||||||
|
{
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then try on this sim (may be a lookup in DB if this is using MySql).
|
||||||
return m_GridService.GetRegionByPosition(scopeID, x, y);
|
return m_GridService.GetRegionByPosition(scopeID, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,12 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
|
|
||||||
|
using OpenMetaverse;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
|
@ -75,5 +77,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
{
|
{
|
||||||
return new List<GridRegion>(m_neighbours.Values);
|
return new List<GridRegion>(m_neighbours.Values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GridRegion GetRegionByPosition(int x, int y)
|
||||||
|
{
|
||||||
|
uint xsnap = (uint)(x / Constants.RegionSize) * Constants.RegionSize;
|
||||||
|
uint ysnap = (uint)(y / Constants.RegionSize) * Constants.RegionSize;
|
||||||
|
ulong handle = Utils.UIntsToLong(xsnap, ysnap);
|
||||||
|
|
||||||
|
if (m_neighbours.ContainsKey(handle))
|
||||||
|
return m_neighbours[handle];
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected IAssetService m_AssetService = null;
|
protected IAssetService m_AssetService = null;
|
||||||
protected IAuthorizationService m_AuthorizationService = null;
|
protected IAuthorizationService m_AuthorizationService = null;
|
||||||
|
|
||||||
|
private Object m_heartbeatLock = new Object();
|
||||||
|
|
||||||
public IAssetService AssetService
|
public IAssetService AssetService
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -942,6 +944,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void Heartbeat(object sender)
|
private void Heartbeat(object sender)
|
||||||
{
|
{
|
||||||
|
if (!Monitor.TryEnter(m_heartbeatLock))
|
||||||
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
|
@ -952,6 +957,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
catch (ThreadAbortException)
|
catch (ThreadAbortException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Monitor.Pulse(m_heartbeatLock);
|
||||||
|
Monitor.Exit(m_heartbeatLock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -962,6 +972,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int maintc = 0;
|
int maintc = 0;
|
||||||
while (!shuttingdown)
|
while (!shuttingdown)
|
||||||
{
|
{
|
||||||
|
//#if DEBUG
|
||||||
|
// int w = 0, io = 0;
|
||||||
|
// ThreadPool.GetAvailableThreads(out w, out io);
|
||||||
|
// if ((w < 10) || (io < 10))
|
||||||
|
// m_log.DebugFormat("[WARNING]: ThreadPool reaching exhaustion. workers = {0}; io = {1}", w, io);
|
||||||
|
//#endif
|
||||||
maintc = Environment.TickCount;
|
maintc = Environment.TickCount;
|
||||||
|
|
||||||
TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate;
|
TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate;
|
||||||
|
|
|
@ -3488,7 +3488,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
public override void UnCombine(PhysicsScene pScene)
|
public override void UnCombine(PhysicsScene pScene)
|
||||||
{
|
{
|
||||||
IntPtr localGround = IntPtr.Zero;
|
IntPtr localGround = IntPtr.Zero;
|
||||||
float[] localHeightfield;
|
//float[] localHeightfield;
|
||||||
bool proceed = false;
|
bool proceed = false;
|
||||||
List<IntPtr> geomDestroyList = new List<IntPtr>();
|
List<IntPtr> geomDestroyList = new List<IntPtr>();
|
||||||
|
|
||||||
|
@ -3785,8 +3785,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
sides.Z = 0.5f;
|
sides.Z = 0.5f;
|
||||||
|
|
||||||
ds.DrawBox(ref pos, ref R, ref sides);
|
ds.DrawBox(ref pos, ref R, ref sides);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3794,7 +3792,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public void start(int unused)
|
public void start(int unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
ds.SetViewpoint(ref xyz, ref hpr);
|
ds.SetViewpoint(ref xyz, ref hpr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -260,7 +260,7 @@ namespace OpenSim.Server.Base
|
||||||
|
|
||||||
public static Dictionary<string, object> ParseXmlResponse(string data)
|
public static Dictionary<string, object> ParseXmlResponse(string data)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[XXX]: received xml string: {0}", data);
|
m_log.DebugFormat("[XXX]: received xml string: {0}", data);
|
||||||
|
|
||||||
Dictionary<string, object> ret = new Dictionary<string, object>();
|
Dictionary<string, object> ret = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,8 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
|
|
||||||
//m_log.DebugFormat("[XXX]: query String: {0}", body);
|
//m_log.DebugFormat("[XXX]: query String: {0}", body);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
Dictionary<string, string> request =
|
Dictionary<string, string> request =
|
||||||
ServerUtils.ParseQueryString(body);
|
ServerUtils.ParseQueryString(body);
|
||||||
|
|
||||||
|
@ -102,8 +104,13 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
return GetRegionRange(request);
|
return GetRegionRange(request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
|
m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[GRID HANDLER]: Exception {0}", e);
|
||||||
|
}
|
||||||
|
|
||||||
return FailureResult();
|
return FailureResult();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -113,7 +120,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
byte[] Register(Dictionary<string, string> request)
|
byte[] Register(Dictionary<string, string> request)
|
||||||
{
|
{
|
||||||
UUID scopeID = UUID.Zero;
|
UUID scopeID = UUID.Zero;
|
||||||
if (request["SCOPEID"] != null)
|
if (request.ContainsKey("SCOPEID"))
|
||||||
UUID.TryParse(request["SCOPEID"], out scopeID);
|
UUID.TryParse(request["SCOPEID"], out scopeID);
|
||||||
else
|
else
|
||||||
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region");
|
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region");
|
||||||
|
@ -137,11 +144,21 @@ namespace OpenSim.Server.Handlers.Grid
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary<string, object> rinfoData = new Dictionary<string, object>();
|
Dictionary<string, object> rinfoData = new Dictionary<string, object>();
|
||||||
|
GridRegion rinfo = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
foreach (KeyValuePair<string, string> kvp in request)
|
foreach (KeyValuePair<string, string> kvp in request)
|
||||||
rinfoData[kvp.Key] = kvp.Value;
|
rinfoData[kvp.Key] = kvp.Value;
|
||||||
GridRegion rinfo = new GridRegion(rinfoData);
|
rinfo = new GridRegion(rinfoData);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[GRID HANDLER]: exception unpacking region data: {0}", e);
|
||||||
|
}
|
||||||
|
|
||||||
bool result = m_GridService.RegisterRegion(scopeID, rinfo);
|
bool result = false;
|
||||||
|
if (rinfo != null)
|
||||||
|
result = m_GridService.RegisterRegion(scopeID, rinfo);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
return SuccessResult();
|
return SuccessResult();
|
||||||
|
|
|
@ -109,8 +109,13 @@ namespace OpenSim.Services.Connectors
|
||||||
{
|
{
|
||||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||||
|
|
||||||
if ((replyData["Result"] != null) && (replyData["Result"].ToString().ToLower() == "success"))
|
if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "success"))
|
||||||
return true;
|
return true;
|
||||||
|
else if (!replyData.ContainsKey("Result"))
|
||||||
|
m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field");
|
||||||
|
else
|
||||||
|
m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.DebugFormat("[GRID CONNECTOR]: RegisterRegion received null reply");
|
m_log.DebugFormat("[GRID CONNECTOR]: RegisterRegion received null reply");
|
||||||
|
|
|
@ -69,18 +69,40 @@ namespace OpenSim.Services.GridService
|
||||||
((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
|
((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
|
||||||
{
|
{
|
||||||
// Region reregistering in other coordinates. Delete the old entry
|
// Region reregistering in other coordinates. Delete the old entry
|
||||||
|
m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.",
|
||||||
|
regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
m_Database.Delete(regionInfos.RegionID);
|
m_Database.Delete(regionInfos.RegionID);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Everything is ok, let's register
|
// Everything is ok, let's register
|
||||||
RegionData rdata = RegionInfo2RegionData(regionInfos);
|
RegionData rdata = RegionInfo2RegionData(regionInfos);
|
||||||
rdata.ScopeID = scopeID;
|
rdata.ScopeID = scopeID;
|
||||||
|
try
|
||||||
|
{
|
||||||
m_Database.Store(rdata);
|
m_Database.Store(rdata);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
|
||||||
|
regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DeregisterRegion(UUID regionID)
|
public bool DeregisterRegion(UUID regionID)
|
||||||
{
|
{
|
||||||
|
m_log.DebugFormat("[GRID SERVICE]: Region {0} deregistered", regionID);
|
||||||
return m_Database.Delete(regionID);
|
return m_Database.Delete(regionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@
|
||||||
; Uncomment below to enable llRemoteData/remote channels
|
; Uncomment below to enable llRemoteData/remote channels
|
||||||
; remoteDataPort = 20800
|
; remoteDataPort = 20800
|
||||||
|
|
||||||
grid_server_url = "http://127.0.0.1:8001"
|
grid_server_url = "http://127.0.0.1:8003"
|
||||||
grid_send_key = "null"
|
grid_send_key = "null"
|
||||||
grid_recv_key = "null"
|
grid_recv_key = "null"
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@
|
||||||
|
|
||||||
asset_server_url = "http://127.0.0.1:8003"
|
asset_server_url = "http://127.0.0.1:8003"
|
||||||
|
|
||||||
inventory_server_url = "http://127.0.0.1:8004"
|
inventory_server_url = "http://127.0.0.1:8003"
|
||||||
|
|
||||||
; The MessagingServer is a companion of the UserServer. It uses
|
; The MessagingServer is a companion of the UserServer. It uses
|
||||||
; user_send_key and user_recv_key, too
|
; user_send_key and user_recv_key, too
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
;
|
;
|
||||||
; change this to your grid-wide inventory server
|
; change this to your grid-wide inventory server
|
||||||
;
|
;
|
||||||
InventoryServerURI = "http://myinventoryserver.com:8004"
|
InventoryServerURI = "http://myinventoryserver.com:8003"
|
||||||
|
|
||||||
[GridService]
|
[GridService]
|
||||||
;
|
;
|
||||||
; change this to your grid-wide grid server
|
; change this to your grid-wide grid server
|
||||||
;
|
;
|
||||||
GridServerURI = "http://mygridserver.com:8001"
|
GridServerURI = "http://mygridserver.com:8003"
|
||||||
|
|
||||||
[Modules]
|
[Modules]
|
||||||
;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.
|
;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.
|
||||||
|
|
Loading…
Reference in New Issue