diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerreputation.cpp | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/linden/indra/newview/llviewerreputation.cpp b/linden/indra/newview/llviewerreputation.cpp deleted file mode 100644 index 3ee4ab3..0000000 --- a/linden/indra/newview/llviewerreputation.cpp +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | /** | ||
2 | * @file llviewerreputation.cpp | ||
3 | * @brief Viewer-side reputation system handling. | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #include "llviewerprecompiledheaders.h" | ||
29 | |||
30 | #include "llviewerreputation.h" | ||
31 | |||
32 | // linden library includes | ||
33 | #include "llerror.h" | ||
34 | #include "llnamevalue.h" | ||
35 | #include "message.h" | ||
36 | #include "lluuid.h" | ||
37 | #include "llinstantmessage.h" | ||
38 | #include "lldbstrings.h" | ||
39 | |||
40 | // viewer includes | ||
41 | #include "llagent.h" | ||
42 | #include "llviewerregion.h" | ||
43 | |||
44 | // constants | ||
45 | const F32 REP_AGENT_SCORE_POS = 1.0f; // positive rating changes score by this much | ||
46 | const F32 REP_AGENT_SCORE_NEG = -1.0f; | ||
47 | const F32 REP_OBJECT_SCORE_POS = 1.0f; | ||
48 | const F32 REP_OBJECT_SCORE_NEG = -1.0f; | ||
49 | |||
50 | |||
51 | // Send a reputation assignment for an agent. | ||
52 | // Forward through the receiving agent's simulator. | ||
53 | void send_reputation_agent_assign(const LLUUID& rator_id, | ||
54 | const LLUUID& ratee_id, | ||
55 | F32 behavior, | ||
56 | F32 appearance, | ||
57 | F32 building, | ||
58 | const char* text) | ||
59 | { | ||
60 | LLMessageSystem* msg = gMessageSystem; | ||
61 | if (!msg) return; | ||
62 | |||
63 | msg->newMessageFast(_PREHASH_ReputationAgentAssign); | ||
64 | msg->nextBlockFast(_PREHASH_DataBlock); | ||
65 | msg->addUUIDFast(_PREHASH_RatorID, rator_id ); | ||
66 | msg->addUUIDFast(_PREHASH_RateeID, ratee_id ); | ||
67 | msg->addF32Fast(_PREHASH_Behavior, behavior ); | ||
68 | msg->addF32Fast(_PREHASH_Appearance, appearance ); | ||
69 | msg->addF32Fast(_PREHASH_Building, building ); | ||
70 | msg->sendReliable( gAgent.getRegion()->getHost() ); | ||
71 | |||
72 | // Send instant message to the person rated. | ||
73 | LLString name; | ||
74 | gAgent.getName(name); | ||
75 | |||
76 | BOOL any_positive = (behavior > 0.f || appearance > 0.f || building > 0.f); | ||
77 | BOOL any_negative = (behavior < 0.f || appearance < 0.f || building < 0.f); | ||
78 | |||
79 | LLString message(name); | ||
80 | if (any_positive && !any_negative) | ||
81 | { | ||
82 | message.append(" rated you positively: "); | ||
83 | } | ||
84 | else if (any_negative && !any_positive) | ||
85 | { | ||
86 | message.append(" rated you negatively: "); | ||
87 | } | ||
88 | else | ||
89 | { | ||
90 | message.append(" rated you: "); | ||
91 | } | ||
92 | |||
93 | if (text && strlen(text) > 0) /* Flawfinder: ignore */ | ||
94 | { | ||
95 | message.append(text); | ||
96 | } | ||
97 | else | ||
98 | { | ||
99 | message.append("(no message)"); | ||
100 | } | ||
101 | |||
102 | pack_instant_message( | ||
103 | msg, | ||
104 | gAgent.getID(), | ||
105 | FALSE, | ||
106 | gAgent.getSessionID(), | ||
107 | ratee_id, | ||
108 | SYSTEM_FROM, | ||
109 | message.c_str(), | ||
110 | IM_ONLINE, | ||
111 | IM_CONSOLE_AND_CHAT_HISTORY); | ||
112 | gAgent.sendReliableMessage(); | ||
113 | } | ||