Merge branch 'master' into httptests

httptests
UbitUmarov 2016-12-14 13:35:53 +00:00
commit 18a292ad02
33 changed files with 231 additions and 111 deletions

View File

@ -1293,7 +1293,7 @@ namespace OpenSim.Framework
void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks);
void SendViewerTime(int phase);
void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout,
void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout,
uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID);
void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question);

View File

@ -138,8 +138,6 @@ namespace OpenSim.Framework
protected uint m_httpPort;
protected string m_serverURI;
protected string m_regionName = String.Empty;
protected bool Allow_Alternate_Ports;
public bool m_allow_alternate_ports;
protected string m_externalHostName;
protected IPEndPoint m_internalEndPoint;
protected uint m_remotingPort;
@ -147,6 +145,7 @@ namespace OpenSim.Framework
public string RemotingAddress;
public UUID ScopeID = UUID.Zero;
private UUID m_maptileStaticUUID = UUID.Zero;
private bool m_resolveAddress = false;
public uint WorldLocX = 0;
public uint WorldLocY = 0;
@ -544,7 +543,7 @@ namespace OpenSim.Framework
private void ReadNiniConfig(IConfigSource source, string name)
{
// bool creatingNew = false;
bool creatingNew = false;
if (source.Configs.Count == 0)
{
@ -568,7 +567,7 @@ namespace OpenSim.Framework
source.AddConfig(name);
// creatingNew = true;
creatingNew = true;
}
if (name == String.Empty)
@ -672,18 +671,19 @@ namespace OpenSim.Framework
}
m_internalEndPoint = new IPEndPoint(address, port);
// AllowAlternatePorts
// ResolveAddress
//
allKeys.Remove("AllowAlternatePorts");
if (config.Contains("AllowAlternatePorts"))
allKeys.Remove("ResolveAddress");
if (config.Contains("ResolveAddress"))
{
m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true);
m_resolveAddress = config.GetBoolean("ResolveAddress", false);
}
else
{
m_allow_alternate_ports = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Allow alternate ports", "False"));
if (creatingNew)
m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False"));
config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
config.Set("ResolveAddress", m_resolveAddress.ToString());
}
// ExternalHostName
@ -706,10 +706,18 @@ namespace OpenSim.Framework
"[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}",
m_externalHostName, name);
}
else
else if (!m_resolveAddress)
{
m_externalHostName = externalName;
}
else
{
IPAddress[] addrs = Dns.GetHostAddresses(externalName);
if (addrs.Length != 1) // If it is ambiguous or not resolveable, use it literally
m_externalHostName = externalName;
else
m_externalHostName = addrs[0].ToString();
}
// RegionType
m_regionType = config.GetString("RegionType", String.Empty);
@ -901,8 +909,6 @@ namespace OpenSim.Framework
config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
config.Set("InternalPort", m_internalEndPoint.Port);
config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString());
config.Set("ExternalHostName", m_externalHostName);
if (m_nonphysPrimMin > 0)
@ -995,10 +1001,6 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Internal IP Port for incoming UDP client connections",
m_internalEndPoint.Port.ToString(), true);
configMember.addConfigurationOption("allow_alternate_ports",
ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Allow sim to find alternate UDP ports when ports are in use?",
m_allow_alternate_ports.ToString(), true);
configMember.addConfigurationOption("external_host_name",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"External Host Name", m_externalHostName, true);
@ -1068,9 +1070,6 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Internal IP Port for incoming UDP client connections",
ConfigSettings.DefaultRegionHttpPort.ToString(), false);
configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Allow sim to find alternate UDP ports when ports are in use?",
"false", true);
configMember.addConfigurationOption("external_host_name",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"External Host Name", "127.0.0.1", false);
@ -1141,9 +1140,6 @@ namespace OpenSim.Framework
case "internal_ip_port":
m_internalEndPoint.Port = (int) configuration_result;
break;
case "allow_alternate_ports":
m_allow_alternate_ports = (bool) configuration_result;
break;
case "external_host_name":
if ((string) configuration_result != "SYSTEMIP")
{
@ -1220,7 +1216,6 @@ namespace OpenSim.Framework
if ((RemotingAddress != null) && !RemotingAddress.Equals(""))
args["remoting_address"] = OSD.FromString(RemotingAddress);
args["remoting_port"] = OSD.FromString(RemotingPort.ToString());
args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports);
if ((proxyUrl != null) && !proxyUrl.Equals(""))
args["proxy_url"] = OSD.FromString(proxyUrl);
if (RegionType != String.Empty)
@ -1275,8 +1270,6 @@ namespace OpenSim.Framework
RemotingAddress = args["remoting_address"].AsString();
if (args["remoting_port"] != null)
UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort);
if (args["allow_alt_ports"] != null)
m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean();
if (args["proxy_url"] != null)
proxyUrl = args["proxy_url"].AsString();
if (args["region_type"] != null)
@ -1314,7 +1307,8 @@ namespace OpenSim.Framework
kvp["http_port"] = HttpPort.ToString();
kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
kvp["internal_port"] = InternalEndPoint.Port.ToString();
kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
// TODO: Remove in next major version
kvp["alternate_ports"] = "False";
kvp["server_uri"] = ServerURI;
return kvp;

View File

@ -1685,6 +1685,8 @@ namespace OpenSim.Framework
// hide the password in the connection string
passPosition = connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase);
if (passPosition == -1)
return connectionString;
passPosition = connectionString.IndexOf("=", passPosition);
if (passPosition < connectionString.Length)
passPosition += 1;

View File

@ -26,6 +26,7 @@
*/
using System;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
@ -74,7 +75,7 @@ namespace OpenSim
private string m_timedScript = "disabled";
private int m_timeInterval = 1200;
private Timer m_scriptTimer;
private System.Timers.Timer m_scriptTimer;
public OpenSim(IConfigSource configSource) : base(configSource)
{
@ -125,6 +126,21 @@ namespace OpenSim
m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod);
}
private static Mono.Unix.UnixSignal[] signals;
private Thread signal_thread = new Thread (delegate ()
{
while (true)
{
// Wait for a signal to be delivered
int index = Mono.Unix.UnixSignal.WaitAny (signals, -1);
//Mono.Unix.Native.Signum signal = signals [index].Signum;
MainConsole.Instance.RunCommand("shutdown");
}
});
/// <summary>
/// Performs initialisation of the scene, such as loading configuration from disk.
/// </summary>
@ -134,6 +150,24 @@ namespace OpenSim
m_log.Info("========================= STARTING OPENSIM =========================");
m_log.Info("====================================================================");
if(!Util.IsWindows())
{
try
{
// linux mac os specifics
signals = new Mono.Unix.UnixSignal[]
{
new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
};
signal_thread.Start();
}
catch (Exception e)
{
m_log.Info("Could not set up UNIX signal handlers. SIGTERM will not");
m_log.InfoFormat("shut down gracefully: {0}", e.Message);
m_log.Debug("Exception was: ", e);
}
}
//m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
// http://msdn.microsoft.com/en-us/library/bb384202.aspx
//GCSettings.LatencyMode = GCLatencyMode.Batch;
@ -217,7 +251,7 @@ namespace OpenSim
// Start timer script (run a script every xx seconds)
if (m_timedScript != "disabled")
{
m_scriptTimer = new Timer();
m_scriptTimer = new System.Timers.Timer();
m_scriptTimer.Enabled = true;
m_scriptTimer.Interval = m_timeInterval*1000;
m_scriptTimer.Elapsed += RunAutoTimerScript;

View File

@ -2704,7 +2704,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task);
}
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType,
string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
UUID partnerID)
{
@ -2716,7 +2716,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else
avatarReply.PropertiesData.AboutText = Utils.EmptyBytes;
avatarReply.PropertiesData.BornOn = Util.StringToBytes256(bornOn);
avatarReply.PropertiesData.CharterMember = charterMember;
avatarReply.PropertiesData.CharterMember = membershipType;
if (flAbout != null)
avatarReply.PropertiesData.FLAboutText = Util.StringToBytes256(flAbout);
else

View File

@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address;
Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler);
Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, m_Config, scene.AuthenticateHandler);
scene.RegionInfo.InternalEndPoint.Port = (int)port;
AddScene(scene);
@ -98,9 +98,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
#endregion
public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager)
{
m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager);
m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager);
}
public virtual void AddScene(IScene scene)
@ -430,12 +430,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public JobEngine OqrEngine { get; protected set; }
public LLUDPServer(
IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port,
IPAddress listenIP, ref uint port, int proxyPortOffsetParm,
IConfigSource configSource, AgentCircuitManager circuitManager)
: base(listenIP, (int)port)
{
#region Environment.TickCount Measurement
// Update the port with the one we actually got
port = (uint)Port;
// Measure the resolution of Environment.TickCount
TickCountResolution = 0f;
for (int i = 0; i < 10; i++)

View File

@ -107,6 +107,11 @@ namespace OpenMetaverse
/// </summary>
public float AverageReceiveTicksForLastSamplePeriod { get; private set; }
public int Port
{
get { return m_udpPort; }
}
#region PacketDropDebugging
/// <summary>
/// For debugging purposes only... random number generator for dropping
@ -217,10 +222,6 @@ namespace OpenMetaverse
SocketType.Dgram,
ProtocolType.Udp);
// OpenSim may need this but in AVN, this messes up automated
// sim restarts badly
//m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
try
{
if (m_udpSocket.Ttl < 128)
@ -248,13 +249,22 @@ namespace OpenMetaverse
// we never want two regions to listen on the same port as they cannot demultiplex each other's messages,
// leading to a confusing bug.
// By default, Windows does not allow two sockets to bind to the same port.
m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
//
// Unfortunately, this also causes a crashed sim to leave the socket in a state
// where it appears to be in use but is really just hung from the old process
// crashing rather than closing it. While this protects agains misconfiguration,
// allowing crashed sims to be started up again right away, rather than having to
// wait 2 minutes for the socket to clear is more valuable. Commented 12/13/2016
// m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
if (recvBufferSize != 0)
m_udpSocket.ReceiveBufferSize = recvBufferSize;
m_udpSocket.Bind(ipep);
if (m_udpPort == 0)
m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port;
IsRunningInbound = true;
// kick off an async receive. The Start() method will return, the

View File

@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
name = account.FirstName + " " + account.LastName;
created = account.Created;
}
Byte[] charterMember = Utils.StringToBytes(name);
Byte[] membershipType = Utils.StringToBytes(name);
profileUrl = "No profile data";
aboutText = string.Empty;
@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
remoteClient.SendAvatarProperties(avatarID, aboutText,
Util.ToDateTime(created).ToString(
"M/d/yyyy", CultureInfo.InvariantCulture),
charterMember, firstLifeAboutText,
membershipType, firstLifeAboutText,
(uint)(0 & 0xff),
firstLifeImage, image, profileUrl, partner);

View File

@ -1009,9 +1009,9 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if (p != null && p.isNPC)
{
remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, "5/25/1977",
remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born,
Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16,
UUID.Zero, UUID.Zero, "", UUID.Zero);
UUID.Zero, ((INPC)(p.ControllingClient)).profileImage, "", UUID.Zero);
remoteClient.SendAvatarInterestsReply(avatarID, 0, "",
0, "Getting into trouble", "Droidspeak");
return;
@ -1032,7 +1032,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
userInfo = new Dictionary<string, object>();
}
Byte[] charterMember = new Byte[1];
Byte[] membershipType = new Byte[1];
string born = String.Empty;
uint flags = 0x00;
@ -1040,11 +1040,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
if (account.UserTitle == "")
{
charterMember[0] = (Byte)((account.UserFlags & 0xf00) >> 8);
membershipType[0] = (Byte)((account.UserFlags & 0xf00) >> 8);
}
else
{
charterMember = Utils.StringToBytes(account.UserTitle);
membershipType = Utils.StringToBytes(account.UserTitle);
}
born = Util.ToDateTime(account.Created).ToString(
@ -1057,11 +1057,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
if ((string)userInfo["user_title"] == "")
{
charterMember[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8);
membershipType[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8);
}
else
{
charterMember = Utils.StringToBytes((string)userInfo["user_title"]);
membershipType = Utils.StringToBytes((string)userInfo["user_title"]);
}
int val_born = (int)userInfo["user_created"];
@ -1085,7 +1085,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return;
}
remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, charterMember , props.FirstLifeText, flags,
remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags,
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);

View File

@ -456,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
// Check Default Location (Also See ScenePresence.CompleteMovement)
if (position.X == 128f && position.Y == 128f)
if (position.X == 128f && position.Y == 128f && position.Z == 22.5f)
position = sp.Scene.RegionInfo.DefaultLandingPoint;
// TODO: Get proper AVG Height

View File

@ -72,8 +72,6 @@ namespace OpenSim.Region.CoreModules.World.Land
public const int LandUnit = 4;
private static readonly string remoteParcelRequestPath = "0009/";
private LandChannel landChannel;
private Scene m_scene;
@ -1682,12 +1680,13 @@ namespace OpenSim.Region.CoreModules.World.Land
private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
{
//string capsBase = "/CAPS/" + UUID.Random();
string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler(
"RemoteParcelRequest",
new RestStreamHandler(
"POST",
capsBase + remoteParcelRequestPath,
capsBase,
(request, path, param, httpRequest, httpResponse)
=> RemoteParcelRequest(request, path, param, agentID, caps),
"RemoteParcelRequest",
@ -1807,24 +1806,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ArrayList list = (ArrayList)hash["location"];
uint x = (uint)(double)list[0];
uint y = (uint)(double)list[1];
if(hash.ContainsKey("region_id"))
{
UUID regionID = (UUID)hash["region_id"];
if (regionID == m_scene.RegionInfo.RegionID)
{
// a parcel request for a local parcel => no need to query the grid
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y);
}
else
{
// a parcel request for a parcel in another region. Ask the grid about the region
GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID);
if (info != null)
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
}
}
else if (hash.ContainsKey("region_handle"))
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
@ -1847,6 +1829,24 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
}
else if(hash.ContainsKey("region_id"))
{
UUID regionID = (UUID)hash["region_id"];
if (regionID == m_scene.RegionInfo.RegionID)
{
// a parcel request for a local parcel => no need to query the grid
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y);
}
else
{
// a parcel request for a parcel in another region. Ask the grid about the region
GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID);
if (info != null)
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
}
}
}
}
catch (LLSD.LLSDParseException e)

View File

@ -216,7 +216,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
// while we don't fix the hard-coded urls
if (flags == 2)
{
if (regionInfos.Count == 0)
if (regionInfos == null || regionInfos.Count == 0)
remoteClient.SendAgentAlertMessage("No regions found with that name.", true);
// else if (regionInfos.Count == 1)
// remoteClient.SendAgentAlertMessage("Region found!", false);

View File

@ -59,6 +59,8 @@ namespace OpenSim.Region.Framework.Interfaces
UUID ActiveGroupId { get; set; }
UUID Owner { get; }
string profileAbout { get; set; }
UUID profileImage { get; set; }
string Born { get; set; }
}
public interface INPCModule

View File

@ -2044,7 +2044,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// Check Default Location (Also See EntityTransferModule.TeleportAgentWithinRegion)
if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f)
if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f && AbsolutePosition.Z == 22.5f)
AbsolutePosition = Scene.RegionInfo.DefaultLandingPoint;
if (!MakeRootAgent(AbsolutePosition, flying, ref look))
@ -2125,11 +2125,12 @@ namespace OpenSim.Region.Framework.Scenes
if (!gotCrossUpdate && !isNPC)
Scene.SendLayerData(ControllingClient);
// HG delay
if((m_teleportFlags & TeleportFlags.ViaHGLogin) != 0)
// HG
bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0;
if(isHGTP)
{
Thread.Sleep(500);
m_log.DebugFormat("[CompleteMovement] HG delay: {0}ms", Util.EnvironmentTickCountSubtract(ts));
// ControllingClient.SendNameReply(m_uuid, Firstname, Lastname);
m_log.DebugFormat("[CompleteMovement] HG");
}
m_previusParcelHide = false;
@ -2151,7 +2152,7 @@ namespace OpenSim.Region.Framework.Scenes
cachedbaked = true;
else
{
if (m_scene.AvatarFactory != null)
if (m_scene.AvatarFactory != null && !isHGTP)
cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
// not sure we need this

View File

@ -1247,7 +1247,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
}
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID)
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID)
{
}

View File

@ -268,8 +268,12 @@ namespace OpenSim.Region.DataSnapshot.Providers
{
XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", "");
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, userOwnerUUID);
username.InnerText = account.FirstName + " " + account.LastName;
if(account != null)
username.InnerText = account.FirstName + " " + account.LastName;
else
username.InnerText = "UnKnown";
userblock.AppendChild(username);
}
catch (Exception)
{

View File

@ -70,6 +70,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
private readonly UUID m_ownerID;
private UUID m_hostGroupID;
private string m_profileAbout = "";
private UUID m_profileImage = UUID.Zero;
private string m_born;
public List<uint> SelectedObjects {get; private set;}
public NPCAvatar(
@ -109,6 +111,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
m_profileAbout = value;
}
}
public UUID profileImage
{
get { return m_profileImage; }
set { m_profileImage = value; }
}
public IScene Scene
{
get { return m_scene; }
@ -611,6 +620,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
set { }
}
public string Born
{
get { return m_born; }
set { m_born = value; }
}
public bool IsGroupMember(UUID groupID)
{
return (m_hostGroupID == groupID);
@ -974,7 +989,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{
}
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType,
string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
UUID partnerID)
{

View File

@ -168,6 +168,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
AvatarAppearance appearance)
{
NPCAvatar npcAvatar = null;
string born = DateTime.UtcNow.ToString();
try
{
@ -222,6 +223,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
ScenePresence sp;
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
{
npcAvatar.Born = born;
npcAvatar.ActiveGroupId = groupID;
sp.CompleteMovement(npcAvatar, false);
sp.Grouptitle = groupTitle;

View File

@ -239,7 +239,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if (m_scene.haveActor(repData.actor))
{
if (needsMeshing(repData.pbs)) // no need for pbs now?
if (needsMeshing(repData)) // no need for pbs now?
{
repData.comand = meshWorkerCmnds.changefull;
createqueue.Enqueue(repData);
@ -284,8 +284,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
/// </summary>
/// <param name="pbs"></param>
/// <returns></returns>
public bool needsMeshing(PrimitiveBaseShape pbs)
public bool needsMeshing(ODEPhysRepData repData)
{
PrimitiveBaseShape pbs = repData.pbs;
// check sculpts or meshs
if (pbs.SculptEntry)
{
@ -301,6 +302,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (forceSimplePrimMeshing)
return true;
// convex shapes have no holes
ushort profilehollow = pbs.ProfileHollow;
if(repData.shapetype == 2)
profilehollow = 0;
// if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
@ -309,7 +315,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
&& pbs.ProfileHollow == 0
&& profilehollow == 0
&& pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
&& pbs.PathBegin == 0 && pbs.PathEnd == 0
&& pbs.PathTaperX == 0 && pbs.PathTaperY == 0
@ -326,7 +332,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
int iPropertiesNotSupportedDefault = 0;
if (pbs.ProfileHollow != 0)
if (profilehollow != 0)
iPropertiesNotSupportedDefault++;
if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
@ -407,7 +413,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
PhysicsActor actor = repData.actor;
PrimitiveBaseShape pbs = repData.pbs;
if (!needsMeshing(pbs))
if (!needsMeshing(repData))
{
repData.meshState = MeshState.noNeed;
repData.hasOBB = false;
@ -417,17 +423,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
IMesh mesh = null;
Vector3 size = repData.size;
byte shapetype = repData.shapetype;
bool convex;
int clod = (int)LevelOfDetail.High;
bool convex;
byte shapetype = repData.shapetype;
if (shapetype == 0)
convex = false;
else
{
convex = true;
if (pbs.SculptType != (byte)SculptType.Mesh)
// sculpts pseudo convex
if (pbs.SculptEntry && pbs.SculptType != (byte)SculptType.Mesh)
clod = (int)LevelOfDetail.Low;
}
@ -483,7 +489,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
repData.mesh = null;
repData.hasOBB = false;
if (!needsMeshing(pbs))
if (!needsMeshing(repData))
{
repData.meshState = MeshState.noNeed;
return;

View File

@ -349,7 +349,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
}
else
{
if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, lod, out coords, out faces))
if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, lod, convex, out coords, out faces))
return null;
}
@ -942,7 +942,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
/// <param name="faces">Faces are added to this list by the method.</param>
/// <returns>true if coords and faces were successfully generated, false if not</returns>
private bool GenerateCoordsAndFacesFromPrimShapeData(
string primName, PrimitiveBaseShape primShape, float lod, out List<Coord> coords, out List<Face> faces)
string primName, PrimitiveBaseShape primShape, float lod, bool convex,
out List<Coord> coords, out List<Face> faces)
{
PrimMesh primMesh;
coords = new List<Coord>();
@ -970,7 +971,9 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
profileBegin = profileEnd - 0.02f;
float profileHollow = (float)primShape.ProfileHollow * 2.0e-5f;
if (profileHollow > 0.95f)
if(convex)
profileHollow = 0.0f;
else if (profileHollow > 0.95f)
profileHollow = 0.95f;
int sides = 4;

View File

@ -6307,6 +6307,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
return World.RegionInfo.ObjectCapacity.ToString();
}
else if (name == "region_object_bonus")
{
return World.RegionInfo.RegionSettings.ObjectBonus.ToString();
}
else
{
return "";

View File

@ -3001,7 +3001,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osNpcSetProfileAbout(LSL_Key npc, string about)
{
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osNpcSetProfileImage(LSL_Key npc, string image)
{
CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
UUID ImageID = new UUID();
ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture);
if (ImageID == null || ImageID == UUID.Zero)
{
if (!UUID.TryParse(image, out ImageID))
return;
}
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
((INPC)(sp.ControllingClient)).profileImage = ImageID;
}
}
public void osNpcSay(LSL_Key npc, string message)
{
osNpcSay(npc, 0, message);

View File

@ -344,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osNpcSetRot(LSL_Key npc, rotation rot);
void osNpcStopMoveToTarget(LSL_Key npc);
void osNpcSetProfileAbout(LSL_Key npc, string about);
void osNpcSetProfileImage(LSL_Key npc, string image);
void osNpcSay(key npc, string message);
void osNpcSay(key npc, int channel, string message);
void osNpcShout(key npc, int channel, string message);

View File

@ -642,6 +642,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcSetProfileAbout(npc, about);
}
public void osNpcSetProfileImage(LSL_Key npc, string image)
{
m_OSSL_Functions.osNpcSetProfileImage(npc, image);
}
public void osNpcSay(key npc, string message)
{
m_OSSL_Functions.osNpcSay(npc, message);

View File

@ -125,6 +125,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
hash["hostname"] = regInfo.ExternalHostName;
hash["http_port"] = regInfo.HttpPort.ToString();
hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
hash["server_uri"] = regInfo.ServerURI;
}
if (message != null)

View File

@ -308,11 +308,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
about = new OSDMap(0);
// Check if this user is a grid operator
byte[] charterMember;
byte[] membershipType;
if (user["AccessLevel"].AsInteger() >= 200)
charterMember = Utils.StringToBytes("Operator");
membershipType = Utils.StringToBytes("Operator");
else
charterMember = Utils.EmptyBytes;
membershipType = Utils.EmptyBytes;
// Check if the user is online
if (client.Scene is Scene)
@ -327,7 +327,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
flags |= ProfileFlags.Identified;
client.SendAvatarProperties(avatarID, about["About"].AsString(), user["CreationDate"].AsDate().ToString("M/d/yyyy",
System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
System.Globalization.CultureInfo.InvariantCulture), membershipType, about["FLAbout"].AsString(), (uint)flags,
about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
OSDMap interests = null;

View File

@ -255,11 +255,8 @@ namespace OpenSim.Services.GridService
regionName = parts[2];
}
if(port == 80)
serverURI = "http://"+ host + "/";
else
serverURI = "http://"+ host +":"+ port.ToString() + "/";
}
serverURI = "http://"+ host +":"+ port.ToString() + "/";
}
}
else
{
@ -301,6 +298,10 @@ namespace OpenSim.Services.GridService
if(!string.IsNullOrEmpty(regionName))
regionName = regionName.Trim(new char[] { '"', ' ' });
serverURI = uri.AbsoluteUri;
if(uri.Port == 80)
serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/";
else if(uri.Port == 443)
serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/";
return true;
}

View File

@ -86,10 +86,10 @@ namespace OpenSim.Tests.Common
uint port = 0;
AgentCircuitManager acm = scene.AuthenticateHandler;
TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm);
TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, configSource, acm);
udpServer.AddScene(scene);
return udpServer;
}
}
}
}

View File

@ -990,7 +990,7 @@ namespace OpenSim.Tests.Common
{
}
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember,
public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType,
string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
UUID partnerID)
{

View File

@ -43,8 +43,8 @@ namespace OpenSim.Tests.Common
{
public List<Packet> PacketsSent { get; private set; }
public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
: base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager)
public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager)
: base(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager)
{
PacketsSent = new List<Packet>();
}

BIN
bin/Mono.Posix.dll Executable file

Binary file not shown.

View File

@ -139,6 +139,8 @@
Allow_osMessageObject = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRegexIsMatch = true
Allow_osGetAvatarHomeURI = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osNpcSetProfileAbout = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osNpcSetProfileImage = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel Moderate
Allow_osDropAttachment = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER

View File

@ -1790,6 +1790,7 @@
<Reference name="System.Core"/>
<Reference name="System.Xml"/>
<Reference name="Mono.Addins" path="../../../bin/"/>
<Reference name="Mono.Posix" path="../../../bin/"/>
<Reference name="NDesk.Options" path="../../../bin/"/>
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>