llviewermessage.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /**
  2. * @file llviewermessage.h
  3. * @brief Message system callbacks for viewer.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLVIEWERMESSAGE_H
  33. #define LL_LLVIEWERMESSAGE_H
  34. #include <string>
  35. #include <time.h>
  36. #include "llextendedstatus.h"
  37. #include "llinstantmessage.h"
  38. #include "llinventory.h"
  39. #include "llpointer.h"
  40. #include "lltransactiontypes.h"
  41. #include "lluuid.h"
  42. #include "llmessage.h"
  43. #include "llchat.h"
  44. //
  45. // Forward declarations
  46. //
  47. class LLColor4;
  48. class LLDispatcher;
  49. class LLViewerObject;
  50. class LLViewerRegion;
  51. //
  52. // Prototypes
  53. //
  54. enum InventoryOfferResponse
  55. {
  56. IOR_ACCEPT,
  57. IOR_DECLINE,
  58. IOR_MUTE,
  59. IOR_BUSY,
  60. IOR_MUTED
  61. };
  62. void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount,
  63. bool is_group = false, S32 trx_type = TRANS_GIFT,
  64. const std::string& desc = LLStringUtil::null);
  65. void busy_message (LLMessageSystem* msg, LLUUID from_id);
  66. void process_logout_reply(LLMessageSystem* msg, void**);
  67. void process_layer_data(LLMessageSystem* msg, void**);
  68. void process_derez_ack(LLMessageSystem*, void**);
  69. void process_places_reply(LLMessageSystem* msg, void** data);
  70. void send_sound_trigger(const LLUUID& sound_id, F32 gain);
  71. void process_improved_im(LLMessageSystem* msg, void**);
  72. void process_script_question(LLMessageSystem* msg, void**);
  73. void process_chat_from_simulator(LLMessageSystem* msg, void**);
  74. void add_floater_chat(const LLChat& chat, bool history);
  75. void send_agent_update(bool force_send, bool send_reliable = false);
  76. void process_object_update(LLMessageSystem* msg, void** data);
  77. void process_compressed_object_update(LLMessageSystem* msg, void** data);
  78. void process_cached_object_update(LLMessageSystem* msg, void** data);
  79. void process_terse_object_update_improved(LLMessageSystem* msg, void** data);
  80. void process_object_properties_family(LLMessageSystem* msg, void**);
  81. void add_newly_created_object(const LLUUID& object_id);
  82. void send_simulator_throttle_settings(const LLHost& host);
  83. void process_kill_object(LLMessageSystem* msg, void**);
  84. void process_time_synch(LLMessageSystem* msg, void**);
  85. void process_sound_trigger(LLMessageSystem* msg, void**);
  86. void process_preload_sound(LLMessageSystem* msg, void**);
  87. void process_attached_sound(LLMessageSystem* msg, void**);
  88. void process_attached_sound_gain_change(LLMessageSystem* msg, void**);
  89. void process_health_message(LLMessageSystem* msg, void**);
  90. void process_sim_stats(LLMessageSystem* msg, void**);
  91. void process_avatar_animation(LLMessageSystem* msg, void**);
  92. void process_object_animation(LLMessageSystem* msg, void**);
  93. void process_avatar_appearance(LLMessageSystem* msg, void**);
  94. void process_camera_constraint(LLMessageSystem* msg, void**);
  95. void process_avatar_sit_response(LLMessageSystem* msg, void**);
  96. void process_set_follow_cam_properties(LLMessageSystem* msg, void**);
  97. void process_clear_follow_cam_properties(LLMessageSystem* msg, void**);
  98. void process_name_value(LLMessageSystem* msg, void**);
  99. void process_remove_name_value(LLMessageSystem* msg, void**);
  100. void process_kick_user(LLMessageSystem* msg, void**);
  101. void process_grant_godlike_powers(LLMessageSystem* msg, void**);
  102. void process_economy_data(LLMessageSystem* msg, void**);
  103. void process_money_balance_reply(LLMessageSystem* msg_system, void**);
  104. void process_adjust_balance(LLMessageSystem* msg_system, void**);
  105. bool attempt_standard_notification(LLMessageSystem* msg);
  106. void process_alert_message(LLMessageSystem* msg, void**);
  107. void process_agent_alert_message(LLMessageSystem* msgsystem, void**);
  108. void process_alert_core(const std::string& message, bool modal);
  109. void process_mean_collision_alert_message(LLMessageSystem* msg, void**);
  110. void process_frozen_message(LLMessageSystem* msg, void**);
  111. void process_derez_container(LLMessageSystem* msg, void**);
  112. // Agent movement
  113. void send_complete_agent_movement(const LLHost& sim_host);
  114. void process_agent_movement_complete(LLMessageSystem* msg, void**);
  115. void process_crossed_region(LLMessageSystem* msg, void**);
  116. void process_teleport_start(LLMessageSystem* msg, void**);
  117. void process_teleport_progress(LLMessageSystem* msg, void**);
  118. void process_teleport_failed(LLMessageSystem* msg, void**);
  119. void process_teleport_finish(LLMessageSystem* msg, void**);
  120. void process_teleport_local(LLMessageSystem* msg, void**);
  121. void process_user_sim_location_reply(LLMessageSystem* msg, void**);
  122. void send_simple_im(const LLUUID& to_id, const std::string& message,
  123. EInstantMessage dialog = IM_NOTHING_SPECIAL,
  124. const LLUUID& id = LLUUID::null);
  125. void send_group_notice(const LLUUID& group_id, const std::string& subject,
  126. const std::string& message,
  127. const LLInventoryItem* item);
  128. void send_lures(const LLSD& notification, const LLSD& response,
  129. bool censor_message = true);
  130. void handle_lure(const uuid_vec_t& ids);
  131. // Always from agent and routes through the agent's current simulator
  132. void send_improved_im(const LLUUID& to_id, const std::string& name,
  133. const std::string& message, U8 offline = IM_ONLINE,
  134. EInstantMessage dialog = IM_NOTHING_SPECIAL,
  135. const LLUUID& id = LLUUID::null,
  136. U32 timestamp = NO_TIMESTAMP,
  137. const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET,
  138. S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE);
  139. void process_user_info_reply(LLMessageSystem* msg, void**);
  140. void busy_message(const LLUUID& from_id);
  141. // Function to format the time using the "TimestampFormat" debug setting.
  142. std::string formatted_time(time_t the_time);
  143. void send_places_query(const LLUUID& query_id, const LLUUID& trans_id,
  144. const std::string& query_text, U32 query_flags,
  145. S32 category, const std::string& sim_name);
  146. void process_script_dialog(LLMessageSystem* msg, void**);
  147. void process_load_url(LLMessageSystem* msg, void**);
  148. void process_script_teleport_request(LLMessageSystem* msg, void**);
  149. void process_covenant_reply(LLMessageSystem* msg, void**);
  150. void onCovenantLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type,
  151. void* data, S32 status, LLExtStat);
  152. // Calling cards
  153. void process_offer_callingcard(LLMessageSystem* msg, void**);
  154. void process_accept_callingcard(LLMessageSystem*, void**);
  155. void process_decline_callingcard(LLMessageSystem*, void**);
  156. // Message system exception prototypes
  157. void invalid_message_callback(LLMessageSystem*, void*, EMessageException);
  158. void process_feature_disabled_message(LLMessageSystem* msg, void**);
  159. void process_initiate_download(LLMessageSystem* msg, void**);
  160. // Called from llappviewer.cpp
  161. void start_new_inventory_observer();
  162. void stop_new_inventory_observer();
  163. void open_inventory_offer(const uuid_vec_t& items,
  164. const std::string& from_name);
  165. class LLOfferInfo
  166. {
  167. public:
  168. LLOfferInfo()
  169. : mLogInChat(true)
  170. {
  171. }
  172. LLOfferInfo(const LLSD& sd);
  173. LLOfferInfo(const LLOfferInfo& other);
  174. void extractSLURL();
  175. void forceResponse(InventoryOfferResponse response);
  176. LLSD asLLSD();
  177. void inventoryOfferHandler();
  178. private:
  179. bool inventoryOfferCallback(const LLSD& notification,
  180. const LLSD& response);
  181. void sendReceiveResponse(bool accept);
  182. public:
  183. EInstantMessage mIM;
  184. LLUUID mFromID;
  185. LLUUID mTransactionID;
  186. LLUUID mFolderID;
  187. LLUUID mObjectID;
  188. LLHost mHost;
  189. LLAssetType::EType mType;
  190. std::string mFromName;
  191. std::string mDesc;
  192. std::string mSLURL;
  193. bool mLogInChat;
  194. bool mFromGroup;
  195. bool mFromObject;
  196. };
  197. // Generic message (formerly in llviewergenericmessage.h)
  198. void send_generic_message(const char* method,
  199. const std::vector<std::string>& strings,
  200. const LLUUID& invoice = LLUUID::null);
  201. void process_generic_message(LLMessageSystem* msg, void**);
  202. void process_generic_streaming_message(LLMessageSystem* msg, void**);
  203. void process_large_generic_message(LLMessageSystem* msg, void**);
  204. extern LLDispatcher gGenericDispatcher;
  205. #endif