From a11edceb00b5b86f825bd957bdac9edb91f893dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 Sep 2015 19:54:53 +0100 Subject: seems to compile ( tests comented out) --- .../Connectors/Asset/AssetServicesConnector.cs | 60 +---------------- .../Hypergrid/UserAgentServiceConnector.cs | 4 -- .../Neighbour/NeighbourServicesConnector.cs | 6 -- .../SimianGrid/SimianGridServiceConnector.cs | 77 ---------------------- .../SimianUserAccountServiceConnector.cs | 5 +- .../Simulation/SimulationServiceConnector.cs | 24 +------ .../UserAccounts/UserAccountServicesConnector.cs | 5 +- 7 files changed, 8 insertions(+), 173 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 795ca2e..24f802e 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -275,18 +275,11 @@ namespace OpenSim.Services.Connectors return fullAsset.Data; } -<<<<<<< HEAD - using (RestClient rc = new RestClient(m_ServerURI)) + using (RestClient rc = new RestClient(MapServer(id))) { rc.AddResourcePath("assets"); rc.AddResourcePath(id); rc.AddResourcePath("data"); -======= - RestClient rc = new RestClient(MapServer(id)); - rc.AddResourcePath("assets"); - rc.AddResourcePath(id); - rc.AddResourcePath("data"); ->>>>>>> avn/ubitvar rc.RequestMethod = "GET"; @@ -300,20 +293,11 @@ namespace OpenSim.Services.Connectors byte[] ret = new byte[s.Length]; s.Read(ret, 0, (int)s.Length); -<<<<<<< HEAD return ret; } return null; } -======= - s.Close(); - return ret; - } - - s.Close(); - return null; ->>>>>>> avn/ubitvar } private class QueuedAssetRequest @@ -348,24 +332,13 @@ namespace OpenSim.Services.Connectors List handlers; lock (m_AssetHandlers) { -<<<<<<< HEAD - if (a != null && m_Cache != null) - m_Cache.Cache(a); -======= handlers = m_AssetHandlers[id]; m_AssetHandlers.Remove(id); } ->>>>>>> avn/ubitvar Util.FireAndForget(x => { -<<<<<<< HEAD - handlers = m_AssetHandlers[id]; - m_AssetHandlers.Remove(id); - } - handlers.Invoke(a); - }, m_maxAssetRequestConcurrency, m_Auth); -======= + foreach (AssetRetrievedEx h in handlers) { // Util.FireAndForget(x => @@ -382,8 +355,6 @@ namespace OpenSim.Services.Connectors // if (handlers != null) // handlers.Clear(); ->>>>>>> avn/ubitvar - success = true; } } @@ -510,32 +481,6 @@ namespace OpenSim.Services.Connectors string newID; try { -<<<<<<< HEAD - newID = SynchronousRestObjectRequester.MakeRequest("POST", uri, asset, m_Auth); - } - catch (Exception e) - { - m_log.Warn(string.Format("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1} ", asset.ID, e.Message), e); - return string.Empty; - } - - // TEMPORARY: SRAS returns 'null' when it's asked to store existing assets - if (newID == null) - { - m_log.DebugFormat("[ASSET CONNECTOR]: Storing of asset {0} returned null; assuming the asset already exists", asset.ID); - return asset.ID; - } - - if (string.IsNullOrEmpty(newID)) - return string.Empty; - - asset.ID = newID; - - if (m_Cache != null) - m_Cache.Cache(asset); - - return newID; -======= newID = SynchronousRestObjectRequester. MakeRequest("POST", uri, asset, 25); if (newID == null || newID == "") @@ -588,7 +533,6 @@ namespace OpenSim.Services.Connectors } } return asset.ID; ->>>>>>> avn/ubitvar } public bool UpdateContent(string id, byte[] data) diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 10b8d22..8abd046 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -100,14 +100,10 @@ namespace OpenSim.Services.Connectors.Hypergrid m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); throw new Exception("UserAgent connector init error"); } -<<<<<<< HEAD m_ServerURL = m_ServerURLHost = serviceURI; if (!m_ServerURL.EndsWith("/")) m_ServerURL += "/"; -======= - m_ServerURL = serviceURI; ->>>>>>> avn/ubitvar //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL); } diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index e236ec3..70f1aee 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs @@ -153,15 +153,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { -<<<<<<< HEAD - m_log.Warn(string.Format( - "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1} (uri {2}). Exception {3} ", - thisRegion.RegionName, region.RegionName, uri, e.Message), e); -======= // m_log.WarnFormat( // "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", // thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); ->>>>>>> avn/ubitvar return false; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 6043b70..bd35c6f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -423,83 +423,6 @@ namespace OpenSim.Services.Connectors.SimianGrid #endregion IGridService - private void UploadMapTile(IScene scene) - { - string errorMessage = null; - - // Create a PNG map tile and upload it to the AddMapTile API - byte[] pngData = Utils.EmptyBytes; - IMapImageGenerator tileGenerator = scene.RequestModuleInterface(); - if (tileGenerator == null) - { - m_log.Warn("[SIMIAN GRID CONNECTOR]: Cannot upload PNG map tile without an IMapImageGenerator"); - return; - } - - using (Image mapTile = tileGenerator.CreateMapTile()) - { - using (MemoryStream stream = new MemoryStream()) - { - mapTile.Save(stream, ImageFormat.Png); - pngData = stream.ToArray(); - } - } - - List postParameters = new List() - { - new MultipartForm.Parameter("X", scene.RegionInfo.RegionLocX.ToString()), - new MultipartForm.Parameter("Y", scene.RegionInfo.RegionLocY.ToString()), - new MultipartForm.File("Tile", "tile.png", "image/png", pngData) - }; - - // Make the remote storage request - try - { - HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); - - HttpWebResponse response = MultipartForm.Post(request, postParameters); - using (Stream responseStream = response.GetResponseStream()) - { - string responseStr = null; - - try - { - responseStr = responseStream.GetStreamString(); - OSD responseOSD = OSDParser.Deserialize(responseStr); - if (responseOSD.Type == OSDType.Map) - { - OSDMap responseMap = (OSDMap)responseOSD; - if (responseMap["Success"].AsBoolean()) - m_log.Info("[SIMIAN GRID CONNECTOR]: Uploaded " + pngData.Length + " byte PNG map tile to AddMapTile"); - else - errorMessage = "Upload failed: " + responseMap["Message"].AsString(); - } - else - { - errorMessage = "Response format was invalid:\n" + responseStr; - } - } - catch (Exception ex) - { - if (!String.IsNullOrEmpty(responseStr)) - errorMessage = "Failed to parse the response:\n" + responseStr; - else - errorMessage = "Failed to retrieve the response: " + ex.Message; - } - } - } - catch (WebException ex) - { - errorMessage = ex.Message; - } - - if (!String.IsNullOrEmpty(errorMessage)) - { - m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}", - pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' ')); - } - } - private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled) { NameValueCollection requestArgs = new NameValueCollection diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 08c5c50..563a1e7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -191,15 +191,14 @@ namespace OpenSim.Services.Connectors.SimianGrid return accounts; } -<<<<<<< HEAD public void InvalidateCache(UUID userID) { m_accountCache.Remove(userID); -======= + } + public List GetUserAccountsWhere(UUID scopeID, string query) { return null; ->>>>>>> avn/ubitvar } public bool StoreUserAccount(UserAccount data) diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 28b6de7..493d7e0 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -283,13 +283,8 @@ namespace OpenSim.Services.Connectors.Simulation } -<<<<<<< HEAD + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List featuresAvailable, out string version, out string reason) -======= - /// - /// - public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, out string version, out string reason) ->>>>>>> avn/ubitvar { reason = "Failed to contact destination"; version = "Unknown"; @@ -306,7 +301,6 @@ namespace OpenSim.Services.Connectors.Simulation request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); request.Add("position", OSD.FromString(position.ToString())); request.Add("my_version", OSD.FromString(myversion)); -<<<<<<< HEAD OSDArray features = new OSDArray(); foreach (UUID feature in featuresAvailable) @@ -314,8 +308,6 @@ namespace OpenSim.Services.Connectors.Simulation request.Add("features", features); -======= ->>>>>>> avn/ubitvar if (agentHomeURI != null) request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); @@ -366,8 +358,6 @@ namespace OpenSim.Services.Connectors.Simulation return false; } -<<<<<<< HEAD - featuresAvailable.Clear(); if (result.ContainsKey("features")) @@ -377,12 +367,6 @@ namespace OpenSim.Services.Connectors.Simulation foreach (OSD o in array) featuresAvailable.Add(new UUID(o.AsString())); } -======= - OSDMap resp = (OSDMap)result["_Result"]; - success = resp["success"].AsBoolean(); - reason = resp["reason"].AsString(); ->>>>>>> avn/ubitvar - return success; } catch (Exception e) @@ -467,17 +451,13 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); -<<<<<<< HEAD + OSDMap result = WebUtil.PostToService(uri, args, 40000, false); if (result == null) return false; bool success = result["success"].AsBoolean(); if (!success) -======= - OSDMap response = WebUtil.PostToService(uri, args, 40000); - if (response["Success"] == "False") ->>>>>>> avn/ubitvar return false; } catch (Exception e) diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs index e5fb5a8..15a9fbe 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs @@ -191,14 +191,13 @@ namespace OpenSim.Services.Connectors return accounts; } -<<<<<<< HEAD public void InvalidateCache(UUID userID) { -======= + } + public List GetUserAccountsWhere(UUID scopeID, string where) { return null; // Not implemented for regions ->>>>>>> avn/ubitvar } public virtual bool StoreUserAccount(UserAccount data) -- cgit v1.1