From d607914f6a7e0ef7890ae229474a1ad90511868f Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 24 Jun 2007 18:40:02 +0000 Subject: Hopefully enabled the OGS commsManager --- OpenSim/OpenSim.Caches/AssetCache.cs | 1 + OpenSim/OpenSim.Region/Caps.cs | 52 +++++++++++++++++++++++++---- OpenSim/OpenSim/OpenSim.csproj | 65 +++++++++++++++++++++--------------- OpenSim/OpenSim/OpenSimMain.cs | 5 +-- 4 files changed, 87 insertions(+), 36 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/OpenSim.Caches/AssetCache.cs b/OpenSim/OpenSim.Caches/AssetCache.cs index f310752..d0cc370 100644 --- a/OpenSim/OpenSim.Caches/AssetCache.cs +++ b/OpenSim/OpenSim.Caches/AssetCache.cs @@ -39,6 +39,7 @@ using OpenSim.Framework.Utilities; namespace OpenSim.Caches { public delegate void DownloadComplete(AssetCache.TextureSender sender); + /// /// Manages local cache of assets and their sending to viewers. /// diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs index 59f24e3..7ec0c75 100644 --- a/OpenSim/OpenSim.Region/Caps.cs +++ b/OpenSim/OpenSim.Region/Caps.cs @@ -22,9 +22,11 @@ namespace OpenSim.Region private string mapLayerPath = "0001/"; private string newInventory = "0002/"; private string requestTexture = "0003/"; + private string eventQueue = "0100/"; private BaseHttpServer httpListener; private LLUUID agentID; private AssetCache assetCache; + private int eventQueueCount = 1; public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) { @@ -45,6 +47,7 @@ namespace OpenSim.Region httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + requestPath, CapsRequest); httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + mapLayerPath, MapLayer); httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + newInventory, NewAgentInventory); + httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + eventQueue, ProcessEventQueue); } /// @@ -74,6 +77,7 @@ namespace OpenSim.Region capURLS += "MapLayerhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + ""; capURLS += "NewFileAgentInventoryhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + ""; //capURLS += "RequestTextureDownloadhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + ""; + capURLS += "EventQueueGethttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + ""; return capURLS; } @@ -116,6 +120,40 @@ namespace OpenSim.Region return res; } + public string ProcessEventQueue(string request, string path, string param) + { + Console.WriteLine("event queue request " + request); + string res = ""; + res = this.CreateEmptyEventResponse(); + return res; + } + + public string CreateEstablishAgentComms(string caps, string ipAddressPort) + { + string res = "id" + eventQueueCount + ""; + res += "events"; + res += "messageEstablishAgentCommunication"; + res += "body"; + res += "sim-ip-and-port"+ipAddressPort +""; + res += "seed-capability"+caps+""; + res += "agent-id"+this.agentID.ToStringHyphenated()+""; + res += ""; + res += ""; + res += ""; + eventQueueCount++; + return res; + } + + public string CreateEmptyEventResponse() + { + string res = "id" + eventQueueCount + ""; + res += "events"; + res += ""; + res += ""; + eventQueueCount++; + return res; + } + public string NewAgentInventory(string request, string path, string param) { //Console.WriteLine("received upload request:"+ request); @@ -123,13 +161,13 @@ namespace OpenSim.Region LLUUID newAsset = LLUUID.Random(); LLUUID newInvItem = LLUUID.Random(); string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); - AssetUploader uploader = new AssetUploader(newAsset,newInvItem, uploaderPath, this.httpListener); + AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; Console.WriteLine("uploader url is " + uploaderURL); res += ""; - res += "uploader"+uploaderURL +""; - //res += "successtrue"; + res += "uploader" + uploaderURL + ""; + //res += "successtrue"; res += "stateupload"; res += ""; uploader.OnUpLoad += this.UploadHandler; @@ -138,7 +176,7 @@ namespace OpenSim.Region public void UploadHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data) { - // Console.WriteLine("upload handler called"); + // Console.WriteLine("upload handler called"); AssetBase asset; asset = new AssetBase(); asset.FullID = assetID; @@ -147,7 +185,7 @@ namespace OpenSim.Region asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); asset.Data = data; this.assetCache.AddAsset(asset); - + } public class AssetUploader @@ -181,12 +219,12 @@ namespace OpenSim.Region res += ""; Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); - httpListener.RemoveRestHandler("POST", "/CAPS/"+uploaderPath); + httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); if (OnUpLoad != null) { OnUpLoad(newAssetID, inv, data); } - + /*FileStream fs = File.Create("upload.jp2"); BinaryWriter bw = new BinaryWriter(fs); bw.Write(data); diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj index a8cadc0..91eb474 100644 --- a/OpenSim/OpenSim/OpenSim.csproj +++ b/OpenSim/OpenSim/OpenSim.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {438A9556-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim @@ -15,9 +16,11 @@ IE50 false Exe - + + OpenSim - + + @@ -28,7 +31,8 @@ TRACE;DEBUG - + + True 4096 False @@ -37,7 +41,8 @@ False False 4 - + + False @@ -46,7 +51,8 @@ TRACE - + + False 4096 True @@ -55,108 +61,113 @@ False False 4 - + + - + ..\..\bin\Axiom.MathLib.dll False - + ..\..\bin\Db4objects.Db4o.dll False - + ..\..\bin\libsecondlife.dll False - + System.dll False - + System.Xml.dll False + + {C1F40DD4-A68B-4233-9142-CE236775A3CE} + OpenGrid.Framework.Communications.OGS1 + OpenGrid.Framework.Communications {683344D5-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenGrid.Framework.UserManagement {DA9A7391-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Caches {1938EB12-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.GenericConfig.Xml {E88EF749-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.LocalCommunications {79CED992-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Physics.Manager {8BE16150-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Region {196916AF-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.RegionServer {632E1BFD-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Servers {8BB20F0A-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Terrain.BasicTerrain {2270B8FE-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False XMLRPC {8E81D43C-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -174,4 +185,4 @@ - + \ No newline at end of file diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs index e2dddaf..50da5a1 100644 --- a/OpenSim/OpenSim/OpenSimMain.cs +++ b/OpenSim/OpenSim/OpenSimMain.cs @@ -54,6 +54,7 @@ using OpenSim.Servers; using OpenSim.GenericConfig; using OpenGrid.Framework.Communications; using OpenSim.LocalCommunications; +using OpenGrid.Framework.Communications.OGS1; namespace OpenSim { @@ -114,7 +115,7 @@ namespace OpenSim else { this.SetupRemoteGridServers(); - this.commsManager = new CommunicationsLocal(this.serversData.DefaultHomeLocX, this.serversData.DefaultHomeLocY); //shouldn't be using the local communications manager + this.commsManager = new GridCommsManager(); } startuptime = DateTime.Now; @@ -267,7 +268,7 @@ namespace OpenSim protected override void SetupHttpListener() { - httpServer = new BaseHttpServer(9000); //regionData[0].IPListenPort); + httpServer = new BaseHttpServer(this.serversData.HttpListenerPort); //regionData[0].IPListenPort); if (!this.m_sandbox) { -- cgit v1.1