From 9a1c8db443ee1de3a0153b4ea177280b8036cf6f Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Oct 2010 05:15:47 +0200 Subject: Convert worldview to GET --- .../World/WorldView/WorldViewRequestHandler.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index 5e744bf..bfdcdb4 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView protected Object m_RequestLock = new Object(); public WorldViewRequestHandler(WorldViewModule fmodule, string rid) - : base("POST", "/worldview/" + rid) + : base("GET", "/worldview/" + rid) { m_WorldViewModule = fmodule; } @@ -58,24 +58,28 @@ namespace OpenSim.Region.OptionalModules.World.WorldView public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - StreamReader sr = new StreamReader(requestData); - string body = sr.ReadToEnd(); - sr.Close(); - body = body.Trim(); + httpResponse.ContentType = "image/jpeg"; + +// StreamReader sr = new StreamReader(requestData); +// string body = sr.ReadToEnd(); +// sr.Close(); +// body = body.Trim(); try { lock (m_RequestLock) { Dictionary request = - ServerUtils.ParseQueryString(body); + new Dictionary(); + foreach (string name in httpRequest.QueryString) + request[name] = httpRequest.QueryString[name]; return SendWorldView(request); } } catch (Exception e) { - m_log.Debug("[WORLDVIEW]: Exception {0}" + e.ToString()); + m_log.Debug("[WORLDVIEW]: Exception: " + e.ToString()); } return new Byte[0]; -- cgit v1.1 From d45276b3f6a309f77ddfac1e83dbe2db377883fa Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Oct 2010 05:44:19 +0100 Subject: Add and plumb the usetex URL parameter to worldview. Required but not yet functional --- OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs | 4 ++-- .../OptionalModules/World/WorldView/WorldViewRequestHandler.cs | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs index 55be9ba..d4b7020 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs @@ -104,13 +104,13 @@ namespace OpenSim.Region.OptionalModules.World.WorldView } public byte[] GenerateWorldView(Vector3 pos, Vector3 rot, float fov, - int width, int height) + int width, int height, bool usetex) { if (!m_Enabled) return new Byte[0]; Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, - height); + height, usetex); MemoryStream str = new MemoryStream(); diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index bfdcdb4..f47d9c7 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -96,6 +96,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView float fov; int width; int height; + bool usetex; if (!request.ContainsKey("posX")) return new Byte[0]; @@ -115,6 +116,8 @@ namespace OpenSim.Region.OptionalModules.World.WorldView return new Byte[0]; if (!request.ContainsKey("height")) return new Byte[0]; + if (!request.ContainsKey("usetex")) + return new Byte[0]; try { @@ -127,6 +130,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView fov = Convert.ToSingle(request["fov"]); width = Convert.ToInt32(request["width"]); height = Convert.ToInt32(request["height"]); + usetex = Convert.ToBoolean(request["usetex"]); } catch { @@ -137,7 +141,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView Vector3 rot = new Vector3(rotX, rotY, rotZ); return m_WorldViewModule.GenerateWorldView(pos, rot, fov, width, - height); + height, usetex); } } } -- cgit v1.1