diff options
Diffstat (limited to 'OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs')
-rw-r--r-- | OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs deleted file mode 100644 index 5ce1e79..0000000 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServicesGridMode.cs +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
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.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Framework.Communications.Cache; | ||
35 | using OpenSim.Framework.Servers.HttpServer; | ||
36 | using OpenSim.Region.Communications.OGS1; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | |||
39 | namespace OpenSim.Region.Communications.Hypergrid | ||
40 | { | ||
41 | public class HGGridServicesGridMode : HGGridServices | ||
42 | { | ||
43 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
45 | /// <summary> | ||
46 | /// Encapsulate remote backend services for manipulation of grid regions | ||
47 | /// </summary> | ||
48 | private OGS1GridServices m_remoteBackend = null; | ||
49 | |||
50 | public OGS1GridServices RemoteBackend | ||
51 | { | ||
52 | get { return m_remoteBackend; } | ||
53 | } | ||
54 | |||
55 | |||
56 | public override string gdebugRegionName | ||
57 | { | ||
58 | get { return m_remoteBackend.gdebugRegionName; } | ||
59 | set { m_remoteBackend.gdebugRegionName = value; } | ||
60 | } | ||
61 | |||
62 | public override bool RegionLoginsEnabled | ||
63 | { | ||
64 | get { return m_remoteBackend.RegionLoginsEnabled; } | ||
65 | set { m_remoteBackend.RegionLoginsEnabled = value; } | ||
66 | } | ||
67 | |||
68 | public HGGridServicesGridMode(NetworkServersInfo servers_info, | ||
69 | SceneManager sman, UserProfileCacheService userv) | ||
70 | : base(servers_info, sman) | ||
71 | { | ||
72 | m_remoteBackend = new OGS1GridServices(servers_info); | ||
73 | m_userProfileCache = userv; | ||
74 | } | ||
75 | |||
76 | #region IGridServices interface | ||
77 | |||
78 | public override RegionCommsListener RegisterRegion(RegionInfo regionInfo) | ||
79 | { | ||
80 | if (!regionInfo.RegionID.Equals(UUID.Zero)) | ||
81 | { | ||
82 | m_regionsOnInstance.Add(regionInfo); | ||
83 | return m_remoteBackend.RegisterRegion(regionInfo); | ||
84 | } | ||
85 | else | ||
86 | return base.RegisterRegion(regionInfo); | ||
87 | } | ||
88 | |||
89 | public override bool DeregisterRegion(RegionInfo regionInfo) | ||
90 | { | ||
91 | bool success = base.DeregisterRegion(regionInfo); | ||
92 | if (!success) | ||
93 | success = m_remoteBackend.DeregisterRegion(regionInfo); | ||
94 | return success; | ||
95 | } | ||
96 | |||
97 | public override List<SimpleRegionInfo> RequestNeighbours(uint x, uint y) | ||
98 | { | ||
99 | List<SimpleRegionInfo> neighbours = m_remoteBackend.RequestNeighbours(x, y); | ||
100 | //List<SimpleRegionInfo> remotes = base.RequestNeighbours(x, y); | ||
101 | //neighbours.AddRange(remotes); | ||
102 | |||
103 | return neighbours; | ||
104 | } | ||
105 | |||
106 | public override RegionInfo RequestNeighbourInfo(UUID Region_UUID) | ||
107 | { | ||
108 | RegionInfo info = m_remoteBackend.RequestNeighbourInfo(Region_UUID); | ||
109 | if (info == null) | ||
110 | info = base.RequestNeighbourInfo(Region_UUID); | ||
111 | return info; | ||
112 | } | ||
113 | |||
114 | public override RegionInfo RequestNeighbourInfo(ulong regionHandle) | ||
115 | { | ||
116 | RegionInfo info = base.RequestNeighbourInfo(regionHandle); | ||
117 | if (info == null) | ||
118 | info = m_remoteBackend.RequestNeighbourInfo(regionHandle); | ||
119 | return info; | ||
120 | } | ||
121 | |||
122 | public override RegionInfo RequestClosestRegion(string regionName) | ||
123 | { | ||
124 | RegionInfo info = m_remoteBackend.RequestClosestRegion(regionName); | ||
125 | if (info == null) | ||
126 | info = base.RequestClosestRegion(regionName); | ||
127 | return info; | ||
128 | } | ||
129 | |||
130 | public override List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) | ||
131 | { | ||
132 | List<MapBlockData> neighbours = m_remoteBackend.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); | ||
133 | List<MapBlockData> remotes = base.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); | ||
134 | neighbours.AddRange(remotes); | ||
135 | |||
136 | return neighbours; | ||
137 | } | ||
138 | |||
139 | public override LandData RequestLandData(ulong regionHandle, uint x, uint y) | ||
140 | { | ||
141 | LandData land = m_remoteBackend.RequestLandData(regionHandle, x, y); | ||
142 | if (land == null) | ||
143 | land = base.RequestLandData(regionHandle, x, y); | ||
144 | return land; | ||
145 | } | ||
146 | |||
147 | public override List<RegionInfo> RequestNamedRegions(string name, int maxNumber) | ||
148 | { | ||
149 | List<RegionInfo> infos = m_remoteBackend.RequestNamedRegions(name, maxNumber); | ||
150 | List<RegionInfo> remotes = base.RequestNamedRegions(name, maxNumber); | ||
151 | infos.AddRange(remotes); | ||
152 | return infos; | ||
153 | } | ||
154 | |||
155 | #endregion | ||
156 | |||
157 | |||
158 | } | ||
159 | } | ||