public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal ["UntrustedSimulatorMessage"] = CapsUtil.CreateCAPS("UntrustedSimulatorMessage", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal ["UntrustedSimulatorMessage"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(UntrustedSimulatorMessage(agentID, request)); })); return(retVal); }
/// <summary> /// Set up the CAPS for friend conferencing /// </summary> /// <param name = "agentID"></param> /// <param name = "caps"></param> public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["ChatSessionRequest"] = CapsUtil.CreateCAPS("ChatSessionRequest", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal["ChatSessionRequest"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ProcessChatSessionRequest(request, agentID)); })); return(retVal); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["DispatchOpenRegionSettings"] = CapsUtil.CreateCAPS("DispatchOpenRegionSettings", ""); //Sets the OpenRegionSettings server.AddStreamHandler(new RestHTTPHandler("POST", retVal["DispatchOpenRegionSettings"], delegate(Hashtable m_dhttpMethod) { return(DispatchOpenRegionSettings(m_dhttpMethod, agentID)); })); return(retVal); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["SimConsoleAsync"] = CapsUtil.CreateCAPS("SimConsoleAsync", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal["SimConsoleAsync"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(SimConsoleAsyncResponder(request, agentID)); })); return(retVal); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["DispatchOpenRegionSettings"] = CapsUtil.CreateCAPS("DispatchOpenRegionSettings", ""); //Sets the OpenRegionSettings server.AddStreamHandler(new GenericStreamHandler("POST", retVal["DispatchOpenRegionSettings"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(DispatchOpenRegionSettings(request, agentID)); })); return(retVal); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["GetObjectPhysicsData"] = CapsUtil.CreateCAPS("GetObjectPhysicsData", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal["GetObjectPhysicsData"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(GetObjectPhysicsData(agentID, request)); })); return(retVal); }
// OnRegisterCaps is invoked via the scene.EventManager // everytime WhiteCore hands out capabilities to a client // (login, region crossing). We contribute two capabilities to // the set of capabilities handed back to the client: // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. // // ProvisionVoiceAccountRequest allows the client to obtain // the voice account credentials for the avatar it is // controlling (e.g., user name, password, etc). // // ParcelVoiceInfoRequest is invoked whenever the client // changes from one region or parcel to another. // // Note that OnRegisterCaps is called here via a closure // delegate containing the scene of the respective region (see // Initialise()). public OSDMap OnRegisterCaps(IScene scene, UUID agentID, IHttpServer caps) { OSDMap retVal = new OSDMap(); retVal["ProvisionVoiceAccountRequest"] = CapsUtil.CreateCAPS("ProvisionVoiceAccountRequest", ""); caps.AddStreamHandler(new GenericStreamHandler("POST", retVal["ProvisionVoiceAccountRequest"], (path, request, httpRequest, httpResponse) => ProvisionVoiceAccountRequest(scene, agentID))); retVal["ParcelVoiceInfoRequest"] = CapsUtil.CreateCAPS("ParcelVoiceInfoRequest", ""); caps.AddStreamHandler(new GenericStreamHandler("POST", retVal["ParcelVoiceInfoRequest"], (path, request, httpRequest, httpResponse) => ParcelVoiceInfoRequest(scene, agentID))); return(retVal); }
public void RegisterCaps(UUID agentID, Caps caps) { string homeLocationCap = CapsUtil.CreateCAPS("HomeLocation", String.Empty); // OpenSimulator CAPs infrastructure seems to be somewhat hostile towards any CAP that requires both GET // and POST handlers, so we first set up a POST handler normally and then add a GET/PUT handler via MainServer IRequestHandler homeLocationRequestHandler = new RestStreamHandler( "POST", homeLocationCap, (request, path, param, httpRequest, httpResponse) => HomeLocation(request, agentID), "HomeLocation", null); MainServer.Instance.AddStreamHandler(homeLocationRequestHandler); caps.RegisterHandler("HomeLocation", homeLocationRequestHandler); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0}", agentID); OSDMap retVal = new OSDMap(); retVal["ViewerStats"] = CapsUtil.CreateCAPS("ViewerStats", ""); server.AddStreamHandler(new RestStreamHandler("POST", retVal["ViewerStats"], delegate(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ViewerStatsReport(request, path, param, agentID)); })); return(retVal); }
/// <summary> /// Not really informing the region. Just filling out the response fields related to the region. /// </summary> /// <param name="sim"></param> /// <param name="user"></param> /// <param name="response"></param> /// <returns>true if the region was successfully contacted, false otherwise</returns> protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) { IPEndPoint endPoint = regionInfo.ExternalEndPoint; response.SimAddress = endPoint.Address.ToString(); response.SimPort = (uint)endPoint.Port; response.RegionX = regionInfo.RegionLocX; response.RegionY = regionInfo.RegionLocY; response.SimHttpPort = regionInfo.HttpPort; string capsPath = CapsUtil.GetRandomCapsObjectPath(); string capsSeedPath = CapsUtil.GetCapsSeedPath(capsPath); // Don't use the following! It Fails for logging into any region not on the same port as the http server! // Kept here so it doesn't happen again! // response.SeedCapability = regionInfo.ServerURI + capsSeedPath; string seedcap = "http://"; if (m_serversInfo.HttpUsesSSL) { // For NAT string host = NetworkUtil.GetHostFor(remoteClient.Address, m_serversInfo.HttpSSLCN); seedcap = "https://" + host + ":" + m_serversInfo.httpSSLPort + capsSeedPath; } else { // For NAT string host = NetworkUtil.GetHostFor(remoteClient.Address, regionInfo.ExternalHostName); seedcap = "http://" + host + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; } response.SeedCapability = seedcap; // Notify the target of an incoming user m_log.InfoFormat( "[LOGIN]: Telling {0} @ {1},{2} ({3}) to prepare for client connection", regionInfo.RegionName, response.RegionX, response.RegionY, regionInfo.ServerURI); // Update agent with target sim user.CurrentAgent.Region = regionInfo.RegionID; user.CurrentAgent.Handle = regionInfo.RegionHandle; return(true); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["ServerReleaseNotes"] = CapsUtil.CreateCAPS("ServerReleaseNotes", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ServerReleaseNotes"], delegate(Hashtable m_dhttpMethod) { return(ProcessServerReleaseNotes(m_dhttpMethod, agentID)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ServerReleaseNotes"], m_dhttpMethod => ProcessServerReleaseNotes(m_dhttpMethod, agentID))); #endif retVal["CopyInventoryFromNotecard"] = CapsUtil.CreateCAPS("CopyInventoryFromNotecard", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["CopyInventoryFromNotecard"], delegate(Hashtable m_dhttpMethod) { return(CopyInventoryFromNotecard(m_dhttpMethod, agentID)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["CopyInventoryFromNotecard"], m_dhttpMethod => CopyInventoryFromNotecard(m_dhttpMethod, agentID))); #endif // note: this seems to be pointed to the CopyInventoryFromNotecard function?? I looked but didn't find anything similar retVal["ExportObject"] = CapsUtil.CreateCAPS("ExportObject", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ExportObject"], delegate(Hashtable m_dhttpMethod) { return(CopyInventoryFromNotecard(m_dhttpMethod, agentID)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ExportObject"], m_dhttpMethod => CopyInventoryFromNotecard(m_dhttpMethod, agentID))); #endif return(retVal); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["UploadObjectAsset"] = CapsUtil.CreateCAPS("UploadObjectAsset", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["UploadObjectAsset"], delegate(Hashtable m_dhttpMethod) { return(ProcessAdd(m_dhttpMethod, agentID)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["UploadObjectAsset"], m_dhttpMethod => ProcessAdd(m_dhttpMethod, agentID))); #endif return(retVal); }
OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["SendUserReportWithScreenshot"] = CapsUtil.CreateCAPS("SendUserReportWithScreenshot", ""); retVal["SendUserReport"] = retVal["SendUserReportWithScreenshot"]; //Region Server bound server.AddStreamHandler(new GenericStreamHandler( "POST", retVal["SendUserReportWithScreenshot"], delegate( string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ProcessSendUserReportWithScreenshot(agentID, path, request, httpRequest, httpResponse)); } )); return(retVal); }
private OSDMap EventManager_OnRegisterCaps(UUID agentID, IHttpServer httpServer) { OSDMap map = new OSDMap(); map["ServerFeatures"] = CapsUtil.CreateCAPS("ServerFeatures", ""); httpServer.AddStreamHandler(new GenericStreamHandler("POST", map["ServerFeatures"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(SetServerFeature(request, agentID)); })); httpServer.AddStreamHandler(new GenericStreamHandler("GET", map["ServerFeatures"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(GetServerFeature(request, agentID)); })); return(map); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["GetObjectPhysicsData"] = CapsUtil.CreateCAPS("GetObjectPhysicsData", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["GetObjectPhysicsData"], delegate(Hashtable m_dhttpMethod) { return(GetObjectPhysicsData(agentID, m_dhttpMethod)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["GetObjectPhysicsData"], m_dhttpMethod => GetObjectPhysicsData(agentID, m_dhttpMethod))); #endif return(retVal); }
OSDMap EventManager_OnRegisterCaps(UUID agentID, IHttpServer httpServer) { OSDMap map = new OSDMap(); map["ServerFeatures"] = CapsUtil.CreateCAPS("ServerFeatures", ""); httpServer.AddStreamHandler(new RestHTTPHandler("POST", map["ServerFeatures"], delegate(Hashtable m_dhttpMethod) { return(SetServerFeature(m_dhttpMethod, agentID)); })); httpServer.AddStreamHandler(new RestHTTPHandler("GET", map["ServerFeatures"], delegate(Hashtable m_dhttpMethod) { return(GetServerFeature(m_dhttpMethod, agentID)); })); return(map); }
private OSDMap EventManager_OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["EnvironmentSettings"] = CapsUtil.CreateCAPS("EnvironmentSettings", ""); //Sets the windlight settings server.AddStreamHandler(new GenericStreamHandler("POST", retVal["EnvironmentSettings"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(SetEnvironment(request, agentID)); })); //Sets the windlight settings server.AddStreamHandler(new GenericStreamHandler("GET", retVal["EnvironmentSettings"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(EnvironmentSettings(agentID)); })); return(retVal); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["UntrustedSimulatorMessage"] = CapsUtil.CreateCAPS("UntrustedSimulatorMessage", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["UntrustedSimulatorMessage"], delegate(Hashtable m_dhttpMethod) { return(UntrustedSimulatorMessage(agentID, m_dhttpMethod)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["UntrustedSimulatorMessage"], m_dhttpMethod => UntrustedSimulatorMessage(agentID, m_dhttpMethod))); #endif return(retVal); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["SimConsoleAsync"] = CapsUtil.CreateCAPS("SimConsoleAsync", ""); #if (!ISWIN) server.AddStreamHandler(new RestHTTPHandler("POST", retVal["SimConsoleAsync"], delegate(Hashtable m_dhttpMethod) { return(SimConsoleAsyncResponder(m_dhttpMethod, agentID)); })); #else server.AddStreamHandler(new RestHTTPHandler("POST", retVal["SimConsoleAsync"], m_dhttpMethod => SimConsoleAsyncResponder(m_dhttpMethod, agentID))); #endif return(retVal); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["ObjectAdd"] = CapsUtil.CreateCAPS("ObjectAdd", ""); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ObjectAdd"], delegate(Hashtable m_dhttpMethod) { return(ProcessAdd(m_dhttpMethod, agentID)); })); retVal["ServerReleaseNotes"] = CapsUtil.CreateCAPS("ServerReleaseNotes", ""); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["ServerReleaseNotes"], delegate(Hashtable m_dhttpMethod) { return(ProcessServerReleaseNotes(m_dhttpMethod, agentID)); })); return(retVal); }
// OnRegisterCaps is invoked via the scene.EventManager // everytime OpenSim hands out capabilities to a client // (login, region crossing). We contribute two capabilities to // the set of capabilities handed back to the client: // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. // // ProvisionVoiceAccountRequest allows the client to obtain // the voice account credentials for the avatar it is // controlling (e.g., user name, password, etc). // // ParcelVoiceInfoRequest is invoked whenever the client // changes from one region or parcel to another. // // Note that OnRegisterCaps is called here via a closure // delegate containing the scene of the respective region (see // Initialise()). public OSDMap OnRegisterCaps(Scene scene, UUID agentID, IHttpServer caps) { m_log.DebugFormat("[MurmurVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); OSDMap retVal = new OSDMap(); retVal["ProvisionVoiceAccountRequest"] = CapsUtil.CreateCAPS("ProvisionVoiceAccountRequest", m_provisionVoiceAccountRequestPath); caps.AddStreamHandler(new RestStreamHandler("POST", retVal["ProvisionVoiceAccountRequest"], delegate(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ProvisionVoiceAccountRequest(scene, request, path, param, agentID)); })); retVal["ParcelVoiceInfoRequest"] = CapsUtil.CreateCAPS("ParcelVoiceInfoRequest", m_parcelVoiceInfoRequestPath); caps.AddStreamHandler(new RestStreamHandler("POST", retVal["ParcelVoiceInfoRequest"], delegate(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ParcelVoiceInfoRequest(scene, request, path, param, agentID)); })); retVal["ChatSessionRequest"] = CapsUtil.CreateCAPS("ChatSessionRequest", m_chatSessionRequestPath); caps.AddStreamHandler(new RestStreamHandler("POST", retVal["ChatSessionRequest"], delegate(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ChatSessionRequest(scene, request, path, param, agentID)); })); //For naali retVal["mumble_server_info"] = CapsUtil.CreateCAPS("mumble_server_info", m_chatSessionRequestPath); caps.AddStreamHandler(new RestStreamHandler("GET", retVal["mumble_server_info"], delegate(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(RestGetMumbleServerInfo(scene, request, path, param, httpRequest, httpResponse)); })); return(retVal); }
private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, AvatarAppearance avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string ipaddress, string viewer, string channel, string mac, string id0) { AgentCircuitData aCircuit = new AgentCircuitData(); aCircuit.AgentID = account.PrincipalID; if (avatar != null) { aCircuit.Appearance = new AvatarAppearance(avatar); } else { aCircuit.Appearance = new AvatarAppearance(account.PrincipalID); } //aCircuit.BaseFolder = irrelevant aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); aCircuit.child = false; // the first login agent is root aCircuit.ChildrenCapSeeds = new Dictionary <ulong, string>(); aCircuit.circuitcode = circuit; aCircuit.firstname = account.FirstName; //aCircuit.InventoryFolder = irrelevant aCircuit.lastname = account.LastName; aCircuit.SecureSessionID = secureSession; aCircuit.SessionID = session; aCircuit.startpos = position; aCircuit.IPAddress = ipaddress; aCircuit.Viewer = viewer; aCircuit.Channel = channel; aCircuit.Mac = mac; aCircuit.Id0 = id0; SetServiceURLs(aCircuit, account); return(aCircuit); //m_UserAgentService.LoginAgentToGrid(aCircuit, GatekeeperServiceConnector, region, out reason); //if (simConnector.CreateAgent(region, aCircuit, 0, out reason)) // return aCircuit; //return null; }
/// <summary> /// Fix That Idiots bug not calling public void initialize /// </summary> /// <param name="service"></param> public void RegisterCaps(IRegionClientCapsService service) { IConfig displayconfig = service.ClientCaps.Registry.RequestModuleInterface <ISimulationBase>().ConfigSource.Configs[ "DisplayNames"]; if (displayconfig == null) { return; } display_update_enabled = displayconfig.GetString("UpdateTimeEnabled", display_update_enabled); display_update_days = displayconfig.GetDouble("UpdateTimeSet", display_update_days); MainConsole.Instance.Info("[DisplayNames] ini config: Enabled = " + display_update_enabled + " Can Update in = " + display_update_days + " Days"); IConfig displayNamesConfig = service.ClientCaps.Registry.RequestModuleInterface <ISimulationBase>().ConfigSource.Configs[ "DisplayNamesModule"]; if (displayNamesConfig != null) { if (!displayNamesConfig.GetBoolean("Enabled", true)) { return; } string bannedNamesString = displayNamesConfig.GetString("BannedUserNames", ""); if (bannedNamesString != "") { bannedNames = new List <string>(bannedNamesString.Split(',')); } } m_service = service; m_profileConnector = Framework.Utilities.DataManager.RequestPlugin <IProfileConnector>(); m_eventQueue = service.Registry.RequestModuleInterface <IEventQueueService>(); m_userService = service.Registry.RequestModuleInterface <IUserAccountService>(); string post = CapsUtil.CreateCAPS("SetDisplayName", ""); service.AddStreamHandler("SetDisplayName", new GenericStreamHandler("POST", post, ProcessSetDisplayName)); post = CapsUtil.CreateCAPS("GetDisplayNames", ""); service.AddStreamHandler("GetDisplayNames", new GenericStreamHandler("GET", post, ProcessGetDisplayName)); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["SimConsole"] = CapsUtil.CreateCAPS("SimConsole", ""); retVal["SimConsoleAsync"] = CapsUtil.CreateCAPS("SimConsoleAsync", ""); //This message is depriated, but we still have it around for now, feel free to remove sometime in the future server.AddStreamHandler(new RestHTTPHandler("POST", retVal["SimConsole"], delegate(Hashtable m_dhttpMethod) { return(SimConsoleResponder(m_dhttpMethod, agentID)); })); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["SimConsoleAsync"], delegate(Hashtable m_dhttpMethod) { return(SimConsoleAsyncResponder(m_dhttpMethod, agentID)); })); return(retVal); }
/// <summary> /// Set up the CAPS for display names /// </summary> /// <param name="agentID"></param> /// <param name="caps"></param> public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["SetDisplayName"] = CapsUtil.CreateCAPS("SetDisplayName", ""); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["SetDisplayName"], delegate(Hashtable m_dhttpMethod) { return(ProcessSetDisplayName(m_dhttpMethod, agentID)); })); retVal["GetDisplayNames"] = CapsUtil.CreateCAPS("GetDisplayNames", ""); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["GetDisplayNames"], delegate(Hashtable m_dhttpMethod) { return(ProcessGetDisplayName(m_dhttpMethod, agentID)); })); return(retVal); }
public OSDMap OnRegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["DispatchWindLightSettings"] = CapsUtil.CreateCAPS("DispatchWindLightSettings", ""); //Sets the windlight settings server.AddStreamHandler(new RestHTTPHandler("POST", retVal["DispatchWindLightSettings"], delegate(Hashtable m_dhttpMethod) { return(DispatchWindLightSettings(m_dhttpMethod, agentID)); })); retVal["RetrieveWindLightSettings"] = CapsUtil.CreateCAPS("RetrieveWindLightSettings", ""); //Retrieves the windlight settings for a specifc parcel or region server.AddStreamHandler(new RestHTTPHandler("POST", retVal["RetrieveWindLightSettings"], delegate(Hashtable m_dhttpMethod) { return(RetrieveWindLightSettings(m_dhttpMethod, agentID)); })); return(retVal); }
private void AddCapsHandler(AgentCircuitData circuit) { //Used by incoming (home) agents from HG #if (!ISWIN) MainServer.Instance.AddStreamHandler(new RestStreamHandler("POST", CapsUtil.GetCapsSeedPath(circuit.CapsPath), delegate(string request, string path, string param2, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(CapsRequest(request, path, param2, httpRequest, httpResponse, circuit.ServiceURLs["IncomingCAPSHandler"].ToString())); })); #else MainServer.Instance.AddStreamHandler(new RestStreamHandler("POST", CapsUtil.GetCapsSeedPath(circuit.CapsPath), (request, path, param2, httpRequest, httpResponse) => CapsRequest(request, path, param2, httpRequest, httpResponse, circuit.ServiceURLs[ "IncomingCAPSHandler"].ToString()))); #endif }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["ServerReleaseNotes"] = CapsUtil.CreateCAPS("ServerReleaseNotes", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal["ServerReleaseNotes"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(ProcessServerReleaseNotes(agentID)); })); retVal["CopyInventoryFromNotecard"] = CapsUtil.CreateCAPS("CopyInventoryFromNotecard", ""); server.AddStreamHandler(new GenericStreamHandler("POST", retVal["CopyInventoryFromNotecard"], delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(CopyInventoryFromNotecard(request, agentID)); })); return(retVal); }
protected object OnGenericEvent(string FunctionName, object parameters) { if (FunctionName == "NewUserConnection") { ICapsService service = m_scene.RequestModuleInterface <ICapsService>(); if (service != null) { object[] obj = (object[])parameters; OSDMap param = (OSDMap)obj[0]; AgentCircuitData circuit = (AgentCircuitData)obj[1]; circuit.child = false; //ONLY USE ROOT AGENTS service.CreateCAPS(circuit.AgentID, CapsUtil.GetCapsSeedPath(circuit.CapsPath), m_scene.RegionInfo.RegionHandle, true, circuit); //We ONLY use root agents because of OpenSim's inability to send the correct data IClientCapsService clientCaps = service.GetClientCapsService(circuit.AgentID); if (clientCaps != null) { IRegionClientCapsService regionCaps = clientCaps.GetCapsService(m_scene.RegionInfo.RegionHandle); if (regionCaps != null) { regionCaps.AddCAPS((OSDMap)param["CapsUrls"]); } } } } else if (FunctionName == "UserStatusChange") { UserInfo info = (UserInfo)parameters; if (!info.IsOnline) //Logging out { ICapsService service = m_scene.RequestModuleInterface <ICapsService>(); if (service != null) { service.RemoveCAPS(UUID.Parse(info.UserID)); } } } return(null); }
public OSDMap RegisterCaps(UUID agentID, IHttpServer server) { OSDMap retVal = new OSDMap(); retVal["UploadObjectAsset"] = CapsUtil.CreateCAPS("UploadObjectAsset", ""); server.AddStreamHandler(new RestHTTPHandler("POST", retVal["UploadObjectAsset"], delegate(Hashtable m_dhttpMethod) { return(ProcessAdd(m_dhttpMethod, agentID)); })); /* * caps.RegisterHandler("NewFileAgentInventoryVariablePrice", * * new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST", * "/CAPS/" + capID.ToString(), * delegate(LLSDAssetUploadRequest req) * { * return NewAgentInventoryRequest(req,agentID); * })); */ return(retVal); }