aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lleventinfo.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/lleventinfo.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/lleventinfo.cpp')
-rw-r--r--linden/indra/newview/lleventinfo.cpp57
1 files changed, 10 insertions, 47 deletions
diff --git a/linden/indra/newview/lleventinfo.cpp b/linden/indra/newview/lleventinfo.cpp
index 2a7dcde..5a416ea 100644
--- a/linden/indra/newview/lleventinfo.cpp
+++ b/linden/indra/newview/lleventinfo.cpp
@@ -38,65 +38,30 @@
38 38
39LLEventInfo::cat_map LLEventInfo::sCategories; 39LLEventInfo::cat_map LLEventInfo::sCategories;
40 40
41LLEventInfo::LLEventInfo(F32 global_x, F32 global_y,
42 const char* name,
43 U32 id,
44 S32 unix_time,
45 U32 event_flags)
46: mName( name ),
47 mID( id ),
48 mPosGlobal( global_x, global_y, 40.0 ),
49 mUnixTime( unix_time ),
50 mEventFlags(event_flags),
51 mSelected( FALSE )
52{
53 struct tm* timep;
54 // Convert to Pacific, based on server's opinion of whether
55 // it's daylight savings time there.
56 timep = utc_to_pacific_time(unix_time, gPacificDaylightTime);
57
58 S32 display_hour = timep->tm_hour % 12;
59 if (display_hour == 0) display_hour = 12;
60
61 mTimeStr = llformat("% 2d/% 2d % 2d:%02d %s",
62 timep->tm_mon+1,
63 timep->tm_year-100,
64 display_hour,
65 timep->tm_min,
66 (timep->tm_hour < 12 ? "AM" : "PM") );
67}
68
69
70void LLEventInfo::unpack(LLMessageSystem *msg) 41void LLEventInfo::unpack(LLMessageSystem *msg)
71{ 42{
72 const U32 MAX_DESC_LENGTH = 1024;
73
74 U32 event_id; 43 U32 event_id;
75 msg->getU32("EventData", "EventID", event_id); 44 msg->getU32("EventData", "EventID", event_id);
76 mID = event_id; 45 mID = event_id;
77 46
78 char buffer[MAX_DESC_LENGTH]; /*Flawfinder: ignore*/ 47 msg->getString("EventData", "Name", mName);
79 msg->getString("EventData", "Name", MAX_DESC_LENGTH, buffer);
80 mName = buffer;
81 48
82 msg->getString("EventData", "Category", MAX_DESC_LENGTH, buffer); 49 msg->getString("EventData", "Category", mCategoryStr);
83 mCategoryStr = buffer;
84 50
85 msg->getString("EventData", "Date", MAX_DESC_LENGTH, buffer); 51 msg->getString("EventData", "Date", mTimeStr);
86 // *FIX: evil hack to let users know that we don't localize
87 // time information. Hack! This is WRONG.
88 mTimeStr = buffer;
89 52
90 U32 duration; 53 U32 duration;
91 msg->getU32("EventData","Duration",duration); 54 msg->getU32("EventData","Duration",duration);
92 mDuration = duration; 55 mDuration = duration;
93 56
94 msg->getU32("EventData", "DateUTC", mUnixTime); 57 U32 date;
58 msg->getU32("EventData", "DateUTC", date);
59 mUnixTime = date;
95 60
96 msg->getString("EventData", "Desc", MAX_DESC_LENGTH, buffer); 61 msg->getString("EventData", "Desc", mDesc);
97 mDesc = buffer;
98 62
99 msg->getString("EventData", "Creator", MAX_DESC_LENGTH, buffer); 63 std::string buffer;
64 msg->getString("EventData", "Creator", buffer);
100 mRunByID = LLUUID(buffer); 65 mRunByID = LLUUID(buffer);
101 66
102 U32 foo; 67 U32 foo;
@@ -110,9 +75,7 @@ void LLEventInfo::unpack(LLMessageSystem *msg)
110 mCover = cover; 75 mCover = cover;
111 } 76 }
112 77
113 char sim_name[256]; /*Flawfinder: ignore*/ 78 msg->getString("EventData", "SimName", mSimName);
114 msg->getString("EventData", "SimName", 256, sim_name);
115 mSimName.assign(sim_name);
116 79
117 msg->getVector3d("EventData", "GlobalPos", mPosGlobal); 80 msg->getVector3d("EventData", "GlobalPos", mPosGlobal);
118 81