HGCommunicationsGridMode.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * Copyright (c) 2008, Contributors. All rights reserved.
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without modification,
  6. * are permitted provided that the following conditions are met:
  7. *
  8. * * Redistributions of source code must retain the above copyright notice,
  9. * this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright notice,
  11. * this list of conditions and the following disclaimer in the documentation
  12. * and/or other materials provided with the distribution.
  13. * * Neither the name of the Organizations nor the names of Individual
  14. * Contributors may be used to endorse or promote products derived from
  15. * this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  20. * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  22. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  23. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  25. * OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. */
  28. using System.Reflection;
  29. using log4net;
  30. using OpenSim.Framework;
  31. using OpenSim.Framework.Communications;
  32. using OpenSim.Framework.Communications.Cache;
  33. using OpenSim.Framework.Servers;
  34. using OpenSim.Region.Framework.Scenes;
  35. namespace OpenSim.Region.Communications.Hypergrid
  36. {
  37. public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1
  38. {
  39. private static readonly ILog m_log
  40. = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  41. IHyperlink m_osw = null;
  42. public IHyperlink HGServices
  43. {
  44. get { return m_osw; }
  45. }
  46. public HGCommunicationsGridMode(
  47. NetworkServersInfo serversInfo, BaseHttpServer httpServer,
  48. IAssetCache assetCache, SceneManager sman, LibraryRootFolder libraryRootFolder)
  49. : base(serversInfo, httpServer, assetCache, false, libraryRootFolder)
  50. {
  51. // From constructor at CommunicationsOGS1
  52. HGGridServices gridInterComms = new HGGridServicesGridMode(serversInfo, httpServer, assetCache, sman, m_userProfileCacheService);
  53. m_gridService = gridInterComms;
  54. m_osw = gridInterComms;
  55. // The HG InventoryService always uses secure handlers
  56. HGInventoryService invService = new HGInventoryService(serversInfo.InventoryURL, this.m_userProfileCacheService, true);
  57. AddSecureInventoryService(invService);
  58. m_defaultInventoryHost = invService.Host;
  59. if (SecureInventoryService != null)
  60. m_log.Info("[HG] SecureInventoryService.");
  61. else
  62. m_log.Info("[HG] Non-secureInventoryService.");
  63. HGUserServices userServices = new HGUserServices(this);
  64. m_userService = userServices;
  65. m_messageService = userServices;
  66. m_avatarService = (IAvatarService)m_userService;
  67. }
  68. }
  69. }