aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorUbitUmarov2014-07-16 16:22:32 +0100
committerUbitUmarov2014-07-16 16:22:32 +0100
commit19d33c571d8f48501ecb2409814d5b95b2b4be23 (patch)
tree8e08805a71ebea81de75b5805105f325e0defa0f /OpenSim/Services/Connectors
parentMerge branch 'avination-current' into ubitwork (diff)
parentMerge branch 'avination-current' of ssh://3dhosting.de/var/git/careminster in... (diff)
downloadopensim-SC-19d33c571d8f48501ecb2409814d5b95b2b4be23.zip
opensim-SC-19d33c571d8f48501ecb2409814d5b95b2b4be23.tar.gz
opensim-SC-19d33c571d8f48501ecb2409814d5b95b2b4be23.tar.bz2
opensim-SC-19d33c571d8f48501ecb2409814d5b95b2b4be23.tar.xz
Merge branch 'avination-current' into ubitwork
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs8
-rw-r--r--OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs60
2 files changed, 67 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 4b502b7..8b702e0 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -137,7 +137,13 @@ namespace OpenSim.Services.Connectors
137 137
138 string prefix = id.Substring(0, 2).ToLower(); 138 string prefix = id.Substring(0, 2).ToLower();
139 139
140 string host = m_UriMap[prefix]; 140 string host;
141
142 // HG URLs will not be valid UUIDS
143 if (m_UriMap.ContainsKey(prefix))
144 host = m_UriMap[prefix];
145 else
146 host = m_UriMap["00"];
141 147
142 serverUri.Host = host; 148 serverUri.Host = host;
143 149
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
index 30bfb70..267dd71 100644
--- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
+++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
@@ -86,6 +86,66 @@ namespace OpenSim.Services.Connectors
86 m_ServerURI = serviceURI.TrimEnd('/'); 86 m_ServerURI = serviceURI.TrimEnd('/');
87 } 87 }
88 88
89 public bool RemoveMapTile(int x, int y, out string reason)
90 {
91 reason = string.Empty;
92 int tickstart = Util.EnvironmentTickCount();
93 Dictionary<string, object> sendData = new Dictionary<string, object>();
94 sendData["X"] = x.ToString();
95 sendData["Y"] = y.ToString();
96
97 string reqString = ServerUtils.BuildQueryString(sendData);
98 string uri = m_ServerURI + "/removemap";
99
100 try
101 {
102 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
103 uri,
104 reqString);
105 if (reply != string.Empty)
106 {
107 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
108
109 if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "success"))
110 {
111 return true;
112 }
113 else if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "failure"))
114 {
115 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Delete failed: {0}", replyData["Message"].ToString());
116 reason = replyData["Message"].ToString();
117 return false;
118 }
119 else if (!replyData.ContainsKey("Result"))
120 {
121 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: reply data does not contain result field");
122 }
123 else
124 {
125 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: unexpected result {0}", replyData["Result"].ToString());
126 reason = "Unexpected result " + replyData["Result"].ToString();
127 }
128
129 }
130 else
131 {
132 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply");
133 }
134 }
135 catch (Exception e)
136 {
137 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting map server at {0}: {1}", uri, e.Message);
138 }
139 finally
140 {
141 // This just dumps a warning for any operation that takes more than 100 ms
142 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
143 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile deleted in {0}ms", tickdiff);
144 }
145
146 return false;
147 }
148
89 public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) 149 public bool AddMapTile(int x, int y, byte[] jpgData, out string reason)
90 { 150 {
91 reason = string.Empty; 151 reason = string.Empty;