29 using System.Collections.Generic;
30 using System.Reflection;
32 using OpenSim.Services.Interfaces;
34 using OpenSim.Server.Base;
35 using OpenSim.Framework.Servers.HttpServer;
36 using OpenSim.Framework;
37 using OpenSim.Region.Framework.Scenes;
42 namespace OpenSim.
Region.CoreModules.World.Estate
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 m_EstateModule = module;
57 Dictionary<string, object> sendData =
new Dictionary<string, object>();
58 sendData[
"METHOD"] =
"teleport_home_one_user";
60 sendData[
"EstateID"] = EstateID.ToString();
61 sendData[
"PreyID"] = PreyID.ToString();
63 SendToEstate(EstateID, sendData);
68 Dictionary<string, object> sendData =
new Dictionary<string, object>();
69 sendData[
"METHOD"] =
"teleport_home_all_users";
71 sendData[
"EstateID"] = EstateID.ToString();
73 SendToEstate(EstateID, sendData);
78 Dictionary<string, object> sendData =
new Dictionary<string, object>();
79 sendData[
"METHOD"] =
"update_covenant";
81 sendData[
"CovenantID"] = CovenantID.ToString();
82 sendData[
"EstateID"] = EstateID.ToString();
86 foreach (
Scene s
in m_EstateModule.Scenes)
89 s.RegionInfo.RegionSettings.Covenant = CovenantID;
93 SendToEstate(EstateID, sendData);
100 Dictionary<string, object> sendData =
new Dictionary<string, object>();
101 sendData[
"METHOD"] =
"update_estate";
103 sendData[
"EstateID"] = EstateID.ToString();
107 foreach (
Scene s
in m_EstateModule.Scenes)
110 s.ReloadEstateData();
113 SendToEstate(EstateID, sendData);
120 Dictionary<string, object> sendData =
new Dictionary<string, object>();
121 sendData[
"METHOD"] =
"estate_message";
123 sendData[
"EstateID"] = EstateID.ToString();
124 sendData[
"FromID"] = FromID.ToString();
125 sendData[
"FromName"] = FromName;
126 sendData[
"Message"] = Message;
128 SendToEstate(EstateID, sendData);
131 private void SendToEstate(uint EstateID, Dictionary<string, object> sendData)
133 List<UUID> regions = m_EstateModule.Scenes[0].GetEstateRegions((int)EstateID);
135 UUID ScopeID = UUID.Zero;
139 lock (m_EstateModule.Scenes)
141 foreach (
Scene s
in m_EstateModule.Scenes)
148 ScopeID = s.RegionInfo.ScopeID;
149 regions.Remove(s.RegionInfo.RegionID);
158 if (ScopeID == UUID.Zero)
159 ScopeID = m_EstateModule.Scenes[0].RegionInfo.ScopeID;
163 List<string> done =
new List<string>();
167 foreach (UUID regionID
in regions)
169 GridRegion region = m_EstateModule.Scenes[0].GridService.GetRegionByUUID(ScopeID, regionID);
172 string url =
"http://" + region.ExternalHostName +
":" + region.HttpPort;
173 if (done.Contains(url))
176 Call(region, sendData);
182 private bool Call(
GridRegion region, Dictionary<string, object> sendData)
184 string reqString = ServerUtils.BuildQueryString(sendData);
188 string url =
"http://" + region.ExternalHostName +
":" + region.HttpPort;
189 string reply = SynchronousRestFormsRequester.MakeRequest(
"POST",
192 if (reply !=
string.Empty)
194 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
196 if (replyData.ContainsKey(
"RESULT"))
198 if (replyData[
"RESULT"].ToString().ToLower() ==
"true")
204 m_log.DebugFormat(
"[XESTATE CONNECTOR]: reply data does not contain result field");
208 m_log.DebugFormat(
"[XESTATE CONNECTOR]: received empty reply");
212 m_log.DebugFormat(
"[XESTATE CONNECTOR]: Exception when contacting remote sim: {0}", e.Message);
void SendTeleportHomeAllUsers(uint EstateID)
EstateSettings EstateSettings
void SendEstateMessage(uint EstateID, UUID FromID, string FromName, string Message)
OpenSim.Services.Interfaces.GridRegion GridRegion
XEstateModule m_EstateModule
EstateConnector(XEstateModule module)
bool SendUpdateEstate(uint EstateID)
void SendTeleportHomeOneUser(uint EstateID, UUID PreyID)
virtual RegionInfo RegionInfo
bool SendUpdateCovenant(uint EstateID, UUID CovenantID)