Merge branch 'master' into httptests
commit
877d3092b4
|
@ -390,3 +390,66 @@ CREATE TABLE IF NOT EXISTS `bakedterrain` (
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
|
:VERSION 55 #----- Increase float precision for windlight needed by scripts
|
||||||
|
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
ALTER TABLE `regionwindlight`
|
||||||
|
|
||||||
|
MODIFY `water_fog_density_exponent` float(9,7) unsigned NOT NULL DEFAULT '4.0',
|
||||||
|
MODIFY `underwater_fog_modifier` float(9,8) unsigned NOT NULL DEFAULT '0.25',
|
||||||
|
MODIFY `reflection_wavelet_scale_1` float(9,7) unsigned NOT NULL DEFAULT '2.0',
|
||||||
|
MODIFY `reflection_wavelet_scale_2` float(9,7) unsigned NOT NULL DEFAULT '2.0',
|
||||||
|
MODIFY `reflection_wavelet_scale_3` float(9,7) unsigned NOT NULL DEFAULT '2.0',
|
||||||
|
MODIFY `fresnel_scale` float(9,8) unsigned NOT NULL DEFAULT '0.40',
|
||||||
|
MODIFY `fresnel_offset` float(9,8) unsigned NOT NULL DEFAULT '0.50',
|
||||||
|
MODIFY `refract_scale_above` float(9,8) unsigned NOT NULL DEFAULT '0.03',
|
||||||
|
MODIFY `refract_scale_below` float(9,8) unsigned NOT NULL DEFAULT '0.20',
|
||||||
|
MODIFY `blur_multiplier` float(9,8) unsigned NOT NULL DEFAULT '0.040',
|
||||||
|
MODIFY `big_wave_direction_x` float(9,8) NOT NULL DEFAULT '1.05',
|
||||||
|
MODIFY `big_wave_direction_y` float(9,8) NOT NULL DEFAULT '-0.42',
|
||||||
|
MODIFY `little_wave_direction_x` float(9,8) NOT NULL DEFAULT '1.11',
|
||||||
|
MODIFY `little_wave_direction_y` float(9,8) NOT NULL DEFAULT '-1.16',
|
||||||
|
MODIFY `horizon_r` float(9,8) unsigned NOT NULL DEFAULT '0.25',
|
||||||
|
MODIFY `horizon_g` float(9,8) unsigned NOT NULL DEFAULT '0.25',
|
||||||
|
MODIFY `horizon_b` float(9,8) unsigned NOT NULL DEFAULT '0.32',
|
||||||
|
MODIFY `horizon_i` float(9,8) unsigned NOT NULL DEFAULT '0.32',
|
||||||
|
MODIFY `haze_horizon` float(9,8) unsigned NOT NULL DEFAULT '0.19',
|
||||||
|
MODIFY `blue_density_r` float(9,8) unsigned NOT NULL DEFAULT '0.12',
|
||||||
|
MODIFY `blue_density_g` float(9,8) unsigned NOT NULL DEFAULT '0.22',
|
||||||
|
MODIFY `blue_density_b` float(9,8) unsigned NOT NULL DEFAULT '0.38',
|
||||||
|
MODIFY `blue_density_i` float(9,8) unsigned NOT NULL DEFAULT '0.38',
|
||||||
|
MODIFY `haze_density` float(9,8) unsigned NOT NULL DEFAULT '0.70',
|
||||||
|
MODIFY `density_multiplier` float(9,8) unsigned NOT NULL DEFAULT '0.18',
|
||||||
|
MODIFY `distance_multiplier` float(9,6) unsigned NOT NULL DEFAULT '0.8',
|
||||||
|
MODIFY `sun_moon_color_r` float(9,8) unsigned NOT NULL DEFAULT '0.24',
|
||||||
|
MODIFY `sun_moon_color_g` float(9,8) unsigned NOT NULL DEFAULT '0.26',
|
||||||
|
MODIFY `sun_moon_color_b` float(9,8) unsigned NOT NULL DEFAULT '0.30',
|
||||||
|
MODIFY `sun_moon_color_i` float(9,8) unsigned NOT NULL DEFAULT '0.30',
|
||||||
|
MODIFY `sun_moon_position` float(9,8) unsigned NOT NULL DEFAULT '0.317',
|
||||||
|
MODIFY `ambient_r` float(9,8) unsigned NOT NULL DEFAULT '0.35',
|
||||||
|
MODIFY `ambient_g` float(9,8) unsigned NOT NULL DEFAULT '0.35',
|
||||||
|
MODIFY `ambient_b` float(9,8) unsigned NOT NULL DEFAULT '0.35',
|
||||||
|
MODIFY `ambient_i` float(9,8) unsigned NOT NULL DEFAULT '0.35',
|
||||||
|
MODIFY `east_angle` float(9,8) unsigned NOT NULL DEFAULT '0.00',
|
||||||
|
MODIFY `sun_glow_focus` float(9,8) unsigned NOT NULL DEFAULT '0.10',
|
||||||
|
MODIFY `sun_glow_size` float(9,8) unsigned NOT NULL DEFAULT '1.75',
|
||||||
|
MODIFY `scene_gamma` float(9,7) unsigned NOT NULL DEFAULT '1.00',
|
||||||
|
MODIFY `star_brightness` float(9,8) unsigned NOT NULL DEFAULT '0.00',
|
||||||
|
MODIFY `cloud_color_r` float(9,8) unsigned NOT NULL DEFAULT '0.41',
|
||||||
|
MODIFY `cloud_color_g` float(9,8) unsigned NOT NULL DEFAULT '0.41',
|
||||||
|
MODIFY `cloud_color_b` float(9,8) unsigned NOT NULL DEFAULT '0.41',
|
||||||
|
MODIFY `cloud_color_i` float(9,8) unsigned NOT NULL DEFAULT '0.41',
|
||||||
|
MODIFY `cloud_x` float(9,8) unsigned NOT NULL DEFAULT '1.00',
|
||||||
|
MODIFY `cloud_y` float(9,8) unsigned NOT NULL DEFAULT '0.53',
|
||||||
|
MODIFY `cloud_density` float(9,8) unsigned NOT NULL DEFAULT '1.00',
|
||||||
|
MODIFY `cloud_coverage` float(9,8) unsigned NOT NULL DEFAULT '0.27',
|
||||||
|
MODIFY `cloud_scale` float(9,8) unsigned NOT NULL DEFAULT '0.42',
|
||||||
|
MODIFY `cloud_detail_x` float(9,8) unsigned NOT NULL DEFAULT '1.00',
|
||||||
|
MODIFY `cloud_detail_y` float(9,8) unsigned NOT NULL DEFAULT '0.53',
|
||||||
|
MODIFY `cloud_detail_density` float(9,8) unsigned NOT NULL DEFAULT '0.12',
|
||||||
|
MODIFY `cloud_scroll_x` float(9,7) NOT NULL DEFAULT '0.20',
|
||||||
|
MODIFY `cloud_scroll_y` float(9,7) NOT NULL DEFAULT '0.01';
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual byte[] Data
|
public byte[] Data
|
||||||
{
|
{
|
||||||
get { return m_data; }
|
get { return m_data; }
|
||||||
set { m_data = value; }
|
set { m_data = value; }
|
||||||
|
|
|
@ -136,7 +136,8 @@ namespace OpenSim.Framework.Monitoring
|
||||||
if(m_jobQueue.Count <= 0)
|
if(m_jobQueue.Count <= 0)
|
||||||
m_cancelSource.Cancel();
|
m_cancelSource.Cancel();
|
||||||
|
|
||||||
m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop);
|
if(m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop))
|
||||||
|
m_finishedProcessingAfterStop.Close();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
@ -176,6 +176,9 @@ namespace OpenSim.Framework
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public uint RegionSizeZ = Constants.RegionHeight;
|
public uint RegionSizeZ = Constants.RegionHeight;
|
||||||
|
|
||||||
|
// If entering avatar has no specific coords, this is where they land
|
||||||
|
public Vector3 DefaultLandingPoint = new Vector3(128, 128, 30);
|
||||||
|
|
||||||
private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>();
|
private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>();
|
||||||
|
|
||||||
// Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
|
// Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
|
||||||
|
@ -712,6 +715,19 @@ namespace OpenSim.Framework
|
||||||
m_regionType = config.GetString("RegionType", String.Empty);
|
m_regionType = config.GetString("RegionType", String.Empty);
|
||||||
allKeys.Remove("RegionType");
|
allKeys.Remove("RegionType");
|
||||||
|
|
||||||
|
// Get Default Landing Location (Defaults to 128,128)
|
||||||
|
string temp_location = config.GetString("DefaultLanding", "<128, 128, 30>");
|
||||||
|
Vector3 temp_vector;
|
||||||
|
|
||||||
|
if (Vector3.TryParse(temp_location, out temp_vector))
|
||||||
|
DefaultLandingPoint = temp_vector;
|
||||||
|
else
|
||||||
|
m_log.ErrorFormat("[RegionInfo]: Unable to parse DefaultLanding for '{0}'. The value given was '{1}'", RegionName, temp_location);
|
||||||
|
|
||||||
|
allKeys.Remove("DefaultLanding");
|
||||||
|
|
||||||
|
DoDefaultLandingSanityChecks();
|
||||||
|
|
||||||
#region Prim and map stuff
|
#region Prim and map stuff
|
||||||
|
|
||||||
m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0);
|
m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0);
|
||||||
|
@ -764,6 +780,48 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure DefaultLanding is within region borders with a buffer zone 5 meters from borders
|
||||||
|
private void DoDefaultLandingSanityChecks()
|
||||||
|
{
|
||||||
|
// Sanity Check Default Landing
|
||||||
|
float buffer_zone = 5f;
|
||||||
|
|
||||||
|
bool ValuesCapped = false;
|
||||||
|
|
||||||
|
// Minimum Positions
|
||||||
|
if (DefaultLandingPoint.X < buffer_zone)
|
||||||
|
{
|
||||||
|
DefaultLandingPoint.X = buffer_zone;
|
||||||
|
ValuesCapped = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DefaultLandingPoint.Y < buffer_zone)
|
||||||
|
{
|
||||||
|
DefaultLandingPoint.Y = buffer_zone;
|
||||||
|
ValuesCapped = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Maximum Positions
|
||||||
|
if (DefaultLandingPoint.X > RegionSizeX - buffer_zone)
|
||||||
|
{
|
||||||
|
DefaultLandingPoint.X = RegionSizeX - buffer_zone;
|
||||||
|
ValuesCapped = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DefaultLandingPoint.Y > RegionSizeY - buffer_zone)
|
||||||
|
{
|
||||||
|
DefaultLandingPoint.Y = RegionSizeY - buffer_zone;
|
||||||
|
ValuesCapped = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Height
|
||||||
|
if (DefaultLandingPoint.Z < 0f)
|
||||||
|
DefaultLandingPoint.Z = 0f;
|
||||||
|
|
||||||
|
if (ValuesCapped == true)
|
||||||
|
m_log.WarnFormat("[RegionInfo]: The default landing location for {0} has been capped to {1}", RegionName, DefaultLandingPoint);
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure user specified region sizes are sane.
|
// Make sure user specified region sizes are sane.
|
||||||
// Must be multiples of legacy region size (256).
|
// Must be multiples of legacy region size (256).
|
||||||
private void DoRegionSizeSanityChecks()
|
private void DoRegionSizeSanityChecks()
|
||||||
|
|
|
@ -430,11 +430,11 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
using (Stream dst = _request.GetRequestStream())
|
using (Stream dst = _request.GetRequestStream())
|
||||||
{
|
{
|
||||||
m_log.Info("[REST]: GetRequestStream is ok");
|
m_log.Debug("[REST]: GetRequestStream is ok");
|
||||||
|
|
||||||
byte[] buf = new byte[1024];
|
byte[] buf = new byte[1024];
|
||||||
int length = src.Read(buf, 0, 1024);
|
int length = src.Read(buf, 0, 1024);
|
||||||
m_log.Info("[REST]: First Read is ok");
|
m_log.Debug("[REST]: First Read is ok");
|
||||||
while (length > 0)
|
while (length > 0)
|
||||||
{
|
{
|
||||||
dst.Write(buf, 0, length);
|
dst.Write(buf, 0, length);
|
||||||
|
|
|
@ -1019,7 +1019,8 @@ namespace OpenSim.Framework
|
||||||
///
|
///
|
||||||
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
|
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
|
||||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||||
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs, IServiceAuth auth)
|
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs = -1,
|
||||||
|
IServiceAuth auth = null, bool keepalive = true)
|
||||||
{
|
{
|
||||||
int reqnum = WebUtil.RequestNumber++;
|
int reqnum = WebUtil.RequestNumber++;
|
||||||
|
|
||||||
|
@ -1034,6 +1035,8 @@ namespace OpenSim.Framework
|
||||||
request.Method = verb;
|
request.Method = verb;
|
||||||
if (timeoutsecs > 0)
|
if (timeoutsecs > 0)
|
||||||
request.Timeout = timeoutsecs * 1000;
|
request.Timeout = timeoutsecs * 1000;
|
||||||
|
if(!keepalive && request is HttpWebRequest)
|
||||||
|
((HttpWebRequest)request).KeepAlive = false;
|
||||||
|
|
||||||
if (auth != null)
|
if (auth != null)
|
||||||
auth.AddAuthorization(request.Headers);
|
auth.AddAuthorization(request.Headers);
|
||||||
|
@ -1125,16 +1128,6 @@ namespace OpenSim.Framework
|
||||||
return respstring;
|
return respstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs)
|
|
||||||
{
|
|
||||||
return MakeRequest(verb, requestUrl, obj, timeoutsecs, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string MakeRequest(string verb, string requestUrl, string obj)
|
|
||||||
{
|
|
||||||
return MakeRequest(verb, requestUrl, obj, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string MakeRequest(string verb, string requestUrl, string obj, IServiceAuth auth)
|
public static string MakeRequest(string verb, string requestUrl, string obj, IServiceAuth auth)
|
||||||
{
|
{
|
||||||
return MakeRequest(verb, requestUrl, obj, -1, auth);
|
return MakeRequest(verb, requestUrl, obj, -1, auth);
|
||||||
|
|
|
@ -242,22 +242,22 @@ namespace OpenSim
|
||||||
ChangeSelectedRegion);
|
ChangeSelectedRegion);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Archiving", false, "save xml",
|
m_console.Commands.AddCommand("Archiving", false, "save xml",
|
||||||
"save xml",
|
"save xml [<file name>]",
|
||||||
"Save a region's data in XML format",
|
"Save a region's data in XML format",
|
||||||
SaveXml);
|
SaveXml);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Archiving", false, "save xml2",
|
m_console.Commands.AddCommand("Archiving", false, "save xml2",
|
||||||
"save xml2",
|
"save xml2 [<file name>]",
|
||||||
"Save a region's data in XML2 format",
|
"Save a region's data in XML2 format",
|
||||||
SaveXml2);
|
SaveXml2);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Archiving", false, "load xml",
|
m_console.Commands.AddCommand("Archiving", false, "load xml",
|
||||||
"load xml [-newIDs [<x> <y> <z>]]",
|
"load xml [<file name> [-newUID [<x> <y> <z>]]]",
|
||||||
"Load a region's data from XML format",
|
"Load a region's data from XML format",
|
||||||
LoadXml);
|
LoadXml);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Archiving", false, "load xml2",
|
m_console.Commands.AddCommand("Archiving", false, "load xml2",
|
||||||
"load xml2",
|
"load xml2 [<file name>]",
|
||||||
"Load a region's data from XML2 format",
|
"Load a region's data from XML2 format",
|
||||||
LoadXml2);
|
LoadXml2);
|
||||||
|
|
||||||
|
@ -1068,7 +1068,7 @@ namespace OpenSim
|
||||||
/// <param name="cmdparams"></param>
|
/// <param name="cmdparams"></param>
|
||||||
protected void SavePrimsXml2(string module, string[] cmdparams)
|
protected void SavePrimsXml2(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
if (cmdparams.Length > 5)
|
if (cmdparams.Length > 4)
|
||||||
{
|
{
|
||||||
SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]);
|
SceneManager.SaveNamedPrimsToXml2(cmdparams[3], cmdparams[4]);
|
||||||
}
|
}
|
||||||
|
@ -1087,7 +1087,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason.");
|
MainConsole.Instance.Output("PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason.");
|
||||||
|
|
||||||
if (cmdparams.Length > 0)
|
if (cmdparams.Length > 2)
|
||||||
{
|
{
|
||||||
SceneManager.SaveCurrentSceneToXml(cmdparams[2]);
|
SceneManager.SaveCurrentSceneToXml(cmdparams[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -606,21 +606,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
//m_scene.CloseAllAgents(CircuitCode);
|
//m_scene.CloseAllAgents(CircuitCode);
|
||||||
|
|
||||||
// Disable UDP handling for this client
|
// Disable UDP handling for this client
|
||||||
m_udpClient.Shutdown();
|
|
||||||
|
|
||||||
m_udpClient.OnQueueEmpty -= HandleQueueEmpty;
|
m_udpClient.OnQueueEmpty -= HandleQueueEmpty;
|
||||||
m_udpClient.HasUpdates -= HandleHasUpdates;
|
m_udpClient.HasUpdates -= HandleHasUpdates;
|
||||||
m_udpClient.OnPacketStats -= PopulateStats;
|
m_udpClient.OnPacketStats -= PopulateStats;
|
||||||
|
m_udpClient.Shutdown();
|
||||||
|
|
||||||
// Shutdown the image manager
|
// Shutdown the image manager
|
||||||
ImageManager.Close();
|
ImageManager.Close();
|
||||||
ImageManager = null;
|
ImageManager = null;
|
||||||
|
|
||||||
m_entityUpdates = null;
|
m_entityUpdates = new PriorityQueue(1);
|
||||||
m_entityProps = null;
|
m_entityProps = new PriorityQueue(1);
|
||||||
m_killRecord.Clear();
|
m_killRecord.Clear();
|
||||||
GroupsInView.Clear();
|
GroupsInView.Clear();
|
||||||
m_scene = null;
|
// m_scene = null; can't do this unless checks are added everywhere due to workitems already in pools
|
||||||
|
|
||||||
//m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
//m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
||||||
//GC.Collect();
|
//GC.Collect();
|
||||||
//m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true));
|
//m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true));
|
||||||
|
@ -3126,10 +3126,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
reply.Data.ActualArea = land.Area;
|
reply.Data.ActualArea = land.Area;
|
||||||
reply.Data.BillableArea = land.Area; // TODO: what is this?
|
reply.Data.BillableArea = land.Area; // TODO: what is this?
|
||||||
|
|
||||||
// Bit 0: Mature, bit 7: on sale, other bits: no idea
|
reply.Data.Flags = (byte)Util.ConvertAccessLevelToMaturity((byte)info.AccessLevel);
|
||||||
reply.Data.Flags = (byte)(
|
if((land.Flags & (uint)ParcelFlags.ForSale) != 0)
|
||||||
(info.AccessLevel > 13 ? (1 << 0) : 0) +
|
reply.Data.Flags |= (byte)((1 << 7));
|
||||||
((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
|
|
||||||
|
|
||||||
Vector3 pos = land.UserLocation;
|
Vector3 pos = land.UserLocation;
|
||||||
if (pos.Equals(Vector3.Zero))
|
if (pos.Equals(Vector3.Zero))
|
||||||
|
@ -4371,7 +4370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
ushort timeDilation;
|
ushort timeDilation;
|
||||||
|
|
||||||
if(m_scene == null)
|
if(!IsActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
|
timeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
|
||||||
|
@ -9614,63 +9613,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Parcel related packets
|
#region Parcel related packets
|
||||||
|
|
||||||
// acumulate several HandleRegionHandleRequest consecutive overlaping requests
|
|
||||||
// to be done with minimal resources as possible
|
|
||||||
// variables temporary here while in test
|
|
||||||
|
|
||||||
Queue<UUID> RegionHandleRequests = new Queue<UUID>();
|
|
||||||
bool RegionHandleRequestsInService = false;
|
|
||||||
|
|
||||||
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
UUID currentUUID;
|
|
||||||
|
|
||||||
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||||
|
|
||||||
if (handlerRegionHandleRequest == null)
|
if (handlerRegionHandleRequest != null)
|
||||||
return true;
|
{
|
||||||
|
|
||||||
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||||
|
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
|
||||||
|
}
|
||||||
|
|
||||||
lock (RegionHandleRequests)
|
|
||||||
{
|
|
||||||
if (RegionHandleRequestsInService)
|
|
||||||
{
|
|
||||||
// we are already busy doing a previus request
|
|
||||||
// so enqueue it
|
|
||||||
RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// else do it
|
|
||||||
currentUUID = rhrPack.RequestBlock.RegionID;
|
|
||||||
RegionHandleRequestsInService = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
handlerRegionHandleRequest(this, currentUUID);
|
|
||||||
|
|
||||||
lock (RegionHandleRequests)
|
|
||||||
{
|
|
||||||
// exit condition, nothing to do or closed
|
|
||||||
// current code seems to assume we may loose the handler at anytime,
|
|
||||||
// so keep checking it
|
|
||||||
handlerRegionHandleRequest = OnRegionHandleRequest;
|
|
||||||
|
|
||||||
if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null)
|
|
||||||
{
|
|
||||||
RegionHandleRequests.Clear();
|
|
||||||
RegionHandleRequestsInService = false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
currentUUID = RegionHandleRequests.Dequeue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true; // actually unreached
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack;
|
ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack;
|
||||||
|
@ -12945,9 +12900,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// provide your own method.</param>
|
/// provide your own method.</param>
|
||||||
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method)
|
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method)
|
||||||
{
|
{
|
||||||
if (m_outPacketsToDrop != null)
|
|
||||||
if (m_outPacketsToDrop.Contains(packet.Type.ToString()))
|
/* this is causing packet loss for some reason
|
||||||
|
if(!m_udpClient.IsConnected)
|
||||||
|
{
|
||||||
|
PacketPool.Instance.ReturnPacket(packet);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if (m_outPacketsToDrop != null)
|
||||||
|
{
|
||||||
|
if (m_outPacketsToDrop.Contains(packet.Type.ToString()))
|
||||||
|
{
|
||||||
|
PacketPool.Instance.ReturnPacket(packet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (DebugPacketLevel > 0)
|
if (DebugPacketLevel > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -288,21 +288,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
|
for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
|
||||||
{
|
{
|
||||||
m_packetOutboxes[i].Clear();
|
m_packetOutboxes[i].Clear();
|
||||||
m_throttleCategories[i] = null;
|
|
||||||
m_nextPackets[i] = null;
|
m_nextPackets[i] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pull the throttle out of the scene throttle
|
// pull the throttle out of the scene throttle
|
||||||
m_throttleClient.Parent.UnregisterRequest(m_throttleClient);
|
m_throttleClient.Parent.UnregisterRequest(m_throttleClient);
|
||||||
m_throttleClient = null;
|
|
||||||
OnPacketStats = null;
|
|
||||||
OnQueueEmpty = null;
|
|
||||||
PendingAcks.Clear();
|
PendingAcks.Clear();
|
||||||
NeedAcks.Clear();
|
NeedAcks.Clear();
|
||||||
NeedAcks = null;
|
|
||||||
PendingAcks = null;
|
|
||||||
m_nextPackets = null;
|
|
||||||
m_packetOutboxes = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -521,7 +521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
// if (usePools)
|
// if (usePools)
|
||||||
// EnablePools();
|
// EnablePools();
|
||||||
DisablePools();
|
base.DisablePools();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
|
|
|
@ -179,6 +179,11 @@ namespace OpenMetaverse
|
||||||
// m_dropRandomGenerator = new Random();
|
// m_dropRandomGenerator = new Random();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~OpenSimUDPBase()
|
||||||
|
{
|
||||||
|
if(m_udpSocket !=null)
|
||||||
|
try { m_udpSocket.Close(); } catch { }
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start inbound UDP packet handling.
|
/// Start inbound UDP packet handling.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -97,7 +97,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected float m_burst;
|
protected float m_burst;
|
||||||
|
|
||||||
public virtual float MaxDripRate { get; set; }
|
protected float m_maxDripRate = 0;
|
||||||
|
public virtual float MaxDripRate
|
||||||
|
{
|
||||||
|
get { return m_maxDripRate; }
|
||||||
|
set { m_maxDripRate = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public float RequestedBurst
|
public float RequestedBurst
|
||||||
{
|
{
|
||||||
|
@ -134,7 +139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// the system tick interval (typically around 15-22ms)</remarks>
|
/// the system tick interval (typically around 15-22ms)</remarks>
|
||||||
protected float m_dripRate;
|
protected float m_dripRate;
|
||||||
|
|
||||||
public virtual float RequestedDripRate
|
public float RequestedDripRate
|
||||||
{
|
{
|
||||||
get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); }
|
get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); }
|
||||||
set {
|
set {
|
||||||
|
@ -146,7 +151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual float DripRate
|
public float DripRate
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
float rate = Math.Min(RequestedDripRate,TotalDripRequest);
|
float rate = Math.Min(RequestedDripRate,TotalDripRequest);
|
||||||
|
@ -344,7 +349,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// greater than this.
|
// greater than this.
|
||||||
// </summary>
|
// </summary>
|
||||||
|
|
||||||
protected float m_maxDripRate = 0;
|
|
||||||
public override float MaxDripRate
|
public override float MaxDripRate
|
||||||
{
|
{
|
||||||
get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); }
|
get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); }
|
||||||
|
@ -359,7 +363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// <summary>
|
// <summary>
|
||||||
// Adjust drip rate in response to network conditions.
|
// Adjust drip rate in response to network conditions.
|
||||||
// </summary>
|
// </summary>
|
||||||
public virtual float AdjustedDripRate
|
public float AdjustedDripRate
|
||||||
{
|
{
|
||||||
get { return m_dripRate; }
|
get { return m_dripRate; }
|
||||||
set
|
set
|
||||||
|
@ -380,12 +384,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
m_enabled = enabled;
|
m_enabled = enabled;
|
||||||
|
|
||||||
MaxDripRate = maxDripRate;
|
m_maxDripRate = (maxDripRate == 0 ? m_totalDripRequest : Math.Max(maxDripRate, m_minimumFlow));
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
AdjustedDripRate = m_maxDripRate * .5f;
|
m_dripRate = m_maxDripRate * .5f;
|
||||||
else
|
else
|
||||||
AdjustedDripRate = m_maxDripRate;
|
m_dripRate = m_maxDripRate;
|
||||||
|
if (m_parent != null)
|
||||||
|
m_parent.RegisterRequest(this, m_dripRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -55,9 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
protected List<string> FreezeCache = new List<string>();
|
protected List<string> FreezeCache = new List<string>();
|
||||||
protected string m_adminPrefix = "";
|
protected string m_adminPrefix = "";
|
||||||
protected object m_syncy = new object();
|
protected object m_syncy = new object();
|
||||||
|
|
||||||
protected IConfig m_config;
|
protected IConfig m_config;
|
||||||
|
|
||||||
#region ISharedRegionModule Members
|
#region ISharedRegionModule Members
|
||||||
public virtual void Initialise(IConfigSource config)
|
public virtual void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
|
|
|
@ -455,6 +455,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
position = emergencyPos;
|
position = emergencyPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check Default Location (Also See ScenePresence.CompleteMovement)
|
||||||
|
if (position.X == 128f && position.Y == 128f)
|
||||||
|
position = sp.Scene.RegionInfo.DefaultLandingPoint;
|
||||||
|
|
||||||
// TODO: Get proper AVG Height
|
// TODO: Get proper AVG Height
|
||||||
float localHalfAVHeight = 0.8f;
|
float localHalfAVHeight = 0.8f;
|
||||||
if (sp.Appearance != null)
|
if (sp.Appearance != null)
|
||||||
|
@ -594,12 +598,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
uint x = 0, y = 0;
|
uint x = 0, y = 0;
|
||||||
Util.RegionHandleToWorldLoc(regionHandle, out x, out y);
|
Util.RegionHandleToWorldLoc(regionHandle, out x, out y);
|
||||||
|
|
||||||
|
GridRegion reg;
|
||||||
|
|
||||||
|
// handle legacy HG. linked regions are mapped into y = 0 and have no size information
|
||||||
|
// so we can only search by base handle
|
||||||
|
if( y == 0)
|
||||||
|
{
|
||||||
|
reg = gridService.GetRegionByPosition(scope, (int)x, (int)y);
|
||||||
|
return reg;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute the world location we're teleporting to
|
// Compute the world location we're teleporting to
|
||||||
double worldX = (double)x + position.X;
|
double worldX = (double)x + position.X;
|
||||||
double worldY = (double)y + position.Y;
|
double worldY = (double)y + position.Y;
|
||||||
|
|
||||||
// Find the region that contains the position
|
// Find the region that contains the position
|
||||||
GridRegion reg = GetRegionContainingWorldLocation(gridService, scope, worldX, worldY);
|
reg = GetRegionContainingWorldLocation(gridService, scope, worldX, worldY);
|
||||||
|
|
||||||
if (reg != null)
|
if (reg != null)
|
||||||
{
|
{
|
||||||
|
@ -813,8 +827,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (OutSideViewRange)
|
if (OutSideViewRange)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}",
|
"[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} size {3},{4} needs new child agent for agent {5} from {6}",
|
||||||
finalDestination.RegionName, newRegionX, newRegionY, sp.Name, Scene.Name);
|
finalDestination.RegionName, newRegionX, newRegionY,newSizeX, newSizeY, sp.Name, Scene.Name);
|
||||||
|
|
||||||
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
|
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
|
||||||
#region IP Translation for NAT
|
#region IP Translation for NAT
|
||||||
|
@ -2180,8 +2194,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
#endregion // NotFoundLocationCache class
|
#endregion // NotFoundLocationCache class
|
||||||
private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache();
|
private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache();
|
||||||
|
|
||||||
// needed for old grid code
|
|
||||||
|
|
||||||
protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py)
|
protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py)
|
||||||
{
|
{
|
||||||
// Since we don't know how big the regions could be, we have to search a very large area
|
// Since we don't know how big the regions could be, we have to search a very large area
|
||||||
|
@ -2191,6 +2203,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
// Given a world position, get the GridRegion info for
|
// Given a world position, get the GridRegion info for
|
||||||
// the region containing that point.
|
// the region containing that point.
|
||||||
|
// for compatibility with old grids it does a scan to find large regions
|
||||||
|
// 0.9 grids to that
|
||||||
|
|
||||||
protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID,
|
protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID,
|
||||||
double px, double py, uint pSizeHint)
|
double px, double py, uint pSizeHint)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,31 +48,16 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||||
private System.Timers.Timer m_timer = new System.Timers.Timer();
|
private JobEngine m_processorJobEngine;
|
||||||
|
|
||||||
private Queue<Action> m_RequestQueue = new Queue<Action>();
|
|
||||||
private Dictionary<string, List<string>> m_Pending = new Dictionary<string, List<string>>();
|
|
||||||
private int m_Interval;
|
|
||||||
|
|
||||||
#region ISharedRegionModule
|
#region ISharedRegionModule
|
||||||
|
|
||||||
public void Initialise(IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
m_Interval = Util.GetConfigVarFromSections<int>(config, "Interval", new string[] { "ServiceThrottle" }, 5000);
|
m_processorJobEngine = new JobEngine(
|
||||||
|
"ServiceThrottle","ServiceThrottle");
|
||||||
m_timer = new System.Timers.Timer();
|
m_processorJobEngine.RequestProcessTimeoutOnStop = 31000; // many webrequests have 30s expire
|
||||||
m_timer.AutoReset = false;
|
m_processorJobEngine.Start();
|
||||||
m_timer.Enabled = true;
|
|
||||||
m_timer.Interval = 15000; // 15 secs at first
|
|
||||||
m_timer.Elapsed += ProcessQueue;
|
|
||||||
m_timer.Start();
|
|
||||||
|
|
||||||
//WorkManager.StartThread(
|
|
||||||
// ProcessQueue,
|
|
||||||
// "GridServiceRequestThread",
|
|
||||||
// ThreadPriority.BelowNormal,
|
|
||||||
// true,
|
|
||||||
// false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddRegion(Scene scene)
|
public void AddRegion(Scene scene)
|
||||||
|
@ -82,7 +67,6 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||||
m_scenes.Add(scene);
|
m_scenes.Add(scene);
|
||||||
scene.RegisterModuleInterface<IServiceThrottleModule>(this);
|
scene.RegisterModuleInterface<IServiceThrottleModule>(this);
|
||||||
scene.EventManager.OnNewClient += OnNewClient;
|
scene.EventManager.OnNewClient += OnNewClient;
|
||||||
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +89,7 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
m_processorJobEngine.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
|
@ -126,38 +111,24 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||||
client.OnRegionHandleRequest += OnRegionHandleRequest;
|
client.OnRegionHandleRequest += OnRegionHandleRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMakeRootAgent(ScenePresence obj)
|
|
||||||
{
|
|
||||||
lock (m_timer)
|
|
||||||
{
|
|
||||||
if (!m_timer.Enabled)
|
|
||||||
{
|
|
||||||
m_timer.Interval = m_Interval;
|
|
||||||
m_timer.Enabled = true;
|
|
||||||
m_timer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnRegionHandleRequest(IClientAPI client, UUID regionID)
|
public void OnRegionHandleRequest(IClientAPI client, UUID regionID)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[SERVICE THROTTLE]: RegionHandleRequest {0}", regionID);
|
//m_log.DebugFormat("[SERVICE THROTTLE]: RegionHandleRequest {0}", regionID);
|
||||||
ulong handle = 0;
|
|
||||||
if (IsLocalRegionHandle(regionID, out handle))
|
|
||||||
{
|
|
||||||
client.SendRegionHandle(regionID, handle);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Action action = delegate
|
Action action = delegate
|
||||||
{
|
{
|
||||||
|
if(!client.IsActive)
|
||||||
|
return;
|
||||||
|
|
||||||
GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, regionID);
|
GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, regionID);
|
||||||
|
|
||||||
|
if(!client.IsActive)
|
||||||
|
return;
|
||||||
|
|
||||||
if (r != null && r.RegionHandle != 0)
|
if (r != null && r.RegionHandle != 0)
|
||||||
client.SendRegionHandle(regionID, r.RegionHandle);
|
client.SendRegionHandle(regionID, r.RegionHandle);
|
||||||
};
|
};
|
||||||
|
|
||||||
Enqueue("region", regionID.ToString(), action);
|
m_processorJobEngine.QueueJob("regionHandle", action, regionID.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Events
|
#endregion Events
|
||||||
|
@ -166,91 +137,10 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||||
|
|
||||||
public void Enqueue(string category, string itemid, Action continuation)
|
public void Enqueue(string category, string itemid, Action continuation)
|
||||||
{
|
{
|
||||||
lock (m_RequestQueue)
|
m_processorJobEngine.QueueJob(category, continuation, itemid);
|
||||||
{
|
|
||||||
if (m_Pending.ContainsKey(category))
|
|
||||||
{
|
|
||||||
if (m_Pending[category].Contains(itemid))
|
|
||||||
// Don't enqueue, it's already pending
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_Pending.Add(category, new List<string>());
|
|
||||||
|
|
||||||
m_Pending[category].Add(itemid);
|
|
||||||
|
|
||||||
m_RequestQueue.Enqueue(delegate
|
|
||||||
{
|
|
||||||
lock (m_RequestQueue)
|
|
||||||
m_Pending[category].Remove(itemid);
|
|
||||||
|
|
||||||
continuation();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion IServiceThrottleModule
|
#endregion IServiceThrottleModule
|
||||||
|
|
||||||
#region Process Continuation Queue
|
|
||||||
|
|
||||||
private void ProcessQueue(object sender, System.Timers.ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
//m_log.DebugFormat("[YYY]: Process queue with {0} continuations", m_RequestQueue.Count);
|
|
||||||
|
|
||||||
while (m_RequestQueue.Count > 0)
|
|
||||||
{
|
|
||||||
Action continuation = null;
|
|
||||||
lock (m_RequestQueue)
|
|
||||||
continuation = m_RequestQueue.Dequeue();
|
|
||||||
|
|
||||||
if (continuation != null)
|
|
||||||
continuation();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AreThereRootAgents())
|
|
||||||
{
|
|
||||||
lock (m_timer)
|
|
||||||
{
|
|
||||||
m_timer.Interval = 1000; // 1 sec
|
|
||||||
m_timer.Enabled = true;
|
|
||||||
m_timer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lock (m_timer)
|
|
||||||
m_timer.Enabled = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Process Continuation Queue
|
|
||||||
|
|
||||||
#region Misc
|
|
||||||
|
|
||||||
private bool IsLocalRegionHandle(UUID regionID, out ulong regionHandle)
|
|
||||||
{
|
|
||||||
regionHandle = 0;
|
|
||||||
foreach (Scene s in m_scenes)
|
|
||||||
if (s.RegionInfo.RegionID == regionID)
|
|
||||||
{
|
|
||||||
regionHandle = s.RegionInfo.RegionHandle;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool AreThereRootAgents()
|
|
||||||
{
|
|
||||||
foreach (Scene s in m_scenes)
|
|
||||||
{
|
|
||||||
foreach (ScenePresence sp in s.GetScenePresences())
|
|
||||||
if (!sp.IsChildAgent)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Misc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not found in cache, queue continuation
|
// Not found in cache, queue continuation
|
||||||
m_ServiceThrottle.Enqueue("name", uuid.ToString(), delegate
|
m_ServiceThrottle.Enqueue("uuidname", uuid.ToString(), delegate
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[YYY]: Name request {0}", uuid);
|
//m_log.DebugFormat("[YYY]: Name request {0}", uuid);
|
||||||
|
|
||||||
|
@ -216,8 +216,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
// So to avoid clients
|
// So to avoid clients
|
||||||
// (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will
|
// (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will
|
||||||
// instead drop the request entirely.
|
// instead drop the request entirely.
|
||||||
|
if(!client.IsActive)
|
||||||
|
return;
|
||||||
if (GetUser(uuid, out user))
|
if (GetUser(uuid, out user))
|
||||||
{
|
{
|
||||||
|
if(client.IsActive)
|
||||||
client.SendNameReply(uuid, user.FirstName, user.LastName);
|
client.SendNameReply(uuid, user.FirstName, user.LastName);
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences
|
||||||
get { return "RemoteAgentPreferencesServicesConnector"; }
|
get { return "RemoteAgentPreferencesServicesConnector"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialise(IConfigSource source)
|
public new void Initialise(IConfigSource source)
|
||||||
{
|
{
|
||||||
IConfig moduleConfig = source.Configs["Modules"];
|
IConfig moduleConfig = source.Configs["Modules"];
|
||||||
if (moduleConfig != null)
|
if (moduleConfig != null)
|
||||||
|
|
|
@ -1801,20 +1801,16 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
{
|
{
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
|
hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
|
||||||
if (hash.ContainsKey("region_id") && hash.ContainsKey("location"))
|
if (hash.ContainsKey("location"))
|
||||||
{
|
{
|
||||||
UUID regionID = (UUID)hash["region_id"];
|
UUID scope = m_scene.RegionInfo.ScopeID;
|
||||||
ArrayList list = (ArrayList)hash["location"];
|
ArrayList list = (ArrayList)hash["location"];
|
||||||
uint x = (uint)(double)list[0];
|
uint x = (uint)(double)list[0];
|
||||||
uint y = (uint)(double)list[1];
|
uint y = (uint)(double)list[1];
|
||||||
if (hash.ContainsKey("region_handle"))
|
if(hash.ContainsKey("region_id"))
|
||||||
{
|
{
|
||||||
// if you do a "About Landmark" on a landmark a second time, the viewer sends the
|
UUID regionID = (UUID)hash["region_id"];
|
||||||
// region_handle it got earlier via RegionHandleRequest
|
if (regionID == m_scene.RegionInfo.RegionID)
|
||||||
ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]);
|
|
||||||
parcelID = Util.BuildFakeParcelID(regionHandle, x, y);
|
|
||||||
}
|
|
||||||
else if (regionID == m_scene.RegionInfo.RegionID)
|
|
||||||
{
|
{
|
||||||
// a parcel request for a local parcel => no need to query the grid
|
// a parcel request for a local parcel => no need to query the grid
|
||||||
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y);
|
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y);
|
||||||
|
@ -1822,11 +1818,36 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// a parcel request for a parcel in another region. Ask the grid about the region
|
// a parcel request for a parcel in another region. Ask the grid about the region
|
||||||
GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, regionID);
|
GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID);
|
||||||
if (info != null)
|
if (info != null)
|
||||||
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
|
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (hash.ContainsKey("region_handle"))
|
||||||
|
{
|
||||||
|
// if you do a "About Landmark" on a landmark a second time, the viewer sends the
|
||||||
|
// region_handle it got earlier via RegionHandleRequest
|
||||||
|
ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]);
|
||||||
|
if(regionHandle == m_scene.RegionInfo.RegionHandle)
|
||||||
|
parcelID = Util.BuildFakeParcelID(regionHandle, x, y);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint wx;
|
||||||
|
uint wy;
|
||||||
|
Util.RegionHandleToWorldLoc(regionHandle, out wx, out wy);
|
||||||
|
wx += x;
|
||||||
|
wy += y;
|
||||||
|
GridRegion info = m_scene.GridService.GetRegionByPosition(scope, (int)wx, (int)wy);
|
||||||
|
if(info != null)
|
||||||
|
{
|
||||||
|
wx -= (uint)info.RegionLocX;
|
||||||
|
wy -= (uint)info.RegionLocY;
|
||||||
|
parcelID = Util.BuildFakeParcelID(info.RegionHandle, wx, wy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (LLSD.LLSDParseException e)
|
catch (LLSD.LLSDParseException e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5454,6 +5454,7 @@ Label_GroupsDone:
|
||||||
|
|
||||||
public void CleanTempObjects()
|
public void CleanTempObjects()
|
||||||
{
|
{
|
||||||
|
DateTime now = DateTime.UtcNow;
|
||||||
EntityBase[] entities = GetEntities();
|
EntityBase[] entities = GetEntities();
|
||||||
foreach (EntityBase obj in entities)
|
foreach (EntityBase obj in entities)
|
||||||
{
|
{
|
||||||
|
@ -5465,7 +5466,7 @@ Label_GroupsDone:
|
||||||
{
|
{
|
||||||
if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
|
if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
|
||||||
{
|
{
|
||||||
if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= DateTime.Now)
|
if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= now)
|
||||||
DeleteSceneObject(grp, false);
|
DeleteSceneObject(grp, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,9 +153,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_scene.SceneGraph.FireChangeBackup(this);
|
m_scene.SceneGraph.FireChangeBackup(this);
|
||||||
}
|
}
|
||||||
timeLastChanged = DateTime.Now.Ticks;
|
timeLastChanged = DateTime.UtcNow.Ticks;
|
||||||
if (!m_hasGroupChanged)
|
if (!m_hasGroupChanged)
|
||||||
timeFirstChanged = DateTime.Now.Ticks;
|
timeFirstChanged = DateTime.UtcNow.Ticks;
|
||||||
if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
|
if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_minPersistTime = m_scene.m_dontPersistBefore;
|
m_minPersistTime = m_scene.m_dontPersistBefore;
|
||||||
}
|
}
|
||||||
|
|
||||||
long currentTime = DateTime.Now.Ticks;
|
long currentTime = DateTime.UtcNow.Ticks;
|
||||||
|
|
||||||
if (timeLastChanged == 0) timeLastChanged = currentTime;
|
if (timeLastChanged == 0) timeLastChanged = currentTime;
|
||||||
if (timeFirstChanged == 0) timeFirstChanged = currentTime;
|
if (timeFirstChanged == 0) timeFirstChanged = currentTime;
|
||||||
|
@ -4161,6 +4161,180 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool GroupResize(double fscale)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, fscale);
|
||||||
|
|
||||||
|
if (Scene == null || IsDeleted || inTransit || fscale < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// ignore lsl restrictions. let them be done a LSL
|
||||||
|
PhysicsActor pa = m_rootPart.PhysActor;
|
||||||
|
|
||||||
|
if(RootPart.KeyframeMotion != null)
|
||||||
|
RootPart.KeyframeMotion.Suspend();
|
||||||
|
|
||||||
|
float minsize = Scene.m_minNonphys;
|
||||||
|
float maxsize = Scene.m_maxNonphys;
|
||||||
|
|
||||||
|
// assuming physics is more restrictive
|
||||||
|
if (pa != null && pa.IsPhysical)
|
||||||
|
{
|
||||||
|
minsize = Scene.m_minPhys;
|
||||||
|
maxsize = Scene.m_maxPhys;
|
||||||
|
}
|
||||||
|
|
||||||
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
|
float tmp;
|
||||||
|
// check scaling factor so parts don't violate dimensions
|
||||||
|
for(int i = 0; i < parts.Length; i++)
|
||||||
|
{
|
||||||
|
SceneObjectPart obPart = parts[i];
|
||||||
|
Vector3 oldSize = new Vector3(obPart.Scale);
|
||||||
|
tmp = (float)(oldSize.X * fscale);
|
||||||
|
if(tmp > maxsize)
|
||||||
|
return false;
|
||||||
|
if(tmp < minsize)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
tmp = (float)(oldSize.Y * fscale);
|
||||||
|
if(tmp > maxsize)
|
||||||
|
return false;
|
||||||
|
if(tmp < minsize)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
tmp = (float)(oldSize.Z * fscale);
|
||||||
|
if(tmp > maxsize)
|
||||||
|
return false;
|
||||||
|
if(tmp < minsize)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3 newSize = RootPart.Scale;
|
||||||
|
newSize.X = (float)(newSize.X * fscale);
|
||||||
|
newSize.Y = (float)(newSize.Y * fscale);
|
||||||
|
newSize.Z = (float)(newSize.Z * fscale);
|
||||||
|
|
||||||
|
if(pa != null)
|
||||||
|
pa.Building = true;
|
||||||
|
|
||||||
|
RootPart.Scale = newSize;
|
||||||
|
|
||||||
|
Vector3 currentpos;
|
||||||
|
for (int i = 0; i < parts.Length; i++)
|
||||||
|
{
|
||||||
|
SceneObjectPart obPart = parts[i];
|
||||||
|
|
||||||
|
if (obPart.UUID != m_rootPart.UUID)
|
||||||
|
{
|
||||||
|
currentpos = obPart.OffsetPosition;
|
||||||
|
currentpos.X = (float)(currentpos.X * fscale);
|
||||||
|
currentpos.Y = (float)(currentpos.Y * fscale);
|
||||||
|
currentpos.Z = (float)(currentpos.Z * fscale);
|
||||||
|
|
||||||
|
newSize = obPart.Scale;
|
||||||
|
newSize.X = (float)(newSize.X * fscale);
|
||||||
|
newSize.Y = (float)(newSize.Y * fscale);
|
||||||
|
newSize.Z = (float)(newSize.Z * fscale);
|
||||||
|
|
||||||
|
obPart.Scale = newSize;
|
||||||
|
obPart.UpdateOffSet(currentpos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pa != null)
|
||||||
|
pa.Building = false;
|
||||||
|
|
||||||
|
InvalidBoundsRadius();
|
||||||
|
|
||||||
|
HasGroupChanged = true;
|
||||||
|
m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
|
||||||
|
ScheduleGroupForFullUpdate();
|
||||||
|
|
||||||
|
if(RootPart.KeyframeMotion != null)
|
||||||
|
RootPart.KeyframeMotion.Resume();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetMaxGroupResizeScale()
|
||||||
|
{
|
||||||
|
if (Scene == null || IsDeleted || inTransit)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
float maxsize = Scene.m_maxNonphys;
|
||||||
|
PhysicsActor pa = m_rootPart.PhysActor;
|
||||||
|
// assuming physics is more restrictive
|
||||||
|
if (pa != null && pa.IsPhysical)
|
||||||
|
maxsize = Scene.m_maxPhys;
|
||||||
|
|
||||||
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
|
float larger = float.MinValue;
|
||||||
|
|
||||||
|
for(int i = 0; i < parts.Length; i++)
|
||||||
|
{
|
||||||
|
SceneObjectPart obPart = parts[i];
|
||||||
|
Vector3 oldSize = new Vector3(obPart.Scale);
|
||||||
|
if(larger < oldSize.X)
|
||||||
|
larger = oldSize.X;
|
||||||
|
|
||||||
|
if(larger < oldSize.Y)
|
||||||
|
larger = oldSize.Y;
|
||||||
|
|
||||||
|
if(larger < oldSize.Z)
|
||||||
|
larger = oldSize.Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(larger >= maxsize)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
larger += 1e-3f;
|
||||||
|
float fscale = maxsize / larger;
|
||||||
|
|
||||||
|
return fscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetMinGroupResizeScale()
|
||||||
|
{
|
||||||
|
if (Scene == null || IsDeleted || inTransit)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
float minsize = Scene.m_minNonphys;
|
||||||
|
PhysicsActor pa = m_rootPart.PhysActor;
|
||||||
|
// assuming physics is more restrictive
|
||||||
|
if (pa != null && pa.IsPhysical)
|
||||||
|
minsize = Scene.m_minPhys;
|
||||||
|
|
||||||
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
|
float smaller = float.MaxValue;
|
||||||
|
|
||||||
|
for(int i = 0; i < parts.Length; i++)
|
||||||
|
{
|
||||||
|
SceneObjectPart obPart = parts[i];
|
||||||
|
Vector3 oldSize = new Vector3(obPart.Scale);
|
||||||
|
if(smaller > oldSize.X)
|
||||||
|
smaller = oldSize.X;
|
||||||
|
|
||||||
|
if(smaller > oldSize.Y)
|
||||||
|
smaller = oldSize.Y;
|
||||||
|
|
||||||
|
if(smaller > oldSize.Z)
|
||||||
|
smaller = oldSize.Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(smaller <= minsize)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
if(smaller > 2e-3f)
|
||||||
|
smaller -= 1e-3f;
|
||||||
|
float fscale = minsize / smaller;
|
||||||
|
if(fscale < 1e-8f)
|
||||||
|
fscale = 1e-8f;
|
||||||
|
|
||||||
|
return fscale;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Position
|
#region Position
|
||||||
|
|
|
@ -185,8 +185,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return
|
return
|
||||||
!(SitTargetPosition == Vector3.Zero
|
!(SitTargetPosition == Vector3.Zero
|
||||||
&& (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion
|
&& (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion
|
||||||
|| SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 1f && SitTargetOrientation.W == 0f // W-Z Mapping was invalid at one point
|
|| (SitTargetOrientation.W == 0f && SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f ))); // Invalid Quaternion
|
||||||
|| SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f && SitTargetOrientation.W == 0f)); // Invalid Quaternion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1909,7 +1908,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void ResetExpire()
|
public void ResetExpire()
|
||||||
{
|
{
|
||||||
Expires = DateTime.Now + new TimeSpan(600000000);
|
Expires = DateTime.UtcNow + new TimeSpan(600000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddFlag(PrimFlags flag)
|
public void AddFlag(PrimFlags flag)
|
||||||
|
|
|
@ -2043,6 +2043,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
look = new Vector3(0.99f, 0.042f, 0);
|
look = new Vector3(0.99f, 0.042f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check Default Location (Also See EntityTransferModule.TeleportAgentWithinRegion)
|
||||||
|
if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f)
|
||||||
|
AbsolutePosition = Scene.RegionInfo.DefaultLandingPoint;
|
||||||
|
|
||||||
if (!MakeRootAgent(AbsolutePosition, flying, ref look))
|
if (!MakeRootAgent(AbsolutePosition, flying, ref look))
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
@ -2071,14 +2075,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
|
m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!gotCrossUpdate)
|
|
||||||
RotateToLookAt(look);
|
|
||||||
|
|
||||||
// Tell the client that we're totally ready
|
// Tell the client that we're totally ready
|
||||||
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
|
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
|
||||||
|
|
||||||
m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(m_callbackURI))
|
if (!string.IsNullOrEmpty(m_callbackURI))
|
||||||
{
|
{
|
||||||
// We cannot sleep here since this would hold up the inbound packet processing thread, as
|
// We cannot sleep here since this would hold up the inbound packet processing thread, as
|
||||||
|
@ -2107,12 +2110,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// client.Name, client.AgentId, m_scene.RegionInfo.RegionName);
|
// client.Name, client.AgentId, m_scene.RegionInfo.RegionName);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
|
||||||
|
|
||||||
|
if(m_teleportFlags > 0) //sanity check
|
||||||
|
gotCrossUpdate = false;
|
||||||
|
|
||||||
|
if(!gotCrossUpdate)
|
||||||
|
RotateToLookAt(look);
|
||||||
|
|
||||||
|
|
||||||
// start sending terrain patchs
|
// start sending terrain patchs
|
||||||
if (!gotCrossUpdate && !isNPC)
|
if (!gotCrossUpdate && !isNPC)
|
||||||
Scene.SendLayerData(ControllingClient);
|
Scene.SendLayerData(ControllingClient);
|
||||||
|
|
||||||
|
// HG delay
|
||||||
|
if((m_teleportFlags & TeleportFlags.ViaHGLogin) != 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(500);
|
||||||
|
m_log.DebugFormat("[CompleteMovement] HG delay: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
}
|
||||||
|
|
||||||
m_previusParcelHide = false;
|
m_previusParcelHide = false;
|
||||||
m_previusParcelUUID = UUID.Zero;
|
m_previusParcelUUID = UUID.Zero;
|
||||||
m_currentParcelHide = false;
|
m_currentParcelHide = false;
|
||||||
|
|
|
@ -265,6 +265,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
||||||
{
|
{
|
||||||
SceneObjectGroup obj = DeserializeGroupFromXml2(aPrimNode.OuterXml);
|
SceneObjectGroup obj = DeserializeGroupFromXml2(aPrimNode.OuterXml);
|
||||||
|
scene.AddNewSceneObject(obj, true);
|
||||||
if (startScripts)
|
if (startScripts)
|
||||||
sceneObjects.Add(obj);
|
sceneObjects.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,15 +53,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private const int DEBUG_CHANNEL = 2147483647;
|
// private const int DEBUG_CHANNEL = 2147483647; use base value
|
||||||
|
|
||||||
private List<IScene> m_scenes = new List<IScene>();
|
private new List<IScene> m_scenes = new List<IScene>();
|
||||||
private List<IScene> m_conciergedScenes = new List<IScene>();
|
private List<IScene> m_conciergedScenes = new List<IScene>();
|
||||||
|
|
||||||
private bool m_replacingChatModule = false;
|
private bool m_replacingChatModule = false;
|
||||||
|
|
||||||
private IConfig m_config;
|
|
||||||
|
|
||||||
private string m_whoami = "conferencier";
|
private string m_whoami = "conferencier";
|
||||||
private Regex m_regions = null;
|
private Regex m_regions = null;
|
||||||
private string m_welcomes = null;
|
private string m_welcomes = null;
|
||||||
|
@ -72,29 +70,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
private string m_brokerURI = String.Empty;
|
private string m_brokerURI = String.Empty;
|
||||||
private int m_brokerUpdateTimeout = 300;
|
private int m_brokerUpdateTimeout = 300;
|
||||||
|
|
||||||
internal object m_syncy = new object();
|
internal new object m_syncy = new object();
|
||||||
|
|
||||||
internal bool m_enabled = false;
|
internal new bool m_enabled = false;
|
||||||
|
|
||||||
#region ISharedRegionModule Members
|
#region ISharedRegionModule Members
|
||||||
public override void Initialise(IConfigSource config)
|
public override void Initialise(IConfigSource configSource)
|
||||||
{
|
{
|
||||||
m_config = config.Configs["Concierge"];
|
IConfig config = configSource.Configs["Concierge"];
|
||||||
|
|
||||||
if (null == m_config)
|
if (config == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!m_config.GetBoolean("enabled", false))
|
if (!config.GetBoolean("enabled", false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
|
|
||||||
|
|
||||||
// check whether ChatModule has been disabled: if yes,
|
// check whether ChatModule has been disabled: if yes,
|
||||||
// then we'll "stand in"
|
// then we'll "stand in"
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (config.Configs["Chat"] == null)
|
if (configSource.Configs["Chat"] == null)
|
||||||
{
|
{
|
||||||
// if Chat module has not been configured it's
|
// if Chat module has not been configured it's
|
||||||
// enabled by default, so we are not going to
|
// enabled by default, so we are not going to
|
||||||
|
@ -103,7 +100,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_replacingChatModule = !config.Configs["Chat"].GetBoolean("enabled", true);
|
m_replacingChatModule = !configSource.Configs["Chat"].GetBoolean("enabled", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@ -114,21 +111,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing");
|
m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing");
|
||||||
|
|
||||||
// take note of concierge channel and of identity
|
// take note of concierge channel and of identity
|
||||||
m_conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel);
|
m_conciergeChannel = configSource.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel);
|
||||||
m_whoami = m_config.GetString("whoami", "conferencier");
|
m_whoami = config.GetString("whoami", "conferencier");
|
||||||
m_welcomes = m_config.GetString("welcomes", m_welcomes);
|
m_welcomes = config.GetString("welcomes", m_welcomes);
|
||||||
m_announceEntering = m_config.GetString("announce_entering", m_announceEntering);
|
m_announceEntering = config.GetString("announce_entering", m_announceEntering);
|
||||||
m_announceLeaving = m_config.GetString("announce_leaving", m_announceLeaving);
|
m_announceLeaving = config.GetString("announce_leaving", m_announceLeaving);
|
||||||
m_xmlRpcPassword = m_config.GetString("password", m_xmlRpcPassword);
|
m_xmlRpcPassword = config.GetString("password", m_xmlRpcPassword);
|
||||||
m_brokerURI = m_config.GetString("broker", m_brokerURI);
|
m_brokerURI = config.GetString("broker", m_brokerURI);
|
||||||
m_brokerUpdateTimeout = m_config.GetInt("broker_timeout", m_brokerUpdateTimeout);
|
m_brokerUpdateTimeout = config.GetInt("broker_timeout", m_brokerUpdateTimeout);
|
||||||
|
|
||||||
m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami);
|
m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami);
|
||||||
|
|
||||||
// calculate regions Regex
|
// calculate regions Regex
|
||||||
if (m_regions == null)
|
if (m_regions == null)
|
||||||
{
|
{
|
||||||
string regions = m_config.GetString("regions", String.Empty);
|
string regions = config.GetString("regions", String.Empty);
|
||||||
if (!String.IsNullOrEmpty(regions))
|
if (!String.IsNullOrEmpty(regions))
|
||||||
{
|
{
|
||||||
m_regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
m_regions = new Regex(@regions, RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
@ -136,7 +133,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void AddRegion(Scene scene)
|
public override void AddRegion(Scene scene)
|
||||||
{
|
{
|
||||||
if (!m_enabled) return;
|
if (!m_enabled) return;
|
||||||
|
|
|
@ -532,7 +532,7 @@ namespace OpenSim.Region.OptionalModules.Materials
|
||||||
|
|
||||||
lock(m_Materials)
|
lock(m_Materials)
|
||||||
{
|
{
|
||||||
if(oldid != UUID.Zero)
|
if(oldid != UUID.Zero && m_MaterialsRefCount.ContainsKey(oldid))
|
||||||
{
|
{
|
||||||
m_MaterialsRefCount[oldid]--;
|
m_MaterialsRefCount[oldid]--;
|
||||||
if(m_MaterialsRefCount[oldid] <= 0)
|
if(m_MaterialsRefCount[oldid] <= 0)
|
||||||
|
|
|
@ -2969,6 +2969,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
|
|
||||||
private void changePhysRepData(ODEPhysRepData repData)
|
private void changePhysRepData(ODEPhysRepData repData)
|
||||||
{
|
{
|
||||||
|
if(_size == repData.size &&
|
||||||
|
_pbs == repData.pbs &&
|
||||||
|
m_shapetype == repData.shapetype &&
|
||||||
|
m_mesh == repData.mesh &&
|
||||||
|
primVolume == repData.volume)
|
||||||
|
return;
|
||||||
|
|
||||||
CheckDelaySelect();
|
CheckDelaySelect();
|
||||||
|
|
||||||
OdePrim parent = (OdePrim)_parent;
|
OdePrim parent = (OdePrim)_parent;
|
||||||
|
|
|
@ -1803,6 +1803,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Integer llScaleByFactor(double scaling_factor)
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
SceneObjectGroup group = m_host.ParentGroup;
|
||||||
|
|
||||||
|
if(scaling_factor < 1e-6)
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
if(scaling_factor > 1e6)
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
|
||||||
|
if (group == null || group.IsDeleted || group.inTransit)
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
|
||||||
|
if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical)
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
|
||||||
|
if (group.RootPart.KeyframeMotion != null)
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
|
||||||
|
if(group.GroupResize(scaling_factor))
|
||||||
|
return ScriptBaseClass.TRUE;
|
||||||
|
else
|
||||||
|
return ScriptBaseClass.FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Float llGetMaxScaleFactor()
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
SceneObjectGroup group = m_host.ParentGroup;
|
||||||
|
|
||||||
|
if (group == null || group.IsDeleted || group.inTransit)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
return (LSL_Float)group.GetMaxGroupResizeScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Float llGetMinScaleFactor()
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
SceneObjectGroup group = m_host.ParentGroup;
|
||||||
|
|
||||||
|
if (group == null || group.IsDeleted || group.inTransit)
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
|
return (LSL_Float)group.GetMinGroupResizeScale();
|
||||||
|
}
|
||||||
|
|
||||||
public void llSetScale(LSL_Vector scale)
|
public void llSetScale(LSL_Vector scale)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -3049,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
double ScriptTime = Util.GetTimeStampMS() - m_timer;
|
double ScriptTime = Util.GetTimeStampMS() - m_timer;
|
||||||
return (ScriptTime / 1000.0);
|
return (float)Math.Round((ScriptTime / 1000.0), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llResetTime()
|
public void llResetTime()
|
||||||
|
@ -3064,7 +3111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
double now = Util.GetTimeStampMS();
|
double now = Util.GetTimeStampMS();
|
||||||
double ScriptTime = now - m_timer;
|
double ScriptTime = now - m_timer;
|
||||||
m_timer = now;
|
m_timer = now;
|
||||||
return (ScriptTime / 1000.0);
|
return (float)Math.Round((ScriptTime / 1000.0), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llSound(string sound, double volume, int queue, int loop)
|
public void llSound(string sound, double volume, int queue, int loop)
|
||||||
|
@ -3482,13 +3529,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
Error("llRezAtRoot", "Can't find object '" + inventory + "'");
|
Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.InvType != (int)InventoryType.Object)
|
if (item.InvType != (int)InventoryType.Object)
|
||||||
{
|
{
|
||||||
Error("llRezAtRoot", "Can't create requested object; object is missing from database");
|
Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3532,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
|
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
}, null, "LSL_Api.llRezAtRoot");
|
}, null, "LSL_Api.doObjectRez");
|
||||||
|
|
||||||
//ScriptSleep((int)((groupmass * velmag) / 10));
|
//ScriptSleep((int)((groupmass * velmag) / 10));
|
||||||
ScriptSleep(m_sleepMsOnRezAtRoot);
|
ScriptSleep(m_sleepMsOnRezAtRoot);
|
||||||
|
|
|
@ -1938,8 +1938,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
taskItem.ResetIDs(m_host.UUID);
|
taskItem.ResetIDs(m_host.UUID);
|
||||||
taskItem.ParentID = m_host.UUID;
|
taskItem.ParentID = m_host.UUID;
|
||||||
taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
|
taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
|
||||||
taskItem.Name = asset.Name;
|
taskItem.Name = name;
|
||||||
taskItem.Description = asset.Description;
|
taskItem.Description = description;
|
||||||
taskItem.Type = (int)AssetType.Notecard;
|
taskItem.Type = (int)AssetType.Notecard;
|
||||||
taskItem.InvType = (int)InventoryType.Notecard;
|
taskItem.InvType = (int)InventoryType.Notecard;
|
||||||
taskItem.OwnerID = m_host.OwnerID;
|
taskItem.OwnerID = m_host.OwnerID;
|
||||||
|
@ -3354,8 +3354,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
Scene scene = m_ScriptEngine.World;
|
Scene scene = m_ScriptEngine.World;
|
||||||
GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID);
|
RegionInfo reg = World.RegionInfo;
|
||||||
return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight);
|
// GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID);
|
||||||
|
// return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight);
|
||||||
|
return new LSL_Vector((float)reg.RegionSizeX, (float)reg.RegionSizeY, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int osGetSimulatorMemory()
|
public int osGetSimulatorMemory()
|
||||||
|
|
|
@ -326,6 +326,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
LSL_Integer llRound(double f);
|
LSL_Integer llRound(double f);
|
||||||
LSL_Integer llSameGroup(string agent);
|
LSL_Integer llSameGroup(string agent);
|
||||||
void llSay(int channelID, string text);
|
void llSay(int channelID, string text);
|
||||||
|
LSL_Integer llScaleByFactor(double scaling_factor);
|
||||||
|
LSL_Float llGetMaxScaleFactor();
|
||||||
|
LSL_Float llGetMinScaleFactor();
|
||||||
void llScaleTexture(double u, double v, int face);
|
void llScaleTexture(double u, double v, int face);
|
||||||
LSL_Integer llScriptDanger(LSL_Vector pos);
|
LSL_Integer llScriptDanger(LSL_Vector pos);
|
||||||
void llScriptProfiler(LSL_Integer flag);
|
void llScriptProfiler(LSL_Integer flag);
|
||||||
|
|
|
@ -1465,6 +1465,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_LSL_Functions.llSay(channelID, text);
|
m_LSL_Functions.llSay(channelID, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Integer llScaleByFactor(double scaling_factor)
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.llScaleByFactor(scaling_factor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Float llGetMaxScaleFactor()
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.llGetMaxScaleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Float llGetMinScaleFactor()
|
||||||
|
{
|
||||||
|
return m_LSL_Functions.llGetMinScaleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
public void llScaleTexture(double u, double v, int face)
|
public void llScaleTexture(double u, double v, int face)
|
||||||
{
|
{
|
||||||
m_LSL_Functions.llScaleTexture(u, v, face);
|
m_LSL_Functions.llScaleTexture(u, v, face);
|
||||||
|
|
|
@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_CurrentEvent = data.EventName;
|
m_CurrentEvent = data.EventName;
|
||||||
m_EventStart = DateTime.Now;
|
m_EventStart = DateTime.UtcNow;
|
||||||
m_InEvent = true;
|
m_InEvent = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -1033,7 +1033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
if (!m_InEvent)
|
if (!m_InEvent)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (DateTime.Now - m_EventStart).Seconds;
|
return (DateTime.UtcNow - m_EventStart).Seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetScript(int timeout)
|
public void ResetScript(int timeout)
|
||||||
|
|
|
@ -70,13 +70,17 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
string imageURL = string.Empty;
|
string imageURL = string.Empty;
|
||||||
ulong regionHandle = 0;
|
ulong regionHandle = 0;
|
||||||
string reason = string.Empty;
|
string reason = string.Empty;
|
||||||
|
int sizeX = 256;
|
||||||
|
int sizeY = 256;
|
||||||
|
|
||||||
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason);
|
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason, out sizeX, out sizeY);
|
||||||
|
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
hash["result"] = success.ToString();
|
hash["result"] = success.ToString();
|
||||||
hash["uuid"] = regionID.ToString();
|
hash["uuid"] = regionID.ToString();
|
||||||
hash["handle"] = regionHandle.ToString();
|
hash["handle"] = regionHandle.ToString();
|
||||||
|
hash["size_x"] = sizeX.ToString();
|
||||||
|
hash["size_y"] = sizeY.ToString();
|
||||||
hash["region_image"] = imageURL;
|
hash["region_image"] = imageURL;
|
||||||
hash["external_name"] = externalName;
|
hash["external_name"] = externalName;
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
hash["region_name"] = regInfo.RegionName;
|
hash["region_name"] = regInfo.RegionName;
|
||||||
hash["hostname"] = regInfo.ExternalHostName;
|
hash["hostname"] = regInfo.ExternalHostName;
|
||||||
hash["http_port"] = regInfo.HttpPort.ToString();
|
hash["http_port"] = regInfo.HttpPort.ToString();
|
||||||
|
hash["server_uri"] = regInfo.ServerURI;
|
||||||
hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
|
hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
|
||||||
hash["position"] = position.ToString();
|
hash["position"] = position.ToString();
|
||||||
hash["lookAt"] = lookAt.ToString();
|
hash["lookAt"] = lookAt.ToString();
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors
|
||||||
Initialise(source);
|
Initialise(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
{
|
{
|
||||||
IConfig gridConfig = source.Configs["AgentPreferencesService"];
|
IConfig gridConfig = source.Configs["AgentPreferencesService"];
|
||||||
if (gridConfig == null)
|
if (gridConfig == null)
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace OpenSim.Services.Connectors.Friends
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
|
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, 15, null, false);
|
||||||
if (reply != string.Empty)
|
if (reply != string.Empty)
|
||||||
{
|
{
|
||||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||||
|
|
|
@ -73,13 +73,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
return "foreignobject/";
|
return "foreignobject/";
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
|
public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)
|
||||||
{
|
{
|
||||||
regionID = UUID.Zero;
|
regionID = UUID.Zero;
|
||||||
imageURL = string.Empty;
|
imageURL = string.Empty;
|
||||||
realHandle = 0;
|
realHandle = 0;
|
||||||
externalName = string.Empty;
|
externalName = string.Empty;
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
sizeX = (int)Constants.RegionSize;
|
||||||
|
sizeY = (int)Constants.RegionSize;
|
||||||
|
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
hash["region_name"] = info.RegionName;
|
hash["region_name"] = info.RegionName;
|
||||||
|
@ -134,8 +136,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
externalName = (string)hash["external_name"];
|
externalName = (string)hash["external_name"];
|
||||||
//m_log.Debug(">> HERE, externalName: " + externalName);
|
//m_log.Debug(">> HERE, externalName: " + externalName);
|
||||||
}
|
}
|
||||||
|
if (hash["size_x"] != null)
|
||||||
|
{
|
||||||
|
Int32.TryParse((string)hash["size_x"], out sizeX);
|
||||||
|
}
|
||||||
|
if (hash["size_y"] != null)
|
||||||
|
{
|
||||||
|
Int32.TryParse((string)hash["size_y"], out sizeY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,7 +277,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
{
|
{
|
||||||
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||||
uri,
|
uri,
|
||||||
ServerUtils.BuildQueryString(sendData), 15);
|
ServerUtils.BuildQueryString(sendData),
|
||||||
|
15,
|
||||||
|
null,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,6 +77,7 @@ namespace OpenSim.Services.FSAssetService
|
||||||
protected int m_missingAssetsFS = 0;
|
protected int m_missingAssetsFS = 0;
|
||||||
protected string m_FSBase;
|
protected string m_FSBase;
|
||||||
protected bool m_useOsgridFormat = false;
|
protected bool m_useOsgridFormat = false;
|
||||||
|
protected bool m_showStats = true;
|
||||||
|
|
||||||
private static bool m_Initialized;
|
private static bool m_Initialized;
|
||||||
private bool m_MainInstance;
|
private bool m_MainInstance;
|
||||||
|
@ -186,6 +187,9 @@ namespace OpenSim.Services.FSAssetService
|
||||||
|
|
||||||
m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat);
|
m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat);
|
||||||
|
|
||||||
|
// Default is to show stats to retain original behaviour
|
||||||
|
m_showStats = assetConfig.GetBoolean("ShowConsoleStats", m_showStats);
|
||||||
|
|
||||||
if (m_MainInstance)
|
if (m_MainInstance)
|
||||||
{
|
{
|
||||||
string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty);
|
string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty);
|
||||||
|
@ -203,9 +207,13 @@ namespace OpenSim.Services.FSAssetService
|
||||||
|
|
||||||
m_WriterThread = new Thread(Writer);
|
m_WriterThread = new Thread(Writer);
|
||||||
m_WriterThread.Start();
|
m_WriterThread.Start();
|
||||||
|
|
||||||
|
if (m_showStats)
|
||||||
|
{
|
||||||
m_StatsThread = new Thread(Stats);
|
m_StatsThread = new Thread(Stats);
|
||||||
m_StatsThread.Start();
|
m_StatsThread.Start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_log.Info("[FSASSETS]: FS asset service enabled");
|
m_log.Info("[FSASSETS]: FS asset service enabled");
|
||||||
}
|
}
|
||||||
|
@ -441,7 +449,7 @@ namespace OpenSim.Services.FSAssetService
|
||||||
Store(asset);
|
Store(asset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (asset == null)
|
if (asset == null && m_showStats)
|
||||||
{
|
{
|
||||||
// m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id);
|
// m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id);
|
||||||
m_missingAssets++;
|
m_missingAssets++;
|
||||||
|
@ -469,8 +477,11 @@ namespace OpenSim.Services.FSAssetService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (asset == null)
|
if (asset == null)
|
||||||
|
{
|
||||||
|
if (m_showStats)
|
||||||
m_missingAssetsFS++;
|
m_missingAssetsFS++;
|
||||||
// m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash);
|
// m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
|
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
|
||||||
|
@ -484,11 +495,14 @@ namespace OpenSim.Services.FSAssetService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_showStats)
|
||||||
|
{
|
||||||
lock (m_statsLock)
|
lock (m_statsLock)
|
||||||
{
|
{
|
||||||
m_readTicks += Environment.TickCount - startTime;
|
m_readTicks += Environment.TickCount - startTime;
|
||||||
m_readCount++;
|
m_readCount++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
|
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
|
||||||
// Fix bad assets before sending them elsewhere
|
// Fix bad assets before sending them elsewhere
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
mapName = mapName.Trim();
|
mapName = mapName.Trim();
|
||||||
|
|
||||||
if (!mapName.StartsWith("http"))
|
if (!mapName.StartsWith("http") && !mapName.StartsWith("https"))
|
||||||
{
|
{
|
||||||
// Formats: grid.example.com:8002:region name
|
// Formats: grid.example.com:8002:region name
|
||||||
// grid.example.com:region name
|
// grid.example.com:region name
|
||||||
|
@ -232,8 +232,9 @@ namespace OpenSim.Services.GridService
|
||||||
regionName = parts[2];
|
regionName = parts[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason);
|
string serverURI = "http://"+ host +":"+ port.ToString() + "/";
|
||||||
if (success)
|
// bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason);
|
||||||
|
if(TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, serverURI, ownerID, out regInfo, out reason))
|
||||||
{
|
{
|
||||||
regInfo.RegionName = mapName;
|
regInfo.RegionName = mapName;
|
||||||
return regInfo;
|
return regInfo;
|
||||||
|
@ -257,6 +258,8 @@ namespace OpenSim.Services.GridService
|
||||||
}
|
}
|
||||||
|
|
||||||
serverURI = parts[0];
|
serverURI = parts[0];
|
||||||
|
if (!serverURI.EndsWith("/"))
|
||||||
|
serverURI = serverURI + "/";
|
||||||
|
|
||||||
if (parts.Length >= 2)
|
if (parts.Length >= 2)
|
||||||
{
|
{
|
||||||
|
@ -365,7 +368,9 @@ namespace OpenSim.Services.GridService
|
||||||
UUID regionID = UUID.Zero;
|
UUID regionID = UUID.Zero;
|
||||||
string externalName = string.Empty;
|
string externalName = string.Empty;
|
||||||
string imageURL = string.Empty;
|
string imageURL = string.Empty;
|
||||||
if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
|
int sizeX = (int)Constants.RegionSize;
|
||||||
|
int sizeY = (int)Constants.RegionSize;
|
||||||
|
if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason, out sizeX, out sizeY))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (regionID == UUID.Zero)
|
if (regionID == UUID.Zero)
|
||||||
|
@ -397,6 +402,8 @@ namespace OpenSim.Services.GridService
|
||||||
// }
|
// }
|
||||||
|
|
||||||
regInfo.RegionID = regionID;
|
regInfo.RegionID = regionID;
|
||||||
|
regInfo.RegionSizeX = sizeX;
|
||||||
|
regInfo.RegionSizeY = sizeY;
|
||||||
|
|
||||||
if (externalName == string.Empty)
|
if (externalName == string.Empty)
|
||||||
regInfo.RegionName = regInfo.ServerURI;
|
regInfo.RegionName = regInfo.ServerURI;
|
||||||
|
|
|
@ -162,10 +162,12 @@ namespace OpenSim.Services.HypergridService
|
||||||
exceptions.Add(s.Trim());
|
exceptions.Add(s.Trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason)
|
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)
|
||||||
{
|
{
|
||||||
regionID = UUID.Zero;
|
regionID = UUID.Zero;
|
||||||
regionHandle = 0;
|
regionHandle = 0;
|
||||||
|
sizeX = (int)Constants.RegionSize;
|
||||||
|
sizeY = (int)Constants.RegionSize;
|
||||||
externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
|
externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
|
||||||
imageURL = string.Empty;
|
imageURL = string.Empty;
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
@ -199,6 +201,8 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
regionID = region.RegionID;
|
regionID = region.RegionID;
|
||||||
regionHandle = region.RegionHandle;
|
regionHandle = region.RegionHandle;
|
||||||
|
sizeX = region.RegionSizeX;
|
||||||
|
sizeY = region.RegionSizeY;
|
||||||
|
|
||||||
string regionimage = "regionImage" + regionID.ToString();
|
string regionimage = "regionImage" + regionID.ToString();
|
||||||
regionimage = regionimage.Replace("-", "");
|
regionimage = regionimage.Replace("-", "");
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
{
|
{
|
||||||
public interface IGatekeeperService
|
public interface IGatekeeperService
|
||||||
{
|
{
|
||||||
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
|
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the region a Hypergrid visitor should enter.
|
/// Returns the region a Hypergrid visitor should enter.
|
||||||
|
|
|
@ -785,7 +785,10 @@ namespace OpenSim.Services.LLLoginService
|
||||||
ulong handle;
|
ulong handle;
|
||||||
string imageURL = string.Empty, reason = string.Empty;
|
string imageURL = string.Empty, reason = string.Empty;
|
||||||
string message;
|
string message;
|
||||||
if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason))
|
int sizeX = (int)Constants.RegionSize;
|
||||||
|
int sizeY = (int)Constants.RegionSize;
|
||||||
|
|
||||||
|
if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason, out sizeX, out sizeY))
|
||||||
{
|
{
|
||||||
string homeURI = null;
|
string homeURI = null;
|
||||||
if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI"))
|
if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
|
|
@ -397,10 +397,6 @@
|
||||||
;; Allow region managers to assume god powers in regions they manage
|
;; Allow region managers to assume god powers in regions they manage
|
||||||
; region_manager_is_god = false
|
; region_manager_is_god = false
|
||||||
|
|
||||||
;# {parcel_owner_is_god} {} {Allow parcel owner gods} {true false} false
|
|
||||||
;; Allow parcel owners to assume god powers in their parcels
|
|
||||||
; parcel_owner_is_god = false
|
|
||||||
|
|
||||||
;# {simple_build_permissions} {} {Allow building in parcel by access list (no groups)} {true false} false
|
;# {simple_build_permissions} {} {Allow building in parcel by access list (no groups)} {true false} false
|
||||||
;; More control over permissions
|
;; More control over permissions
|
||||||
;; This is definitely not SL!
|
;; This is definitely not SL!
|
||||||
|
|
|
@ -473,7 +473,7 @@
|
||||||
;region_manager_is_god = false
|
;region_manager_is_god = false
|
||||||
|
|
||||||
; Allow parcel owners to assume god powers in their parcels
|
; Allow parcel owners to assume god powers in their parcels
|
||||||
; you really may not want this...
|
; you really do not want this...
|
||||||
;parcel_owner_is_god = false
|
;parcel_owner_is_god = false
|
||||||
|
|
||||||
; Control user types that are allowed to create new scripts
|
; Control user types that are allowed to create new scripts
|
||||||
|
|
|
@ -31,6 +31,9 @@ ExternalHostName = SYSTEMIP
|
||||||
; SizeX = 512
|
; SizeX = 512
|
||||||
; SizeY = 512
|
; SizeY = 512
|
||||||
|
|
||||||
|
; * Default region landing point used when no teleport coords are specified
|
||||||
|
; DefaultLanding = <128,128,30>
|
||||||
|
|
||||||
; *
|
; *
|
||||||
; * Prim data
|
; * Prim data
|
||||||
; * This allows limiting the sizes of prims and the region prim count
|
; * This allows limiting the sizes of prims and the region prim count
|
||||||
|
|
|
@ -242,6 +242,9 @@
|
||||||
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
|
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
|
||||||
;DaysBetweenAccessTimeUpdates = 30
|
;DaysBetweenAccessTimeUpdates = 30
|
||||||
|
|
||||||
|
;; Should FSAssets print read/write stats to the robust console, default is true
|
||||||
|
;ShowConsoleStats = true
|
||||||
|
|
||||||
;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
|
;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
|
||||||
;StorageProvider = ""
|
;StorageProvider = ""
|
||||||
;ConnectionString = ""
|
;ConnectionString = ""
|
||||||
|
|
|
@ -204,6 +204,9 @@
|
||||||
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
|
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
|
||||||
;DaysBetweenAccessTimeUpdates = 30
|
;DaysBetweenAccessTimeUpdates = 30
|
||||||
|
|
||||||
|
;; Should FSAssets print read/write stats to the robust console, default is true
|
||||||
|
;ShowConsoleStats = true
|
||||||
|
|
||||||
;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
|
;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
|
||||||
;StorageProvider = ""
|
;StorageProvider = ""
|
||||||
;ConnectionString = ""
|
;ConnectionString = ""
|
||||||
|
|
Loading…
Reference in New Issue