diff options
Diffstat (limited to 'OpenSim/Server/Handlers')
8 files changed, 376 insertions, 7 deletions
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakes.cs b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs new file mode 100644 index 0000000..d1b2e12 --- /dev/null +++ b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs | |||
@@ -0,0 +1,150 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Diagnostics; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using System.Text; | ||
33 | using System.Threading; | ||
34 | using System.Reflection; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework.Console; | ||
37 | using OpenSim.Server.Base; | ||
38 | using OpenSim.Services.Base; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using Nini.Config; | ||
41 | using log4net; | ||
42 | using OpenMetaverse; | ||
43 | |||
44 | namespace OpenSim.Server.Handlers.BakedTextures | ||
45 | { | ||
46 | public class XBakes : ServiceBase, IBakedTextureService | ||
47 | { | ||
48 | private static readonly ILog m_log = | ||
49 | LogManager.GetLogger( | ||
50 | MethodBase.GetCurrentMethod().DeclaringType); | ||
51 | |||
52 | protected string m_FSBase; | ||
53 | |||
54 | private System.Text.UTF8Encoding utf8encoding = | ||
55 | new System.Text.UTF8Encoding(); | ||
56 | |||
57 | public XBakes(IConfigSource config) : base(config) | ||
58 | { | ||
59 | MainConsole.Instance.Commands.AddCommand("fs", false, | ||
60 | "delete bakes", "delete bakes <ID>", | ||
61 | "Delete agent's baked textures from server", | ||
62 | HandleDeleteBakes); | ||
63 | |||
64 | IConfig assetConfig = config.Configs["BakedTextureService"]; | ||
65 | if (assetConfig == null) | ||
66 | { | ||
67 | throw new Exception("No BakedTextureService configuration"); | ||
68 | } | ||
69 | |||
70 | m_FSBase = assetConfig.GetString("BaseDirectory", String.Empty); | ||
71 | if (m_FSBase == String.Empty) | ||
72 | { | ||
73 | m_log.ErrorFormat("[BAKES]: BaseDirectory not specified"); | ||
74 | throw new Exception("Configuration error"); | ||
75 | } | ||
76 | |||
77 | m_log.Info("[BAKES]: XBakes service enabled"); | ||
78 | } | ||
79 | |||
80 | public string Get(string id) | ||
81 | { | ||
82 | string file = HashToFile(id); | ||
83 | string diskFile = Path.Combine(m_FSBase, file); | ||
84 | |||
85 | if (File.Exists(diskFile)) | ||
86 | { | ||
87 | try | ||
88 | { | ||
89 | byte[] content = File.ReadAllBytes(diskFile); | ||
90 | |||
91 | return utf8encoding.GetString(content); | ||
92 | } | ||
93 | catch | ||
94 | { | ||
95 | } | ||
96 | } | ||
97 | return String.Empty; | ||
98 | } | ||
99 | |||
100 | public void Store(string id, string sdata) | ||
101 | { | ||
102 | string file = HashToFile(id); | ||
103 | string diskFile = Path.Combine(m_FSBase, file); | ||
104 | |||
105 | Directory.CreateDirectory(Path.GetDirectoryName(diskFile)); | ||
106 | |||
107 | File.Delete(diskFile); | ||
108 | |||
109 | byte[] data = utf8encoding.GetBytes(sdata); | ||
110 | FileStream fs = File.Create(diskFile); | ||
111 | |||
112 | fs.Write(data, 0, data.Length); | ||
113 | |||
114 | fs.Close(); | ||
115 | } | ||
116 | |||
117 | private void HandleDeleteBakes(string module, string[] args) | ||
118 | { | ||
119 | if (args.Length < 3) | ||
120 | { | ||
121 | MainConsole.Instance.Output("Syntax: delete bakes <ID>"); | ||
122 | return; | ||
123 | } | ||
124 | |||
125 | string file = HashToFile(args[2]); | ||
126 | string diskFile = Path.Combine(m_FSBase, file); | ||
127 | |||
128 | if (File.Exists(diskFile)) | ||
129 | { | ||
130 | File.Delete(diskFile); | ||
131 | MainConsole.Instance.Output("Bakes deleted"); | ||
132 | return; | ||
133 | } | ||
134 | MainConsole.Instance.Output("Bakes not found"); | ||
135 | } | ||
136 | |||
137 | public string HashToPath(string hash) | ||
138 | { | ||
139 | return Path.Combine(hash.Substring(0, 2), | ||
140 | Path.Combine(hash.Substring(2, 2), | ||
141 | Path.Combine(hash.Substring(4, 2), | ||
142 | hash.Substring(6, 4)))); | ||
143 | } | ||
144 | |||
145 | public string HashToFile(string hash) | ||
146 | { | ||
147 | return Path.Combine(HashToPath(hash), hash); | ||
148 | } | ||
149 | } | ||
150 | } | ||
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs new file mode 100644 index 0000000..fb4b794 --- /dev/null +++ b/OpenSim/Server/Handlers/BakedTextures/XBakesGetHandler.cs | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using Nini.Config; | ||
29 | using log4net; | ||
30 | using System; | ||
31 | using System.IO; | ||
32 | using System.Reflection; | ||
33 | using System.Net; | ||
34 | using System.Text; | ||
35 | using System.Text.RegularExpressions; | ||
36 | using System.Xml; | ||
37 | using System.Xml.Serialization; | ||
38 | using OpenSim.Server.Base; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Framework; | ||
41 | using OpenSim.Framework.Servers.HttpServer; | ||
42 | |||
43 | namespace OpenSim.Server.Handlers.BakedTextures | ||
44 | { | ||
45 | public class BakesServerGetHandler : BaseStreamHandler | ||
46 | { | ||
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
49 | private IBakedTextureService m_BakesService; | ||
50 | private System.Text.UTF8Encoding utf8 = | ||
51 | new System.Text.UTF8Encoding(); | ||
52 | |||
53 | public BakesServerGetHandler(IBakedTextureService service) : | ||
54 | base("GET", "/bakes") | ||
55 | { | ||
56 | m_BakesService = service; | ||
57 | } | ||
58 | |||
59 | public override byte[] Handle(string path, Stream request, | ||
60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
61 | { | ||
62 | string[] p = SplitParams(path); | ||
63 | |||
64 | if (p.Length == 0) | ||
65 | return new byte[0]; | ||
66 | |||
67 | return utf8.GetBytes(m_BakesService.Get(p[0])); | ||
68 | } | ||
69 | } | ||
70 | } | ||
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs new file mode 100644 index 0000000..7bf7641 --- /dev/null +++ b/OpenSim/Server/Handlers/BakedTextures/XBakesHandler.cs | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using Nini.Config; | ||
30 | using OpenSim.Server.Base; | ||
31 | using OpenSim.Services.Interfaces; | ||
32 | using OpenSim.Framework.Servers.HttpServer; | ||
33 | using OpenSim.Server.Handlers.Base; | ||
34 | |||
35 | namespace OpenSim.Server.Handlers.BakedTextures | ||
36 | { | ||
37 | public class XBakesConnector : ServiceConnector | ||
38 | { | ||
39 | private IBakedTextureService m_BakesService; | ||
40 | private string m_ConfigName = "BakedTextureService"; | ||
41 | |||
42 | public XBakesConnector(IConfigSource config, IHttpServer server, string configName) : | ||
43 | base(config, server, configName) | ||
44 | { | ||
45 | if (configName != String.Empty) | ||
46 | m_ConfigName = configName; | ||
47 | |||
48 | IConfig serverConfig = config.Configs[m_ConfigName]; | ||
49 | if (serverConfig == null) | ||
50 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); | ||
51 | |||
52 | string assetService = serverConfig.GetString("LocalServiceModule", | ||
53 | String.Empty); | ||
54 | |||
55 | if (assetService == String.Empty) | ||
56 | throw new Exception("No BakedTextureService in config file"); | ||
57 | |||
58 | Object[] args = new Object[] { config }; | ||
59 | m_BakesService = | ||
60 | ServerUtils.LoadPlugin<IBakedTextureService>(assetService, args); | ||
61 | |||
62 | server.AddStreamHandler(new BakesServerGetHandler(m_BakesService)); | ||
63 | server.AddStreamHandler(new BakesServerPostHandler(m_BakesService)); | ||
64 | } | ||
65 | } | ||
66 | } | ||
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs new file mode 100644 index 0000000..69adb7f --- /dev/null +++ b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using Nini.Config; | ||
29 | using log4net; | ||
30 | using System; | ||
31 | using System.Reflection; | ||
32 | using System.IO; | ||
33 | using System.Net; | ||
34 | using System.Text; | ||
35 | using System.Text.RegularExpressions; | ||
36 | using System.Xml; | ||
37 | using System.Xml.Serialization; | ||
38 | using OpenSim.Server.Base; | ||
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Framework; | ||
41 | using OpenSim.Framework.Servers.HttpServer; | ||
42 | |||
43 | namespace OpenSim.Server.Handlers.BakedTextures | ||
44 | { | ||
45 | public class BakesServerPostHandler : BaseStreamHandler | ||
46 | { | ||
47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
49 | private IBakedTextureService m_BakesService; | ||
50 | |||
51 | private System.Text.UTF8Encoding utf8 = | ||
52 | new System.Text.UTF8Encoding(); | ||
53 | |||
54 | public BakesServerPostHandler(IBakedTextureService service) : | ||
55 | base("POST", "/bakes") | ||
56 | { | ||
57 | m_BakesService = service; | ||
58 | } | ||
59 | |||
60 | public override byte[] Handle(string path, Stream request, | ||
61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
62 | { | ||
63 | string[] p = SplitParams(path); | ||
64 | |||
65 | if (p.Length == 0) | ||
66 | { | ||
67 | return new byte[0]; | ||
68 | } | ||
69 | |||
70 | StreamReader sr = new StreamReader(request); | ||
71 | |||
72 | m_BakesService.Store(p[0], sr.ReadToEnd()); | ||
73 | sr.Close(); | ||
74 | |||
75 | return new byte[0]; | ||
76 | } | ||
77 | } | ||
78 | } | ||
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index c63b409..16d9b7d 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
48 | public class GridServerPostHandler : BaseStreamHandler | 48 | public class GridServerPostHandler : BaseStreamHandler |
49 | { | 49 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | private static string LogHeader = "[GRID HANDLER]"; | ||
51 | 52 | ||
52 | private IGridService m_GridService; | 53 | private IGridService m_GridService; |
53 | 54 | ||
@@ -281,8 +282,8 @@ namespace OpenSim.Server.Handlers.Grid | |||
281 | else | 282 | else |
282 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); | 283 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); |
283 | 284 | ||
285 | // m_log.DebugFormat("{0} GetRegionByPosition: loc=<{1},{2}>", LogHeader, x, y); | ||
284 | GridRegion rinfo = m_GridService.GetRegionByPosition(scopeID, x, y); | 286 | GridRegion rinfo = m_GridService.GetRegionByPosition(scopeID, x, y); |
285 | //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); | ||
286 | 287 | ||
287 | Dictionary<string, object> result = new Dictionary<string, object>(); | 288 | Dictionary<string, object> result = new Dictionary<string, object>(); |
288 | if (rinfo == null) | 289 | if (rinfo == null) |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs index 5d03097..f25e6e0 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -105,6 +105,8 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
105 | hash["uuid"] = regInfo.RegionID.ToString(); | 105 | hash["uuid"] = regInfo.RegionID.ToString(); |
106 | hash["x"] = regInfo.RegionLocX.ToString(); | 106 | hash["x"] = regInfo.RegionLocX.ToString(); |
107 | hash["y"] = regInfo.RegionLocY.ToString(); | 107 | hash["y"] = regInfo.RegionLocY.ToString(); |
108 | hash["size_x"] = regInfo.RegionSizeX.ToString(); | ||
109 | hash["size_y"] = regInfo.RegionSizeY.ToString(); | ||
108 | hash["region_name"] = regInfo.RegionName; | 110 | hash["region_name"] = regInfo.RegionName; |
109 | hash["hostname"] = regInfo.ExternalHostName; | 111 | hash["hostname"] = regInfo.ExternalHostName; |
110 | hash["http_port"] = regInfo.HttpPort.ToString(); | 112 | hash["http_port"] = regInfo.HttpPort.ToString(); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 7137836..15b5b31 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -132,6 +132,8 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
132 | hash["uuid"] = regInfo.RegionID.ToString(); | 132 | hash["uuid"] = regInfo.RegionID.ToString(); |
133 | hash["x"] = regInfo.RegionLocX.ToString(); | 133 | hash["x"] = regInfo.RegionLocX.ToString(); |
134 | hash["y"] = regInfo.RegionLocY.ToString(); | 134 | hash["y"] = regInfo.RegionLocY.ToString(); |
135 | hash["size_x"] = regInfo.RegionSizeX.ToString(); | ||
136 | hash["size_y"] = regInfo.RegionSizeY.ToString(); | ||
135 | hash["region_name"] = regInfo.RegionName; | 137 | hash["region_name"] = regInfo.RegionName; |
136 | hash["hostname"] = regInfo.ExternalHostName; | 138 | hash["hostname"] = regInfo.ExternalHostName; |
137 | hash["http_port"] = regInfo.HttpPort.ToString(); | 139 | hash["http_port"] = regInfo.HttpPort.ToString(); |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index d438fc7..4d1729e 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -116,9 +116,9 @@ namespace OpenSim.Server.Handlers.MapImage | |||
116 | httpResponse.StatusCode = (int)OSHttpStatusCode.ClientErrorBadRequest; | 116 | httpResponse.StatusCode = (int)OSHttpStatusCode.ClientErrorBadRequest; |
117 | return FailureResult("Bad request."); | 117 | return FailureResult("Bad request."); |
118 | } | 118 | } |
119 | int x = 0, y = 0; | 119 | uint x = 0, y = 0; |
120 | Int32.TryParse(request["X"].ToString(), out x); | 120 | UInt32.TryParse(request["X"].ToString(), out x); |
121 | Int32.TryParse(request["Y"].ToString(), out y); | 121 | UInt32.TryParse(request["Y"].ToString(), out y); |
122 | 122 | ||
123 | m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y); | 123 | m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y); |
124 | 124 | ||
@@ -130,7 +130,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
130 | if (m_GridService != null) | 130 | if (m_GridService != null) |
131 | { | 131 | { |
132 | System.Net.IPAddress ipAddr = GetCallerIP(httpRequest); | 132 | System.Net.IPAddress ipAddr = GetCallerIP(httpRequest); |
133 | GridRegion r = m_GridService.GetRegionByPosition(UUID.Zero, x * (int)Constants.RegionSize, y * (int)Constants.RegionSize); | 133 | GridRegion r = m_GridService.GetRegionByPosition(UUID.Zero, (int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y)); |
134 | if (r != null) | 134 | if (r != null) |
135 | { | 135 | { |
136 | if (r.ExternalEndPoint.Address.ToString() != ipAddr.ToString()) | 136 | if (r.ExternalEndPoint.Address.ToString() != ipAddr.ToString()) |
@@ -151,7 +151,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
151 | byte[] data = Convert.FromBase64String(request["DATA"].ToString()); | 151 | byte[] data = Convert.FromBase64String(request["DATA"].ToString()); |
152 | 152 | ||
153 | string reason = string.Empty; | 153 | string reason = string.Empty; |
154 | bool result = m_MapService.AddMapTile(x, y, data, out reason); | 154 | bool result = m_MapService.AddMapTile((int)x, (int)y, data, out reason); |
155 | 155 | ||
156 | if (result) | 156 | if (result) |
157 | return SuccessResult(); | 157 | return SuccessResult(); |