mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge git://github.com/opensim/opensim into mantis5110
This commit is contained in:
@@ -231,7 +231,7 @@ namespace OpenSim.Framework
|
||||
|
||||
protected virtual void SetDefaultParams()
|
||||
{
|
||||
m_visualparams = new byte[] { 56,23,66,0,0,25,0,124,107,0,0,91,137,36,180,79,78,20,32,255,0,63,137,137,63,122,0,71,127,94,63,0,150,150,150,17,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,78,0,0,0,0,0,0,0,0,0,145,216,133,0,0,0,219,107,150,150,165,135,0,150,150,150,63,112,155,150,150,150,150,150,150,150,150,150,150,150,0,0,0,0,188,255,91,219,124,0,150,127,165,127,127,127,127,59,63,107,71,68,89,33,79,114,178,127,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,0,85,131,117,127,147,163,104,0,140,18,0,107,130,0,150,150,198,0,0,40,38,91,165,209,198,127,127,153,204,51,51,150,150,255,204,0,150,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,22,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
|
||||
m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
|
||||
// for (int i = 0; i < VISUALPARAM_COUNT; i++)
|
||||
// {
|
||||
// m_visualparams[i] = 150;
|
||||
|
||||
@@ -221,9 +221,6 @@ namespace OpenSim.Framework
|
||||
{
|
||||
get
|
||||
{
|
||||
if (defaultWearables != null)
|
||||
return defaultWearables;
|
||||
|
||||
defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these
|
||||
for (int i = 0; i < MAX_WEARABLES; i++)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using Nini.Config;
|
||||
@@ -62,6 +63,7 @@ namespace OpenSim.Framework.Console
|
||||
new Dictionary<UUID, ConsoleConnection>();
|
||||
private string m_UserName = String.Empty;
|
||||
private string m_Password = String.Empty;
|
||||
private string m_AllowedOrigin = String.Empty;
|
||||
|
||||
public RemoteConsole(string defaultPrompt) : base(defaultPrompt)
|
||||
{
|
||||
@@ -77,6 +79,7 @@ namespace OpenSim.Framework.Console
|
||||
|
||||
m_UserName = netConfig.GetString("ConsoleUser", String.Empty);
|
||||
m_Password = netConfig.GetString("ConsolePass", String.Empty);
|
||||
m_AllowedOrigin = netConfig.GetString("ConsoleAllowedOrigin", String.Empty);
|
||||
}
|
||||
|
||||
public void SetServer(IHttpServer server)
|
||||
@@ -150,6 +153,29 @@ namespace OpenSim.Framework.Console
|
||||
return cmdinput;
|
||||
}
|
||||
|
||||
private Hashtable CheckOrigin(Hashtable result)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(m_AllowedOrigin))
|
||||
result["access_control_allow_origin"] = m_AllowedOrigin;
|
||||
return result;
|
||||
}
|
||||
/* TODO: Figure out how PollServiceHTTPHandler can access the request headers
|
||||
* in order to use m_AllowedOrigin as a regular expression
|
||||
private Hashtable CheckOrigin(Hashtable headers, Hashtable result)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(m_AllowedOrigin))
|
||||
{
|
||||
if (headers.ContainsKey("origin"))
|
||||
{
|
||||
string origin = headers["origin"].ToString();
|
||||
if (Regex.IsMatch(origin, m_AllowedOrigin))
|
||||
result["access_control_allow_origin"] = origin;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
private void DoExpire()
|
||||
{
|
||||
List<UUID> expired = new List<UUID>();
|
||||
@@ -235,6 +261,7 @@ namespace OpenSim.Framework.Console
|
||||
reply["str_response_string"] = xmldoc.InnerXml;
|
||||
reply["int_response_code"] = 200;
|
||||
reply["content_type"] = "text/xml";
|
||||
reply = CheckOrigin(reply);
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -289,6 +316,7 @@ namespace OpenSim.Framework.Console
|
||||
reply["str_response_string"] = xmldoc.InnerXml;
|
||||
reply["int_response_code"] = 200;
|
||||
reply["content_type"] = "text/xml";
|
||||
reply = CheckOrigin(reply);
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -344,6 +372,7 @@ namespace OpenSim.Framework.Console
|
||||
reply["str_response_string"] = xmldoc.InnerXml;
|
||||
reply["int_response_code"] = 200;
|
||||
reply["content_type"] = "text/xml";
|
||||
reply = CheckOrigin(reply);
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -457,6 +486,7 @@ namespace OpenSim.Framework.Console
|
||||
result["content_type"] = "application/xml";
|
||||
result["keepalive"] = false;
|
||||
result["reusecontext"] = false;
|
||||
result = CheckOrigin(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -480,6 +510,7 @@ namespace OpenSim.Framework.Console
|
||||
result["content_type"] = "text/xml";
|
||||
result["keepalive"] = false;
|
||||
result["reusecontext"] = false;
|
||||
result = CheckOrigin(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
using log4net;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
|
||||
@@ -47,6 +48,11 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
public static IHttpServer GetHttpServer(uint port)
|
||||
{
|
||||
return GetHttpServer(port,null);
|
||||
}
|
||||
|
||||
public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
|
||||
{
|
||||
if (port == 0)
|
||||
return Instance;
|
||||
@@ -58,6 +64,9 @@ namespace OpenSim.Framework
|
||||
|
||||
m_Servers[port] = new BaseHttpServer(port);
|
||||
|
||||
if (ipaddr != null )
|
||||
m_Servers[port].ListenIPAddress = ipaddr;
|
||||
|
||||
m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port);
|
||||
m_Servers[port].Start();
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
public class RegionLightShareData : ICloneable
|
||||
{
|
||||
public bool valid = false;
|
||||
public UUID regionID = UUID.Zero;
|
||||
public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f);
|
||||
public float waterFogDensityExponent = 4.0f;
|
||||
|
||||
@@ -1450,6 +1450,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
if (responsedata.ContainsKey("reusecontext"))
|
||||
response.ReuseContext = (bool) responsedata["reusecontext"];
|
||||
|
||||
// Cross-Origin Resource Sharing with simple requests
|
||||
if (responsedata.ContainsKey("access_control_allow_origin"))
|
||||
response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]);
|
||||
|
||||
//Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this
|
||||
//and should check for NullReferenceExceptions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user