/indra/newview/llworldmapmessage.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 77 lines · 31 code · 10 blank · 36 comment · 0 complexity · b43782794947551f1d0329ba2e0abdec MD5 · raw file

  1. /**
  2. * @file llworldmapmessage.h
  3. * @brief Handling of the messages to the DB made by and for the world map.
  4. *
  5. * $LicenseInfo:firstyear=2003&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLWORLDMAPMESSAGE_H
  27. #define LL_LLWORLDMAPMESSAGE_H
  28. // Handling of messages (send and process) as well as SLURL callback if necessary
  29. class LLMessageSystem;
  30. class LLWorldMapMessage : public LLSingleton<LLWorldMapMessage>
  31. {
  32. public:
  33. typedef boost::function<void(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)>
  34. url_callback_t;
  35. LLWorldMapMessage();
  36. ~LLWorldMapMessage();
  37. // Process incoming answers to map stuff requests
  38. static void processMapBlockReply(LLMessageSystem*, void**);
  39. static void processMapItemReply(LLMessageSystem*, void**);
  40. // Request data for all regions in a rectangular area. Coordinates in grids (i.e. meters / 256).
  41. void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false);
  42. // Various methods to request LLSimInfo data to the simulator and asset DB
  43. void sendNamedRegionRequest(std::string region_name);
  44. void sendNamedRegionRequest(std::string region_name,
  45. url_callback_t callback,
  46. const std::string& callback_url,
  47. bool teleport);
  48. void sendHandleRegionRequest(U64 region_handle,
  49. url_callback_t callback,
  50. const std::string& callback_url,
  51. bool teleport);
  52. // Request item data for regions
  53. // Note: the handle works *only* when requesting agent count (type = MAP_ITEM_AGENT_LOCATIONS). In that case,
  54. // the request will actually be transitting through the spaceserver (all that is done on the sim).
  55. // All other values of type do create a global grid request to the asset DB. So no need to try to get, say,
  56. // the events for one particular region. For such a request, the handle is ignored.
  57. void sendItemRequest(U32 type, U64 handle = 0);
  58. private:
  59. // Search for region (by name or handle) for SLURL processing and teleport
  60. // None of this relies explicitly on the LLWorldMap instance so better handle it here
  61. std::string mSLURLRegionName;
  62. U64 mSLURLRegionHandle;
  63. std::string mSLURL;
  64. url_callback_t mSLURLCallback;
  65. bool mSLURLTeleport;
  66. };
  67. #endif // LL_LLWORLDMAPMESSAGE_H