* Completed a partial port of OpenSim's LSL API. Thank you to everyone on the OpenSim team for their hard work on this incredibly large feature * Added Agent.GetSimulatorPosition() * Corrected default PrimFlags for agents and prims * Stubs for encoding/decoding prim linkset assets * Route chat through the scene * Stub for grid messaging (IM and email) * Add GetTerrainHeightAt(), removed duplicate heightmap storage in Movement.cs * Added a permissions manager stub * Store wind speeds, added functions to get wind speed * Make sure all of the important prim properties are set before creating an object * Lots of new object manipulation functions in scene * Properly clean up event queues on agent exit * Stubbed out a space for a scripting engine * Stubbed out task inventory * Added ScriptingConsole, which allows you to run LSL functions from the chat console * Added new PacketCategory, Messaging, for chat-related packets * Fixed InventoryObject overrides * Added a NotecardCache, useful for the scripting engine and may become generally useful later * Added several helper functions and new members to SimulationObject git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2462 52acb1d6-8a22-11de-b505-999d5b087335
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using ExtensionLoader;
|
|
using HttpServer;
|
|
using OpenMetaverse;
|
|
using OpenMetaverse.Http;
|
|
using OpenMetaverse.StructuredData;
|
|
|
|
namespace Simian.Extensions
|
|
{
|
|
public class CapsManager : IExtension<Simian>, ICapabilitiesProvider
|
|
{
|
|
Simian server;
|
|
CapsServer capsServer;
|
|
|
|
public CapsManager()
|
|
{
|
|
}
|
|
|
|
public void Start(Simian server)
|
|
{
|
|
this.server = server;
|
|
capsServer = new CapsServer(server.HttpServer, @"^/caps/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
|
|
capsServer.Start();
|
|
}
|
|
|
|
public void Stop()
|
|
{
|
|
if (capsServer != null)
|
|
capsServer.Stop();
|
|
}
|
|
|
|
public Uri CreateCapability(CapsRequestCallback localHandler, bool clientCertRequired, object state)
|
|
{
|
|
UUID capID = capsServer.CreateCapability(localHandler, clientCertRequired, state);
|
|
return new Uri(
|
|
(server.SSL ? "https://" : "http://") +
|
|
server.HostName +
|
|
(server.HttpPort == 80 ? String.Empty : ":" + server.HttpPort) +
|
|
"/caps/" + capID.ToString());
|
|
}
|
|
|
|
public Uri CreateCapability(Uri remoteHandler, bool clientCertRequired)
|
|
{
|
|
UUID capID = capsServer.CreateCapability(remoteHandler, clientCertRequired);
|
|
return new Uri(
|
|
(server.SSL ? "https://" : "http://") +
|
|
server.HostName +
|
|
(server.HttpPort == 80 ? String.Empty : ":" + server.HttpPort) +
|
|
"/caps/" + capID.ToString());
|
|
}
|
|
|
|
public bool RemoveCapability(Uri cap)
|
|
{
|
|
string path = cap.PathAndQuery.TrimEnd('/');
|
|
UUID capID;
|
|
|
|
// Parse the capability UUID out of the URI
|
|
if (UUID.TryParse(path.Substring(path.Length - 36), out capID))
|
|
return capsServer.RemoveCapability(capID);
|
|
else
|
|
return false;
|
|
}
|
|
}
|
|
}
|