SceneCommunicationService.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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 OpenSim 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.Net;
  31. using libsecondlife;
  32. using OpenSim.Framework;
  33. using OpenSim.Framework.Communications;
  34. using OpenSim.Framework.Console;
  35. namespace OpenSim.Region.Environment.Scenes
  36. {
  37. public delegate void KillObjectDelegate(uint localID);
  38. public class SceneCommunicationService //one instance per region
  39. {
  40. private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  41. protected CommunicationsManager m_commsProvider;
  42. protected RegionInfo m_regionInfo;
  43. protected RegionCommsListener regionCommsHost;
  44. public event AgentCrossing OnAvatarCrossingIntoRegion;
  45. public event ExpectUserDelegate OnExpectUser;
  46. public event ExpectPrimDelegate OnExpectPrim;
  47. public event CloseAgentConnection OnCloseAgentConnection;
  48. public event PrimCrossing OnPrimCrossingIntoRegion;
  49. public event RegionUp OnRegionUp;
  50. public event ChildAgentUpdate OnChildAgentUpdate;
  51. public KillObjectDelegate KillObject;
  52. public string _debugRegionName = String.Empty;
  53. public string debugRegionName
  54. {
  55. get { return _debugRegionName; }
  56. set { _debugRegionName = value; }
  57. }
  58. public SceneCommunicationService(CommunicationsManager commsMan)
  59. {
  60. m_commsProvider = commsMan;
  61. m_commsProvider.GridService.gdebugRegionName = _debugRegionName;
  62. m_commsProvider.InterRegion.rdebugRegionName = _debugRegionName;
  63. }
  64. public void RegisterRegion(RegionInfo regionInfos)
  65. {
  66. m_regionInfo = regionInfos;
  67. regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo);
  68. if (regionCommsHost != null)
  69. {
  70. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
  71. regionCommsHost.debugRegionName = _debugRegionName;
  72. regionCommsHost.OnExpectPrim += IncomingPrimCrossing;
  73. regionCommsHost.OnExpectUser += NewUserConnection;
  74. regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
  75. regionCommsHost.OnCloseAgentConnection += CloseConnection;
  76. regionCommsHost.OnRegionUp += newRegionUp;
  77. regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
  78. }
  79. else
  80. {
  81. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
  82. }
  83. }
  84. public void Close()
  85. {
  86. if (regionCommsHost != null)
  87. {
  88. regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
  89. regionCommsHost.OnRegionUp -= newRegionUp;
  90. regionCommsHost.OnExpectUser -= NewUserConnection;
  91. regionCommsHost.OnExpectPrim -= IncomingPrimCrossing;
  92. regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
  93. regionCommsHost.OnCloseAgentConnection -= CloseConnection;
  94. m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
  95. regionCommsHost = null;
  96. }
  97. }
  98. #region CommsManager Event handlers
  99. /// <summary>
  100. ///
  101. /// </summary>
  102. /// <param name="regionHandle"></param>
  103. /// <param name="agent"></param>
  104. ///
  105. protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent)
  106. {
  107. if (OnExpectUser != null)
  108. {
  109. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
  110. OnExpectUser(regionHandle, agent);
  111. }
  112. }
  113. protected bool newRegionUp(RegionInfo region)
  114. {
  115. if (OnRegionUp != null)
  116. {
  117. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName);
  118. OnRegionUp(region);
  119. }
  120. return true;
  121. }
  122. protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
  123. {
  124. if (OnChildAgentUpdate != null)
  125. OnChildAgentUpdate(regionHandle, cAgentData);
  126. return true;
  127. }
  128. protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
  129. {
  130. if (OnAvatarCrossingIntoRegion != null)
  131. {
  132. OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying);
  133. }
  134. }
  135. protected void IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData)
  136. {
  137. if (OnExpectPrim != null)
  138. {
  139. OnExpectPrim(regionHandle, primID, objXMLData);
  140. }
  141. }
  142. protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
  143. {
  144. if (OnPrimCrossingIntoRegion != null)
  145. {
  146. OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical);
  147. }
  148. }
  149. protected bool CloseConnection(ulong regionHandle, LLUUID agentID)
  150. {
  151. m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString());
  152. if (OnCloseAgentConnection != null)
  153. {
  154. return OnCloseAgentConnection(regionHandle, agentID);
  155. }
  156. return false;
  157. }
  158. #endregion
  159. #region Inform Client of Neighbours
  160. private delegate void InformClientOfNeighbourDelegate(
  161. ScenePresence avatar, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint);
  162. private void InformClientOfNeighbourCompleted(IAsyncResult iar)
  163. {
  164. InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState;
  165. icon.EndInvoke(iar);
  166. }
  167. /// <summary>
  168. /// Async compnent for informing client of which neighbours exists
  169. /// </summary>
  170. /// <remarks>
  171. /// This needs to run asynchronesously, as a network timeout may block the thread for a long while
  172. /// </remarks>
  173. /// <param name="remoteClient"></param>
  174. /// <param name="a"></param>
  175. /// <param name="regionHandle"></param>
  176. /// <param name="endPoint"></param>
  177. private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, ulong regionHandle,
  178. IPEndPoint endPoint)
  179. {
  180. m_log.Info("[INTERGRID]: Starting to inform client about neighbours");
  181. bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, a);
  182. if (regionAccepted)
  183. {
  184. avatar.ControllingClient.InformClientOfNeighbour(regionHandle, endPoint);
  185. avatar.AddNeighbourRegion(regionHandle);
  186. m_log.Info("[INTERGRID]: Completed inform client about neighbours");
  187. }
  188. }
  189. public void RequestNeighbors(RegionInfo region)
  190. {
  191. List<SimpleRegionInfo> neighbours =
  192. m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
  193. //IPEndPoint blah = new IPEndPoint();
  194. //blah.Address = region.RemotingAddress;
  195. //blah.Port = region.RemotingPort;
  196. }
  197. /// <summary>
  198. /// This informs all neighboring regions about agent "avatar".
  199. /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
  200. /// </summary>
  201. public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours)
  202. {
  203. List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
  204. //m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
  205. for (int i = 0; i < lstneighbours.Count; i++)
  206. {
  207. // We don't want to keep sending to regions that consistently fail on comms.
  208. if (!(lstneighbours[i].commFailTF))
  209. {
  210. neighbours.Add(new SimpleRegionInfo(lstneighbours[i]));
  211. }
  212. }
  213. // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be
  214. // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/
  215. neighbours =
  216. m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
  217. if (neighbours != null)
  218. {
  219. for (int i = 0; i < neighbours.Count; i++)
  220. {
  221. AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
  222. agent.BaseFolder = LLUUID.Zero;
  223. agent.InventoryFolder = LLUUID.Zero;
  224. agent.startpos = new LLVector3(128, 128, 70);
  225. agent.child = true;
  226. InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
  227. d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint,
  228. InformClientOfNeighbourCompleted,
  229. d);
  230. }
  231. }
  232. }
  233. /// <summary>
  234. /// This informs a single neighboring region about agent "avatar".
  235. /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
  236. /// </summary>
  237. public void InformNeighborChildAgent(ScenePresence avatar, RegionInfo region, List<RegionInfo> neighbours)
  238. {
  239. AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
  240. agent.BaseFolder = LLUUID.Zero;
  241. agent.InventoryFolder = LLUUID.Zero;
  242. agent.startpos = new LLVector3(128, 128, 70);
  243. agent.child = true;
  244. InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
  245. d.BeginInvoke(avatar, agent, region.RegionHandle, region.ExternalEndPoint,
  246. InformClientOfNeighbourCompleted,
  247. d);
  248. }
  249. #endregion
  250. public delegate void InformNeighbourThatRegionUpDelegate(RegionInfo region, ulong regionhandle);
  251. private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar)
  252. {
  253. InformNeighbourThatRegionUpDelegate icon = (InformNeighbourThatRegionUpDelegate) iar.AsyncState;
  254. icon.EndInvoke(iar);
  255. }
  256. private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle)
  257. {
  258. m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here");
  259. bool regionAccepted =
  260. m_commsProvider.InterRegion.RegionUp((new SearializableRegionInfo(region)), regionhandle);
  261. if (regionAccepted)
  262. {
  263. m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
  264. }
  265. else
  266. {
  267. m_log.Info("[INTERGRID]: Failed to inform neighbors that I'm here");
  268. }
  269. }
  270. /// <summary>
  271. /// Called by scene when region is initialized (not always when it's listening for agents)
  272. /// This is an inter-region message that informs the surrounding neighbors that the sim is up.
  273. /// </summary>
  274. public void InformNeighborsThatRegionisUp(RegionInfo region)
  275. {
  276. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
  277. List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
  278. // This stays uncached because we don't already know about our neighbors at this point.
  279. neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
  280. if (neighbours != null)
  281. {
  282. for (int i = 0; i < neighbours.Count; i++)
  283. {
  284. InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
  285. d.BeginInvoke(region, neighbours[i].RegionHandle,
  286. InformNeighborsThatRegionisUpCompleted,
  287. d);
  288. }
  289. }
  290. //bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
  291. }
  292. public delegate void SendChildAgentDataUpdateDelegate(ChildAgentDataUpdate cAgentData, ScenePresence presence);
  293. /// <summary>
  294. /// This informs all neighboring regions about the settings of it's child agent.
  295. /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
  296. ///
  297. /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc.
  298. ///
  299. /// </summary>
  300. private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence)
  301. {
  302. //m_log.Info("[INTERGRID]: Informing neighbors about my agent.");
  303. try
  304. {
  305. foreach (ulong regionHandle in presence.KnownChildRegions)
  306. {
  307. bool regionAccepted = m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle, cAgentData);
  308. if (regionAccepted)
  309. {
  310. //m_log.Info("[INTERGRID]: Completed sending a neighbor an update about my agent");
  311. }
  312. else
  313. {
  314. //m_log.Info("[INTERGRID]: Failed sending a neighbor an update about my agent");
  315. }
  316. }
  317. }
  318. catch (System.InvalidOperationException)
  319. {
  320. // We're ignoring a collection was modified error because this data gets old and outdated fast.
  321. }
  322. }
  323. private void SendChildAgentDataUpdateCompleted(IAsyncResult iar)
  324. {
  325. SendChildAgentDataUpdateDelegate icon = (SendChildAgentDataUpdateDelegate) iar.AsyncState;
  326. icon.EndInvoke(iar);
  327. }
  328. public void SendChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, ScenePresence presence)
  329. {
  330. // This assumes that we know what our neighbors are.
  331. SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
  332. d.BeginInvoke(cAgentData,presence,
  333. SendChildAgentDataUpdateCompleted,
  334. d);
  335. }
  336. public delegate void SendCloseChildAgentDelegate( ScenePresence presence);
  337. /// <summary>
  338. /// This Closes child agents on neighboring regions
  339. /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
  340. /// </summary>
  341. private void SendCloseChildAgentAsync(ScenePresence presence)
  342. {
  343. foreach (ulong regionHandle in presence.KnownChildRegions)
  344. {
  345. bool regionAccepted = m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, presence.ControllingClient.AgentId);
  346. if (regionAccepted)
  347. {
  348. m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor");
  349. presence.RemoveNeighbourRegion(regionHandle);
  350. }
  351. else
  352. {
  353. m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor");
  354. }
  355. }
  356. }
  357. private void SendCloseChildAgentCompleted(IAsyncResult iar)
  358. {
  359. SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState;
  360. icon.EndInvoke(iar);
  361. }
  362. public void SendCloseChildAgentConnections(ScenePresence presence)
  363. {
  364. // This assumes that we know what our neighbors are.
  365. SendCloseChildAgentDelegate d = SendCloseChildAgentAsync;
  366. d.BeginInvoke(presence,
  367. SendCloseChildAgentCompleted,
  368. d);
  369. }
  370. /// <summary>
  371. /// Helper function to request neighbors from grid-comms
  372. /// </summary>
  373. /// <param name="regionHandle"></param>
  374. /// <returns></returns>
  375. public virtual RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
  376. {
  377. //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionHandle.ToString());
  378. return m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
  379. }
  380. /// <summary>
  381. /// Requests map blocks in area of minX, maxX, minY, MaxY in world cordinates
  382. /// </summary>
  383. /// <param name="minX"></param>
  384. /// <param name="minY"></param>
  385. /// <param name="maxX"></param>
  386. /// <param name="maxY"></param>
  387. public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY)
  388. {
  389. List<MapBlockData> mapBlocks;
  390. mapBlocks = m_commsProvider.GridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, minX + 4, minY + 4);
  391. remoteClient.SendMapBlock(mapBlocks);
  392. }
  393. /// <summary>
  394. ///
  395. /// </summary>
  396. /// <param name="remoteClient"></param>
  397. /// <param name="RegionHandle"></param>
  398. /// <param name="position"></param>
  399. /// <param name="lookAt"></param>
  400. /// <param name="flags"></param>
  401. public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, LLVector3 position,
  402. LLVector3 lookAt, uint flags)
  403. {
  404. bool destRegionUp = false;
  405. if (regionHandle == m_regionInfo.RegionHandle)
  406. {
  407. avatar.ControllingClient.SendTeleportLocationStart();
  408. avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags);
  409. avatar.Teleport(position);
  410. }
  411. else
  412. {
  413. RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle);
  414. if (reg != null)
  415. {
  416. avatar.ControllingClient.SendTeleportLocationStart();
  417. AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
  418. agent.BaseFolder = LLUUID.Zero;
  419. agent.InventoryFolder = LLUUID.Zero;
  420. agent.startpos = position;
  421. agent.child = true;
  422. if (reg.RemotingAddress != "" && reg.RemotingPort != 0)
  423. {
  424. // region is remote. see if it is up
  425. m_commsProvider.InterRegion.CheckRegion(reg.RemotingAddress, reg.RemotingPort);
  426. destRegionUp = m_commsProvider.InterRegion.Available;
  427. }
  428. else
  429. {
  430. // assume local regions are always up
  431. destRegionUp = true;
  432. }
  433. if(destRegionUp)
  434. {
  435. avatar.Close();
  436. m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent);
  437. m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId,
  438. position, false);
  439. AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo();
  440. string capsPath = Util.GetCapsURL(avatar.ControllingClient.AgentId);
  441. avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4),
  442. capsPath);
  443. avatar.MakeChildAgent();
  444. if (KillObject != null)
  445. {
  446. KillObject(avatar.LocalId);
  447. }
  448. uint newRegionX = (uint)(regionHandle >> 40);
  449. uint newRegionY = (((uint)(regionHandle)) >> 8);
  450. uint oldRegionX = (uint)(m_regionInfo.RegionHandle >> 40);
  451. uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
  452. if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)
  453. {
  454. SendCloseChildAgentConnections(avatar);
  455. }
  456. }
  457. else
  458. {
  459. avatar.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
  460. }
  461. }
  462. }
  463. }
  464. /// <summary>
  465. ///
  466. /// </summary>
  467. /// <param name="regionhandle"></param>
  468. /// <param name="agentID"></param>
  469. /// <param name="position"></param>
  470. public bool CrossToNeighbouringRegion(ulong regionhandle, LLUUID agentID, LLVector3 position, bool isFlying)
  471. {
  472. return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
  473. }
  474. public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, string objData)
  475. {
  476. return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData);
  477. }
  478. public Dictionary<string, string> GetGridSettings()
  479. {
  480. return m_commsProvider.GridService.GetGridSettings();
  481. }
  482. public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz)
  483. {
  484. m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz);
  485. }
  486. public void ClearUserAgent(LLUUID avatarID)
  487. {
  488. m_commsProvider.UserService.clearUserAgent(avatarID);
  489. }
  490. public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
  491. {
  492. m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms);
  493. }
  494. public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
  495. {
  496. m_commsProvider.UpdateUserFriendPerms(friendlistowner, friend, perms);
  497. }
  498. public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
  499. {
  500. m_commsProvider.RemoveUserFriend(friendlistowner, friend);
  501. }
  502. public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
  503. {
  504. return m_commsProvider.GetUserFriendList(friendlistowner);
  505. }
  506. public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
  507. {
  508. return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
  509. }
  510. public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
  511. {
  512. return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
  513. }
  514. }
  515. }