diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmessage/mean_collision_data.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/mean_collision_data.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/linden/indra/llmessage/mean_collision_data.h b/linden/indra/llmessage/mean_collision_data.h new file mode 100644 index 0000000..2d60159 --- /dev/null +++ b/linden/indra/llmessage/mean_collision_data.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /** | ||
2 | * @file mean_collision_data.h | ||
3 | * @brief data type to log interactions between stuff and agents that | ||
4 | * might be community standards violations | ||
5 | * | ||
6 | * Copyright (c) 2000-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef LL_MEAN_COLLISIONS_DATA_H | ||
30 | #define LL_MEAN_COLLISIONS_DATA_H | ||
31 | |||
32 | #include <time.h> | ||
33 | #include "lldbstrings.h" | ||
34 | |||
35 | const F32 MEAN_COLLISION_TIMEOUT = 5.f; | ||
36 | const S32 MAX_MEAN_COLLISIONS = 5; | ||
37 | |||
38 | typedef enum e_mean_collision_types | ||
39 | { | ||
40 | MEAN_INVALID, | ||
41 | MEAN_BUMP, | ||
42 | MEAN_LLPUSHOBJECT, | ||
43 | MEAN_SELECTED_OBJECT_COLLIDE, | ||
44 | MEAN_SCRIPTED_OBJECT_COLLIDE, | ||
45 | MEAN_PHYSICAL_OBJECT_COLLIDE, | ||
46 | MEAN_EOF | ||
47 | } EMeanCollisionType; | ||
48 | |||
49 | class LLMeanCollisionData | ||
50 | { | ||
51 | public: | ||
52 | LLMeanCollisionData(const LLUUID &victim, const LLUUID &perp, time_t time, EMeanCollisionType type, F32 mag) | ||
53 | : mVictim(victim), mPerp(perp), mTime(time), mType(type), mMag(mag) | ||
54 | { mFirstName[0] = 0; mLastName[0] = 0; } | ||
55 | |||
56 | LLMeanCollisionData(LLMeanCollisionData *mcd) | ||
57 | : mVictim(mcd->mVictim), mPerp(mcd->mPerp), mTime(mcd->mTime), mType(mcd->mType), mMag(mcd->mMag) | ||
58 | { | ||
59 | strncpy(mFirstName, mcd->mFirstName, sizeof(mFirstName) -1); /* Flawfinder: Ignore */ | ||
60 | mFirstName[sizeof(mFirstName) -1] = '\0'; | ||
61 | strncpy(mLastName, mcd->mLastName, sizeof(mLastName) -1); /* Flawfinder: Ignore */ | ||
62 | mLastName[sizeof(mLastName) -1] = '\0'; | ||
63 | } | ||
64 | |||
65 | friend std::ostream& operator<<(std::ostream& s, const LLMeanCollisionData &a) | ||
66 | { | ||
67 | switch(a.mType) | ||
68 | { | ||
69 | case MEAN_BUMP: | ||
70 | s << "Mean Collision: " << a.mPerp << " bumped " << a.mVictim << " with a velocity of " << a.mMag << " at " << ctime(&a.mTime); | ||
71 | break; | ||
72 | case MEAN_LLPUSHOBJECT: | ||
73 | s << "Mean Collision: " << a.mPerp << " llPushObject-ed " << a.mVictim << " with a total force of " << a.mMag << " at "<< ctime(&a.mTime); | ||
74 | break; | ||
75 | case MEAN_SELECTED_OBJECT_COLLIDE: | ||
76 | s << "Mean Collision: " << a.mPerp << " dragged an object into " << a.mVictim << " with a velocity of " << a.mMag << " at "<< ctime(&a.mTime); | ||
77 | break; | ||
78 | case MEAN_SCRIPTED_OBJECT_COLLIDE: | ||
79 | s << "Mean Collision: " << a.mPerp << " smacked " << a.mVictim << " with a scripted object with velocity of " << a.mMag << " at "<< ctime(&a.mTime); | ||
80 | break; | ||
81 | case MEAN_PHYSICAL_OBJECT_COLLIDE: | ||
82 | s << "Mean Collision: " << a.mPerp << " smacked " << a.mVictim << " with a physical object with velocity of " << a.mMag << " at "<< ctime(&a.mTime); | ||
83 | break; | ||
84 | default: | ||
85 | break; | ||
86 | } | ||
87 | return s; | ||
88 | } | ||
89 | |||
90 | LLUUID mVictim; | ||
91 | LLUUID mPerp; | ||
92 | time_t mTime; | ||
93 | EMeanCollisionType mType; | ||
94 | F32 mMag; | ||
95 | char mFirstName[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: Ignore */ | ||
96 | char mLastName[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: Ignore */ | ||
97 | }; | ||
98 | |||
99 | |||
100 | #endif | ||