Update svn properties, formatting cleanup.
parent
086284da55
commit
3bf8858727
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
|
@ -38,11 +38,9 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
|
|
||||||
public class Rest
|
public class Rest
|
||||||
{
|
{
|
||||||
|
internal static readonly log4net.ILog Log =
|
||||||
internal static readonly log4net.ILog Log =
|
|
||||||
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
internal static bool DEBUG = Log.IsDebugEnabled;
|
internal static bool DEBUG = Log.IsDebugEnabled;
|
||||||
|
@ -88,7 +86,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
static Rest()
|
static Rest()
|
||||||
{
|
{
|
||||||
HttpStatusDesc = new Dictionary<int,string>();
|
HttpStatusDesc = new Dictionary<int,string>();
|
||||||
if (HttpStatusCodeArray.Length != HttpStatusDescArray.Length)
|
if (HttpStatusCodeArray.Length != HttpStatusDescArray.Length)
|
||||||
{
|
{
|
||||||
Log.ErrorFormat("{0} HTTP Status Code and Description arrays do not match");
|
Log.ErrorFormat("{0} HTTP Status Code and Description arrays do not match");
|
||||||
|
@ -455,7 +453,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nonce management
|
// Nonce management
|
||||||
|
@ -465,17 +462,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
return StringToBase64(CreationDate + Guid.NewGuid().ToString());
|
return StringToBase64(CreationDate + Guid.NewGuid().ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump he specified data stream;
|
// Dump the specified data stream
|
||||||
|
|
||||||
public static void Dump(byte[] data)
|
public static void Dump(byte[] data)
|
||||||
{
|
{
|
||||||
|
|
||||||
char[] buffer = new char[Rest.DumpLineSize];
|
char[] buffer = new char[Rest.DumpLineSize];
|
||||||
int cc = 0;
|
int cc = 0;
|
||||||
|
|
||||||
for (int i = 0; i < data.Length; i++)
|
for (int i = 0; i < data.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (i % Rest.DumpLineSize == 0) Console.Write("\n{0}: ",i.ToString("d8"));
|
if (i % Rest.DumpLineSize == 0) Console.Write("\n{0}: ",i.ToString("d8"));
|
||||||
|
|
||||||
if (i % 4 == 0) Console.Write(" ");
|
if (i % 4 == 0) Console.Write(" ");
|
||||||
|
@ -494,7 +489,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Console.Write(" |"+(new String(buffer))+"|");
|
Console.Write(" |"+(new String(buffer))+"|");
|
||||||
cc = 0;
|
cc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish off any incomplete line
|
// Finish off any incomplete line
|
||||||
|
@ -513,16 +507,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Console.Write("\n");
|
Console.Write("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Local exception type
|
// Local exception type
|
||||||
|
|
||||||
public class RestException : Exception
|
public class RestException : Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
internal int statusCode;
|
internal int statusCode;
|
||||||
internal string statusDesc;
|
internal string statusDesc;
|
||||||
internal string httpmethod;
|
internal string httpmethod;
|
||||||
|
@ -532,5 +523,4 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
@ -40,10 +39,8 @@ using OpenSim.Framework.Communications.Cache;
|
||||||
|
|
||||||
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
|
|
||||||
public class RestAssetServices : IRest
|
public class RestAssetServices : IRest
|
||||||
{
|
{
|
||||||
|
|
||||||
private bool enabled = false;
|
private bool enabled = false;
|
||||||
private string qPrefix = "assets";
|
private string qPrefix = "assets";
|
||||||
|
|
||||||
|
@ -52,7 +49,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public RestAssetServices()
|
public RestAssetServices()
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.InfoFormat("{0} Asset services initializing", MsgId);
|
Rest.Log.InfoFormat("{0} Asset services initializing", MsgId);
|
||||||
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
|
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
|
||||||
|
|
||||||
|
@ -73,7 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
|
||||||
Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId);
|
Rest.Log.InfoFormat("{0} Asset services initialization complete", MsgId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post-construction, pre-enabled initialization opportunity
|
// Post-construction, pre-enabled initialization opportunity
|
||||||
|
@ -111,7 +106,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoAsset(RequestData rparm)
|
private void DoAsset(RequestData rparm)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
|
|
||||||
AssetRequestData rdata = (AssetRequestData) rparm;
|
AssetRequestData rdata = (AssetRequestData) rparm;
|
||||||
|
@ -186,14 +180,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} REST Asset handler EXIT", MsgId);
|
Rest.Log.DebugFormat("{0} REST Asset handler EXIT", MsgId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Interface
|
#endregion Interface
|
||||||
|
|
||||||
private void DoGet(AssetRequestData rdata)
|
private void DoGet(AssetRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool istexture = false;
|
bool istexture = false;
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
|
Rest.Log.DebugFormat("{0} REST Asset handler, Method = <{1}> ENTRY", MsgId, rdata.method);
|
||||||
|
@ -203,13 +195,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (rdata.Parameters.Length == 1)
|
if (rdata.Parameters.Length == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
LLUUID uuid = new LLUUID(rdata.Parameters[0]);
|
LLUUID uuid = new LLUUID(rdata.Parameters[0]);
|
||||||
AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture);
|
AssetBase asset = Rest.AssetServices.GetAsset(uuid, istexture);
|
||||||
|
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.Parameters[0]);
|
Rest.Log.DebugFormat("{0} Asset located <{1}>", MsgId, rdata.Parameters[0]);
|
||||||
|
|
||||||
rdata.initXmlWriter();
|
rdata.initXmlWriter();
|
||||||
|
@ -237,7 +227,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
rdata.Complete();
|
rdata.Complete();
|
||||||
rdata.Respond("Asset " + rdata.method + ": Normal completion");
|
rdata.Respond("Asset " + rdata.method + ": Normal completion");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoPut(AssetRequestData rdata)
|
private void DoPut(AssetRequestData rdata)
|
||||||
|
@ -277,7 +266,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
rdata.Complete();
|
rdata.Complete();
|
||||||
rdata.Respond("Asset " + rdata.method + ": Normal completion");
|
rdata.Respond("Asset " + rdata.method + ": Normal completion");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class AssetRequestData : RequestData
|
internal class AssetRequestData : RequestData
|
||||||
|
@ -287,6 +275,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -35,7 +34,6 @@ using OpenSim.ApplicationPlugins.Rest;
|
||||||
|
|
||||||
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// The class signature reveals the roles that RestHandler plays.
|
/// The class signature reveals the roles that RestHandler plays.
|
||||||
///
|
///
|
||||||
|
@ -86,7 +84,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
static RestHandler()
|
static RestHandler()
|
||||||
{
|
{
|
||||||
|
|
||||||
Module[] mods = Assembly.GetExecutingAssembly().GetModules();
|
Module[] mods = Assembly.GetExecutingAssembly().GetModules();
|
||||||
|
|
||||||
foreach (Module m in mods)
|
foreach (Module m in mods)
|
||||||
|
@ -108,7 +105,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion local static state
|
#endregion local static state
|
||||||
|
@ -136,7 +132,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
if (!handlersLoaded)
|
if (!handlersLoaded)
|
||||||
{
|
{
|
||||||
|
|
||||||
ConstructorInfo ci;
|
ConstructorInfo ci;
|
||||||
Object ht;
|
Object ht;
|
||||||
|
|
||||||
|
@ -211,7 +206,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
// This plugin will only be enabled if the broader
|
// This plugin will only be enabled if the broader
|
||||||
// REST plugin mechanism is enabled.
|
// REST plugin mechanism is enabled.
|
||||||
|
|
||||||
|
@ -329,7 +323,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message);
|
Rest.Log.ErrorFormat("{0} Plugin initialization has failed: {1}", MsgId, e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -344,7 +337,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public override void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
|
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -357,7 +349,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
handler.Close();
|
handler.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion overriding methods
|
#endregion overriding methods
|
||||||
|
@ -406,7 +397,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
foreach (string key in streamHandlers.Keys)
|
foreach (string key in streamHandlers.Keys)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Match testing {1} against stream prefix <{2}>", MsgId, path, key);
|
Rest.Log.DebugFormat("{0} Match testing {1} against stream prefix <{2}>", MsgId, path, key);
|
||||||
|
|
||||||
// Note that Match will not necessarily find the handler that will
|
// Note that Match will not necessarily find the handler that will
|
||||||
|
@ -426,7 +416,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -486,7 +475,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Rest.Log.DebugFormat("{0} EXIT", MsgId);
|
Rest.Log.DebugFormat("{0} EXIT", MsgId);
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion interface methods
|
#endregion interface methods
|
||||||
|
@ -534,7 +522,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
return rdata.handled;
|
return rdata.handled;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -547,7 +534,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public void AddStreamHandler(string httpMethod, string path, RestMethod method)
|
public void AddStreamHandler(string httpMethod, string path, RestMethod method)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!IsEnabled)
|
if (!IsEnabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -571,7 +557,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path);
|
Rest.Log.WarnFormat("{0} Ignoring duplicate handler for {1}", MsgId, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -586,7 +571,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response)
|
internal bool FindPathHandler(OSHttpRequest request, OSHttpResponse response)
|
||||||
{
|
{
|
||||||
|
|
||||||
RequestData rdata = null;
|
RequestData rdata = null;
|
||||||
string bestMatch = null;
|
string bestMatch = null;
|
||||||
|
|
||||||
|
@ -612,7 +596,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(bestMatch))
|
if (!String.IsNullOrEmpty(bestMatch))
|
||||||
{
|
{
|
||||||
|
|
||||||
rdata = pathAllocators[bestMatch](request, response, bestMatch);
|
rdata = pathAllocators[bestMatch](request, response, bestMatch);
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch);
|
Rest.Log.DebugFormat("{0} Path based REST handler matched with <{1}>", MsgId, bestMatch);
|
||||||
|
@ -629,11 +612,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message);
|
Rest.Log.WarnFormat("{0} Request failed: {1}", MsgId, r.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (rdata == null) ? false : rdata.handled;
|
return (rdata == null) ? false : rdata.handled;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -643,7 +624,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra)
|
public void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ra)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!IsEnabled)
|
if (!IsEnabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -665,8 +645,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
pathHandlers.Add(path, mh);
|
pathHandlers.Add(path, mh);
|
||||||
pathAllocators.Add(path, ra);
|
pathAllocators.Add(path, ra);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -42,10 +41,8 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
|
|
||||||
public class RestInventoryServices : IRest
|
public class RestInventoryServices : IRest
|
||||||
{
|
{
|
||||||
|
|
||||||
private static readonly int PARM_USERID = 0;
|
private static readonly int PARM_USERID = 0;
|
||||||
private static readonly int PARM_PATH = 1;
|
private static readonly int PARM_PATH = 1;
|
||||||
|
|
||||||
|
@ -61,7 +58,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public RestInventoryServices()
|
public RestInventoryServices()
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId);
|
Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId);
|
||||||
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
|
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
|
||||||
|
|
||||||
|
@ -82,7 +78,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
|
||||||
Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId);
|
Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -143,7 +138,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoInventory(RequestData hdata)
|
private void DoInventory(RequestData hdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryRequestData rdata = (InventoryRequestData) hdata;
|
InventoryRequestData rdata = (InventoryRequestData) hdata;
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId);
|
Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId);
|
||||||
|
@ -272,7 +266,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (Rest.InventoryServices.HasInventoryForUser(rdata.uuid))
|
if (Rest.InventoryServices.HasInventoryForUser(rdata.uuid))
|
||||||
{
|
{
|
||||||
|
|
||||||
rdata.root = Rest.InventoryServices.RequestRootFolder(rdata.uuid);
|
rdata.root = Rest.InventoryServices.RequestRootFolder(rdata.uuid);
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}",
|
Rest.Log.DebugFormat("{0} Inventory Root retrieved for {1} {2}",
|
||||||
|
@ -311,7 +304,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
switch (rdata.method)
|
switch (rdata.method)
|
||||||
{
|
{
|
||||||
|
|
||||||
case Rest.HEAD : // Do the processing, set the status code, suppress entity
|
case Rest.HEAD : // Do the processing, set the status code, suppress entity
|
||||||
DoGet(rdata);
|
DoGet(rdata);
|
||||||
rdata.buffer = null;
|
rdata.buffer = null;
|
||||||
|
@ -339,7 +331,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, rdata.method+" not supported");
|
rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, rdata.method+" not supported");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Interface
|
#endregion Interface
|
||||||
|
@ -355,7 +346,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoGet(InventoryRequestData rdata)
|
private void DoGet(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
rdata.initXmlWriter();
|
rdata.initXmlWriter();
|
||||||
|
|
||||||
rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty);
|
rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty);
|
||||||
|
@ -379,7 +369,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
// constructed from the result of the XML writer.
|
// constructed from the result of the XML writer.
|
||||||
|
|
||||||
rdata.Respond(String.Format("Inventory {0} Normal completion", rdata.method));
|
rdata.Respond(String.Format("Inventory {0} Normal completion", rdata.method));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -423,7 +412,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoExtend(InventoryRequestData rdata)
|
private void DoExtend(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool created = false;
|
bool created = false;
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
string newnode = String.Empty;
|
string newnode = String.Empty;
|
||||||
|
@ -447,7 +435,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
||||||
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
||||||
{
|
{
|
||||||
|
|
||||||
// Cast the context node appropriately.
|
// Cast the context node appropriately.
|
||||||
|
|
||||||
InventoryFolderBase context = (InventoryFolderBase) InventoryNode;
|
InventoryFolderBase context = (InventoryFolderBase) InventoryNode;
|
||||||
|
@ -471,7 +458,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (entity.Assets.Count > 0)
|
if (entity.Assets.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Adding {1} assets to server",
|
Rest.Log.DebugFormat("{0} Adding {1} assets to server",
|
||||||
MsgId, entity.Assets.Count);
|
MsgId, entity.Assets.Count);
|
||||||
|
|
||||||
|
@ -489,9 +475,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Dump(asset.Data);
|
Rest.Dump(asset.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify the context using the collection of folders and items
|
// Modify the context using the collection of folders and items
|
||||||
|
@ -499,7 +483,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
foreach (InventoryFolderBase folder in entity.Folders)
|
foreach (InventoryFolderBase folder in entity.Folders)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryFolderBase found;
|
InventoryFolderBase found;
|
||||||
|
|
||||||
// If the parentID is zero, then this folder is going
|
// If the parentID is zero, then this folder is going
|
||||||
|
@ -544,7 +527,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
modified = true;
|
modified = true;
|
||||||
rdata.appendStatus(String.Format("<p> Created folder {0}, UUID {1}<p>",
|
rdata.appendStatus(String.Format("<p> Created folder {0}, UUID {1}<p>",
|
||||||
folder.Name, folder.ID));
|
folder.Name, folder.ID));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -553,10 +536,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
created = true;
|
created = true;
|
||||||
rdata.appendStatus(String.Format("<p> Modified folder {0}, UUID {1}<p>",
|
rdata.appendStatus(String.Format("<p> Modified folder {0}, UUID {1}<p>",
|
||||||
folder.Name, folder.ID));
|
folder.Name, folder.ID));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we repeat a similar process for the items included
|
// Now we repeat a similar process for the items included
|
||||||
|
@ -564,7 +545,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
foreach (InventoryItemBase item in entity.Items)
|
foreach (InventoryItemBase item in entity.Items)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryItemBase found = null;
|
InventoryItemBase found = null;
|
||||||
|
|
||||||
// If the parentID is zero, then this is going
|
// If the parentID is zero, then this is going
|
||||||
|
@ -604,7 +584,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
created = true;
|
created = true;
|
||||||
rdata.appendStatus(String.Format("<p> Created item {2}, UUID {3}<p>", item.Name, item.ID));
|
rdata.appendStatus(String.Format("<p> Created item {2}, UUID {3}<p>", item.Name, item.ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (created)
|
if (created)
|
||||||
|
@ -627,7 +606,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -635,7 +613,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
MsgId, rdata.method, rdata.path, InventoryNode.GetType());
|
MsgId, rdata.method, rdata.path, InventoryNode.GetType());
|
||||||
rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid resource context");
|
rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid resource context");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -663,7 +640,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoUpdate(InventoryRequestData rdata)
|
private void DoUpdate(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
bool created = false;
|
bool created = false;
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
|
@ -705,7 +681,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Dump(asset.Data);
|
Rest.Dump(asset.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +702,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
||||||
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
||||||
{
|
{
|
||||||
|
|
||||||
bool rfound = false;
|
bool rfound = false;
|
||||||
InventoryFolderBase uri = (InventoryFolderBase) InventoryNode;
|
InventoryFolderBase uri = (InventoryFolderBase) InventoryNode;
|
||||||
InventoryFolderBase xml = null;
|
InventoryFolderBase xml = null;
|
||||||
|
@ -741,7 +715,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (uri == rdata.root)
|
if (uri == rdata.root)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (InventoryFolderBase folder in entity.Folders)
|
foreach (InventoryFolderBase folder in entity.Folders)
|
||||||
{
|
{
|
||||||
if ((rfound = (folder.Name == PRIVATE_ROOT_NAME)))
|
if ((rfound = (folder.Name == PRIVATE_ROOT_NAME)))
|
||||||
|
@ -757,7 +730,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
MsgId, rdata.method, rdata.path);
|
MsgId, rdata.method, rdata.path);
|
||||||
rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid inventory structure");
|
rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid inventory structure");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan the set of folders in the entity collection for an
|
// Scan the set of folders in the entity collection for an
|
||||||
|
@ -801,7 +773,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryFolderBase TrashCan = GetTrashCan(rdata);
|
InventoryFolderBase TrashCan = GetTrashCan(rdata);
|
||||||
|
|
||||||
// All went well, so we generate a UUID is one is
|
// All went well, so we generate a UUID is one is
|
||||||
|
@ -816,7 +787,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Rest.InventoryServices.MoveFolder(uri);
|
Rest.InventoryServices.MoveFolder(uri);
|
||||||
Rest.InventoryServices.PurgeFolder(TrashCan);
|
Rest.InventoryServices.PurgeFolder(TrashCan);
|
||||||
modified = true;
|
modified = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now, regardelss of what they represent, we
|
// Now, regardelss of what they represent, we
|
||||||
|
@ -833,7 +803,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
rdata.appendStatus(String.Format("<p>Storing item {0} UUID {1}<p>", it.Name, it.ID));
|
rdata.appendStatus(String.Format("<p>Storing item {0} UUID {1}<p>", it.Name, it.ID));
|
||||||
Rest.InventoryServices.AddItem(it);
|
Rest.InventoryServices.AddItem(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -846,7 +815,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryItemBase uri = (InventoryItemBase) InventoryNode;
|
InventoryItemBase uri = (InventoryItemBase) InventoryNode;
|
||||||
InventoryItemBase xml = null;
|
InventoryItemBase xml = null;
|
||||||
|
|
||||||
|
@ -884,7 +852,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Rest.InventoryServices.AddItem(xml);
|
Rest.InventoryServices.AddItem(xml);
|
||||||
|
|
||||||
rdata.appendStatus(String.Format("<p>Storing item {0} UUID {1}<p>", xml.Name, xml.ID));
|
rdata.appendStatus(String.Format("<p>Storing item {0} UUID {1}<p>", xml.Name, xml.ID));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (created)
|
if (created)
|
||||||
|
@ -904,7 +871,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -930,13 +896,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void DoDelete(InventoryRequestData rdata)
|
private void DoDelete(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, false);
|
Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, false);
|
||||||
|
|
||||||
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
|
||||||
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
typeof(InventoryFolderImpl) == InventoryNode.GetType())
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryFolderBase TrashCan = GetTrashCan(rdata);
|
InventoryFolderBase TrashCan = GetTrashCan(rdata);
|
||||||
|
|
||||||
InventoryFolderBase folder = (InventoryFolderBase) InventoryNode;
|
InventoryFolderBase folder = (InventoryFolderBase) InventoryNode;
|
||||||
|
@ -947,7 +911,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Rest.InventoryServices.PurgeFolder(TrashCan);
|
Rest.InventoryServices.PurgeFolder(TrashCan);
|
||||||
|
|
||||||
rdata.appendStatus(String.Format("<p>Deleted folder {0} UUID {1}<p>", folder.Name, folder.ID));
|
rdata.appendStatus(String.Format("<p>Deleted folder {0} UUID {1}<p>", folder.Name, folder.ID));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deleting items is much more straight forward.
|
// Deleting items is much more straight forward.
|
||||||
|
@ -963,7 +926,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
rdata.Complete();
|
rdata.Complete();
|
||||||
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
rdata.Respond("Inventory " + rdata.method + ": Normal completion");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion method-specific processing
|
#endregion method-specific processing
|
||||||
|
@ -1000,7 +962,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
InventoryFolderBase folder,
|
InventoryFolderBase folder,
|
||||||
int pi, bool fill)
|
int pi, bool fill)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryFolderBase foundf = null;
|
InventoryFolderBase foundf = null;
|
||||||
int fk = 0;
|
int fk = 0;
|
||||||
|
|
||||||
|
@ -1021,6 +982,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
// option.
|
// option.
|
||||||
|
|
||||||
if (rdata.folders != null)
|
if (rdata.folders != null)
|
||||||
|
{
|
||||||
foreach (InventoryFolderBase f in rdata.folders)
|
foreach (InventoryFolderBase f in rdata.folders)
|
||||||
{
|
{
|
||||||
// Look for the present node in the directory list
|
// Look for the present node in the directory list
|
||||||
|
@ -1032,6 +994,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
fk++;
|
fk++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If more than one node matched, then the path, as specified
|
// If more than one node matched, then the path, as specified
|
||||||
// is ambiguous.
|
// is ambiguous.
|
||||||
|
@ -1099,7 +1062,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
rdata.Fail(Rest.HttpStatusCodeNotFound, "resource "+rdata.path+" not found");
|
rdata.Fail(Rest.HttpStatusCodeNotFound, "resource "+rdata.path+" not found");
|
||||||
|
|
||||||
return null; /* Never reached */
|
return null; /* Never reached */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1119,12 +1081,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void traverse(InventoryRequestData rdata, InventoryFolderBase folder, int pi)
|
private void traverse(InventoryRequestData rdata, InventoryFolderBase folder, int pi)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Traverse[initial] : {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi);
|
Rest.Log.DebugFormat("{0} Traverse[initial] : {1} {2} [{3}]", MsgId, folder.ID, folder.Name, pi);
|
||||||
|
|
||||||
if (rdata.folders != null)
|
if (rdata.folders != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// If there was only one parameter (avatar name), then the entire
|
// If there was only one parameter (avatar name), then the entire
|
||||||
// inventory is being requested.
|
// inventory is being requested.
|
||||||
|
|
||||||
|
@ -1159,7 +1119,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1170,7 +1129,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void traverseInventory(InventoryRequestData rdata, InventoryFolderBase folder, int pi)
|
private void traverseInventory(InventoryRequestData rdata, InventoryFolderBase folder, int pi)
|
||||||
{
|
{
|
||||||
|
|
||||||
int fk = 0;
|
int fk = 0;
|
||||||
InventoryFolderBase ffound = null;
|
InventoryFolderBase ffound = null;
|
||||||
InventoryItemBase ifound = null;
|
InventoryItemBase ifound = null;
|
||||||
|
@ -1194,7 +1152,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (pi == rdata.Parameters.Length-1)
|
if (pi == rdata.Parameters.Length-1)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Only if there are any items, and there pretty much always are.
|
// Only if there are any items, and there pretty much always are.
|
||||||
|
|
||||||
if (rdata.items != null)
|
if (rdata.items != null)
|
||||||
|
@ -1240,14 +1197,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
else if (fk > 1)
|
else if (fk > 1)
|
||||||
{
|
{
|
||||||
rdata.Fail(Rest.HttpStatusCodeConflict,
|
rdata.Fail(Rest.HttpStatusCodeConflict,
|
||||||
String.Format("ambiguous element ({0}) in path specified: <{1}>",
|
String.Format("ambiguous element ({0}) in path specified: <{1}>",
|
||||||
pi, rdata.path));
|
pi, rdata.path));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>",
|
Rest.Log.DebugFormat("{0} Inventory does not contain item/folder: <{1}>",
|
||||||
MsgId, rdata.path);
|
MsgId, rdata.path);
|
||||||
rdata.Fail(Rest.HttpStatusCodeNotFound,String.Format("no such item/folder : {0}",
|
rdata.Fail(Rest.HttpStatusCodeNotFound,String.Format("no such item/folder : {0}",
|
||||||
rdata.Parameters[pi]));
|
rdata.Parameters[pi]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1264,7 +1221,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void formatInventory(InventoryRequestData rdata, InventoryFolderBase folder, string indent)
|
private void formatInventory(InventoryRequestData rdata, InventoryFolderBase folder, string indent)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Rest.DEBUG)
|
if (Rest.DEBUG)
|
||||||
{
|
{
|
||||||
Rest.Log.DebugFormat("{0} Folder : {1} {2} {3} type = {4}",
|
Rest.Log.DebugFormat("{0} Folder : {1} {2} {3} type = {4}",
|
||||||
|
@ -1307,7 +1263,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
// End folder item
|
// End folder item
|
||||||
|
|
||||||
rdata.writer.WriteEndElement();
|
rdata.writer.WriteEndElement();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1319,7 +1274,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent)
|
private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Item : {1} {2} {3} Type = {4}, AssetType = {5}",
|
Rest.Log.DebugFormat("{0} Item : {1} {2} {3} Type = {4}, AssetType = {5}",
|
||||||
MsgId, i.ID, indent, i.Name, i.InvType, i.AssetType);
|
MsgId, i.ID, indent, i.Name, i.InvType, i.AssetType);
|
||||||
|
|
||||||
|
@ -1350,7 +1304,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
rdata.writer.WriteElementString("Asset",i.AssetID.ToString());
|
rdata.writer.WriteElementString("Asset",i.AssetID.ToString());
|
||||||
|
|
||||||
rdata.writer.WriteEndElement();
|
rdata.writer.WriteEndElement();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1366,7 +1319,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private InventoryFolderBase GetTrashCan(InventoryRequestData rdata)
|
private InventoryFolderBase GetTrashCan(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryFolderBase TrashCan = null;
|
InventoryFolderBase TrashCan = null;
|
||||||
|
|
||||||
foreach (InventoryFolderBase f in rdata.folders)
|
foreach (InventoryFolderBase f in rdata.folders)
|
||||||
|
@ -1401,7 +1353,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
return TrashCan;
|
return TrashCan;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1413,11 +1364,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private bool FolderHasChanged(InventoryFolderBase newf, InventoryFolderBase oldf)
|
private bool FolderHasChanged(InventoryFolderBase newf, InventoryFolderBase oldf)
|
||||||
{
|
{
|
||||||
return ( newf.Name != oldf.Name
|
return (newf.Name != oldf.Name
|
||||||
|| newf.ParentID != oldf.ParentID
|
|| newf.ParentID != oldf.ParentID
|
||||||
|| newf.Owner != oldf.Owner
|
|| newf.Owner != oldf.Owner
|
||||||
|| newf.Type != oldf.Type
|
|| newf.Type != oldf.Type
|
||||||
|| newf.Version != oldf.Version
|
|| newf.Version != oldf.Version
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1430,16 +1381,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf)
|
private bool ItemHasChanged(InventoryItemBase newf, InventoryItemBase oldf)
|
||||||
{
|
{
|
||||||
return ( newf.Name != oldf.Name
|
return (newf.Name != oldf.Name
|
||||||
|| newf.Folder != oldf.Description
|
|| newf.Folder != oldf.Description
|
||||||
|| newf.Description != oldf.Description
|
|| newf.Description != oldf.Description
|
||||||
|| newf.Owner != oldf.Owner
|
|| newf.Owner != oldf.Owner
|
||||||
|| newf.Creator != oldf.Creator
|
|| newf.Creator != oldf.Creator
|
||||||
|| newf.AssetID != oldf.AssetID
|
|| newf.AssetID != oldf.AssetID
|
||||||
|| newf.GroupID != oldf.GroupID
|
|| newf.GroupID != oldf.GroupID
|
||||||
|| newf.GroupOwned != oldf.GroupOwned
|
|| newf.GroupOwned != oldf.GroupOwned
|
||||||
|| newf.InvType != oldf.InvType
|
|| newf.InvType != oldf.InvType
|
||||||
|| newf.AssetType != oldf.AssetType
|
|| newf.AssetType != oldf.AssetType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1468,14 +1419,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
internal XmlInventoryCollection ReconstituteEntity(InventoryRequestData rdata)
|
internal XmlInventoryCollection ReconstituteEntity(InventoryRequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Reconstituting entity", MsgId);
|
Rest.Log.DebugFormat("{0} Reconstituting entity", MsgId);
|
||||||
|
|
||||||
XmlInventoryCollection ic = new XmlInventoryCollection();
|
XmlInventoryCollection ic = new XmlInventoryCollection();
|
||||||
|
|
||||||
if (rdata.request.HasEntityBody)
|
if (rdata.request.HasEntityBody)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Entity present", MsgId);
|
Rest.Log.DebugFormat("{0} Entity present", MsgId);
|
||||||
|
|
||||||
ic.init(rdata);
|
ic.init(rdata);
|
||||||
|
@ -1571,7 +1520,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Rest.Log.WarnFormat("{0} Unexpected XML parsing error: {1}", MsgId, e.Message);
|
Rest.Log.WarnFormat("{0} Unexpected XML parsing error: {1}", MsgId, e.Message);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1587,7 +1535,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
return ic;
|
return ic;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1602,7 +1549,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void CollectFolder(XmlInventoryCollection ic)
|
private void CollectFolder(XmlInventoryCollection ic)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Interpret folder element", MsgId);
|
Rest.Log.DebugFormat("{0} Interpret folder element", MsgId);
|
||||||
|
|
||||||
InventoryFolderBase result = new InventoryFolderBase();
|
InventoryFolderBase result = new InventoryFolderBase();
|
||||||
|
@ -1614,7 +1560,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
result.Owner = ic.UserID;
|
result.Owner = ic.UserID;
|
||||||
result.ParentID = LLUUID.Zero; // Context
|
result.ParentID = LLUUID.Zero; // Context
|
||||||
result.Type = (short) AssetType.Folder;
|
result.Type = (short) AssetType.Folder;
|
||||||
result.Version = 1;
|
result.Version = 1;
|
||||||
|
|
||||||
if (ic.xml.HasAttributes)
|
if (ic.xml.HasAttributes)
|
||||||
{
|
{
|
||||||
|
@ -1664,7 +1610,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
foreach (InventoryFolderBase parent in ic.rdata.folders)
|
foreach (InventoryFolderBase parent in ic.rdata.folders)
|
||||||
|
@ -1682,7 +1627,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
MsgId, ic.Item.Folder, result.ID);
|
MsgId, ic.Item.Folder, result.ID);
|
||||||
ic.Fail(Rest.HttpStatusCodeBadRequest, "invalid parent");
|
ic.Fail(Rest.HttpStatusCodeBadRequest, "invalid parent");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a new folder, so no existing UUID is available
|
// This is a new folder, so no existing UUID is available
|
||||||
|
@ -1697,7 +1641,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
// obsolete as a consequence.
|
// obsolete as a consequence.
|
||||||
|
|
||||||
ic.Push(result);
|
ic.Push(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1715,7 +1658,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void CollectItem(XmlInventoryCollection ic)
|
private void CollectItem(XmlInventoryCollection ic)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Interpret item element", MsgId);
|
Rest.Log.DebugFormat("{0} Interpret item element", MsgId);
|
||||||
|
|
||||||
InventoryItemBase result = new InventoryItemBase();
|
InventoryItemBase result = new InventoryItemBase();
|
||||||
|
@ -1736,7 +1678,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ic.xml.AttributeCount; i++)
|
for (int i = 0; i < ic.xml.AttributeCount; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
ic.xml.MoveToAttribute(i);
|
ic.xml.MoveToAttribute(i);
|
||||||
|
|
||||||
switch (ic.xml.Name)
|
switch (ic.xml.Name)
|
||||||
|
@ -1797,7 +1738,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
ic.xml.MoveToElement();
|
ic.xml.MoveToElement();
|
||||||
|
|
||||||
ic.Push(result);
|
ic.Push(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1910,7 +1850,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
string b64string = null;
|
string b64string = null;
|
||||||
|
|
||||||
// Generate a UUID of none were given, and generally none should
|
// Generate a UUID of none were given, and generally none should
|
||||||
|
@ -1952,7 +1891,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
ic.Item.AssetID = uuid;
|
ic.Item.AssetID = uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ic.Push(asset);
|
ic.Push(asset);
|
||||||
|
@ -1967,7 +1905,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void CollectPermissions(XmlInventoryCollection ic)
|
private void CollectPermissions(XmlInventoryCollection ic)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ic.xml.HasAttributes)
|
if (ic.xml.HasAttributes)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ic.xml.AttributeCount; i++)
|
for (int i = 0; i < ic.xml.AttributeCount; i++)
|
||||||
|
@ -1998,7 +1935,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
ic.xml.MoveToElement();
|
ic.xml.MoveToElement();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2013,7 +1949,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
private void Validate(XmlInventoryCollection ic)
|
private void Validate(XmlInventoryCollection ic)
|
||||||
{
|
{
|
||||||
|
|
||||||
// There really should be an item present if we've
|
// There really should be an item present if we've
|
||||||
// called validate. So fail if there is not.
|
// called validate. So fail if there is not.
|
||||||
|
|
||||||
|
@ -2037,11 +1972,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
if (ic.Item.AssetID == LLUUID.Zero)
|
if (ic.Item.AssetID == LLUUID.Zero)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.ErrorFormat("{0} Unable to complete request", MsgId);
|
Rest.Log.ErrorFormat("{0} Unable to complete request", MsgId);
|
||||||
Rest.Log.InfoFormat("{0} Asset information is missing", MsgId);
|
Rest.Log.InfoFormat("{0} Asset information is missing", MsgId);
|
||||||
ic.Fail(Rest.HttpStatusCodeBadRequest, "asset information required");
|
ic.Fail(Rest.HttpStatusCodeBadRequest, "asset information required");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the item is new, then assign it an ID
|
// If the item is new, then assign it an ID
|
||||||
|
@ -2061,7 +1994,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
foreach (InventoryFolderBase parent in ic.rdata.folders)
|
foreach (InventoryFolderBase parent in ic.rdata.folders)
|
||||||
|
@ -2079,7 +2011,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
MsgId, ic.Item.Folder, ic.Item.ID);
|
MsgId, ic.Item.Folder, ic.Item.ID);
|
||||||
ic.Fail(Rest.HttpStatusCodeBadRequest, "parent information required");
|
ic.Fail(Rest.HttpStatusCodeBadRequest, "parent information required");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is an inline asset being constructed in the context
|
// If this is an inline asset being constructed in the context
|
||||||
|
@ -2107,7 +2038,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
if (ic.Item.AssetType == (int) AssetType.Unknown ||
|
if (ic.Item.AssetType == (int) AssetType.Unknown ||
|
||||||
ic.Item.InvType == (int) AssetType.Unknown)
|
ic.Item.InvType == (int) AssetType.Unknown)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId);
|
Rest.Log.DebugFormat("{0} Attempting to infer item type", MsgId);
|
||||||
|
|
||||||
string[] parts = ic.Item.Name.Split(Rest.CA_PERIOD);
|
string[] parts = ic.Item.Name.Split(Rest.CA_PERIOD);
|
||||||
|
@ -2188,14 +2118,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
}
|
}
|
||||||
|
|
||||||
ic.reset();
|
ic.reset();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Inventory RequestData extension
|
#region Inventory RequestData extension
|
||||||
|
|
||||||
internal class InventoryRequestData : RequestData
|
internal class InventoryRequestData : RequestData
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// These are the inventory specific request/response state
|
/// These are the inventory specific request/response state
|
||||||
/// extensions.
|
/// extensions.
|
||||||
|
@ -2230,7 +2158,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
Monitor.Pulse(this);
|
Monitor.Pulse(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Inventory RequestData extension
|
#endregion Inventory RequestData extension
|
||||||
|
@ -2243,7 +2170,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
internal class XmlInventoryCollection : InventoryCollection
|
internal class XmlInventoryCollection : InventoryCollection
|
||||||
{
|
{
|
||||||
|
|
||||||
internal InventoryRequestData rdata;
|
internal InventoryRequestData rdata;
|
||||||
private Stack<InventoryFolderBase> stk;
|
private Stack<InventoryFolderBase> stk;
|
||||||
|
|
||||||
|
@ -2336,7 +2262,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
rdata.Fail(code, addendum);
|
rdata.Fail(code, addendum);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
@ -41,10 +40,8 @@ using OpenSim.Framework.Communications.Cache;
|
||||||
|
|
||||||
namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
{
|
{
|
||||||
|
|
||||||
public class Remote : ITest
|
public class Remote : ITest
|
||||||
{
|
{
|
||||||
|
|
||||||
private static readonly int PARM_TESTID = 0;
|
private static readonly int PARM_TESTID = 0;
|
||||||
private static readonly int PARM_COMMAND = 1;
|
private static readonly int PARM_COMMAND = 1;
|
||||||
|
|
||||||
|
@ -95,7 +92,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
|
|
||||||
public void Execute(RequestData rdata)
|
public void Execute(RequestData rdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
|
|
||||||
// If we can't relate to what's there, leave it for others.
|
// If we can't relate to what's there, leave it for others.
|
||||||
|
@ -138,7 +134,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
{
|
{
|
||||||
if (rdata.Parameters.Length >= 6)
|
if (rdata.Parameters.Length >= 6)
|
||||||
{
|
{
|
||||||
|
|
||||||
string[] names = rdata.Parameters[PARM_MOVE_AVATAR].Split(Rest.CA_SPACE);
|
string[] names = rdata.Parameters[PARM_MOVE_AVATAR].Split(Rest.CA_SPACE);
|
||||||
ScenePresence avatar = null;
|
ScenePresence avatar = null;
|
||||||
Scene scene = null;
|
Scene scene = null;
|
||||||
|
@ -171,7 +166,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
|
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} Move : Avatar {1} located in region {2}",
|
Rest.Log.DebugFormat("{0} Move : Avatar {1} located in region {2}",
|
||||||
MsgId, rdata.Parameters[PARM_MOVE_AVATAR], scene.RegionInfo.RegionName);
|
MsgId, rdata.Parameters[PARM_MOVE_AVATAR], scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
@ -185,8 +179,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
rdata.Fail(Rest.HttpStatusCodeBadRequest,
|
rdata.Fail(Rest.HttpStatusCodeBadRequest,
|
||||||
String.Format("invalid parameters: {0}", e.Message));
|
String.Format("invalid parameters: {0}", e.Message));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -205,7 +199,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId);
|
Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId);
|
||||||
rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided");
|
rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly string Help =
|
private static readonly string Help =
|
||||||
|
@ -220,6 +213,5 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
+ "</body>"
|
+ "</body>"
|
||||||
+ "</html>"
|
+ "</html>"
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -617,9 +617,9 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||||
|
|
||||||
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
|
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
|
||||||
|
|
||||||
if(mm != null)
|
if (mm != null)
|
||||||
{
|
{
|
||||||
if(!mm.UploadCovered(client))
|
if (!mm.UploadCovered(client))
|
||||||
{
|
{
|
||||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
private Header header;
|
private Header header;
|
||||||
public override void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
|
public override void FromBytes(Header header, byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
|
public override void FromBytes(byte[] bytes, ref int i, ref int packetEnd, byte[] zeroBuffer)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Header Header { get { return header; } set { header = value; }}
|
public override Header Header { get { return header; } set { header = value; }}
|
||||||
|
@ -56,6 +54,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public KillPacket()
|
public KillPacket()
|
||||||
{
|
{
|
||||||
Header = new LowHeader();
|
Header = new LowHeader();
|
||||||
|
|
|
@ -2100,8 +2100,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
// Gesture
|
// Gesture
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region Appearance/ Wearables Methods
|
#region Appearance/ Wearables Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1537,7 +1537,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
||||||
{
|
{
|
||||||
GetClientFunds(client);
|
GetClientFunds(client);
|
||||||
|
|
||||||
lock(m_KnownClientFunds)
|
lock (m_KnownClientFunds)
|
||||||
{
|
{
|
||||||
if (!m_KnownClientFunds.ContainsKey(client.AgentId))
|
if (!m_KnownClientFunds.ContainsKey(client.AgentId))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1570,7 +1570,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
||||||
|
|
||||||
int funds = m_KnownClientFunds[remoteClient.AgentId];
|
int funds = m_KnownClientFunds[remoteClient.AgentId];
|
||||||
|
|
||||||
if(salePrice != 0 && funds < salePrice)
|
if (salePrice != 0 && funds < salePrice)
|
||||||
{
|
{
|
||||||
remoteClient.SendAgentAlertMessage("Unable to buy now. You don't have sufficient funds.", false);
|
remoteClient.SendAgentAlertMessage("Unable to buy now. You don't have sufficient funds.", false);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -83,7 +83,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
public bool visible_to_parent;
|
public bool visible_to_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class OpenGridProtocolModule : IRegionModule
|
public class OpenGridProtocolModule : IRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -92,8 +91,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
private Dictionary<string, AgentCircuitData> CapsLoginID = new Dictionary<string, AgentCircuitData>();
|
private Dictionary<string, AgentCircuitData> CapsLoginID = new Dictionary<string, AgentCircuitData>();
|
||||||
private Dictionary<LLUUID, OGPState> m_OGPState = new Dictionary<LLUUID, OGPState>();
|
private Dictionary<LLUUID, OGPState> m_OGPState = new Dictionary<LLUUID, OGPState>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region IRegionModule Members
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
|
@ -220,12 +217,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
|
|
||||||
Scene homeScene = GetRootScene();
|
Scene homeScene = GetRootScene();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (homeScene == null)
|
if (homeScene == null)
|
||||||
return GenerateNoHandlerMessage();
|
return GenerateNoHandlerMessage();
|
||||||
|
|
||||||
|
|
||||||
RegionInfo reg = homeScene.RegionInfo;
|
RegionInfo reg = homeScene.RegionInfo;
|
||||||
ulong regionhandle = GetOSCompatibleRegionHandle(reg);
|
ulong regionhandle = GetOSCompatibleRegionHandle(reg);
|
||||||
//string RegionURI = reg.ServerURI;
|
//string RegionURI = reg.ServerURI;
|
||||||
|
@ -239,7 +233,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
string FirstName = requestMap["first_name"].AsString();
|
string FirstName = requestMap["first_name"].AsString();
|
||||||
string LastName = requestMap["last_name"].AsString();
|
string LastName = requestMap["last_name"].AsString();
|
||||||
|
|
||||||
|
|
||||||
OGPState userState = GetOGPState(LocalAgentID);
|
OGPState userState = GetOGPState(LocalAgentID);
|
||||||
|
|
||||||
userState.first_name = requestMap["first_name"].AsString();
|
userState.first_name = requestMap["first_name"].AsString();
|
||||||
|
@ -299,7 +292,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
useragent.SecureSessionID=agentData.SecureSessionID;
|
useragent.SecureSessionID=agentData.SecureSessionID;
|
||||||
useragent.SessionID = agentData.SessionID;
|
useragent.SessionID = agentData.SessionID;
|
||||||
|
|
||||||
|
|
||||||
UserProfileData userProfile = new UserProfileData();
|
UserProfileData userProfile = new UserProfileData();
|
||||||
userProfile.AboutText = "OGP User";
|
userProfile.AboutText = "OGP User";
|
||||||
userProfile.CanDoMask = (uint)0;
|
userProfile.CanDoMask = (uint)0;
|
||||||
|
@ -339,14 +331,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
// Do caps registration
|
// Do caps registration
|
||||||
// get seed cap
|
// get seed cap
|
||||||
|
|
||||||
|
|
||||||
// Stick our data in the cache so the region will know something about us
|
// Stick our data in the cache so the region will know something about us
|
||||||
homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
|
homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
|
||||||
|
|
||||||
// Call 'new user' event handler
|
// Call 'new user' event handler
|
||||||
homeScene.NewUserConnection(reg.RegionHandle, agentData);
|
homeScene.NewUserConnection(reg.RegionHandle, agentData);
|
||||||
|
|
||||||
|
|
||||||
//string raCap = string.Empty;
|
//string raCap = string.Empty;
|
||||||
|
|
||||||
LLUUID AvatarRezCapUUID = LLUUID.Random();
|
LLUUID AvatarRezCapUUID = LLUUID.Random();
|
||||||
|
@ -521,27 +511,19 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
responseMap["connect"] = LLSD.FromBoolean(true);
|
responseMap["connect"] = LLSD.FromBoolean(true);
|
||||||
|
|
||||||
m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString());
|
m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return responseMap;
|
return responseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LLSD DerezAvatarMethod(string path, LLSD request)
|
public LLSD DerezAvatarMethod(string path, LLSD request)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString());
|
m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString());
|
||||||
|
|
||||||
//LLSD llsdResponse = null;
|
//LLSD llsdResponse = null;
|
||||||
LLSDMap responseMap = new LLSDMap();
|
LLSDMap responseMap = new LLSDMap();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string[] PathArray = path.Split('/');
|
string[] PathArray = path.Split('/');
|
||||||
m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]);
|
m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]);
|
||||||
string uuidString = PathArray[2];
|
string uuidString = PathArray[2];
|
||||||
|
@ -549,7 +531,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
LLUUID userUUID = LLUUID.Zero;
|
LLUUID userUUID = LLUUID.Zero;
|
||||||
if (Helpers.TryParse(uuidString, out userUUID))
|
if (Helpers.TryParse(uuidString, out userUUID))
|
||||||
{
|
{
|
||||||
|
|
||||||
LLUUID RemoteID = uuidString;
|
LLUUID RemoteID = uuidString;
|
||||||
LLUUID LocalID = RemoteID;
|
LLUUID LocalID = RemoteID;
|
||||||
// FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds
|
// FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds
|
||||||
|
@ -559,7 +540,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
OGPState userState = GetOGPState(LocalID);
|
OGPState userState = GetOGPState(LocalID);
|
||||||
if (userState.agent_id != LLUUID.Zero)
|
if (userState.agent_id != LLUUID.Zero)
|
||||||
{
|
{
|
||||||
|
|
||||||
//LLSDMap outboundRequestMap = new LLSDMap();
|
//LLSDMap outboundRequestMap = new LLSDMap();
|
||||||
LLSDMap inboundRequestMap = (LLSDMap)request;
|
LLSDMap inboundRequestMap = (LLSDMap)request;
|
||||||
string rezAvatarString = inboundRequestMap["rez_avatar"].AsString();
|
string rezAvatarString = inboundRequestMap["rez_avatar"].AsString();
|
||||||
|
@ -569,7 +549,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
LookAtArray.Add(LLSD.FromInteger(1));
|
LookAtArray.Add(LLSD.FromInteger(1));
|
||||||
LookAtArray.Add(LLSD.FromInteger(1));
|
LookAtArray.Add(LLSD.FromInteger(1));
|
||||||
|
|
||||||
|
|
||||||
LLSDArray PositionArray = new LLSDArray();
|
LLSDArray PositionArray = new LLSDArray();
|
||||||
PositionArray.Add(LLSD.FromInteger(128));
|
PositionArray.Add(LLSD.FromInteger(128));
|
||||||
PositionArray.Add(LLSD.FromInteger(128));
|
PositionArray.Add(LLSD.FromInteger(128));
|
||||||
|
@ -610,7 +589,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
|
|
||||||
LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"];
|
LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"];
|
||||||
|
|
||||||
|
|
||||||
responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap);
|
responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap);
|
||||||
responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
|
responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
|
||||||
responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_host).ToString());
|
responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_host).ToString());
|
||||||
|
@ -619,23 +597,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
responseMap["region_y"] = LLSD.FromInteger(rrY );
|
responseMap["region_y"] = LLSD.FromInteger(rrY );
|
||||||
responseMap["region_id"] = LLSD.FromUUID(rrRID);
|
responseMap["region_id"] = LLSD.FromUUID(rrRID);
|
||||||
responseMap["sim_access"] = LLSD.FromString(rrAccess);
|
responseMap["sim_access"] = LLSD.FromString(rrAccess);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
responseMap["position"] = RezResponsePositionArray;
|
responseMap["position"] = RezResponsePositionArray;
|
||||||
responseMap["look_at"] = lookArray;
|
responseMap["look_at"] = lookArray;
|
||||||
responseMap["connect"] = LLSD.FromBoolean(true);
|
responseMap["connect"] = LLSD.FromBoolean(true);
|
||||||
|
|
||||||
ShutdownConnection(LocalID,this);
|
ShutdownConnection(LocalID,this);
|
||||||
|
|
||||||
|
|
||||||
m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString());
|
m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString());
|
||||||
return responseMap;
|
return responseMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
return GenerateNoHandlerMessage();
|
return GenerateNoHandlerMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -649,14 +621,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
|
|
||||||
private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState)
|
private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState)
|
||||||
{
|
{
|
||||||
|
|
||||||
Scene reg = GetRootScene();
|
Scene reg = GetRootScene();
|
||||||
|
|
||||||
WebRequest DeRezRequest = WebRequest.Create(CapAddress);
|
WebRequest DeRezRequest = WebRequest.Create(CapAddress);
|
||||||
DeRezRequest.Method = "POST";
|
DeRezRequest.Method = "POST";
|
||||||
DeRezRequest.ContentType = "application/xml+llsd";
|
DeRezRequest.ContentType = "application/xml+llsd";
|
||||||
|
|
||||||
|
|
||||||
LLSDMap RAMap = new LLSDMap();
|
LLSDMap RAMap = new LLSDMap();
|
||||||
LLSDMap AgentParms = new LLSDMap();
|
LLSDMap AgentParms = new LLSDMap();
|
||||||
LLSDMap RegionParms = new LLSDMap();
|
LLSDMap RegionParms = new LLSDMap();
|
||||||
|
@ -696,7 +666,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
// Planned for version 2
|
// Planned for version 2
|
||||||
// RAMap["agent_params"] = AgentParms;
|
// RAMap["agent_params"] = AgentParms;
|
||||||
|
|
||||||
|
|
||||||
RAMap["region_params"] = RegionParms;
|
RAMap["region_params"] = RegionParms;
|
||||||
RAMap["parameter"] = Parameter;
|
RAMap["parameter"] = Parameter;
|
||||||
|
|
||||||
|
@ -770,8 +739,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
return responseMap;
|
return responseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LLSD GenerateNoHandlerMessage()
|
public LLSD GenerateNoHandlerMessage()
|
||||||
{
|
{
|
||||||
LLSDMap map = new LLSDMap();
|
LLSDMap map = new LLSDMap();
|
||||||
|
@ -802,7 +769,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
CapsLoginID.Remove(path);
|
CapsLoginID.Remove(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Scene GetRootScene()
|
private Scene GetRootScene()
|
||||||
{
|
{
|
||||||
Scene ReturnScene = null;
|
Scene ReturnScene = null;
|
||||||
|
@ -815,7 +781,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
}
|
}
|
||||||
|
|
||||||
return ReturnScene;
|
return ReturnScene;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ulong GetOSCompatibleRegionHandle(RegionInfo reg)
|
private ulong GetOSCompatibleRegionHandle(RegionInfo reg)
|
||||||
|
@ -871,9 +836,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
public void DeleteOGPState(LLUUID agentId)
|
public void DeleteOGPState(LLUUID agentId)
|
||||||
{
|
{
|
||||||
lock (m_OGPState)
|
lock (m_OGPState)
|
||||||
|
{
|
||||||
if (m_OGPState.ContainsKey(agentId))
|
if (m_OGPState.ContainsKey(agentId))
|
||||||
m_OGPState.Remove(agentId);
|
m_OGPState.Remove(agentId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateOGPState(LLUUID agentId, OGPState state)
|
private void UpdateOGPState(LLUUID agentId, OGPState state)
|
||||||
|
@ -890,6 +856,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod)
|
public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod)
|
||||||
{
|
{
|
||||||
Scene homeScene = GetRootScene();
|
Scene homeScene = GetRootScene();
|
||||||
|
@ -903,22 +870,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
ta.Start();
|
ta.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary hack to allow teleporting to and from Vaak
|
// Temporary hack to allow teleporting to and from Vaak
|
||||||
private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
|
private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
|
||||||
{
|
{
|
||||||
|
|
||||||
//if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US")
|
//if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US")
|
||||||
//{
|
//{
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//return false;
|
//return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class KillAUser
|
public class KillAUser
|
||||||
|
@ -953,12 +915,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MonoCert : ICertificatePolicy
|
public class MonoCert : ICertificatePolicy
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#region ICertificatePolicy Members
|
#region ICertificatePolicy Members
|
||||||
|
|
||||||
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
|
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
|
|
||||||
Bitmap mapbmp = new Bitmap(256, 256);
|
Bitmap mapbmp = new Bitmap(256, 256);
|
||||||
//long t = System.Environment.TickCount;
|
//long t = System.Environment.TickCount;
|
||||||
//for(int i = 0; i < 10; ++i) {
|
//for (int i = 0; i < 10; ++i) {
|
||||||
terrainRenderer.TerrainToBitmap(mapbmp);
|
terrainRenderer.TerrainToBitmap(mapbmp);
|
||||||
//}
|
//}
|
||||||
//t = System.Environment.TickCount - t;
|
//t = System.Environment.TickCount - t;
|
||||||
|
|
|
@ -97,8 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
// No, that doesn't scale it:
|
// No, that doesn't scale it:
|
||||||
// heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue
|
// heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
||||||
heightvalue = 0;
|
heightvalue = 0;
|
||||||
else if (heightvalue > 255f)
|
else if (heightvalue > 255f)
|
||||||
|
@ -198,7 +196,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
|
|
||||||
mapbmp.SetPixel(x-1, yr+1, color);
|
mapbmp.SetPixel(x-1, yr+1, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +210,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
color = Color.Black;
|
color = Color.Black;
|
||||||
mapbmp.SetPixel(x, yr, color);
|
mapbmp.SetPixel(x, yr, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,10 +82,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
// (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
|
// (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
|
||||||
public Color toColor()
|
public Color toColor()
|
||||||
{
|
{
|
||||||
if(s < 0f) Console.WriteLine("S < 0: " + s);
|
if (s < 0f) Console.WriteLine("S < 0: " + s);
|
||||||
else if(s > 1f) Console.WriteLine("S > 1: " + s);
|
else if (s > 1f) Console.WriteLine("S > 1: " + s);
|
||||||
if(v < 0f) Console.WriteLine("V < 0: " + v);
|
if (v < 0f) Console.WriteLine("V < 0: " + v);
|
||||||
else if(v > 1f) Console.WriteLine("V > 1: " + v);
|
else if (v > 1f) Console.WriteLine("V > 1: " + v);
|
||||||
|
|
||||||
float f = h / 60f;
|
float f = h / 60f;
|
||||||
int sector = (int)f % 6;
|
int sector = (int)f % 6;
|
||||||
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
int ti = (int)(v * (1f - (1f - f) * s) * 255f);
|
int ti = (int)(v * (1f - (1f - f) * s) * 255f);
|
||||||
int vi = (int)(v * 255f);
|
int vi = (int)(v * 255f);
|
||||||
|
|
||||||
switch(sector)
|
switch (sector)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return Color.FromArgb(vi, ti, pi);
|
return Color.FromArgb(vi, ti, pi);
|
||||||
|
@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
{
|
{
|
||||||
AssetBase asset = m_scene.AssetCache.GetAsset(id, true);
|
AssetBase asset = m_scene.AssetCache.GetAsset(id, true);
|
||||||
m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null);
|
m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null);
|
||||||
if(asset == null) return null;
|
if (asset == null) return null;
|
||||||
return new Bitmap(OpenJPEG.DecodeToImage(asset.Data));
|
return new Bitmap(OpenJPEG.DecodeToImage(asset.Data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
// color-channel, so 2^24 is the maximum value we can get, adding everything.
|
// color-channel, so 2^24 is the maximum value we can get, adding everything.
|
||||||
// int is be big enough for that.
|
// int is be big enough for that.
|
||||||
int r = 0, g = 0, b = 0;
|
int r = 0, g = 0, b = 0;
|
||||||
for(int y = 0; y < bmp.Height; ++y)
|
for (int y = 0; y < bmp.Height; ++y)
|
||||||
{
|
{
|
||||||
for(int x = 0; x < bmp.Width; ++x)
|
for (int x = 0; x < bmp.Width; ++x)
|
||||||
{
|
{
|
||||||
Color c = bmp.GetPixel(x, y);
|
Color c = bmp.GetPixel(x, y);
|
||||||
r += (int)c.R & 0xff;
|
r += (int)c.R & 0xff;
|
||||||
|
@ -218,14 +218,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
|
|
||||||
// interpolate two colors in HSV space and return the resulting color
|
// interpolate two colors in HSV space and return the resulting color
|
||||||
private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) {
|
private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) {
|
||||||
if(ratio <= 0f) return c1;
|
if (ratio <= 0f) return c1;
|
||||||
if(ratio >= 1f) return c2;
|
if (ratio >= 1f) return c2;
|
||||||
|
|
||||||
// make sure we are on the same side on the hue-circle for interpolation
|
// make sure we are on the same side on the hue-circle for interpolation
|
||||||
// We change the hue of the parameters here, but we don't change the color
|
// We change the hue of the parameters here, but we don't change the color
|
||||||
// represented by that value
|
// represented by that value
|
||||||
if(c1.h - c2.h > 180f) c1.h -= 360f;
|
if (c1.h - c2.h > 180f) c1.h -= 360f;
|
||||||
else if(c2.h - c1.h > 180f) c1.h += 360f;
|
else if (c2.h - c1.h > 180f) c1.h += 360f;
|
||||||
|
|
||||||
return new HSV(c1.h * (1f - ratio) + c2.h * ratio,
|
return new HSV(c1.h * (1f - ratio) + c2.h * ratio,
|
||||||
c1.s * (1f - ratio) + c2.s * ratio,
|
c1.s * (1f - ratio) + c2.s * ratio,
|
||||||
|
@ -321,16 +321,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
|
||||||
}
|
}
|
||||||
|
|
||||||
HSV hsv;
|
HSV hsv;
|
||||||
if(hmod <= low) hsv = hsv1; // too low
|
if (hmod <= low) hsv = hsv1; // too low
|
||||||
else if(hmod >= high) hsv = hsv4; // too high
|
else if (hmod >= high) hsv = hsv4; // too high
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// HSV-interpolate along the colors
|
// HSV-interpolate along the colors
|
||||||
// first, rescale h to 0.0 - 1.0
|
// first, rescale h to 0.0 - 1.0
|
||||||
hmod = (hmod - low) / (high - low);
|
hmod = (hmod - low) / (high - low);
|
||||||
// now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4
|
// now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4
|
||||||
if(hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f);
|
if (hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f);
|
||||||
else if(hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f);
|
else if (hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f);
|
||||||
else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f);
|
else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,8 +276,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (m_storageManager.EstateDataStore != null)
|
if (m_storageManager.EstateDataStore != null)
|
||||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
|
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Bind Storage Manager functions to some land manager functions for this scene
|
//Bind Storage Manager functions to some land manager functions for this scene
|
||||||
EventManager.OnLandObjectAdded +=
|
EventManager.OnLandObjectAdded +=
|
||||||
new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject);
|
new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject);
|
||||||
|
@ -322,7 +320,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
m_log.Warn("Failed to load StartupConfig");
|
m_log.Warn("Failed to load StartupConfig");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -351,7 +348,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// we add it to the notify list regardless of distance.
|
// we add it to the notify list regardless of distance.
|
||||||
// We'll check the agent's draw distance before notifying them though.
|
// We'll check the agent's draw distance before notifying them though.
|
||||||
|
|
||||||
|
|
||||||
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
|
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_neighbours.Count; i++)
|
for (int i = 0; i < m_neighbours.Count; i++)
|
||||||
|
@ -386,8 +382,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX);
|
int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX);
|
||||||
int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY);
|
int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY);
|
||||||
if ((resultX <= 1) &&
|
if (resultX <= 1 && resultY <= 1)
|
||||||
(resultY <= 1))
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -584,8 +579,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
m_scripts_enabled = !ScriptEngine;
|
m_scripts_enabled = !ScriptEngine;
|
||||||
m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
|
m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
|
||||||
|
@ -600,7 +593,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public int GetInaccurateNeighborCount()
|
public int GetInaccurateNeighborCount()
|
||||||
{
|
{
|
||||||
lock (m_neighbours)
|
lock (m_neighbours)
|
||||||
|
{
|
||||||
return m_neighbours.Count;
|
return m_neighbours.Count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the method that shuts down the scene.
|
// This is the method that shuts down the scene.
|
||||||
|
@ -1062,7 +1057,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
float hfdiff = hfvalue;
|
float hfdiff = hfvalue;
|
||||||
int hfdiffi = 0;
|
int hfdiffi = 0;
|
||||||
|
|
||||||
|
|
||||||
for (int x = 0; x < 256; x++)
|
for (int x = 0; x < 256; x++)
|
||||||
{
|
{
|
||||||
//int tc = System.Environment.TickCount;
|
//int tc = System.Environment.TickCount;
|
||||||
|
@ -1087,10 +1081,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//float tmpval = (float)hm[x, y];
|
//float tmpval = (float)hm[x, y];
|
||||||
float heightvalue = (float)hm[x, y];
|
float heightvalue = (float)hm[x, y];
|
||||||
|
|
||||||
|
|
||||||
if (heightvalue > (float)m_regInfo.RegionSettings.WaterHeight)
|
if (heightvalue > (float)m_regInfo.RegionSettings.WaterHeight)
|
||||||
{
|
{
|
||||||
|
|
||||||
// scale height value
|
// scale height value
|
||||||
heightvalue = low + mid * (heightvalue - low) / mid;
|
heightvalue = low + mid * (heightvalue - low) / mid;
|
||||||
|
|
||||||
|
@ -1102,6 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
|
||||||
heightvalue = 0;
|
heightvalue = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue);
|
Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue);
|
||||||
|
@ -1136,7 +1129,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// we use floats, colors use bytes, so shrink are space down to
|
// we use floats, colors use bytes, so shrink are space down to
|
||||||
// 0-255
|
// 0-255
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1;
|
hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1;
|
||||||
|
@ -1166,15 +1158,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade);
|
mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (System.ArgumentException)
|
catch (System.ArgumentException)
|
||||||
{
|
{
|
||||||
|
@ -1264,7 +1249,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (part == null)
|
if (part == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
// Draw if the object is at least 1 meter wide in any direction
|
// Draw if the object is at least 1 meter wide in any direction
|
||||||
if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
|
if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
|
||||||
{
|
{
|
||||||
|
@ -1426,6 +1410,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LazySaveGeneratedMaptile(byte[] data, bool temporary)
|
public void LazySaveGeneratedMaptile(byte[] data, bool temporary)
|
||||||
{
|
{
|
||||||
// Overwrites the local Asset cache with new maptile data
|
// Overwrites the local Asset cache with new maptile data
|
||||||
|
@ -1482,6 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
asset.Temporary = temporary;
|
asset.Temporary = temporary;
|
||||||
AssetCache.AddAsset(asset);
|
AssetCache.AddAsset(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Load Land
|
#region Load Land
|
||||||
|
@ -1556,6 +1542,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
pos = RayEnd;
|
pos = RayEnd;
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RayTargetID != LLUUID.Zero)
|
if (RayTargetID != LLUUID.Zero)
|
||||||
{
|
{
|
||||||
SceneObjectPart target = GetSceneObjectPart(RayTargetID);
|
SceneObjectPart target = GetSceneObjectPart(RayTargetID);
|
||||||
|
@ -1921,9 +1908,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (position.X > Constants.RegionSize + 0.1f)
|
if (position.X > Constants.RegionSize + 0.1f)
|
||||||
{
|
{
|
||||||
pos.X = ((pos.X - Constants.RegionSize));
|
pos.X = ((pos.X - Constants.RegionSize));
|
||||||
|
|
||||||
newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
|
||||||
|
|
||||||
// x + 1
|
// x + 1
|
||||||
}
|
}
|
||||||
else if (position.X < -0.1f)
|
else if (position.X < -0.1f)
|
||||||
|
@ -2165,9 +2150,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
client.OnScriptReset += ProcessScriptReset;
|
client.OnScriptReset += ProcessScriptReset;
|
||||||
client.OnGetScriptRunning += GetScriptRunning;
|
client.OnGetScriptRunning += GetScriptRunning;
|
||||||
client.OnSetScriptRunning += SetScriptRunning;
|
client.OnSetScriptRunning += SetScriptRunning;
|
||||||
|
|
||||||
client.OnRegionHandleRequest += RegionHandleRequest;
|
client.OnRegionHandleRequest += RegionHandleRequest;
|
||||||
|
|
||||||
client.OnUnackedTerrain += TerrainUnAcked;
|
client.OnUnackedTerrain += TerrainUnAcked;
|
||||||
|
|
||||||
//Gesture
|
//Gesture
|
||||||
|
@ -2185,7 +2168,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (userInfo != null)
|
if (userInfo != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
@ -2206,7 +2188,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (userInfo != null)
|
if (userInfo != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
@ -2607,7 +2588,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
"[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
|
"[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
|
||||||
agent.AgentID, regionHandle, RegionInfo.RegionName);
|
agent.AgentID, regionHandle, RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateCircuitData(AgentCircuitData data)
|
public void UpdateCircuitData(AgentCircuitData data)
|
||||||
|
@ -2645,9 +2625,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
|
m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a caps handler for the given agent. If the CAPS handler already exists for this agent,
|
/// Add a caps handler for the given agent. If the CAPS handler already exists for this agent,
|
||||||
/// then it is replaced by a new CAPS handler.
|
/// then it is replaced by a new CAPS handler.
|
||||||
|
@ -3016,7 +2995,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_statsReporter.SetObjectCapacity(objects);
|
m_statsReporter.SetObjectCapacity(objects);
|
||||||
}
|
}
|
||||||
objectCapacity = objects;
|
objectCapacity = objects;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FriendListItem> GetFriendList(LLUUID avatarID)
|
public List<FriendListItem> GetFriendList(LLUUID avatarID)
|
||||||
|
@ -3089,7 +3067,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method is a way for the Friends Module to create an instant
|
/// This method is a way for the Friends Module to create an instant
|
||||||
/// message to the avatar and for Instant Messages that travel across
|
/// message to the avatar and for Instant Messages that travel across
|
||||||
|
@ -3105,7 +3082,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_eventManager.TriggerGridInstantMessage(message, options);
|
m_eventManager.TriggerGridInstantMessage(message, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms)
|
public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms)
|
||||||
{
|
{
|
||||||
// TODO: m_sceneGridService.DoStuff;
|
// TODO: m_sceneGridService.DoStuff;
|
||||||
|
@ -3123,6 +3099,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// TODO: m_sceneGridService.DoStuff;
|
// TODO: m_sceneGridService.DoStuff;
|
||||||
m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID);
|
m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual List<FriendListItem> StoreGetFriendsForUser(LLUUID ownerID)
|
public virtual List<FriendListItem> StoreGetFriendsForUser(LLUUID ownerID)
|
||||||
{
|
{
|
||||||
// TODO: m_sceneGridService.DoStuff;
|
// TODO: m_sceneGridService.DoStuff;
|
||||||
|
@ -3135,11 +3112,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_statsReporter.AddOutPackets(outPackets);
|
m_statsReporter.AddOutPackets(outPackets);
|
||||||
m_statsReporter.AddunAckedBytes(unAckedBytes);
|
m_statsReporter.AddunAckedBytes(unAckedBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAgentTime(int ms)
|
public void AddAgentTime(int ms)
|
||||||
{
|
{
|
||||||
m_statsReporter.addFrameMS(ms);
|
m_statsReporter.addFrameMS(ms);
|
||||||
m_statsReporter.addAgentMS(ms);
|
m_statsReporter.addAgentMS(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAgentUpdates(int count)
|
public void AddAgentUpdates(int count)
|
||||||
{
|
{
|
||||||
m_statsReporter.AddAgentUpdates(count);
|
m_statsReporter.AddAgentUpdates(count);
|
||||||
|
@ -3239,7 +3218,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="Message">The Message being sent to the user</param>
|
/// <param name="Message">The Message being sent to the user</param>
|
||||||
public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message)
|
public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message)
|
||||||
{
|
{
|
||||||
|
|
||||||
List<ScenePresence> presenceList = GetScenePresences();
|
List<ScenePresence> presenceList = GetScenePresences();
|
||||||
|
|
||||||
foreach (ScenePresence presence in presenceList)
|
foreach (ScenePresence presence in presenceList)
|
||||||
|
@ -3359,7 +3337,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
foreach (ScenePresence presence in presenceList)
|
foreach (ScenePresence presence in presenceList)
|
||||||
{
|
{
|
||||||
if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
|
if (presence.Firstname == firstName && presence.Lastname == lastName)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||||
break;
|
break;
|
||||||
|
@ -3876,7 +3854,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return m_httpListener.AddLLSDHandler(path, handler);
|
return m_httpListener.AddLLSDHandler(path, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void RemoveStreamHandler(string httpMethod, string path)
|
public void RemoveStreamHandler(string httpMethod, string path)
|
||||||
{
|
{
|
||||||
m_httpListener.RemoveStreamHandler(httpMethod, path);
|
m_httpListener.RemoveStreamHandler(httpMethod, path);
|
||||||
|
@ -3945,7 +3922,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
client.SendRegionHandle(regionID, info.RegionHandle);
|
client.SendRegionHandle(regionID, info.RegionHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
|
public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
//Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||||
|
@ -3973,10 +3949,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void ObjectSaleInfo(IClientAPI client, LLUUID agentID, LLUUID sessionID, uint localID, byte saleType, int salePrice)
|
public void ObjectSaleInfo(IClientAPI client, LLUUID agentID, LLUUID sessionID, uint localID, byte saleType, int salePrice)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
if(part == null || part.ParentGroup == null)
|
if (part == null || part.ParentGroup == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(part.ParentGroup.RootPart == null)
|
if (part.ParentGroup.RootPart == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
part = part.ParentGroup.RootPart;
|
part = part.ParentGroup.RootPart;
|
||||||
|
@ -3994,10 +3970,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
|
|
||||||
if(part == null)
|
if (part == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(part.ParentGroup == null)
|
if (part.ParentGroup == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SceneObjectGroup group = part.ParentGroup;
|
SceneObjectGroup group = part.ParentGroup;
|
||||||
|
|
|
@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// both regions
|
// both regions
|
||||||
if (avatar.ParentID != (uint)0)
|
if (avatar.ParentID != (uint)0)
|
||||||
avatar.StandUp();
|
avatar.StandUp();
|
||||||
if(!avatar.ValidateAttachments())
|
if (!avatar.ValidateAttachments())
|
||||||
{
|
{
|
||||||
avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state");
|
avatar.ControllingClient.SendTeleportFailed("Inconsistent attachment state");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2350,10 +2350,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// Validate
|
// Validate
|
||||||
foreach (SceneObjectGroup gobj in m_attachments)
|
foreach (SceneObjectGroup gobj in m_attachments)
|
||||||
{
|
{
|
||||||
if(gobj == null)
|
if (gobj == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(gobj.RootPart == null)
|
if (gobj.RootPart == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2370,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// Validate
|
// Validate
|
||||||
foreach (SceneObjectGroup gobj in m_attachments)
|
foreach (SceneObjectGroup gobj in m_attachments)
|
||||||
{
|
{
|
||||||
if(gobj == null || gobj.RootPart == null)
|
if (gobj == null || gobj.RootPart == null)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1891,8 +1891,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
{ // half circle, prim is a sphere
|
{ // half circle, prim is a sphere
|
||||||
sides = 24;
|
sides = 24;
|
||||||
|
|
||||||
profileBegin = 0.5f * profileBegin + 0.5f;
|
profileBegin = 0.5f * profileBegin + 0.5f;
|
||||||
profileEnd = 0.5f * profileEnd + 0.5f;
|
profileEnd = 0.5f * profileEnd + 0.5f;
|
||||||
|
|
||||||
//profileHollow = 0.0f; // debugging only
|
//profileHollow = 0.0f; // debugging only
|
||||||
}
|
}
|
||||||
|
@ -1905,7 +1905,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
else if (primShape.HollowShape == HollowShape.Triangle)
|
else if (primShape.HollowShape == HollowShape.Triangle)
|
||||||
hollowSides = 3;
|
hollowSides = 3;
|
||||||
|
|
||||||
|
|
||||||
PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides);
|
PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides);
|
||||||
//PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, 0.0f, 4);
|
//PrimMesh primMesh = new PrimMesh(sides, profileBegin, profileEnd, 0.0f, 4);
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,8 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
internal List<Angle> angles;
|
internal List<Angle> angles;
|
||||||
|
|
||||||
// this class should have a table of most commonly computed values
|
// this class should have a table of most commonly computed values
|
||||||
// instead of all the trig function calls
|
// instead of all the trig function calls
|
||||||
// most common would be for sides = 3, 4, or 24
|
// most common would be for sides = 3, 4, or 24
|
||||||
internal void makeAngles( int sides, float startAngle, float stopAngle )
|
internal void makeAngles( int sides, float startAngle, float stopAngle )
|
||||||
{
|
{
|
||||||
angles = new List<Angle>();
|
angles = new List<Angle>();
|
||||||
|
@ -134,7 +134,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
newAngle.Y = (float) System.Math.Sin(angle);
|
newAngle.Y = (float) System.Math.Sin(angle);
|
||||||
angles.Add(newAngle);
|
angles.Add(newAngle);
|
||||||
step += 1;
|
step += 1;
|
||||||
angle = stepSize * step;
|
angle = stepSize * step;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startAngle > angles[0].angle)
|
if (startAngle > angles[0].angle)
|
||||||
|
@ -189,13 +189,13 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
float xScale = 0.5f;
|
float xScale = 0.5f;
|
||||||
float yScale = 0.5f;
|
float yScale = 0.5f;
|
||||||
if (sides == 4) // corners of a square are sqrt(2) from center
|
if (sides == 4) // corners of a square are sqrt(2) from center
|
||||||
{
|
{
|
||||||
xScale = 0.707f;
|
xScale = 0.707f;
|
||||||
yScale = 0.707f;
|
yScale = 0.707f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float startAngle = profileStart * twoPi;
|
float startAngle = profileStart * twoPi;
|
||||||
float stopAngle = profileEnd * twoPi;
|
float stopAngle = profileEnd * twoPi;
|
||||||
float stepSize = twoPi / sides;
|
float stepSize = twoPi / sides;
|
||||||
|
|
||||||
try { angles.makeAngles(sides, startAngle, stopAngle); }
|
try { angles.makeAngles(sides, startAngle, stopAngle); }
|
||||||
|
@ -507,23 +507,23 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
s += "sides..................: " + this.sides.ToString();
|
s += "sides..................: " + this.sides.ToString();
|
||||||
s += "\nhollowSides..........: " + this.hollowSides.ToString();
|
s += "\nhollowSides..........: " + this.hollowSides.ToString();
|
||||||
s += "\nprofileStart.........: " + this.profileStart.ToString();
|
s += "\nprofileStart.........: " + this.profileStart.ToString();
|
||||||
s += "\nprofileEnd...........: " + this.profileEnd.ToString();
|
s += "\nprofileEnd...........: " + this.profileEnd.ToString();
|
||||||
s += "\nhollow...............: " + this.hollow.ToString();
|
s += "\nhollow...............: " + this.hollow.ToString();
|
||||||
s += "\ntwistBegin...........: " + this.twistBegin.ToString();
|
s += "\ntwistBegin...........: " + this.twistBegin.ToString();
|
||||||
s += "\ntwistEnd.............: " + this.twistEnd.ToString();
|
s += "\ntwistEnd.............: " + this.twistEnd.ToString();
|
||||||
s += "\ntopShearX............: " + this.topShearX.ToString();
|
s += "\ntopShearX............: " + this.topShearX.ToString();
|
||||||
s += "\ntopShearY............: " + this.topShearY.ToString();
|
s += "\ntopShearY............: " + this.topShearY.ToString();
|
||||||
s += "\npathCutBegin.........: " + this.pathCutBegin.ToString();
|
s += "\npathCutBegin.........: " + this.pathCutBegin.ToString();
|
||||||
s += "\npathCutEnd...........: " + this.pathCutEnd.ToString();
|
s += "\npathCutEnd...........: " + this.pathCutEnd.ToString();
|
||||||
s += "\ndimpleBegin..........: " + this.dimpleBegin.ToString();
|
s += "\ndimpleBegin..........: " + this.dimpleBegin.ToString();
|
||||||
s += "\ndimpleEnd............: " + this.dimpleEnd.ToString();
|
s += "\ndimpleEnd............: " + this.dimpleEnd.ToString();
|
||||||
s += "\nskew.................: " + this.skew.ToString();
|
s += "\nskew.................: " + this.skew.ToString();
|
||||||
s += "\nholeSizeX............: " + this.holeSizeX.ToString();
|
s += "\nholeSizeX............: " + this.holeSizeX.ToString();
|
||||||
s += "\nholeSizeY............: " + this.holeSizeY.ToString();
|
s += "\nholeSizeY............: " + this.holeSizeY.ToString();
|
||||||
s += "\ntaperX...............: " + this.taperX.ToString();
|
s += "\ntaperX...............: " + this.taperX.ToString();
|
||||||
s += "\ntaperY...............: " + this.taperY.ToString();
|
s += "\ntaperY...............: " + this.taperY.ToString();
|
||||||
s += "\nradius...............: " + this.radius.ToString();
|
s += "\nradius...............: " + this.radius.ToString();
|
||||||
s += "\nrevolutions..........: " + this.revolutions.ToString();
|
s += "\nrevolutions..........: " + this.revolutions.ToString();
|
||||||
s += "\nstepsPerRevolution...: " + this.stepsPerRevolution.ToString();
|
s += "\nstepsPerRevolution...: " + this.stepsPerRevolution.ToString();
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
@ -542,20 +542,20 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
this.hollowSides = hollowSides;
|
this.hollowSides = hollowSides;
|
||||||
|
|
||||||
if (sides < 3)
|
if (sides < 3)
|
||||||
this.sides = 3;
|
this.sides = 3;
|
||||||
if ( hollowSides < 3)
|
if ( hollowSides < 3)
|
||||||
this.hollowSides = 3;
|
this.hollowSides = 3;
|
||||||
if (profileStart < 0.0f)
|
if (profileStart < 0.0f)
|
||||||
this.profileStart = 0.0f;
|
this.profileStart = 0.0f;
|
||||||
if (profileEnd > 1.0f)
|
if (profileEnd > 1.0f)
|
||||||
this.profileEnd = 1.0f;
|
this.profileEnd = 1.0f;
|
||||||
if (profileEnd < 0.02f)
|
if (profileEnd < 0.02f)
|
||||||
this.profileEnd = 0.02f;
|
this.profileEnd = 0.02f;
|
||||||
if (profileStart >= profileEnd)
|
if (profileStart >= profileEnd)
|
||||||
this.profileStart = profileEnd - 0.02f;
|
this.profileStart = profileEnd - 0.02f;
|
||||||
if (hollow > 1.0f)
|
if (hollow > 1.0f)
|
||||||
this.hollow = 1.0f;
|
this.hollow = 1.0f;
|
||||||
if (hollow < 0.0f)
|
if (hollow < 0.0f)
|
||||||
this.hollow = 0.0f;
|
this.hollow = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,7 +708,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ExtrudeCircular()
|
public void ExtrudeCircular()
|
||||||
{
|
{
|
||||||
this.coords = new List<Coord>();
|
this.coords = new List<Coord>();
|
||||||
|
@ -721,9 +720,9 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
float twistEnd = this.twistEnd / 360.0f * twoPi;
|
float twistEnd = this.twistEnd / 360.0f * twoPi;
|
||||||
float twistTotal = twistEnd - twistBegin;
|
float twistTotal = twistEnd - twistBegin;
|
||||||
|
|
||||||
// if the profile has a lot of twist, add more layers otherwise the layers may overlap
|
// if the profile has a lot of twist, add more layers otherwise the layers may overlap
|
||||||
// and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't
|
// and the resulting mesh may be quite inaccurate. This method is arbitrary and doesn't
|
||||||
// accurately match the viewer
|
// accurately match the viewer
|
||||||
float twistTotalAbs = Math.Abs(twistTotal);
|
float twistTotalAbs = Math.Abs(twistTotal);
|
||||||
if (twistTotalAbs > 0.01f)
|
if (twistTotalAbs > 0.01f)
|
||||||
{
|
{
|
||||||
|
@ -739,12 +738,12 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
float skewStart = this.pathCutBegin * 2.0f * this.skew - this.skew;
|
float skewStart = this.pathCutBegin * 2.0f * this.skew - this.skew;
|
||||||
|
|
||||||
// It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end
|
// It's not quite clear what pushY (Y top shear) does, but subtracting it from the start and end
|
||||||
// angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used
|
// angles appears to approximate it's effects on path cut. Likewise, adding it to the angle used
|
||||||
// to calculate the sine for generating the path radius appears to approximate it's effects there
|
// to calculate the sine for generating the path radius appears to approximate it's effects there
|
||||||
// too, but there are some subtle differences in the radius which are noticeable as the prim size
|
// too, but there are some subtle differences in the radius which are noticeable as the prim size
|
||||||
// increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on
|
// increases and it may affect megaprims quite a bit. The effect of the Y top shear parameter on
|
||||||
// the meshes generated with this technique appear nearly identical in shape to the same prims when
|
// the meshes generated with this technique appear nearly identical in shape to the same prims when
|
||||||
// displayed by the viewer.
|
// displayed by the viewer.
|
||||||
|
|
||||||
float startAngle = (twoPi * this.pathCutBegin * this.revolutions) - this.topShearY * 0.9f;
|
float startAngle = (twoPi * this.pathCutBegin * this.revolutions) - this.topShearY * 0.9f;
|
||||||
float endAngle = (twoPi * this.pathCutEnd * this.revolutions) - this.topShearY * 0.9f;
|
float endAngle = (twoPi * this.pathCutEnd * this.revolutions) - this.topShearY * 0.9f;
|
||||||
|
@ -834,7 +833,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
newLayer.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist));
|
newLayer.AddRot(new Quaternion(new Vertex(0.0f, 0.0f, 1.0f), twist));
|
||||||
|
|
||||||
// now orient the rotation of the profile layer relative to it's position on the path
|
// now orient the rotation of the profile layer relative to it's position on the path
|
||||||
// adding taperY to the angle used to generate the quat appears to approximate the viewer
|
// adding taperY to the angle used to generate the quat appears to approximate the viewer
|
||||||
newLayer.AddRot(new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), angle + this.topShearY * 0.9f));
|
newLayer.AddRot(new Quaternion(new Vertex(1.0f, 0.0f, 0.0f), angle + this.topShearY * 0.9f));
|
||||||
newLayer.AddPos(xOffset, yOffset, zOffset);
|
newLayer.AddPos(xOffset, yOffset, zOffset);
|
||||||
|
|
||||||
|
|
|
@ -2296,7 +2296,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
float dist = (float)llVecDist(llGetPos(), pos);
|
float dist = (float)llVecDist(llGetPos(), pos);
|
||||||
if(dist > m_distanceFactor * 10.0f)
|
if (dist > m_distanceFactor * 10.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Instead of using return;, I'm using continue; because in our TaskInventory implementation
|
// Instead of using return;, I'm using continue; because in our TaskInventory implementation
|
||||||
|
@ -7014,10 +7014,10 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
{
|
{
|
||||||
case 5: // DATA_SIM_POS
|
case 5: // DATA_SIM_POS
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString();
|
return LLUUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
reply = new LSL_Types.Vector3(
|
reply = new LSL_Types.Vector3(
|
||||||
info.RegionLocX * Constants.RegionSize,
|
info.RegionLocX * Constants.RegionSize,
|
||||||
info.RegionLocY * Constants.RegionSize,
|
info.RegionLocY * Constants.RegionSize,
|
||||||
|
@ -7031,10 +7031,10 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
break;
|
break;
|
||||||
case 7: // DATA_SIM_RATING
|
case 7: // DATA_SIM_RATING
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString();
|
return LLUUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
int access = info.RegionSettings.Maturity;
|
int access = info.RegionSettings.Maturity;
|
||||||
if (access == 0)
|
if (access == 0)
|
||||||
reply = "PG";
|
reply = "PG";
|
||||||
|
@ -7047,18 +7047,18 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
reply = m_ScriptEngine.World.GetSimulatorVersion();
|
reply = m_ScriptEngine.World.GetSimulatorVersion();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString(); // Raise no event
|
return LLUUID.Zero.ToString(); // Raise no event
|
||||||
}
|
}
|
||||||
LLUUID rq = LLUUID.Random();
|
LLUUID rq = LLUUID.Random();
|
||||||
|
|
||||||
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
|
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.
|
||||||
m_Dataserver.RegisterRequest(m_localID, m_itemID, rq.ToString());
|
m_Dataserver.RegisterRequest(m_localID, m_itemID, rq.ToString());
|
||||||
|
|
||||||
m_ScriptEngine.m_ASYNCLSLCommandManager.
|
m_ScriptEngine.m_ASYNCLSLCommandManager.
|
||||||
m_Dataserver.DataserverReply(rq.ToString(), reply);
|
m_Dataserver.DataserverReply(rq.ToString(), reply);
|
||||||
|
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
@ -8041,12 +8041,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
(line >= 0) &&
|
(line >= 0) &&
|
||||||
(line < notecardLines.Length))
|
(line < notecardLines.Length))
|
||||||
{
|
{
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return notecardLines[line];
|
return notecardLines[line];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2130,7 +2130,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
float dist = (float)llVecMag(llGetPos() - pos);
|
float dist = (float)llVecMag(llGetPos() - pos);
|
||||||
|
|
||||||
if(dist > m_ScriptDistanceFactor * 10.0f)
|
if (dist > m_ScriptDistanceFactor * 10.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -5735,8 +5735,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
||||||
if (remain < 5)
|
if (remain < 5)
|
||||||
return;
|
return;
|
||||||
LSL_Types.LSLInteger light = new LSL_Types.LSLInteger(rules.Data[idx++].ToString());
|
LSL_Types.LSLInteger light = new LSL_Types.LSLInteger(rules.Data[idx++].ToString());
|
||||||
LSL_Types.Vector3 lightcolor =new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
LSL_Types.Vector3 lightcolor = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||||
float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
|
float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||||
float radius = (float)Convert.ToDouble(rules.Data[idx++]);
|
float radius = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||||
float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
|
float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||||
|
@ -6895,10 +6895,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
case 5: // DATA_SIM_POS
|
case 5: // DATA_SIM_POS
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString();
|
return LLUUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
reply = new LSL_Types.Vector3(
|
reply = new LSL_Types.Vector3(
|
||||||
info.RegionLocX * Constants.RegionSize,
|
info.RegionLocX * Constants.RegionSize,
|
||||||
info.RegionLocY * Constants.RegionSize,
|
info.RegionLocY * Constants.RegionSize,
|
||||||
|
@ -6912,10 +6912,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
break;
|
break;
|
||||||
case 7: // DATA_SIM_RATING
|
case 7: // DATA_SIM_RATING
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString();
|
return LLUUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
int access = info.RegionSettings.Maturity;
|
int access = info.RegionSettings.Maturity;
|
||||||
if (access == 0)
|
if (access == 0)
|
||||||
reply = "PG";
|
reply = "PG";
|
||||||
|
@ -6928,7 +6928,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
reply = m_ScriptEngine.World.GetSimulatorVersion();
|
reply = m_ScriptEngine.World.GetSimulatorVersion();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return LLUUID.Zero.ToString(); // Raise no event
|
return LLUUID.Zero.ToString(); // Raise no event
|
||||||
}
|
}
|
||||||
LLUUID rq = LLUUID.Random();
|
LLUUID rq = LLUUID.Random();
|
||||||
|
@ -6939,7 +6939,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
AsyncCommands.
|
AsyncCommands.
|
||||||
DataserverPlugin.DataserverReply(rq.ToString(), reply);
|
DataserverPlugin.DataserverReply(rq.ToString(), reply);
|
||||||
|
|
||||||
// ScriptSleep(1000);
|
// ScriptSleep(1000);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
@ -7910,7 +7910,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
AsyncCommands.
|
AsyncCommands.
|
||||||
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
||||||
NotecardCache.GetLines(item.AssetID).ToString());
|
NotecardCache.GetLines(item.AssetID).ToString());
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
|
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
|
||||||
|
@ -7924,7 +7924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
DataserverPlugin.DataserverReply(id.ToString(),
|
DataserverPlugin.DataserverReply(id.ToString(),
|
||||||
NotecardCache.GetLines(id).ToString());
|
NotecardCache.GetLines(id).ToString());
|
||||||
});
|
});
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7948,7 +7948,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
AsyncCommands.
|
AsyncCommands.
|
||||||
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
DataserverPlugin.DataserverReply(item.AssetID.ToString(),
|
||||||
NotecardCache.GetLine(item.AssetID, line));
|
NotecardCache.GetLine(item.AssetID, line));
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
|
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
|
||||||
|
@ -7963,7 +7963,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
NotecardCache.GetLine(id, line));
|
NotecardCache.GetLine(id, line));
|
||||||
});
|
});
|
||||||
|
|
||||||
// ScriptSleep(100);
|
// ScriptSleep(100);
|
||||||
return tid.ToString();
|
return tid.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
det[0].Key = remoteClient.AgentId;
|
det[0].Key = remoteClient.AgentId;
|
||||||
det[0].Populate(myScriptEngine.World);
|
det[0].Populate(myScriptEngine.World);
|
||||||
|
|
||||||
|
|
||||||
if (originalID == 0)
|
if (originalID == 0)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
|
SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
|
||||||
|
|
Loading…
Reference in New Issue