PageRenderTime 313ms CodeModel.GetById 151ms app.highlight 4ms RepoModel.GetById 157ms app.codeStats 0ms

/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
27#ifndef LL_LLWORLDMAPMESSAGE_H
28#define LL_LLWORLDMAPMESSAGE_H
29
30// Handling of messages (send and process) as well as SLURL callback if necessary
31class LLMessageSystem;
32
33class LLWorldMapMessage : public LLSingleton<LLWorldMapMessage>
34{
35public:
36	typedef boost::function<void(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)>
37		url_callback_t;
38
39	LLWorldMapMessage();
40	~LLWorldMapMessage();
41
42	// Process incoming answers to map stuff requests
43	static void processMapBlockReply(LLMessageSystem*, void**);
44	static void processMapItemReply(LLMessageSystem*, void**);
45
46	// Request data for all regions in a rectangular area. Coordinates in grids (i.e. meters / 256).
47	void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false);
48
49	// Various methods to request LLSimInfo data to the simulator and asset DB
50	void sendNamedRegionRequest(std::string region_name);
51	void sendNamedRegionRequest(std::string region_name, 
52		url_callback_t callback,
53		const std::string& callback_url,
54		bool teleport);
55	void sendHandleRegionRequest(U64 region_handle, 
56		url_callback_t callback,
57		const std::string& callback_url,
58		bool teleport);
59
60	// Request item data for regions
61	// Note: the handle works *only* when requesting agent count (type = MAP_ITEM_AGENT_LOCATIONS). In that case,
62	// the request will actually be transitting through the spaceserver (all that is done on the sim).
63	// All other values of type do create a global grid request to the asset DB. So no need to try to get, say,
64	// the events for one particular region. For such a request, the handle is ignored.
65	void sendItemRequest(U32 type, U64 handle = 0);
66
67private:
68	// Search for region (by name or handle) for SLURL processing and teleport
69	// None of this relies explicitly on the LLWorldMap instance so better handle it here
70	std::string		mSLURLRegionName;
71	U64				mSLURLRegionHandle;
72	std::string		mSLURL;
73	url_callback_t	mSLURLCallback;
74	bool			mSLURLTeleport;
75};
76
77#endif // LL_LLWORLDMAPMESSAGE_H