From b235c59d60472f818a9142c0886b95a0ff4191d7 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:19 -0500 Subject: Second Life viewer sources 1.18.6.0-RC --- linden/doc/contributions.txt | 1 + linden/etc/message.xml | 10 +- linden/indra/SConstruct | 9 +- linden/indra/indra_complete/indra_complete.sln | 1 + linden/indra/indra_complete/indra_complete_vc8.sln | 198 +- linden/indra/lib/python/indra/util/llmanifest.py | 7 + linden/indra/linux_crash_logger/files.lst | 2 + .../linux_crash_logger/linux_crash_logger.cpp | 538 +- .../linux_crash_logger/llcrashloggerlinux.cpp | 140 + .../indra/linux_crash_logger/llcrashloggerlinux.h | 49 + linden/indra/llcommon/llapp.cpp | 34 + linden/indra/llcommon/llavatarconstants.h | 1 + linden/indra/llcommon/llcommon.vcproj | 3 + linden/indra/llcommon/llcommon_vc8.vcproj | 2 + linden/indra/llcommon/llsd.cpp | 20 + linden/indra/llcommon/llsd.h | 1 + linden/indra/llcommon/llsdserialize.cpp | 5 + linden/indra/llcommon/llstring.cpp | 58 +- linden/indra/llcommon/llstring.h | 32 +- linden/indra/llcommon/llsys.cpp | 77 +- linden/indra/llcommon/llsys.h | 2 + linden/indra/llcommon/lluri.cpp | 69 +- linden/indra/llcommon/lluri.h | 7 +- linden/indra/llcommon/llversionserver.h | 4 +- linden/indra/llcommon/llversionviewer.h | 4 +- linden/indra/llcrashlogger/llcrashlogger.cpp | 309 + linden/indra/llcrashlogger/llcrashlogger.h | 85 + linden/indra/llinventory/llparcel.cpp | 2760 ++++----- linden/indra/llinventory/llparcel.h | 24 +- linden/indra/llinventory/llparcelflags.h | 14 +- linden/indra/llmessage/llcircuit.cpp | 19 +- linden/indra/llmessage/llcircuit.h | 5 +- linden/indra/llmessage/llcurl.cpp | 5 + linden/indra/llmessage/llcurl.h | 3 +- linden/indra/llmessage/llregionflags.h | 8 +- linden/indra/llmessage/message.cpp | 7 +- linden/indra/llmessage/message.h | 2 +- linden/indra/llmessage/message_prehash.cpp | 5 + linden/indra/llmessage/message_prehash.h | 2 + linden/indra/llui/llalertdialog.cpp | 35 +- linden/indra/llui/llalertdialog.h | 24 +- linden/indra/llui/llbutton.cpp | 3 - linden/indra/llui/llfloater.cpp | 29 +- linden/indra/llui/llfloater.h | 3 +- linden/indra/llui/lllineeditor.cpp | 14 +- linden/indra/llui/lllineeditor.h | 2 - linden/indra/llui/llpanel.cpp | 10 + linden/indra/llui/llpanel.h | 1 + linden/indra/llui/llscrolllistctrl.cpp | 19 +- linden/indra/llui/llscrolllistctrl.h | 1 + linden/indra/llui/lltextbox.cpp | 43 +- linden/indra/llui/lltextbox.h | 11 +- linden/indra/llui/lltexteditor.cpp | 14 +- linden/indra/llui/lltexteditor.h | 2 - linden/indra/llui/llview.cpp | 18 +- linden/indra/llui/llview.h | 6 +- linden/indra/llvfs/lldir_win32.cpp | 1 - linden/indra/llwindow/lldxhardware.cpp | 102 + linden/indra/llwindow/lldxhardware.h | 3 + linden/indra/llwindow/llgl.cpp | 19 + linden/indra/llwindow/llgl.h | 3 + linden/indra/llwindow/llwindowwin32.cpp | 7 +- linden/indra/llwindow/llwindowwin32.h | 1 + linden/indra/lscript/lscript_compile/indra.l | 16 +- .../lscript/lscript_compile/lscript_compile.vcproj | 9 +- .../lscript_compile/lscript_compile_fb.vcproj | 8 +- .../lscript_compile/lscript_compile_fb_vc8.vcproj | 237 +- linden/indra/mac_crash_logger/llcrashloggermac.cpp | 342 ++ linden/indra/mac_crash_logger/llcrashloggermac.h | 51 + linden/indra/mac_crash_logger/mac_crash_logger.cpp | 668 +- .../indra/mac_updater/AutoUpdater.nib/classes.nib | 4 + linden/indra/mac_updater/AutoUpdater.nib/info.nib | 14 + .../indra/mac_updater/AutoUpdater.nib/objects.xib | 56 + linden/indra/newview/CrashReporter.nib/info.nib | 8 +- linden/indra/newview/CrashReporter.nib/objects.xib | 78 +- .../indra/newview/English.lproj/InfoPlist.strings | 4 +- linden/indra/newview/Info-SecondLife.plist | 2 +- linden/indra/newview/files.lst | 5 +- .../linux_tools/handle_secondlifeprotocol.sh | 17 + .../linux_tools/register_secondlifeprotocol.sh | 46 + linden/indra/newview/linux_tools/wrapper.sh | 4 + linden/indra/newview/llagent.cpp | 33 +- linden/indra/newview/llagent.h | 2 + linden/indra/newview/llagentpilot.cpp | 4 +- linden/indra/newview/llappviewer.cpp | 3894 ++++++++++++ linden/indra/newview/llappviewer.h | 294 + linden/indra/newview/llappviewerlinux.cpp | 414 ++ linden/indra/newview/llappviewerlinux.h | 59 + linden/indra/newview/llappviewermacosx.cpp | 373 ++ linden/indra/newview/llappviewermacosx.h | 56 + linden/indra/newview/llappviewerwin32.cpp | 461 ++ linden/indra/newview/llappviewerwin32.h | 63 + linden/indra/newview/llassetuploadresponders.cpp | 1 - linden/indra/newview/llcallingcard.cpp | 2 +- linden/indra/newview/llcameraview.cpp | 8 +- linden/indra/newview/llclassifiedinfo.cpp | 1 - linden/indra/newview/llcommandhandler.cpp | 11 +- linden/indra/newview/llcommandhandler.h | 9 +- linden/indra/newview/llcompass.cpp | 1 - linden/indra/newview/llconsole.cpp | 1 - linden/indra/newview/llcontroldef.cpp | 11 +- linden/indra/newview/llcurrencyuimanager.cpp | 5 +- linden/indra/newview/lldirpicker.cpp | 1 - linden/indra/newview/lldrawable.h | 3 +- linden/indra/newview/lldrawpoolavatar.cpp | 2 +- linden/indra/newview/lldrawpoolwater.cpp | 1 - linden/indra/newview/lleventinfo.cpp | 2 +- linden/indra/newview/llfasttimerview.cpp | 2 +- linden/indra/newview/llfeaturemanager.cpp | 4 - linden/indra/newview/llfirstuse.cpp | 2 +- linden/indra/newview/llfloaterabout.cpp | 9 +- linden/indra/newview/llfloateranimpreview.cpp | 1 - linden/indra/newview/llfloaterauction.cpp | 3 +- linden/indra/newview/llfloateravatarinfo.cpp | 4 +- linden/indra/newview/llfloateravatarpicker.cpp | 10 +- linden/indra/newview/llfloateravatartextures.cpp | 2 +- linden/indra/newview/llfloaterbump.cpp | 2 +- linden/indra/newview/llfloaterbuycurrency.cpp | 2 +- linden/indra/newview/llfloaterbuyland.cpp | 4 +- linden/indra/newview/llfloaterclassified.cpp | 4 +- linden/indra/newview/llfloatercolorpicker.cpp | 1 - linden/indra/newview/llfloaterdirectory.cpp | 4 + linden/indra/newview/llfloaterdirectory.h | 4 + linden/indra/newview/llfloaterevent.cpp | 6 +- linden/indra/newview/llfloaterfriends.cpp | 34 +- linden/indra/newview/llfloatergroupinfo.cpp | 4 +- linden/indra/newview/llfloaterimagepreview.cpp | 1 - linden/indra/newview/llfloaterimport.cpp | 1 - linden/indra/newview/llfloaterlagmeter.cpp | 5 +- linden/indra/newview/llfloaterland.cpp | 713 +-- linden/indra/newview/llfloaterland.h | 82 +- linden/indra/newview/llfloatermap.cpp | 4 +- linden/indra/newview/llfloaternewim.cpp | 1 - linden/indra/newview/llfloaterparcel.cpp | 4 +- linden/indra/newview/llfloaterpostcard.cpp | 1 - linden/indra/newview/llfloaterpreference.cpp | 46 +- linden/indra/newview/llfloaterpreference.h | 1 + linden/indra/newview/llfloaterregioninfo.cpp | 52 +- linden/indra/newview/llfloaterregioninfo.h | 4 + linden/indra/newview/llfloaterreleasemsg.cpp | 3 +- linden/indra/newview/llfloaterreporter.cpp | 2 +- linden/indra/newview/llfloatersnapshot.cpp | 1 - linden/indra/newview/llfloatertest.cpp | 4 +- linden/indra/newview/llfloatertools.cpp | 3 +- linden/indra/newview/llfloatertos.cpp | 2 +- linden/indra/newview/llfloaterworldmap.cpp | 2 +- linden/indra/newview/llfolderview.cpp | 2 +- linden/indra/newview/llframestatview.cpp | 1 - linden/indra/newview/llgesturemgr.cpp | 1 - linden/indra/newview/llglsandbox.cpp | 1 - linden/indra/newview/llgroupmgr.cpp | 16 +- linden/indra/newview/llgroupnotify.cpp | 4 +- linden/indra/newview/llhudtext.cpp | 1 - linden/indra/newview/llimpanel.cpp | 2 +- linden/indra/newview/llimview.cpp | 2 +- linden/indra/newview/llinventoryactions.cpp | 1 - linden/indra/newview/llinventorybridge.cpp | 1 - linden/indra/newview/llinventorybridge.h | 1 + linden/indra/newview/llinventorymodel.cpp | 2 +- linden/indra/newview/llinventoryview.cpp | 2 +- linden/indra/newview/lllcd.cpp | 6 +- linden/indra/newview/lllcd.h | 3 + linden/indra/newview/lllogchat.cpp | 2 +- linden/indra/newview/llmanip.cpp | 1 - linden/indra/newview/llmaniprotate.cpp | 3 - linden/indra/newview/llmaniptranslate.cpp | 1 - linden/indra/newview/llmemoryview.cpp | 1 - linden/indra/newview/llmenucommands.cpp | 1 - linden/indra/newview/llmorphview.cpp | 1 - linden/indra/newview/llmoveview.cpp | 2 +- linden/indra/newview/llmutelist.cpp | 1 - linden/indra/newview/llnetmap.cpp | 2 +- linden/indra/newview/llnotify.cpp | 35 +- linden/indra/newview/llnotify.h | 3 +- linden/indra/newview/lloverlaybar.cpp | 1 - linden/indra/newview/llpanelLCD.cpp | 2 +- linden/indra/newview/llpanelaudioprefs.cpp | 2 +- linden/indra/newview/llpanelavatar.cpp | 10 +- linden/indra/newview/llpanelclassified.cpp | 4 +- linden/indra/newview/llpanelcontents.cpp | 1 - linden/indra/newview/llpaneldirbrowser.cpp | 3 + linden/indra/newview/llpaneldirevents.cpp | 2 +- linden/indra/newview/llpaneldirfind.cpp | 9 +- linden/indra/newview/llpaneldisplay.cpp | 2 +- linden/indra/newview/llpanelgeneral.cpp | 27 +- linden/indra/newview/llpanelgeneral.h | 1 + linden/indra/newview/llpanelgroup.cpp | 4 +- linden/indra/newview/llpanelgrouplandmoney.cpp | 9 +- linden/indra/newview/llpanelgroupvoting.cpp | 6 +- linden/indra/newview/llpanelinput.cpp | 6 +- linden/indra/newview/llpanellogin.cpp | 642 +- linden/indra/newview/llpanellogin.h | 48 +- linden/indra/newview/llpanelobject.cpp | 2 +- linden/indra/newview/llpanelvolume.cpp | 1 - linden/indra/newview/llprefsvoice.cpp | 2 +- linden/indra/newview/llpreviewgesture.cpp | 4 +- linden/indra/newview/llpreviewlandmark.cpp | 1 - linden/indra/newview/llpreviewnotecard.cpp | 5 +- linden/indra/newview/llpreviewscript.cpp | 6 +- linden/indra/newview/llprogressview.cpp | 8 +- linden/indra/newview/llsky.cpp | 1 + linden/indra/newview/llspatialpartition.cpp | 2 +- linden/indra/newview/llsprite.cpp | 1 - linden/indra/newview/llstartup.cpp | 338 +- linden/indra/newview/llstartup.h | 2 +- linden/indra/newview/llstatgraph.cpp | 8 +- linden/indra/newview/llstatusbar.cpp | 4 +- linden/indra/newview/llsurface.cpp | 6 +- linden/indra/newview/lltexlayer.cpp | 1 - linden/indra/newview/lltexturectrl.cpp | 8 +- linden/indra/newview/lltexturefetch.cpp | 17 +- linden/indra/newview/lltextureview.cpp | 16 +- linden/indra/newview/lltoolbar.cpp | 1 - linden/indra/newview/lltoolbrush.cpp | 2 +- linden/indra/newview/lltooldraganddrop.cpp | 1 - linden/indra/newview/lltoolfocus.cpp | 1 - linden/indra/newview/lltoolgrab.cpp | 1 - linden/indra/newview/lltoolgun.cpp | 1 - linden/indra/newview/lltoolmgr.cpp | 5 + linden/indra/newview/lltoolmgr.h | 2 + linden/indra/newview/lltoolmorph.cpp | 1 - linden/indra/newview/lltoolobjpicker.cpp | 1 - linden/indra/newview/lltoolpie.cpp | 2 + linden/indra/newview/lltoolplacer.cpp | 380 +- linden/indra/newview/lltoolplacer.h | 7 + linden/indra/newview/lltoolselect.cpp | 1 - linden/indra/newview/lltoolselectland.cpp | 1 - linden/indra/newview/lltoolselectrect.cpp | 1 - linden/indra/newview/lltracker.cpp | 3 +- linden/indra/newview/llurldispatcher.cpp | 64 +- linden/indra/newview/llurlsimstring.cpp | 1 - linden/indra/newview/lluserauth.cpp | 10 +- linden/indra/newview/lluserauth.h | 4 +- linden/indra/newview/llvectorperfoptions.cpp | 121 + linden/indra/newview/llvectorperfoptions.h | 31 + linden/indra/newview/llvieweraudio.cpp | 228 + linden/indra/newview/llvieweraudio.h | 30 + linden/indra/newview/llviewercamera.h | 3 + linden/indra/newview/llviewercontrol.cpp | 4 + linden/indra/newview/llviewercontrol.h | 7 + linden/indra/newview/llviewerdisplay.cpp | 199 +- linden/indra/newview/llviewerdisplay.h | 7 +- linden/indra/newview/llviewerimage.cpp | 27 +- linden/indra/newview/llviewerimagelist.cpp | 14 +- linden/indra/newview/llviewerinventory.cpp | 1 - linden/indra/newview/llviewerjoystick.cpp | 2 +- linden/indra/newview/llviewermenu.cpp | 99 +- linden/indra/newview/llviewermenu.h | 1 + linden/indra/newview/llviewermenufile.cpp | 16 +- linden/indra/newview/llviewermessage.cpp | 63 +- linden/indra/newview/llviewermessage.h | 2 +- linden/indra/newview/llviewernetwork.cpp | 28 +- linden/indra/newview/llviewernetwork.h | 38 +- linden/indra/newview/llviewerobject.cpp | 7 +- linden/indra/newview/llviewerobject.h | 3 + linden/indra/newview/llviewerobjectlist.cpp | 7 +- linden/indra/newview/llviewerparcelmgr.cpp | 13 +- linden/indra/newview/llviewerregion.cpp | 23 +- linden/indra/newview/llviewerregion.h | 2 +- linden/indra/newview/llviewerstats.cpp | 449 +- linden/indra/newview/llviewerstats.h | 10 +- linden/indra/newview/llviewertexteditor.cpp | 7 +- linden/indra/newview/llviewerwindow.cpp | 74 +- linden/indra/newview/llviewerwindow.h | 6 + linden/indra/newview/llvoavatar.cpp | 5 +- linden/indra/newview/llvoclouds.cpp | 4 +- linden/indra/newview/llvoiceclient.cpp | 12 +- linden/indra/newview/llvosky.cpp | 5 +- linden/indra/newview/llvosky.h | 6 + linden/indra/newview/llwearable.cpp | 3 - linden/indra/newview/llweb.cpp | 21 +- linden/indra/newview/llweb.h | 16 +- linden/indra/newview/llwebbrowserctrl.cpp | 12 +- linden/indra/newview/llwind.cpp | 1 - linden/indra/newview/llwindebug.cpp | 406 +- linden/indra/newview/llwindebug.h | 2 +- linden/indra/newview/llworld.cpp | 14 +- linden/indra/newview/llworld.h | 2 +- linden/indra/newview/llworldmap.cpp | 2 +- linden/indra/newview/llworldmapview.cpp | 2 +- linden/indra/newview/llxmlrpctransaction.cpp | 2 +- linden/indra/newview/macutil_Prefix.h | 3 + .../newview/macview.xcodeproj/default.pbxuser | 183 + .../newview/macview.xcodeproj/project.pbxproj | 330 +- linden/indra/newview/macview_Prefix.h | 1 - linden/indra/newview/newview.vcproj | 41 +- linden/indra/newview/newview_vc8.vcproj | 43 +- linden/indra/newview/pipeline.cpp | 40 +- linden/indra/newview/releasenotes.txt | 29 + linden/indra/newview/res/newViewRes.rc | 8 +- linden/indra/newview/skins/xui/de/LCD_text.xml | 75 + .../newview/skins/xui/de/floater_landmark_ctrl.xml | 10 + .../skins/xui/de/floater_preview_classified.xml | 2 + .../newview/skins/xui/de/floater_preview_event.xml | 2 + .../newview/skins/xui/de/floater_preview_url.xml | 2 + linden/indra/newview/skins/xui/de/menu_slurl.xml | 6 + linden/indra/newview/skins/xui/de/need_to_long.xml | 85 + .../newview/skins/xui/de/need_to_translate.xml | 1056 ++++ .../indra/newview/skins/xui/de/need_to_update.xml | 420 ++ linden/indra/newview/skins/xui/de/panel_login.xml | 40 +- .../newview/skins/xui/de/panel_preferences_LCD.xml | 30 + linden/indra/newview/skins/xui/en-us/alerts.xml | 229 +- .../newview/skins/xui/en-us/floater_about_land.xml | 133 +- .../newview/skins/xui/en-us/floater_directory.xml | 4 +- .../skins/xui/en-us/floater_texture_ctrl.xml | 1 + .../indra/newview/skins/xui/en-us/menu_login.xml | 37 + .../indra/newview/skins/xui/en-us/menu_viewer.xml | 2 +- linden/indra/newview/skins/xui/en-us/notify.xml | 20 + .../indra/newview/skins/xui/en-us/panel_avatar.xml | 6 + .../indra/newview/skins/xui/en-us/panel_login.xml | 92 +- .../skins/xui/en-us/panel_region_estate.xml | 63 +- .../newview/skins/xui/en-us/teleport_strings.xml | 34 +- linden/indra/newview/skins/xui/es/panel_login.xml | 36 +- linden/indra/newview/skins/xui/fr/panel_login.xml | 38 +- linden/indra/newview/skins/xui/ja/LCD_text.xml | 75 + .../newview/skins/xui/ja/floater_landmark_ctrl.xml | 12 + .../skins/xui/ja/floater_preview_classified.xml | 2 + .../newview/skins/xui/ja/floater_preview_event.xml | 2 + .../newview/skins/xui/ja/floater_preview_url.xml | 2 + linden/indra/newview/skins/xui/ja/menu_slurl.xml | 6 + linden/indra/newview/skins/xui/ja/need_to_long.xml | 85 + .../newview/skins/xui/ja/need_to_translate.xml | 1059 ++++ .../indra/newview/skins/xui/ja/need_to_update.xml | 419 ++ linden/indra/newview/skins/xui/ja/panel_login.xml | 40 +- .../newview/skins/xui/ja/panel_preferences_LCD.xml | 33 + linden/indra/newview/skins/xui/ko/LCD_text.xml | 75 + .../newview/skins/xui/ko/floater_landmark_ctrl.xml | 10 + .../skins/xui/ko/floater_preview_classified.xml | 2 + .../newview/skins/xui/ko/floater_preview_event.xml | 2 + .../newview/skins/xui/ko/floater_preview_url.xml | 2 + linden/indra/newview/skins/xui/ko/menu_slurl.xml | 6 + linden/indra/newview/skins/xui/ko/need_to_long.xml | 85 + .../newview/skins/xui/ko/need_to_translate.xml | 1060 ++++ .../indra/newview/skins/xui/ko/need_to_update.xml | 420 ++ linden/indra/newview/skins/xui/ko/panel_login.xml | 39 +- .../newview/skins/xui/ko/panel_preferences_LCD.xml | 31 + linden/indra/newview/skins/xui/pt/panel_login.xml | 27 +- linden/indra/newview/skins/xui/zh/panel_login.xml | 36 +- linden/indra/newview/viewer.cpp | 6368 -------------------- linden/indra/newview/viewer.h | 325 - linden/indra/newview/viewer_manifest.py | 2 + linden/indra/test/lluri_tut.cpp | 39 + linden/indra/test/test.vcproj | 6 + linden/indra/test/test_vc8.vcproj | 16 - linden/indra/win_crash_logger/StdAfx.h | 1 - .../win_crash_logger/llcrashloggerwindows.cpp | 378 ++ .../indra/win_crash_logger/llcrashloggerwindows.h | 59 + linden/indra/win_crash_logger/resource.h | 34 +- linden/indra/win_crash_logger/win_crash_logger.cpp | 874 +-- linden/indra/win_crash_logger/win_crash_logger.rc | 65 +- .../indra/win_crash_logger/win_crash_logger.vcproj | 22 +- .../win_crash_logger/win_crash_logger_vc8.vcproj | 29 +- linden/scripts/messages/message_template.msg | 12 +- 353 files changed, 18888 insertions(+), 13019 deletions(-) create mode 100644 linden/indra/linux_crash_logger/llcrashloggerlinux.cpp create mode 100644 linden/indra/linux_crash_logger/llcrashloggerlinux.h create mode 100755 linden/indra/llcrashlogger/llcrashlogger.cpp create mode 100755 linden/indra/llcrashlogger/llcrashlogger.h create mode 100644 linden/indra/mac_crash_logger/llcrashloggermac.cpp create mode 100644 linden/indra/mac_crash_logger/llcrashloggermac.h create mode 100644 linden/indra/mac_updater/AutoUpdater.nib/classes.nib create mode 100644 linden/indra/mac_updater/AutoUpdater.nib/info.nib create mode 100644 linden/indra/mac_updater/AutoUpdater.nib/objects.xib create mode 100755 linden/indra/newview/linux_tools/handle_secondlifeprotocol.sh create mode 100755 linden/indra/newview/linux_tools/register_secondlifeprotocol.sh create mode 100644 linden/indra/newview/llappviewer.cpp create mode 100644 linden/indra/newview/llappviewer.h create mode 100644 linden/indra/newview/llappviewerlinux.cpp create mode 100644 linden/indra/newview/llappviewerlinux.h create mode 100644 linden/indra/newview/llappviewermacosx.cpp create mode 100644 linden/indra/newview/llappviewermacosx.h create mode 100644 linden/indra/newview/llappviewerwin32.cpp create mode 100644 linden/indra/newview/llappviewerwin32.h create mode 100644 linden/indra/newview/llvectorperfoptions.cpp create mode 100644 linden/indra/newview/llvectorperfoptions.h create mode 100644 linden/indra/newview/llvieweraudio.cpp create mode 100644 linden/indra/newview/llvieweraudio.h create mode 100644 linden/indra/newview/macview.xcodeproj/default.pbxuser create mode 100644 linden/indra/newview/skins/xui/de/LCD_text.xml create mode 100644 linden/indra/newview/skins/xui/de/floater_landmark_ctrl.xml create mode 100644 linden/indra/newview/skins/xui/de/floater_preview_classified.xml create mode 100644 linden/indra/newview/skins/xui/de/floater_preview_event.xml create mode 100644 linden/indra/newview/skins/xui/de/floater_preview_url.xml create mode 100644 linden/indra/newview/skins/xui/de/menu_slurl.xml create mode 100644 linden/indra/newview/skins/xui/de/need_to_long.xml create mode 100644 linden/indra/newview/skins/xui/de/need_to_translate.xml create mode 100644 linden/indra/newview/skins/xui/de/need_to_update.xml create mode 100644 linden/indra/newview/skins/xui/de/panel_preferences_LCD.xml create mode 100644 linden/indra/newview/skins/xui/en-us/menu_login.xml create mode 100644 linden/indra/newview/skins/xui/ja/LCD_text.xml create mode 100644 linden/indra/newview/skins/xui/ja/floater_landmark_ctrl.xml create mode 100644 linden/indra/newview/skins/xui/ja/floater_preview_classified.xml create mode 100644 linden/indra/newview/skins/xui/ja/floater_preview_event.xml create mode 100644 linden/indra/newview/skins/xui/ja/floater_preview_url.xml create mode 100644 linden/indra/newview/skins/xui/ja/menu_slurl.xml create mode 100644 linden/indra/newview/skins/xui/ja/need_to_long.xml create mode 100644 linden/indra/newview/skins/xui/ja/need_to_translate.xml create mode 100644 linden/indra/newview/skins/xui/ja/need_to_update.xml create mode 100644 linden/indra/newview/skins/xui/ja/panel_preferences_LCD.xml create mode 100644 linden/indra/newview/skins/xui/ko/LCD_text.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_landmark_ctrl.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_preview_classified.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_preview_event.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_preview_url.xml create mode 100644 linden/indra/newview/skins/xui/ko/menu_slurl.xml create mode 100644 linden/indra/newview/skins/xui/ko/need_to_long.xml create mode 100644 linden/indra/newview/skins/xui/ko/need_to_translate.xml create mode 100644 linden/indra/newview/skins/xui/ko/need_to_update.xml create mode 100644 linden/indra/newview/skins/xui/ko/panel_preferences_LCD.xml delete mode 100644 linden/indra/newview/viewer.cpp delete mode 100644 linden/indra/newview/viewer.h create mode 100644 linden/indra/win_crash_logger/llcrashloggerwindows.cpp create mode 100644 linden/indra/win_crash_logger/llcrashloggerwindows.h diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index 897977c..62210f0 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -215,6 +215,7 @@ Nicholaz Beresford VWR-1861 VWR-1872 VWR-1968 + VWR-2046 VWR-2152 Nounouch Hapmouche VWR-238 diff --git a/linden/etc/message.xml b/linden/etc/message.xml index 3d9d0eb..1e6e30e 100644 --- a/linden/etc/message.xml +++ b/linden/etc/message.xml @@ -255,7 +255,7 @@ CoarseLocationUpdate flavor - llsd + template trusted-sender true @@ -399,6 +399,14 @@ true + + ScriptRunningReply + + flavor + llsd + trusted-sender + false + capBans diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct index f1a6c89..0e68039 100644 --- a/linden/indra/SConstruct +++ b/linden/indra/SConstruct @@ -91,7 +91,7 @@ opts.AddOptions( BoolOption('GSTREAMER', 'Enabled GStreamer support', True), BoolOption('COLORGCC', 'Enabled colorgcc', True), EnumOption('GRID', 'Client package\'s default grid', 'default', - allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak')), + allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak', 'yami')), EnumOption('CHANNEL', 'Client package\'s default channel', 'Release', allowed_values=('Release', 'Release Candidate', 'WindLight')), BoolOption('ELFIO', 'Enabled enhanced backtraces with libELFIO symbol extraction support', True), @@ -203,7 +203,7 @@ for build_target in targets: ### Base include directories ### include_dirs = Split(""" - ./llcommon ./llmath ./llwindow ./llaudio ./llcharacter + ./llcommon ./llmath ./llwindow ./llaudio ./llcharacter ./llcrashlogger ./lldatabase ./llhavok ./llimage ./llinventory ./llmedia ./llmessage ./llprimitive ./llrender ./llscene ./llui ./llvfs ./llwindow ./llxml ./lscript ./lscript/lscript_compile @@ -350,7 +350,7 @@ for build_target in targets: releasenoopt_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 ' releasefordownload_cflags = cflags + '-O2 ' releasefordownload_cxxflags = cxxflags + '-O2 ' - releasefordownload_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 ' + releasefordownload_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DLL_SEND_CRASH_REPORTS=1 ' ################ # ENVIRONMENT # @@ -585,6 +585,7 @@ for build_target in targets: create_cond_module('llvfs') create_cond_module('llimagej2coj', module_libs=['openjpeg']) create_cond_module('llimage', module_libs=['llimagej2coj', 'jpeg', 'png12']) + create_static_module('llcrashlogger') create_static_module('llmessage') create_static_module('llinventory') create_static_module('llcharacter') @@ -616,7 +617,7 @@ for build_target in targets: pkgconfig('--libs-only-l', ['gtk+-2.0']).split()] else: external_libs = net_external_libs + [ 'db-4.2', 'gtk-x11-2.0' ] - internal_libs = [ 'llvfs', 'llmath', 'llcommon' ] + internal_libs = [ 'llui', 'llxml', 'llmessage', 'llvfs', 'llmath', 'llcommon' ] create_executable(output_crashlogger_bin + '-globalsyms', 'linux_crash_logger', internal_libs + external_libs) diff --git a/linden/indra/indra_complete/indra_complete.sln b/linden/indra/indra_complete/indra_complete.sln index 513d9a8..83dbdc5 100644 --- a/linden/indra/indra_complete/indra_complete.sln +++ b/linden/indra/indra_complete/indra_complete.sln @@ -482,6 +482,7 @@ Global {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload.ActiveCfg = Release|Win32 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload.Build.0 = Release|Win32 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseNoOpt.ActiveCfg = ReleaseNoOpt|Win32 + {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseNoOpt.Build.0 = ReleaseNoOpt|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug.ActiveCfg = Debug|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug.Build.0 = Debug|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Release.ActiveCfg = Release|Win32 diff --git a/linden/indra/indra_complete/indra_complete_vc8.sln b/linden/indra/indra_complete/indra_complete_vc8.sln index 04e1e9a..f677d2c 100644 --- a/linden/indra/indra_complete/indra_complete_vc8.sln +++ b/linden/indra/indra_complete/indra_complete_vc8.sln @@ -26,28 +26,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llinventory", "..\llinvento EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newview", "..\newview\newview_vc8.vcproj", "{E6F4CF1B-6109-4CA8-B58D-87FA936CDE08}" ProjectSection(ProjectDependencies) = postProject - {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B} = {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B} - {9D0C7E02-6506-4EE7-BC5C-75671D28D594} = {9D0C7E02-6506-4EE7-BC5C-75671D28D594} - {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} - {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} - {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} - {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} - {076DD042-2E58-42EA-9401-53210B65C1FC} = {076DD042-2E58-42EA-9401-53210B65C1FC} - {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681} - {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} - {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} - {B771CF1B-E253-47BD-8B0A-6B0440CC9228} = {B771CF1B-E253-47BD-8B0A-6B0440CC9228} - {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} - {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} - {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} = {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} - {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} - {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} = {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} = {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} + {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} + {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} = {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} + {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} + {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} + {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} + {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681} + {076DD042-2E58-42EA-9401-53210B65C1FC} = {076DD042-2E58-42EA-9401-53210B65C1FC} + {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} + {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} + {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} + {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} + {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} + {9D0C7E02-6506-4EE7-BC5C-75671D28D594} = {9D0C7E02-6506-4EE7-BC5C-75671D28D594} + {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B} = {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B} EndProjectSection EndProject EndProject @@ -70,45 +69,43 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_compile", "..\lscri EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} - {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} - {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} - {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} - {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} - {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} - {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} - {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B} - {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} - {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} {023011F7-3ADB-49D3-9EC5-6D392F6D15FE} = {023011F7-3ADB-49D3-9EC5-6D392F6D15FE} + {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} + {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} + {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} + {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} + {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} + {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} + {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} + {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} - {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} - {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B} - {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} + {B4B838C7-2C72-428E-BBFD-25764E659A8B} = {B4B838C7-2C72-428E-BBFD-25764E659A8B} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} + {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_compile_fb", "..\lscript\lscript_compile\lscript_compile_fb_vc8.vcproj", "{B771CF1B-E253-47BD-8B0A-6B0440CC9228}" -EndProject ProjectSection(ProjectDependencies) = postProject {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} EndProjectSection @@ -119,11 +116,11 @@ EndProject EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_crash_logger", "..\win_crash_logger\win_crash_logger_vc8.vcproj", "{648685F3-8760-4CC5-BB2B-CAF9DECC25A4}" ProjectSection(ProjectDependencies) = postProject - {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} + {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_updater", "..\win_updater\win_updater_vc8.vcproj", "{E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}" @@ -133,16 +130,16 @@ EndProject EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} - {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} - {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} - {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681} - {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} + {DE55D666-6A3D-476C-937F-109269B83681} = {DE55D666-6A3D-476C-937F-109269B83681} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} + {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} = {93B2BA29-FBE9-4376-92C1-6108DCFE09D3} + {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} + {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} + {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llmedia", "..\llmedia\llmedia_vc8.vcproj", "{9D0C7E02-6506-4EE7-BC5C-75671D28D594}" @@ -150,51 +147,52 @@ EndProject EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "..\test\test_vc8.vcproj", "{BBAA6588-CA96-4A87-A988-B02270B8D02B}" ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} - {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} - {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} - {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} - {B771CF1B-E253-47BD-8B0A-6B0440CC9228} = {B771CF1B-E253-47BD-8B0A-6B0440CC9228} - {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC} = {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC} - {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} - {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} - {777F38BE-2DFE-4051-9AAD-2832ABC474CC} = {777F38BE-2DFE-4051-9AAD-2832ABC474CC} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {777F38BE-2DFE-4051-9AAD-2832ABC474CC} = {777F38BE-2DFE-4051-9AAD-2832ABC474CC} + {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E} + {A5470DA6-0C3A-4602-B930-43DB25511A59} = {A5470DA6-0C3A-4602-B930-43DB25511A59} + {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC} = {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808} + {328D1968-924F-4863-AAE8-5F9A95BA68E5} = {328D1968-924F-4863-AAE8-5F9A95BA68E5} + {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} + {F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552} + {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} - {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} - {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} - {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} - {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {E5D94794-5671-4BD6-A16D-26EC18F3DB34} = {E5D94794-5671-4BD6-A16D-26EC18F3DB34} + {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} = {4B19F64E-AB97-4FB9-8E1D-74A8104DE0C4} + {FCC4483C-5B84-4944-B91F-4589A219BC0B} = {FCC4483C-5B84-4944-B91F-4589A219BC0B} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} + {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} = {AF2D801E-EEE7-4B52-A025-F8E648ADC34B} + {B5B53617-416F-404A-BF10-22EBCCA0E4FB} = {B5B53617-416F-404A-BF10-22EBCCA0E4FB} + {2ADE3C14-94C4-40BF-B033-70F3C954EE90} = {2ADE3C14-94C4-40BF-B033-70F3C954EE90} EndProjectSection EndProject EndProject EndProject ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} - {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} + {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject ProjectSection(ProjectDependencies) = postProject - {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} - {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} + {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} = {681FDD6C-2FAE-4CB9-AF6D-B952F2B151C5} + {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llimagej2coj", "..\llimagej2coj\llimagej2coj_vc8.vcproj", "{4C8D64D5-649F-481E-96BE-EF1E82A77ACB}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lscript_compile_fb_vc8", "..\lscript\lscript_compile\lscript_compile_fb_vc8.vcproj", "{B771CF1B-E253-47BD-8B0A-6B0440CC9228}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -414,16 +412,6 @@ Global {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseForDownload|Win32.Build.0 = Release|Win32 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32 {A5504A1E-8BA4-45D2-8144-1B6937E37E98}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.ActiveCfg = Debug|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.Build.0 = Debug|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.ActiveCfg = Release|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.Build.0 = Release|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.Build.0 = Release|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32 - {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.Build.0 = Release|Win32 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Debug|Win32.ActiveCfg = Debug|Win32 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Debug|Win32.Build.0 = Debug|Win32 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 @@ -432,6 +420,7 @@ Global {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.Release|Win32.Build.0 = Release|Win32 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32 + {777F38BE-2DFE-4051-9AAD-2832ABC474CC}.ReleaseNoOpt|Win32.Build.0 = Release|Win32 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Debug|Win32.ActiveCfg = Debug|Win32 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Debug|Win32.Build.0 = Debug|Win32 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 @@ -440,6 +429,7 @@ Global {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.Release|Win32.Build.0 = Release|Win32 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32 + {EC2A989E-3F8F-4B8B-9AE6-7C7EA37C84BC}.ReleaseNoOpt|Win32.Build.0 = Release|Win32 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Debug|Win32.ActiveCfg = Debug|Win32 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.Debug|Win32.Build.0 = Debug|Win32 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 @@ -449,7 +439,6 @@ Global {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseForDownload|Win32.Build.0 = Release|Win32 {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32 - {648685F3-8760-4CC5-BB2B-CAF9DECC25A4}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Debug|Win32.ActiveCfg = Debug|Win32 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.Debug|Win32.Build.0 = Debug|Win32 {E928F33B-E090-4FA8-818B-6B5D8B0F1F4B}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 @@ -513,6 +502,7 @@ Global {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseForDownload|Win32.Build.0 = Release|Win32 {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32 + {E9F5BD55-F8E8-4C61-B9B5-CCE7C1048241}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug|Win32.ActiveCfg = Debug|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.Debug|Win32.Build.0 = Debug|Win32 {023011F7-3ADB-49D3-9EC5-6D392F6D15FE}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 @@ -563,6 +553,16 @@ Global {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseForDownload|Win32.Build.0 = Release|Win32 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseNoOpt|Win32.ActiveCfg = ReleaseNoOpt|Win32 {4C8D64D5-649F-481E-96BE-EF1E82A77ACB}.ReleaseNoOpt|Win32.Build.0 = ReleaseNoOpt|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.ActiveCfg = Debug|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Debug|Win32.Build.0 = Debug|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.ActiveCfg = Debug|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.DebugMesaHeadless|Win32.Build.0 = Debug|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.ActiveCfg = Release|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.Release|Win32.Build.0 = Release|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.ActiveCfg = Release|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseForDownload|Win32.Build.0 = Release|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.ActiveCfg = Release|Win32 + {B771CF1B-E253-47BD-8B0A-6B0440CC9228}.ReleaseNoOpt|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/linden/indra/lib/python/indra/util/llmanifest.py b/linden/indra/lib/python/indra/util/llmanifest.py index 029b697..2408fab 100644 --- a/linden/indra/lib/python/indra/util/llmanifest.py +++ b/linden/indra/lib/python/indra/util/llmanifest.py @@ -38,6 +38,7 @@ import re import shutil import sys import tarfile +import errno def path_ancestors(path): path = os.path.normpath(path) @@ -463,6 +464,12 @@ class LLManifest(object): return # only copy if it's not excluded if(self.includes(src, dst)): + try: + os.unlink(dst) + except OSError, err: + if err.errno != errno.ENOENT: + raise + shutil.copy2(src, dst) def ccopytree(self, src, dst): diff --git a/linden/indra/linux_crash_logger/files.lst b/linden/indra/linux_crash_logger/files.lst index 8bf99b0..5c8b9a2 100644 --- a/linden/indra/linux_crash_logger/files.lst +++ b/linden/indra/linux_crash_logger/files.lst @@ -1 +1,3 @@ +llcrashlogger/llcrashlogger.cpp linux_crash_logger/linux_crash_logger.cpp +linux_crash_logger/llcrashloggerlinux.cpp diff --git a/linden/indra/linux_crash_logger/linux_crash_logger.cpp b/linden/indra/linux_crash_logger/linux_crash_logger.cpp index e75a317..5310093 100644 --- a/linden/indra/linux_crash_logger/linux_crash_logger.cpp +++ b/linden/indra/linux_crash_logger/linux_crash_logger.cpp @@ -29,542 +29,16 @@ * $/LicenseInfo$ */ -#include "linden_common.h" - -#include -#include -#include - -#include - -#if LL_GTK -# include "gtk/gtk.h" -#endif // LL_GTK - -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" - -#include "llstring.h" - - -// These need to be localized. -static const char dialog_text[] = -"Second Life appears to have crashed.\n" -"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, which are used for debugging purposes only.\n" -"Sending crash reports is the best way to help us improve the quality of Second Life.\n" -"If you continue to experience this problem, please try:\n" -"- Contacting support by visiting http://www.secondlife.com/support\n" -"\n" -"Send crash report?"; - -static const char dialog_title[] = -"Second Life Crash Logger"; - - -class LLFileEncoder -{ -public: - LLFileEncoder(const char *formname, const char *filename, bool isCrashLog = false); - - BOOL isValid() const { return mIsValid; } - LLString encodeURL(const S32 max_length = 0); -public: - BOOL mIsValid; - LLString mFilename; - LLString mFormname; - LLString mBuf; -}; - -LLString encode_string(const char *formname, const LLString &str); - -LLString gServerResponse; -BOOL gSendReport = FALSE; -LLString gUserserver; -LLString gUserText; -BOOL gCrashInPreviousExec = FALSE; -time_t gLaunchTime; - -static size_t curl_download_callback(void *data, size_t size, size_t nmemb, - void *user_data) -{ - S32 bytes = size * nmemb; - char *cdata = (char *) data; - for (int i =0; i < bytes; i += 1) - { - gServerResponse += (cdata[i]); - } - return bytes; -} - -#if LL_GTK -static void response_callback (GtkDialog *dialog, - gint arg1, - gpointer user_data) -{ - gint *response = (gint*)user_data; - *response = arg1; - gtk_widget_destroy(GTK_WIDGET(dialog)); - gtk_main_quit(); -} -#endif // LL_GTK - -static BOOL do_ask_dialog(void) -{ -#if LL_GTK - gtk_disable_setlocale(); - if (!gtk_init_check(NULL, NULL)) { - llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl; - return FALSE; - } - - GtkWidget *win = NULL; - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype = GTK_MESSAGE_QUESTION; - GtkButtonsType buttons = GTK_BUTTONS_YES_NO; - gint response = GTK_RESPONSE_NONE; - - win = gtk_message_dialog_new(NULL, - flags, messagetype, buttons, - dialog_text); - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_title(GTK_WINDOW(win), dialog_title); - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - gtk_widget_show_all (win); - gtk_main(); - - return (GTK_RESPONSE_OK == response || - GTK_RESPONSE_YES == response || - GTK_RESPONSE_APPLY == response); -#else - return FALSE; -#endif // LL_GTK -} - +#include "llcrashloggerlinux.h" int main(int argc, char **argv) { - const S32 BT_MAX_SIZE = 100000; // Maximum size to transmit of the backtrace file - const S32 SL_MAX_SIZE = 100000; // Maximum size of the Second Life log file. - int i; - S32 crash_behavior = CRASH_BEHAVIOR_ALWAYS_SEND; - - time(&gLaunchTime); - - llinfos << "Starting Second Life Viewer Crash Reporter" << llendl; - - for(i=1; iinitAppDirs("SecondLife"); - - // Lots of silly variable, replicated for each log file. - LLString db_file_name; - LLString sl_file_name; - LLString bt_file_name; // stack_trace.log file - LLString st_file_name; // stats.log file - LLString si_file_name; // settings.xml file - - LLFileEncoder *db_filep = NULL; - LLFileEncoder *sl_filep = NULL; - LLFileEncoder *st_filep = NULL; - LLFileEncoder *bt_filep = NULL; - LLFileEncoder *si_filep = NULL; - - /////////////////////////////////// - // - // We do the parsing for the debug_info file first, as that will - // give us the location of the SecondLife.log file. - // - - // Figure out the filename of the debug log - db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log").c_str(); - db_filep = new LLFileEncoder("DB", db_file_name.c_str()); - - // Get the filename of the SecondLife.log file - // *NOTE: These buffer sizes are hardcoded into a scanf() below. - char tmp_sl_name[LL_MAX_PATH]; - tmp_sl_name[0] = '\0'; - char tmp_space[256]; - tmp_space[0] = '\0'; - - // Look for it in the debug_info.log file - if (db_filep->isValid()) - { - // This was originally scanning for "SL Log: %[^\r\n]", which happily skipped to the next line - // on debug logs (which don't have anything after "SL Log:" and tried to open a nonsensical filename. - sscanf(db_filep->mBuf.c_str(), "SL Log:%255[ ]%1023[^\r\n]", tmp_space, tmp_sl_name); - } - else - { - delete db_filep; - db_filep = NULL; - } - - // If we actually have a legitimate file name, use it. - if (gCrashInPreviousExec) - { - // If we froze, the crash log this time around isn't useful. - // Use the old one. - sl_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.old"); - } - else if (tmp_sl_name[0]) - { - sl_file_name = tmp_sl_name; - llinfos << "Using log file from debug log: " << sl_file_name << llendl; - } - else - { - // Figure out the filename of the second life log - sl_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log").c_str(); - } - - // Now we get the SecondLife.log file if it's there, and recent enough... - sl_filep = new LLFileEncoder("SL", sl_file_name.c_str()); - if (!sl_filep->isValid()) - { - delete sl_filep; - sl_filep = NULL; - } - - st_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log").c_str(); - st_filep = new LLFileEncoder("ST", st_file_name.c_str()); - if (!st_filep->isValid()) - { - delete st_filep; - st_filep = NULL; - } - - si_file_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml").c_str(); - si_filep = new LLFileEncoder("SI", si_file_name.c_str()); - if (!si_filep->isValid()) - { - delete si_filep; - si_filep = NULL; - } - - // encode this as if it were a 'Dr Watson' plain-text backtrace - bt_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log").c_str(); - bt_filep = new LLFileEncoder("DW", bt_file_name.c_str()); - if (!bt_filep->isValid()) - { - delete bt_filep; - bt_filep = NULL; - } - - LLString post_data; - LLString tmp_url_buf; - - // Append the userserver - tmp_url_buf = encode_string("USER", gUserserver); - post_data += tmp_url_buf; - llinfos << "PostData:" << post_data << llendl; - - if (gCrashInPreviousExec) - { - post_data.append("&"); - tmp_url_buf = encode_string("EF", "Y"); - post_data += tmp_url_buf; - } - - if (db_filep) - { - post_data.append("&"); - tmp_url_buf = db_filep->encodeURL(); - post_data += tmp_url_buf; - llinfos << "Sending DB log file" << llendl; - } - else - { - llinfos << "Not sending DB log file" << llendl; - } - - if (sl_filep) - { - post_data.append("&"); - tmp_url_buf = sl_filep->encodeURL(SL_MAX_SIZE); - post_data += tmp_url_buf; - llinfos << "Sending SL log file" << llendl; - } - else - { - llinfos << "Not sending SL log file" << llendl; - } - - if (st_filep) - { - post_data.append("&"); - tmp_url_buf = st_filep->encodeURL(SL_MAX_SIZE); - post_data += tmp_url_buf; - llinfos << "Sending stats log file" << llendl; - } - else - { - llinfos << "Not sending stats log file" << llendl; - } - - if (bt_filep) - { - post_data.append("&"); - tmp_url_buf = bt_filep->encodeURL(BT_MAX_SIZE); - post_data += tmp_url_buf; - llinfos << "Sending crash log file" << llendl; - } - else - { - llinfos << "Not sending crash log file" << llendl; - } - - if (si_filep) - { - post_data.append("&"); - tmp_url_buf = si_filep->encodeURL(); - post_data += tmp_url_buf; - llinfos << "Sending settings log file" << llendl; - } - else - { - llinfos << "Not sending settings.xml file" << llendl; - } - - if (gUserText.size()) - { - post_data.append("&"); - tmp_url_buf = encode_string("UN", gUserText); - post_data += tmp_url_buf; - } - - delete db_filep; - db_filep = NULL; - delete sl_filep; - sl_filep = NULL; - delete bt_filep; - bt_filep = NULL; - - // Debugging spam -#if 0 - printf("Crash report post data:\n--------\n"); - printf("%s", post_data.getString()); - printf("\n--------\n"); -#endif - - // Send the report. Yes, it's this easy. - { - CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); - curl_easy_setopt(curl, CURLOPT_POST, 1); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data.c_str()); - curl_easy_setopt(curl, CURLOPT_URL, "http://EXAMPLE.com/cgi-bin/viewer_crash_reporter2"); - - llinfos << "Connecting to crash report server" << llendl; - CURLcode result = curl_easy_perform(curl); - - curl_easy_cleanup(curl); - - if(result != CURLE_OK) - { - llinfos << "Couldn't talk to crash report server" << llendl; - } - else - { - llinfos << "Response from crash report server:" << llendl; - llinfos << gServerResponse << llendl; - } - } - + LLCrashLoggerLinux app; + app.parseCommandOptions(argc, argv); + app.init(); + app.mainLoop(); + app.cleanup(); return 0; } -LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool isCrashLog) -{ - mFormname = form_name; - mFilename = filename; - mIsValid = FALSE; - - int res; - - struct stat stat_data; - res = stat(mFilename.c_str(), &stat_data); - if (res) - { - llwarns << "File " << mFilename << " is missing!" << llendl; - return; - } - else - { - // Debugging spam -// llinfos << "File " << mFilename << " is present..." << llendl; - - if(!gCrashInPreviousExec && isCrashLog) - { - // Make sure the file isn't too old. - double age = difftime(gLaunchTime, stat_data.st_mtim.tv_sec); - -// llinfos << "age is " << age << llendl; - if(age > 60.0) - { - // The file was last modified more than 60 seconds before the crash reporter was launched. Assume it's stale. - llwarns << "File " << mFilename << " is too old!" << llendl; - return; - } - } - - } - - S32 buf_size = stat_data.st_size; - FILE *fp = fopen(mFilename.c_str(), "rb"); - U8 *buf = new U8[buf_size + 1]; - size_t nread = fread(buf, 1, buf_size, fp); - fclose(fp); - buf[nread] = 0; - - mBuf = (char *)buf; - - if(isCrashLog) - { - // Crash logs consist of a number of entries, one per crash. - // Each entry is preceeded by "**********" on a line by itself. - // We want only the most recent (i.e. last) one. - const char *sep = "**********"; - const char *start = mBuf.c_str(); - const char *cur = start; - const char *temp = strstr(cur, sep); - - while(temp != NULL) - { - // Skip past the marker we just found - cur = temp + strlen(sep); - - // and try to find another - temp = strstr(cur, sep); - } - - // If there's more than one entry in the log file, strip all but the last one. - if(cur != start) - { - mBuf.erase(0, cur - start); - } - } - - mIsValid = TRUE; - delete[] buf; -} - -LLString LLFileEncoder::encodeURL(const S32 max_length) -{ - LLString result = mFormname; - result.append("="); - - S32 i = 0; - - if (max_length) - { - if ((S32)mBuf.size() > max_length) - { - i = mBuf.size() - max_length; - } - } - -#if 0 - // Plain text version for debugging - result.append(mBuf); -#else - // Not using LLString because of bad performance issues - S32 buf_size = mBuf.size(); - S32 url_buf_size = 3*mBuf.size() + 1; - char *url_buf = new char[url_buf_size]; - - S32 cur_pos = 0; - for (; i < buf_size; i++) - { - sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); - cur_pos += 3; - } - url_buf[i*3] = 0; - - result.append(url_buf); - delete[] url_buf; -#endif - return result; -} - -LLString encode_string(const char *formname, const LLString &str) -{ - LLString result = formname; - result.append("="); - // Not using LLString because of bad performance issues - S32 buf_size = str.size(); - S32 url_buf_size = 3*str.size() + 1; - char *url_buf = new char[url_buf_size]; - - S32 cur_pos = 0; - S32 i; - for (i = 0; i < buf_size; i++) - { - sprintf(url_buf + cur_pos, "%%%02x", str[i]); - cur_pos += 3; - } - url_buf[i*3] = 0; - - result.append(url_buf); - delete[] url_buf; - return result; -} diff --git a/linden/indra/linux_crash_logger/llcrashloggerlinux.cpp b/linden/indra/linux_crash_logger/llcrashloggerlinux.cpp new file mode 100644 index 0000000..26a8f0c --- /dev/null +++ b/linden/indra/linux_crash_logger/llcrashloggerlinux.cpp @@ -0,0 +1,140 @@ +/** + * @file llcrashloggerlinux.cpp + * @brief Linux crash logger implementation + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llcrashloggerlinux.h" + +#include + +#include "linden_common.h" + +#include "boost/tokenizer.hpp" + +#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME +#include "llerror.h" +#include "llfile.h" +#include "lltimer.h" +#include "llstring.h" +#include "lldir.h" +#include "llsdserialize.h" + +#if LL_GTK +# include "gtk/gtk.h" +#endif // LL_GTK + +#define MAX_LOADSTRING 100 + +// These need to be localized. +static const char dialog_text[] = +"Second Life appears to have crashed or frozen last time it ran.\n" +"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n" +"In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help!\n" +"This report is NOT read by Customer Support. If you have billing or other questions, contact support by visiting http://www.secondlife.com/support\n" +"\n" +"Send crash report?"; + +static const char dialog_title[] = +"Second Life Crash Logger"; + +#if LL_GTK +static void response_callback (GtkDialog *dialog, + gint arg1, + gpointer user_data) +{ + gint *response = (gint*)user_data; + *response = arg1; + gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_main_quit(); +} +#endif // LL_GTK + +static BOOL do_ask_dialog(void) +{ +#if LL_GTK + gtk_disable_setlocale(); + if (!gtk_init_check(NULL, NULL)) { + llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl; + return FALSE; + } + + GtkWidget *win = NULL; + GtkDialogFlags flags = GTK_DIALOG_MODAL; + GtkMessageType messagetype = GTK_MESSAGE_QUESTION; + GtkButtonsType buttons = GTK_BUTTONS_YES_NO; + gint response = GTK_RESPONSE_NONE; + + win = gtk_message_dialog_new(NULL, + flags, messagetype, buttons, + dialog_text); + gtk_window_set_type_hint(GTK_WINDOW(win), + GDK_WINDOW_TYPE_HINT_DIALOG); + gtk_window_set_title(GTK_WINDOW(win), dialog_title); + g_signal_connect (win, + "response", + G_CALLBACK (response_callback), + &response); + gtk_widget_show_all (win); + gtk_main(); + + return (GTK_RESPONSE_OK == response || + GTK_RESPONSE_YES == response || + GTK_RESPONSE_APPLY == response); +#else + return FALSE; +#endif // LL_GTK +} + +LLCrashLoggerLinux::LLCrashLoggerLinux(void) +{ +} + +LLCrashLoggerLinux::~LLCrashLoggerLinux(void) +{ +} + +void LLCrashLoggerLinux::gatherPlatformSpecificFiles() +{ + mFileMap["CrashLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log").c_str(); +} + +bool LLCrashLoggerLinux::mainLoop() +{ + if(!do_ask_dialog()) + { + return true; + } + sendCrashLogs(); + return true; +} + +void LLCrashLoggerLinux::updateApplication(LLString message) +{ + LLCrashLogger::updateApplication(message); +} diff --git a/linden/indra/linux_crash_logger/llcrashloggerlinux.h b/linden/indra/linux_crash_logger/llcrashloggerlinux.h new file mode 100644 index 0000000..a84ee00 --- /dev/null +++ b/linden/indra/linux_crash_logger/llcrashloggerlinux.h @@ -0,0 +1,49 @@ +/** + * @file llcrashloggerlinux.h + * @brief Linux crash logger definition + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLCRASHLOGGERLINUX_H +#define LLCRASHLOGGERLINUX_H + +#include "linden_common.h" +#include "llcrashlogger.h" +#include "llstring.h" + +class LLCrashLoggerLinux : public LLCrashLogger +{ +public: + LLCrashLoggerLinux(void); + ~LLCrashLoggerLinux(void); + virtual bool mainLoop(); + virtual void updateApplication(LLString message = ""); + virtual void gatherPlatformSpecificFiles(); +}; + +#endif diff --git a/linden/indra/llcommon/llapp.cpp b/linden/indra/llcommon/llapp.cpp index b0751b8..2347ac9 100644 --- a/linden/indra/llcommon/llapp.cpp +++ b/linden/indra/llcommon/llapp.cpp @@ -47,6 +47,7 @@ // #if LL_WINDOWS LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop); +BOOL ConsoleCtrlHandler(DWORD fdwCtrlType); #else #include // for fork() void setup_signals(); @@ -219,6 +220,11 @@ void LLApp::setupErrorHandling() // Disable this until the viewer gets ported so server crashes can be JIT debugged. //LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; //prev_filter = SetUnhandledExceptionFilter(default_windows_exception_handler); + + // This sets a callback to handle w32 signals to the console window. + // The viewer shouldn't be affected, sicne its a windowed app. + SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE); + #else // // Start up signal handling. @@ -399,6 +405,34 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except return retval; } +// Win32 doesn't support signals. This is used instead. +BOOL ConsoleCtrlHandler(DWORD fdwCtrlType) +{ + switch (fdwCtrlType) + { + case CTRL_BREAK_EVENT: + case CTRL_LOGOFF_EVENT: + case CTRL_SHUTDOWN_EVENT: + case CTRL_CLOSE_EVENT: // From end task or the window close button. + case CTRL_C_EVENT: // from CTRL-C on the keyboard + // Just set our state to quitting, not error + if (LLApp::isQuitting() || LLApp::isError()) + { + // We're already trying to die, just ignore this signal + if (LLApp::sLogInSignal) + { + llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl; + } + return TRUE; + } + LLApp::setQuitting(); + return TRUE; + + default: + return FALSE; + } +} + #else //!LL_WINDOWS void LLApp::setChildCallback(pid_t pid, LLAppChildCallback callback) { diff --git a/linden/indra/llcommon/llavatarconstants.h b/linden/indra/llcommon/llavatarconstants.h index c62cae2..4ba6642 100644 --- a/linden/indra/llcommon/llavatarconstants.h +++ b/linden/indra/llcommon/llavatarconstants.h @@ -49,6 +49,7 @@ const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature" const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known. +const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified static const std::string VISIBILITY_DEFAULT("default"); static const std::string VISIBILITY_HIDDEN("hidden"); diff --git a/linden/indra/llcommon/llcommon.vcproj b/linden/indra/llcommon/llcommon.vcproj index 80704af..0ab544e 100644 --- a/linden/indra/llcommon/llcommon.vcproj +++ b/linden/indra/llcommon/llcommon.vcproj @@ -415,6 +415,9 @@ RelativePath=".\llindexedqueue.h"> + + class ImplBase : public LLSD::Impl ///< This class handles most of the work for a subclass of Impl @@ -632,7 +648,11 @@ U32 LLSD::Impl::sOutstandingCount = 0; +#ifdef NAME_UNNAMED_NAMESPACE +namespace LLSDUnnamedNamespace { +#else namespace { +#endif inline LLSD::Impl& safe(LLSD::Impl* impl) { return LLSD::Impl::safe(impl); } diff --git a/linden/indra/llcommon/llsd.h b/linden/indra/llcommon/llsd.h index 1fb917f..65ba7dd 100644 --- a/linden/indra/llcommon/llsd.h +++ b/linden/indra/llcommon/llsd.h @@ -376,6 +376,7 @@ struct llsd_select_string : public std::unary_function } }; +std::ostream& operator<<(std::ostream& s, const LLSD& llsd); /** QUESTIONS & TO DOS - Would Binary be more convenient as usigned char* buffer semantics? diff --git a/linden/indra/llcommon/llsdserialize.cpp b/linden/indra/llcommon/llsdserialize.cpp index a7470be..5ab9471 100644 --- a/linden/indra/llcommon/llsdserialize.cpp +++ b/linden/indra/llcommon/llsdserialize.cpp @@ -1641,4 +1641,9 @@ void serialize_string(const std::string& value, std::ostream& str) } } +std::ostream& operator<<(std::ostream& s, const LLSD& llsd) +{ + s << LLSDNotationStreamer(llsd); + return s; +} diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp index 6dab598..e701ea0 100644 --- a/linden/indra/llcommon/llstring.cpp +++ b/linden/indra/llcommon/llstring.cpp @@ -34,6 +34,13 @@ #include "llstring.h" #include "llerror.h" +#if LL_WINDOWS +#define WIN32_LEAN_AND_MEAN +#include +#include +#include // for WideCharToMultiByte +#endif + std::string ll_safe_string(const char* in) { if(in) return std::string(in); @@ -718,19 +725,7 @@ std::string utf8str_removeCRLF(const std::string& utf8str) } #if LL_WINDOWS -/* If the size of the passed in buffer is not large enough to hold the string, - * two bad things happen: - * 1. resulting formatted string is NOT null terminated - * 2. Depending on the platform, the return value could be a) the required - * size of the buffer to copy the entire formatted string or b) -1. - * On Windows with VS.Net 2003, it returns -1 e.g. - * - * safe_snprintf always adds a NULL terminator so that the caller does not - * need to check for return value or need to add the NULL terminator. - * It does not, however change the return value - to let the caller know - * that the passed in buffer size was not large enough to hold the formatted string. - * - */ +// documentation moved to header. Phoenix 2007-11-27 int safe_snprintf(char *str, size_t size, const char *format, ...) { va_list args; @@ -742,6 +737,43 @@ int safe_snprintf(char *str, size_t size, const char *format, ...) str[size-1] = '\0'; // always null terminate return num_written; } + +std::string ll_convert_wide_to_string(const wchar_t* in) +{ + std::string out; + if(in) + { + int len_in = wcslen(in); + int len_out = WideCharToMultiByte( + CP_ACP, + 0, + in, + len_in, + NULL, + 0, + 0, + 0); + // We will need two more bytes for the double NULL ending + // created in WideCharToMultiByte(). + char* pout = new char [len_out + 2]; + memset(pout, 0, len_out + 2); + if(pout) + { + WideCharToMultiByte( + CP_ACP, + 0, + in, + len_in, + pout, + len_out, + 0, + 0); + out.assign(pout); + delete[] pout; + } + } + return out; +} #endif // LL_WINDOWS S32 LLStringOps::collate(const llwchar* a, const llwchar* b) diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h index 70f7d54..ae44ac3 100644 --- a/linden/indra/llcommon/llstring.h +++ b/linden/indra/llcommon/llstring.h @@ -481,7 +481,37 @@ std::ostream& operator<<(std::ostream &s, const LLStringBase &str) std::ostream& operator<<(std::ostream &s, const LLWString &wstr); #if LL_WINDOWS -int safe_snprintf(char *str, size_t size, const char *format, ...); +/* @name Windows string helpers + */ +//@{ + +/** + * @brief Implementation the expected snprintf interface. + * + * If the size of the passed in buffer is not large enough to hold the string, + * two bad things happen: + * 1. resulting formatted string is NOT null terminated + * 2. Depending on the platform, the return value could be a) the required + * size of the buffer to copy the entire formatted string or b) -1. + * On Windows with VS.Net 2003, it returns -1 e.g. + * + * safe_snprintf always adds a NULL terminator so that the caller does not + * need to check for return value or need to add the NULL terminator. + * It does not, however change the return value - to let the caller know + * that the passed in buffer size was not large enough to hold the + * formatted string. + * + */ +int safe_snprintf(char* str, size_t size, const char* format, ...); + +/** + * @brief Convert a wide string to std::string + * + * This replaces the unsafe W2A macro from ATL. + */ +std::string ll_convert_wide_to_string(const wchar_t* in); + +//@} #endif // LL_WINDOWS /** diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp index 3b57db7..7346b29 100644 --- a/linden/indra/llcommon/llsys.cpp +++ b/linden/indra/llcommon/llsys.cpp @@ -65,8 +65,7 @@ static const S32 CPUINFO_BUFFER_SIZE = 16383; LLCPUInfo gSysCPU; LLOSInfo::LLOSInfo() : - mMajorVer(0), mMinorVer(0), mBuild(0), - mOSString("") + mMajorVer(0), mMinorVer(0), mBuild(0) { #if LL_WINDOWS @@ -94,27 +93,28 @@ LLOSInfo::LLOSInfo() : // Test for the product. if(osvi.dwMajorVersion <= 4) { - mOSString = "Microsoft Windows NT "; + mOSStringSimple = "Microsoft Windows NT "; } else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) { - mOSString = "Microsoft Windows 2000 "; + mOSStringSimple = "Microsoft Windows 2000 "; } else if(osvi.dwMajorVersion ==5 && osvi.dwMinorVersion == 1) { - mOSString = "Microsoft Windows XP "; + mOSStringSimple = "Microsoft Windows XP "; } else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { if(osvi.wProductType == VER_NT_WORKSTATION) - mOSString = "Microsoft Windows XP x64 Edition "; - else mOSString = "Microsoft Windows Server 2003 "; + mOSStringSimple = "Microsoft Windows XP x64 Edition "; + else + mOSStringSimple = "Microsoft Windows Server 2003 "; } else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { if(osvi.wProductType == VER_NT_WORKSTATION) - mOSString = "Microsoft Windows Vista "; - else mOSString = "Microsoft Windows Vista Server "; + mOSStringSimple = "Microsoft Windows Vista "; + else mOSStringSimple = "Microsoft Windows Vista Server "; } else // Use the registry on early versions of Windows NT. { @@ -129,15 +129,15 @@ LLOSInfo::LLOSInfo() : RegCloseKey( hKey ); if ( lstrcmpi( L"WINNT", szProductType) == 0 ) { - mOSString += "Professional "; + mOSStringSimple += "Professional "; } else if ( lstrcmpi( L"LANMANNT", szProductType) == 0 ) { - mOSString += "Server "; + mOSStringSimple += "Server "; } else if ( lstrcmpi( L"SERVERNT", szProductType) == 0 ) { - mOSString += "Advanced Server "; + mOSStringSimple += "Advanced Server "; } } @@ -164,7 +164,7 @@ LLOSInfo::LLOSInfo() : csdversion.c_str(), (osvi.dwBuildNumber & 0xffff)); } - mOSString += tmp; + mOSString = mOSStringSimple + tmp; } break; @@ -172,41 +172,65 @@ LLOSInfo::LLOSInfo() : // Test for the Windows 95 product family. if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) { - mOSString = "Microsoft Windows 95 "; + mOSStringSimple = "Microsoft Windows 95 "; if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' ) { - mOSString += "OSR2 "; + mOSStringSimple += "OSR2 "; } } if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) { - mOSString = "Microsoft Windows 98 "; + mOSStringSimple = "Microsoft Windows 98 "; if ( osvi.szCSDVersion[1] == 'A' ) { - mOSString += "SE "; + mOSStringSimple += "SE "; } } if(osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) { - mOSString = "Microsoft Windows Millennium Edition "; - } + mOSStringSimple = "Microsoft Windows Millennium Edition "; + } + mOSString = mOSStringSimple; break; } #else struct utsname un; - if(uname(&un) != -1) + if(uname(&un) != -1) { - mOSString.append(un.sysname); - mOSString.append(" "); - mOSString.append(un.release); + mOSStringSimple.append(un.sysname); + mOSStringSimple.append(" "); + mOSStringSimple.append(un.release); + + mOSString = mOSStringSimple; mOSString.append(" "); mOSString.append(un.version); mOSString.append(" "); mOSString.append(un.machine); + + // Simplify 'Simple' + std::string ostype = mOSStringSimple.substr(0, mOSStringSimple.find_first_of(" ", 0)); + if (ostype == "Darwin") + { + // Only care about major Darwin versions, truncate at first '.' + S32 idx1 = mOSStringSimple.find_first_of(".", 0); + std::string simple = mOSStringSimple.substr(0, idx1); + if (simple.length() > 0) + mOSStringSimple = simple; + } + else if (ostype == "Linux") + { + // Only care about major and minor Linux versions, truncate at second '.' + S32 idx1 = mOSStringSimple.find_first_of(".", 0); + S32 idx2 = (idx1 != std::string::npos) ? mOSStringSimple.find_first_of(".", idx1+1) : std::string::npos; + std::string simple = mOSStringSimple.substr(0, idx2); + if (simple.length() > 0) + mOSStringSimple = simple; + } } else { - mOSString.append("Unable to collect OS info"); + mOSStringSimple.append("Unable to collect OS info"); + mOSString = mOSStringSimple; } #endif @@ -255,6 +279,11 @@ const std::string& LLOSInfo::getOSString() const return mOSString; } +const std::string& LLOSInfo::getOSStringSimple() const +{ + return mOSStringSimple; +} + const S32 STATUS_SIZE = 8192; //static diff --git a/linden/indra/llcommon/llsys.h b/linden/indra/llcommon/llsys.h index fc4e027..332d62c 100644 --- a/linden/indra/llcommon/llsys.h +++ b/linden/indra/llcommon/llsys.h @@ -51,6 +51,7 @@ public: void stream(std::ostream& s) const; const std::string& getOSString() const; + const std::string& getOSStringSimple() const; S32 mMajorVer; S32 mMinorVer; @@ -64,6 +65,7 @@ public: static U32 getProcessResidentSizeKB(); private: std::string mOSString; + std::string mOSStringSimple; }; diff --git a/linden/indra/llcommon/lluri.cpp b/linden/indra/llcommon/lluri.cpp index df79043..5e4dec7 100644 --- a/linden/indra/llcommon/lluri.cpp +++ b/linden/indra/llcommon/lluri.cpp @@ -40,6 +40,8 @@ #include "../llmath/lluuid.h" +// system includes +#include // static std::string LLURI::escape(const std::string& str, const std::string & allowed) @@ -130,7 +132,7 @@ LLURI::LLURI() LLURI::LLURI(const std::string& escaped_str) { - std::string::size_type delim_pos, delim_pos2; + std::string::size_type delim_pos; delim_pos = escaped_str.find(':'); std::string temp; if (delim_pos == std::string::npos) @@ -144,13 +146,39 @@ LLURI::LLURI(const std::string& escaped_str) mEscapedOpaque = escaped_str.substr(delim_pos+1); } - if (mScheme == "http" || mScheme == "https" || mScheme == "ftp") + parseAuthorityAndPathUsingOpaque(); + + delim_pos = mEscapedPath.find('?'); + if (delim_pos != std::string::npos) + { + mEscapedQuery = mEscapedPath.substr(delim_pos+1); + mEscapedPath = mEscapedPath.substr(0,delim_pos); + } +} + +static BOOL isDefault(const std::string& scheme, U16 port) +{ + if (scheme == "http") + return port == 80; + if (scheme == "https") + return port == 443; + if (scheme == "ftp") + return port == 21; + + return FALSE; +} + +void LLURI::parseAuthorityAndPathUsingOpaque() +{ + if (mScheme == "http" || mScheme == "https" || + mScheme == "ftp" || mScheme == "secondlife" ) { if (mEscapedOpaque.substr(0,2) != "//") { return; } - + + std::string::size_type delim_pos, delim_pos2; delim_pos = mEscapedOpaque.find('/', 2); delim_pos2 = mEscapedOpaque.find('?', 2); // no path, no query @@ -182,27 +210,12 @@ LLURI::LLURI(const std::string& escaped_str) mEscapedPath = mEscapedOpaque.substr(delim_pos); } } - - delim_pos = mEscapedPath.find('?'); - if (delim_pos != std::string::npos) + else if (mScheme == "about") { - mEscapedQuery = mEscapedPath.substr(delim_pos+1); - mEscapedPath = mEscapedPath.substr(0,delim_pos); + mEscapedPath = mEscapedOpaque; } } -static BOOL isDefault(const std::string& scheme, U16 port) -{ - if (scheme == "http") - return port == 80; - if (scheme == "https") - return port == 443; - if (scheme == "ftp") - return port == 21; - - return FALSE; -} - LLURI::LLURI(const std::string& scheme, const std::string& userName, const std::string& password, @@ -440,6 +453,22 @@ std::string LLURI::path() const return unescape(mEscapedPath); } +LLSD LLURI::pathArray() const +{ + typedef boost::tokenizer > tokenizer; + boost::char_separator sep("/", "", boost::drop_empty_tokens); + tokenizer tokens(mEscapedPath, sep); + tokenizer::iterator it = tokens.begin(); + tokenizer::iterator end = tokens.end(); + + LLSD params; + for ( ; it != end; ++it) + { + params.append(*it); + } + return params; +} + std::string LLURI::query() const { return unescape(mEscapedQuery); diff --git a/linden/indra/llcommon/lluri.h b/linden/indra/llcommon/lluri.h index 3246dcd..bfe673c 100644 --- a/linden/indra/llcommon/lluri.h +++ b/linden/indra/llcommon/lluri.h @@ -107,7 +107,7 @@ public: BOOL defaultPort() const; // true if port is default for scheme const std::string& escapedPath() const { return mEscapedPath; } std::string path() const; // ex.: "/abc/def", includes leading slash - // LLSD pathArray() const; // above decoded into an array of strings + LLSD pathArray() const; // above decoded into an array of strings std::string query() const; // ex.: "x=34", section after "?" const std::string& escapedQuery() const { return mEscapedQuery; } LLSD queryMap() const; // above decoded into a map @@ -135,6 +135,11 @@ public: //@} private: + // only "http", "https", "ftp", and "secondlife" schemes are parsed + // secondlife scheme parses authority as "" and includes it as part of + // the path. See lluri_tut.cpp + // i.e. secondlife://app/login has mAuthority = "" and mPath = "/app/login" + void parseAuthorityAndPathUsingOpaque(); std::string mScheme; std::string mEscapedOpaque; std::string mEscapedAuthority; diff --git a/linden/indra/llcommon/llversionserver.h b/linden/indra/llcommon/llversionserver.h index e36702a..9e1a8f5 100644 --- a/linden/indra/llcommon/llversionserver.h +++ b/linden/indra/llcommon/llversionserver.h @@ -34,8 +34,8 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 18; -const S32 LL_VERSION_PATCH = 3; -const S32 LL_VERSION_BUILD = 73552; +const S32 LL_VERSION_PATCH = 6; +const S32 LL_VERSION_BUILD = 74522; const char * const LL_CHANNEL = "Second Life Server"; diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index 1df8a89..f9f3bf2 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h @@ -34,8 +34,8 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 18; -const S32 LL_VERSION_PATCH = 5; -const S32 LL_VERSION_BUILD = 3; +const S32 LL_VERSION_PATCH = 6; +const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Release"; diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp new file mode 100755 index 0000000..01e9901 --- /dev/null +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp @@ -0,0 +1,309 @@ +/** +* @file llcrashlogger.cpp +* @brief Crash logger implementation +* +* $LicenseInfo:firstyear=2003&license=viewergpl$ +* +* Copyright (c) 2003-2007, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlife.com/developers/opensource/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlife.com/developers/opensource/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ +#include +#include +#include +#include + +#include "llcrashlogger.h" +#include "linden_common.h" +#include "llstring.h" +#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME +#include "llerror.h" +#include "lltimer.h" +#include "lldir.h" +#include "llsdserialize.h" +#include "lliopipe.h" +#include "llpumpio.h" +#include "llhttpclient.h" +#include "llsdserialize.h" + +LLPumpIO* gServicePump; +BOOL gBreak = false; +BOOL gSent = false; + +class LLCrashLoggerResponder : public LLHTTPClient::Responder +{ +public: + LLCrashLoggerResponder() + { + } + + virtual void error(U32 status, const std::string& reason) + { + gBreak = true; + } + + virtual void result(const LLSD& content) + { + gBreak = true; + gSent = true; + } +}; + +bool LLCrashLoggerText::mainLoop() +{ + std::cout << "Entering main loop" << std::endl; + sendCrashLogs(); + return true; +} + +void LLCrashLoggerText::updateApplication(LLString message) +{ + LLCrashLogger::updateApplication(message); + std::cout << message << std::endl; +} + +LLCrashLogger::LLCrashLogger() : +mSentCrashLogs(false) +{ + +} + +LLCrashLogger::~LLCrashLogger() +{ + +} + +void LLCrashLogger::gatherFiles() +{ + + /* + //TODO:This function needs to be reimplemented somewhere in here... + if(!previous_crash && is_crash_log) + { + // Make sure the file isn't too old. + double age = difftime(gLaunchTime, stat_data.st_mtimespec.tv_sec); + + // llinfos << "age is " << age << llendl; + + if(age > 60.0) + { + // The file was last modified more than 60 seconds before the crash reporter was launched. Assume it's stale. + llwarns << "File " << mFilename << " is too old!" << llendl; + return; + } + } + */ + + updateApplication("Gathering logs..."); + + // Figure out the filename of the debug log + LLString db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log").c_str(); + std::ifstream debug_log_file(db_file_name.c_str()); + + // Look for it in the debug_info.log file + if (debug_log_file.is_open()) + { + LLSDSerialize::fromXML(mDebugLog, debug_log_file); + mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); + mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); + LLHTTPClient::setCABundle(mDebugLog["CAFilename"].asString()); + llinfos << "Using log file from debug log " << mFileMap["SecondLifeLog"] << llendl; + llinfos << "Using settings file from debug log " << mFileMap["SettingsXml"] << llendl; + } + else + { + // Figure out the filename of the second life log + LLHTTPClient::setCABundle(gDirUtilp->getCAFile()); + mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log"); + mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); + } + + gatherPlatformSpecificFiles(); + + //Use the debug log to reconstruct the URL to send the crash report to + mCrashHost = "https://"; + mCrashHost += mDebugLog["CurrentSimHost"].asString(); + mCrashHost += ":12043/crash/report"; + mAltCrashHost = "https://"; + mAltCrashHost += mDebugLog["GridUtilHost"].asString(); + mAltCrashHost += ":12043/crash/report"; + + mCrashInfo["DebugLog"] = mDebugLog; + mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log"); + mFileMap["StackTrace"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); + + updateApplication("Encoding files..."); + + for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) + { + std::ifstream f((*itr).second.c_str()); + if(!f.is_open()) + { + std::cout << "Can't find file " << (*itr).second.c_str() << std::endl; + continue; + } + std::stringstream s; + s << f.rdbuf(); + mCrashInfo[(*itr).first] = s.str(); + } +} + +LLSD LLCrashLogger::constructPostData() +{ + LLSD ret; + + if(mCrashInPreviousExec) + { + mCrashInfo["CrashInPreviousExecution"] = "Y"; + } + + return mCrashInfo; +} + +S32 LLCrashLogger::loadCrashBehaviorSetting() +{ + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); + + mCrashSettings.loadFromFile(filename); + + S32 value = mCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); + + if (value < CRASH_BEHAVIOR_ASK || CRASH_BEHAVIOR_NEVER_SEND < value) return CRASH_BEHAVIOR_ASK; + + return value; +} + +bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) +{ + if (crash_behavior < CRASH_BEHAVIOR_ASK) return false; + if (crash_behavior > CRASH_BEHAVIOR_NEVER_SEND) return false; + + mCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); + + mCrashSettings.saveToFile(filename, FALSE); + + return true; +} + +bool LLCrashLogger::sendCrashLogs() +{ + gatherFiles(); + + LLSD post_data; + post_data = constructPostData(); + + updateApplication("Sending reports..."); + + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLifeCrashReport"); + std::string report_file = dump_path + ".log"; + + std::ofstream out_file(report_file.c_str()); + LLSDSerialize::toPrettyXML(post_data, out_file); + out_file.close(); + LLHTTPClient::post(mCrashHost, post_data, new LLCrashLoggerResponder(), 5); + + gBreak = false; + while(!gBreak) + { + updateApplication("Sending logs..."); + } + + if(!gSent) + { + gBreak = false; + LLHTTPClient::post(mAltCrashHost, post_data, new LLCrashLoggerResponder(), 5); + + while(!gBreak) + { + updateApplication("Sending logs to Alternate Server..."); + } + } + mSentCrashLogs = gSent; + + return true; +} + +void LLCrashLogger::updateApplication(LLString message) +{ + gServicePump->pump(); + gServicePump->callback(); +} + +bool LLCrashLogger::init() +{ + // We assume that all the logs we're looking for reside on the current drive + gDirUtilp->initAppDirs("SecondLife"); + + // Default to the product name "Second Life" (this is overridden by the -name argument) + mProductName = "Second Life"; + + mCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " + "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); + + llinfos << "Loading crash behavior setting" << llendl; + mCrashBehavior = loadCrashBehaviorSetting(); + + //Run through command line options + if(getOption("previous").isDefined()) + { + llinfos << "Previous execution did not remove SecondLife.exec_marker" << llendl; + mCrashInPreviousExec = TRUE; + } + + if(getOption("dialog").isDefined()) + { + llinfos << "Show the user dialog" << llendl; + mCrashBehavior = CRASH_BEHAVIOR_ASK; + } + + LLSD server = getOption("user"); + if(server.isDefined()) + { + mGridName = server.asString(); + llinfos << "Got userserver " << mGridName << llendl; + } + else + { + mGridName = "agni"; + } + + LLSD name = getOption("name"); + if(name.isDefined()) + { + mProductName = name.asString(); + } + + // If user doesn't want to send, bail out + if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) + { + llinfos << "Crash behavior is never_send, quitting" << llendl; + return false; + } + + gServicePump = new LLPumpIO(gAPRPoolp); + gServicePump->prime(gAPRPoolp); + LLHTTPClient::setPump(*gServicePump); + return true; +} diff --git a/linden/indra/llcrashlogger/llcrashlogger.h b/linden/indra/llcrashlogger/llcrashlogger.h new file mode 100755 index 0000000..f797a2f --- /dev/null +++ b/linden/indra/llcrashlogger/llcrashlogger.h @@ -0,0 +1,85 @@ +/** +* @file llcrashlogger.h +* @brief Crash Logger Definition +* +* $LicenseInfo:firstyear=2003&license=viewergpl$ +* +* Copyright (c) 2003-2007, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlife.com/developers/opensource/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlife.com/developers/opensource/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ +#ifndef LLCRASHLOGGER_H +#define LLCRASHLOGGER_H + +#include + +#include "linden_common.h" + +#include "llapp.h" +#include "llsd.h" +#include "llcontrol.h" + +class LLCrashLogger : public LLApp +{ +public: + LLCrashLogger(); + virtual ~LLCrashLogger(); + S32 loadCrashBehaviorSetting(); + void gatherFiles(); + virtual void gatherPlatformSpecificFiles() {} + bool saveCrashBehaviorSetting(S32 crash_behavior); + bool sendCrashLogs(); + LLSD constructPostData(); + virtual void updateApplication(LLString message = ""); + virtual bool init(); + virtual bool mainLoop() = 0; + virtual bool cleanup() { return true; } + void setUserText(LLString& text) { mCrashInfo["UserNotes"] = text; } + S32 getCrashBehavior() { return mCrashBehavior; } +protected: + S32 mCrashBehavior; + BOOL mCrashInPreviousExec; + std::map mFileMap; + static const int mMaxSendSize = 200000; + LLString mGridName; + LLControlGroup mCrashSettings; + LLString mProductName; + LLSD mCrashInfo; + LLString mCrashHost; + LLString mAltCrashHost; + LLSD mDebugLog; + bool mSentCrashLogs; +}; + +class LLCrashLoggerText : public LLCrashLogger +{ +public: + LLCrashLoggerText(void) {} + ~LLCrashLoggerText(void) {} + + virtual bool mainLoop(); + virtual void updateApplication(LLString message = ""); +}; + + +#endif //LLCRASHLOGGER_H diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index 7cc3e57..a20b307 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp @@ -1,33 +1,33 @@ /** - * @file llparcel.cpp - * @brief A land parcel. - * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2007, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ +* @file llparcel.cpp +* @brief A land parcel. +* +* $LicenseInfo:firstyear=2002&license=viewergpl$ +* +* Copyright (c) 2002-2007, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlife.com/developers/opensource/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at http://secondlife.com/developers/opensource/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ #include "linden_common.h" @@ -49,9 +49,9 @@ static const F32 SOME_BIG_NUMBER = 1000.0f; static const F32 SOME_BIG_NEG_NUMBER = -1000.0f; static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = { - "leased", - "lease_pending", - "abandoned" + "leased", + "lease_pending", + "abandoned" }; // NOTE: Adding parcel categories also requires updating: @@ -59,52 +59,52 @@ static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = // * Web site "create event" tools static const char* PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] = { - "none", - "linden", - "adult", - "arts", - "store", // "business" legacy name - "educational", - "game", // "gaming" legacy name - "gather", // "hangout" legacy name - "newcomer", - "park", - "home", // "residential" legacy name - "shopping", - "stage", - "other", + "none", + "linden", + "adult", + "arts", + "store", // "business" legacy name + "educational", + "game", // "gaming" legacy name + "gather", // "hangout" legacy name + "newcomer", + "park", + "home", // "residential" legacy name + "shopping", + "stage", + "other", }; static const char* PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] = { - "None", - "Linden Location", - "Adult", - "Arts & Culture", - "Business", - "Educational", - "Gaming", - "Hangout", - "Newcomer Friendly", - "Parks & Nature", - "Residential", - "Shopping", - "Stage", - "Other", - "Any", // valid string for parcel searches + "None", + "Linden Location", + "Adult", + "Arts & Culture", + "Business", + "Educational", + "Gaming", + "Hangout", + "Newcomer Friendly", + "Parks & Nature", + "Residential", + "Shopping", + "Stage", + "Other", + "Any", // valid string for parcel searches }; static const char* PARCEL_ACTION_STRING[LLParcel::A_COUNT + 1] = { - "create", - "release", - "absorb", - "absorbed", - "divide", - "division", - "acquire", - "relinquish", - "confirm", - "unknown" + "create", + "release", + "absorb", + "absorbed", + "divide", + "division", + "acquire", + "relinquish", + "confirm", + "unknown" }; // Timeouts for parcels @@ -142,369 +142,365 @@ LLParcel::ECategory category_ui_string_to_category(const char* s); LLParcel::LLParcel() { - init(LLUUID::null, TRUE, FALSE, FALSE, 0, 0, 0, 0, 0, 1.f, 0); + init(LLUUID::null, TRUE, FALSE, FALSE, 0, 0, 0, 0, 0, 1.f, 0); } LLParcel::LLParcel(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, - time_t claim_date, S32 claim_price_per_meter, - S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + BOOL modify, BOOL terraform, BOOL damage, + time_t claim_date, S32 claim_price_per_meter, + S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, + BOOL is_group_owned) { - init( owner_id, modify, terraform, damage, claim_date, - claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, - is_group_owned); + init( owner_id, modify, terraform, damage, claim_date, + claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, + is_group_owned); } // virtual LLParcel::~LLParcel() { - // user list cleaned up by LLDynamicArray destructor. + // user list cleaned up by LLDynamicArray destructor. } void LLParcel::init(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, - time_t claim_date, S32 claim_price_per_meter, - S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + BOOL modify, BOOL terraform, BOOL damage, + time_t claim_date, S32 claim_price_per_meter, + S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, + BOOL is_group_owned) { - mID.setNull(); - mOwnerID = owner_id; - mGroupOwned = is_group_owned; - mClaimDate = claim_date; - mClaimPricePerMeter = claim_price_per_meter; - mRentPricePerMeter = rent_price_per_meter; - mArea = area; - mDiscountRate = 1.0f; - mDrawDistance = 512.f; - - mUserLookAt.setVec(0.0f, 0.f, 0.f); - // Default to using the parcel's landing point, if any. - mLandingType = L_LANDING_POINT; - - // *FIX: if owner_id != null, should be owned or sale pending, - // investigate init callers. - mStatus = OS_NONE; - mCategory = C_NONE; - mAuthBuyerID.setNull(); - //mBuyerID.setNull(); - //mJoinNeighbors = 0x0; - mSaleTimerExpires.setTimerExpirySec(0); - mSaleTimerExpires.stop(); - mGraceExtension = 0; - //mExpireAction = STEA_REVERT; - mRecordTransaction = FALSE; - - mAuctionID = 0; - mInEscrow = false; - - mParcelFlags = PF_DEFAULT; - setParcelFlag(PF_CREATE_OBJECTS, modify); - setParcelFlag(PF_ALLOW_TERRAFORM, terraform); - setParcelFlag(PF_ALLOW_DAMAGE, damage); - - mSalePrice = 10000; - setName(NULL); - setDesc(NULL); - setMusicURL(NULL); - setMediaURL(NULL); - mMediaID.setNull(); - mMediaAutoScale = 0; - - mGroupID.setNull(); - - mPassPrice = PARCEL_PASS_PRICE_DEFAULT; - mPassHours = PARCEL_PASS_HOURS_DEFAULT; - - mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER); - mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER); - - mLocalID = 0; - - //mSimWidePrimCorrection = 0; - setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); - setSimWideMaxPrimCapacity(0); - setSimWidePrimCount(0); - setOwnerPrimCount(0); - setGroupPrimCount(0); - setOtherPrimCount(0); - setSelectedPrimCount(0); - setTempPrimCount(0); - setCleanOtherTime(0); - setParcelPrimBonus(parcel_object_bonus); - - setPreviousOwnerID(LLUUID::null); - setPreviouslyGroupOwned(FALSE); + mID.setNull(); + mOwnerID = owner_id; + mGroupOwned = is_group_owned; + mClaimDate = claim_date; + mClaimPricePerMeter = claim_price_per_meter; + mRentPricePerMeter = rent_price_per_meter; + mArea = area; + mDiscountRate = 1.0f; + mDrawDistance = 512.f; + + mUserLookAt.setVec(0.0f, 0.f, 0.f); + // Default to using the parcel's landing point, if any. + mLandingType = L_LANDING_POINT; + + // *FIX: if owner_id != null, should be owned or sale pending, + // investigate init callers. + mStatus = OS_NONE; + mCategory = C_NONE; + mAuthBuyerID.setNull(); + //mBuyerID.setNull(); + //mJoinNeighbors = 0x0; + mSaleTimerExpires.setTimerExpirySec(0); + mSaleTimerExpires.stop(); + mGraceExtension = 0; + //mExpireAction = STEA_REVERT; + mRecordTransaction = FALSE; + + mAuctionID = 0; + mInEscrow = false; + + mParcelFlags = PF_DEFAULT; + setParcelFlag(PF_CREATE_OBJECTS, modify); + setParcelFlag(PF_ALLOW_TERRAFORM, terraform); + setParcelFlag(PF_ALLOW_DAMAGE, damage); + + mSalePrice = 10000; + setName(NULL); + setDesc(NULL); + setMusicURL(NULL); + setMediaURL(NULL); + mMediaID.setNull(); + mMediaAutoScale = 0; + + mGroupID.setNull(); + + mPassPrice = PARCEL_PASS_PRICE_DEFAULT; + mPassHours = PARCEL_PASS_HOURS_DEFAULT; + + mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER); + mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER); + + mLocalID = 0; + + //mSimWidePrimCorrection = 0; + setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); + setSimWideMaxPrimCapacity(0); + setSimWidePrimCount(0); + setOwnerPrimCount(0); + setGroupPrimCount(0); + setOtherPrimCount(0); + setSelectedPrimCount(0); + setTempPrimCount(0); + setCleanOtherTime(0); + setParcelPrimBonus(parcel_object_bonus); + + setPreviousOwnerID(LLUUID::null); + setPreviouslyGroupOwned(FALSE); } void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) { - // Override with system permission (LLUUID::null) - // Overridden parcels have no group - mOwnerID = owner_id; - mGroupOwned = is_group_owned; - if(mGroupOwned) - { - mGroupID = mOwnerID; - } - else - { - mGroupID.setNull(); - } - mInEscrow = false; + // Override with system permission (LLUUID::null) + // Overridden parcels have no group + mOwnerID = owner_id; + mGroupOwned = is_group_owned; + if(mGroupOwned) + { + mGroupID = mOwnerID; + } + else + { + mGroupID.setNull(); + } + mInEscrow = false; } void LLParcel::overrideParcelFlags(U32 flags) { - mParcelFlags = flags; + mParcelFlags = flags; } void LLParcel::setName(const LLString& name) { - // The escaping here must match the escaping in the database - // abstraction layer. - mName = name; - LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); + // The escaping here must match the escaping in the database + // abstraction layer. + mName = name; + LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); } void LLParcel::setDesc(const LLString& desc) { - // The escaping here must match the escaping in the database - // abstraction layer. - mDesc = desc; - mDesc = rawstr_to_utf8(mDesc); + // The escaping here must match the escaping in the database + // abstraction layer. + mDesc = desc; + mDesc = rawstr_to_utf8(mDesc); } void LLParcel::setMusicURL(const LLString& url) { - mMusicURL = url; - // The escaping here must match the escaping in the database - // abstraction layer. - // This should really filter the url in some way. Other than - // simply requiring non-printable. - LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); + mMusicURL = url; + // The escaping here must match the escaping in the database + // abstraction layer. + // This should really filter the url in some way. Other than + // simply requiring non-printable. + LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); } void LLParcel::setMediaURL(const LLString& url) { - mMediaURL = url; - // The escaping here must match the escaping in the database - // abstraction layer if it's ever added. - // This should really filter the url in some way. Other than - // simply requiring non-printable. - LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR); + mMediaURL = url; + // The escaping here must match the escaping in the database + // abstraction layer if it's ever added. + // This should really filter the url in some way. Other than + // simply requiring non-printable. + LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR); } // virtual void LLParcel::setLocalID(S32 local_id) { - mLocalID = local_id; + mLocalID = local_id; } void LLParcel::setAllParcelFlags(U32 flags) { - mParcelFlags = flags; + mParcelFlags = flags; } void LLParcel::setParcelFlag(U32 flag, BOOL b) { - if (b) - { - mParcelFlags |= flag; - } - else - { - mParcelFlags &= ~flag; - } + if (b) + { + mParcelFlags |= flag; + } + else + { + mParcelFlags &= ~flag; + } } BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const { - if (agent_id == LLUUID::null) - { - // system always can enter - return TRUE; - } - else if (isPublic()) - { - return TRUE; - } - else if (agent_id == mOwnerID) - { - // owner can always perform operations - return TRUE; - } - else if (mParcelFlags & PF_CREATE_OBJECTS) - { - return TRUE; - } - else if ((mParcelFlags & PF_CREATE_GROUP_OBJECTS) - && group_id.notNull() ) - { - return (getGroupID() == group_id); - } - - return FALSE; + if (agent_id == LLUUID::null) + { + // system always can enter + return TRUE; + } + else if (isPublic()) + { + return TRUE; + } + else if (agent_id == mOwnerID) + { + // owner can always perform operations + return TRUE; + } + else if (mParcelFlags & PF_CREATE_OBJECTS) + { + return TRUE; + } + else if ((mParcelFlags & PF_CREATE_GROUP_OBJECTS) + && group_id.notNull() ) + { + return (getGroupID() == group_id); + } + + return FALSE; } BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const { - if (agent_id == LLUUID::null) - { - // system always can enter - return TRUE; - } - else if(OS_LEASED == mStatus) - { - if(agent_id == mOwnerID) - { - // owner can modify leased land - return TRUE; - } - else - { - // otherwise check other people - return mParcelFlags & PF_ALLOW_TERRAFORM; - } - } - else - { - return FALSE; - } + if (agent_id == LLUUID::null) + { + // system always can enter + return TRUE; + } + else if(OS_LEASED == mStatus) + { + if(agent_id == mOwnerID) + { + // owner can modify leased land + return TRUE; + } + else + { + // otherwise check other people + return mParcelFlags & PF_ALLOW_TERRAFORM; + } + } + else + { + return FALSE; + } } bool LLParcel::isAgentBlockedFromParcel(LLParcel* parcelp, - const LLUUID& agent_id, - const std::vector& group_ids, - const BOOL is_agent_identified, - const BOOL is_agent_transacted) + const LLUUID& agent_id, + const std::vector& group_ids, + const BOOL is_agent_identified, + const BOOL is_agent_transacted, + const BOOL is_agent_ageverified) { - S32 current_group_access = parcelp->blockAccess(agent_id, LLUUID::null, is_agent_identified, is_agent_transacted); - S32 count; - bool is_allowed = (current_group_access == BA_ALLOWED) ? true: false; - LLUUID group_id; - - count = group_ids.size(); - for (int i = 0; i < count && !is_allowed; i++) - { - group_id = group_ids[i]; - current_group_access = parcelp->blockAccess(agent_id, group_id, is_agent_identified, is_agent_transacted); - - if (current_group_access == BA_ALLOWED) is_allowed = true; - } - - return !is_allowed; + S32 current_group_access = parcelp->blockAccess(agent_id, LLUUID::null, is_agent_identified, is_agent_transacted, is_agent_ageverified); + S32 count; + bool is_allowed = (current_group_access == BA_ALLOWED) ? true: false; + LLUUID group_id; + + count = group_ids.size(); + for (int i = 0; i < count && !is_allowed; i++) + { + group_id = group_ids[i]; + current_group_access = parcelp->blockAccess(agent_id, group_id, is_agent_identified, is_agent_transacted, is_agent_ageverified); + + if (current_group_access == BA_ALLOWED) is_allowed = true; + } + + return !is_allowed; } BOOL LLParcel::isAgentBanned(const LLUUID& agent_id) const { // Test ban list - if (getParcelFlag(PF_USE_BAN_LIST) - && (mBanList.find(agent_id) != mBanList.end())) + if (mBanList.find(agent_id) != mBanList.end()) { return TRUE; } - - return FALSE; + + return FALSE; } + S32 LLParcel::blockAccess(const LLUUID& agent_id, const LLUUID& group_id, - const BOOL is_agent_identified, - const BOOL is_agent_transacted) const + const BOOL is_agent_identified, + const BOOL is_agent_transacted, + const BOOL is_agent_ageverified) const { - // Test ban list - if (isAgentBanned(agent_id)) - { - return BA_BANNED; - } - - // Always allow owner on (unless he banned himself, useful for - // testing). We will also allow estate owners/managers in if they - // are not explicitly banned. - if (agent_id == mOwnerID) - { - return BA_ALLOWED; - } - - // Special case when using pass list where group access is being restricted but not - // using access list. In this case group members are allowed only if they buy a pass. - // We return BA_NOT_IN_LIST if not in list - BOOL passWithGroup = getParcelFlag(PF_USE_PASS_LIST) && !getParcelFlag(PF_USE_ACCESS_LIST) - && getParcelFlag(PF_USE_ACCESS_GROUP) && !mGroupID.isNull() && group_id == mGroupID; - - - // Test group list - if (getParcelFlag(PF_USE_ACCESS_GROUP) - && !mGroupID.isNull() - && group_id == mGroupID - && !passWithGroup) - { - return BA_ALLOWED; - } - - // Test access list - if (getParcelFlag(PF_USE_ACCESS_LIST) || passWithGroup ) - { - if (mAccessList.find(agent_id) != mAccessList.end()) - { - return BA_ALLOWED; - } - - return BA_NOT_ON_LIST; - } - - // If we're not doing any other limitations, all users - // can enter, unless - if ( !getParcelFlag(PF_USE_ACCESS_GROUP) - && !getParcelFlag(PF_USE_ACCESS_LIST)) - { - //If the land is group owned, and you are in the group, bypass these checks - if(getIsGroupOwned() && group_id == mGroupID) - { - return BA_ALLOWED; - } - - // Test for "payment" access levels - // Anonymous - No Payment Info on File - if(getParcelFlag(PF_DENY_ANONYMOUS) && !is_agent_identified && !is_agent_transacted) - { - return BA_NO_ACCESS_LEVEL; - } - // Identified - Payment Info on File - // Must check to make sure we're only banning Identified, since Transacted accounts - // also have their identified flag set - if(getParcelFlag(PF_DENY_IDENTIFIED) && is_agent_identified && !is_agent_transacted) - { - return BA_NO_ACCESS_LEVEL; - } - // Transacted - Payment Info Used - if(getParcelFlag(PF_DENY_TRANSACTED) && is_agent_transacted) - { - return BA_NO_ACCESS_LEVEL; - } - return BA_ALLOWED; - } - - return BA_NOT_IN_GROUP; - + // Test ban list + if (isAgentBanned(agent_id)) + { + return BA_BANNED; + } + + // Always allow owner on (unless he banned himself, useful for + // testing). We will also allow estate owners/managers in if they + // are not explicitly banned. + if (agent_id == mOwnerID) + { + return BA_ALLOWED; + } + + // Special case when using pass list where group access is being restricted but not + // using access list. In this case group members are allowed only if they buy a pass. + // We return BA_NOT_IN_LIST if not in list + BOOL passWithGroup = getParcelFlag(PF_USE_PASS_LIST) && !getParcelFlag(PF_USE_ACCESS_LIST) + && getParcelFlag(PF_USE_ACCESS_GROUP) && !mGroupID.isNull() && group_id == mGroupID; + + + // Test group list + if (getParcelFlag(PF_USE_ACCESS_GROUP) + && !mGroupID.isNull() + && group_id == mGroupID + && !passWithGroup) + { + return BA_ALLOWED; + } + + // Test access list + if (getParcelFlag(PF_USE_ACCESS_LIST) || passWithGroup ) + { + if (mAccessList.find(agent_id) != mAccessList.end()) + { + return BA_ALLOWED; + } + + return BA_NOT_ON_LIST; + } + + // If we're not doing any other limitations, all users + // can enter, unless + if ( !getParcelFlag(PF_USE_ACCESS_GROUP) + && !getParcelFlag(PF_USE_ACCESS_LIST)) + { + //If the land is group owned, and you are in the group, bypass these checks + if(getIsGroupOwned() && group_id == mGroupID) + { + return BA_ALLOWED; + } + + // Test for "payment" access levels + // Anonymous - No Payment Info on File + if(getParcelFlag(PF_DENY_ANONYMOUS) && !is_agent_identified && !is_agent_transacted) + { + return BA_NO_ACCESS_LEVEL; + } + // AgeUnverified - Not Age Verified + if(getParcelFlag(PF_DENY_AGEUNVERIFIED) && !is_agent_ageverified) + { + return BA_NOT_AGE_VERIFIED; + } + + return BA_ALLOWED; + } + + return BA_NOT_IN_GROUP; + } void LLParcel::setArea(S32 area, S32 sim_object_limit) { - mArea = area; - setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); + mArea = area; + setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); } void LLParcel::setDiscountRate(F32 rate) { - // this is to make sure that the rate is at least sane - this is - // not intended to enforce economy rules. It only enfoces that the - // rate is a scaler between 0 and 1. - mDiscountRate = llclampf(rate); + // this is to make sure that the rate is at least sane - this is + // not intended to enforce economy rules. It only enfoces that the + // rate is a scaler between 0 and 1. + mDiscountRate = llclampf(rate); } @@ -516,909 +512,918 @@ void LLParcel::setDiscountRate(F32 rate) // WARNING: Area will be wrong until you calculate it. BOOL LLParcel::importStream(std::istream& input_stream) { - U32 setting; - S32 secs_until_revert = 0; - - skip_to_end_of_next_keyword("{", input_stream); - if (!input_stream.good()) - { - llwarns << "LLParcel::importStream() - bad input_stream" << llendl; - return FALSE; - } - - while (input_stream.good()) - { - skip_comments_and_emptyspace(input_stream); - LLString line, keyword, value; - get_line(line, input_stream, MAX_STRING); - get_keyword_and_value(keyword, value, line); - - if ("}" == keyword) - { - break; - } - else if ("parcel_id" == keyword) - { - mID.set(value.c_str()); - } - else if ("status" == keyword) - { - mStatus = ownership_string_to_status(value.c_str()); - } - else if ("category" == keyword) - { - mCategory = category_string_to_category(value.c_str()); - } - else if ("local_id" == keyword) - { - LLString::convertToS32(value, mLocalID); - } - else if ("name" == keyword) - { - setName( value ); - } - else if ("desc" == keyword) - { - setDesc( value ); - } - else if ("music_url" == keyword) - { - setMusicURL( value ); - } - else if ("media_url" == keyword) - { - setMediaURL( value ); - } - else if ("media_id" == keyword) - { - mMediaID.set( value.c_str() ); - } - else if ("media_auto_scale" == keyword) - { - LLString::convertToU8(value, mMediaAutoScale); - } - else if ("owner_id" == keyword) - { - mOwnerID.set( value.c_str() ); - } - else if ("group_owned" == keyword) - { - LLString::convertToBOOL(value, mGroupOwned); - } - else if ("clean_other_time" == keyword) - { - S32 time; - LLString::convertToS32(value, time); - setCleanOtherTime(time); - } - else if ("auth_buyer_id" == keyword) - { - mAuthBuyerID.set(value.c_str()); - } - else if ("snapshot_id" == keyword) - { - mSnapshotID.set(value.c_str()); - } - else if ("user_location" == keyword) - { - sscanf(value.c_str(), "%f %f %f", - &mUserLocation.mV[VX], - &mUserLocation.mV[VY], - &mUserLocation.mV[VZ]); - } - else if ("user_look_at" == keyword) - { - sscanf(value.c_str(), "%f %f %f", - &mUserLookAt.mV[VX], - &mUserLookAt.mV[VY], - &mUserLookAt.mV[VZ]); - } - else if ("landing_type" == keyword) - { - S32 landing_type = 0; - LLString::convertToS32(value, landing_type); - mLandingType = (ELandingType) landing_type; - } - else if ("join_neighbors" == keyword) - { - llinfos << "found deprecated keyword join_neighbors" << llendl; - } - else if ("revert_sale" == keyword) - { - LLString::convertToS32(value, secs_until_revert); - if (secs_until_revert > 0) - { - mSaleTimerExpires.start(); - mSaleTimerExpires.setTimerExpirySec((F32)secs_until_revert); - } - } - else if("extended_grace" == keyword) - { - LLString::convertToS32(value, mGraceExtension); - } - else if ("user_list_type" == keyword) - { - // deprecated - } - else if("auction_id" == keyword) - { - LLString::convertToU32(value, mAuctionID); - } - else if ("allow_modify" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_CREATE_OBJECTS, setting); - } - else if ("allow_group_modify" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting); - } - else if ("allow_all_object_entry" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting); - } - else if ("allow_group_object_entry" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting); - } - else if ("allow_deed_to_group" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting); - } - else if("contribute_with_deed" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting); - } - else if ("allow_terraform" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_TERRAFORM, setting); - } - else if ("allow_damage" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_DAMAGE, setting); - } - else if ("allow_fly" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_FLY, setting); - } - else if ("allow_landmark" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_LANDMARK, setting); - } - else if ("sound_local" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_SOUND_LOCAL, setting); - } - else if ("allow_group_scripts" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); - } - else if ("allow_voice_chat" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); - } - else if ("use_estate_voice_chan" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); - } - else if ("allow_scripts" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting); - } - else if ("for_sale" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_FOR_SALE, setting); - } - else if ("sell_w_objects" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting); - } - else if ("use_pass_list" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_USE_PASS_LIST, setting); - } - else if ("show_directory" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_SHOW_DIRECTORY, setting); - } - else if ("allow_publish" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_ALLOW_PUBLISH, setting); - } - else if ("mature_publish" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_MATURE_PUBLISH, setting); - } - else if ("claim_date" == keyword) - { - // BUG: This will fail when time rolls over in 2038. - S32 time; - LLString::convertToS32(value, time); - mClaimDate = time; - } - else if ("claim_price" == keyword) - { - LLString::convertToS32(value, mClaimPricePerMeter); - } - else if ("rent_price" == keyword) - { - LLString::convertToS32(value, mRentPricePerMeter); - } - else if ("discount_rate" == keyword) - { - LLString::convertToF32(value, mDiscountRate); - } - else if ("draw_distance" == keyword) - { - LLString::convertToF32(value, mDrawDistance); - } - else if ("sale_price" == keyword) - { - LLString::convertToS32(value, mSalePrice); - } - else if ("pass_price" == keyword) - { - LLString::convertToS32(value, mPassPrice); - } - else if ("pass_hours" == keyword) - { - LLString::convertToF32(value, mPassHours); - } - else if ("box" == keyword) - { - // deprecated - } - else if ("aabb_min" == keyword) - { - sscanf(value.c_str(), "%f %f %f", - &mAABBMin.mV[VX], &mAABBMin.mV[VY], &mAABBMin.mV[VZ]); - } - else if ("use_access_group" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_USE_ACCESS_GROUP, setting); - } - else if ("use_access_list" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_USE_ACCESS_LIST, setting); - } - else if ("use_ban_list" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_USE_BAN_LIST, setting); - } - else if ("group_name" == keyword) - { - llinfos << "found deprecated keyword group_name" << llendl; - } - else if ("group_id" == keyword) - { - mGroupID.set( value.c_str() ); - } - // TODO: DEPRECATED FLAG - // Flag removed from simstate files in 1.11.1 - // Remove at some point where we have guarenteed this flag - // no longer exists anywhere in simstate files. - else if ("require_identified" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_DENY_ANONYMOUS, setting); - } - // TODO: DEPRECATED FLAG - // Flag removed from simstate files in 1.11.1 - // Remove at some point where we have guarenteed this flag - // no longer exists anywhere in simstate files. - else if ("require_transacted" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_DENY_ANONYMOUS, setting); - setParcelFlag(PF_DENY_IDENTIFIED, setting); - } - else if ("restrict_pushobject" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting); - } - else if ("deny_anonymous" == keyword) - { - LLString::convertToU32(value, setting); - setParcelFlag(PF_DENY_ANONYMOUS, setting); - } + U32 setting; + S32 secs_until_revert = 0; + + skip_to_end_of_next_keyword("{", input_stream); + if (!input_stream.good()) + { + llwarns << "LLParcel::importStream() - bad input_stream" << llendl; + return FALSE; + } + + while (input_stream.good()) + { + skip_comments_and_emptyspace(input_stream); + LLString line, keyword, value; + get_line(line, input_stream, MAX_STRING); + get_keyword_and_value(keyword, value, line); + + if ("}" == keyword) + { + break; + } + else if ("parcel_id" == keyword) + { + mID.set(value.c_str()); + } + else if ("status" == keyword) + { + mStatus = ownership_string_to_status(value.c_str()); + } + else if ("category" == keyword) + { + mCategory = category_string_to_category(value.c_str()); + } + else if ("local_id" == keyword) + { + LLString::convertToS32(value, mLocalID); + } + else if ("name" == keyword) + { + setName( value ); + } + else if ("desc" == keyword) + { + setDesc( value ); + } + else if ("music_url" == keyword) + { + setMusicURL( value ); + } + else if ("media_url" == keyword) + { + setMediaURL( value ); + } + else if ("media_id" == keyword) + { + mMediaID.set( value.c_str() ); + } + else if ("media_auto_scale" == keyword) + { + LLString::convertToU8(value, mMediaAutoScale); + } + else if ("owner_id" == keyword) + { + mOwnerID.set( value.c_str() ); + } + else if ("group_owned" == keyword) + { + LLString::convertToBOOL(value, mGroupOwned); + } + else if ("clean_other_time" == keyword) + { + S32 time; + LLString::convertToS32(value, time); + setCleanOtherTime(time); + } + else if ("auth_buyer_id" == keyword) + { + mAuthBuyerID.set(value.c_str()); + } + else if ("snapshot_id" == keyword) + { + mSnapshotID.set(value.c_str()); + } + else if ("user_location" == keyword) + { + sscanf(value.c_str(), "%f %f %f", + &mUserLocation.mV[VX], + &mUserLocation.mV[VY], + &mUserLocation.mV[VZ]); + } + else if ("user_look_at" == keyword) + { + sscanf(value.c_str(), "%f %f %f", + &mUserLookAt.mV[VX], + &mUserLookAt.mV[VY], + &mUserLookAt.mV[VZ]); + } + else if ("landing_type" == keyword) + { + S32 landing_type = 0; + LLString::convertToS32(value, landing_type); + mLandingType = (ELandingType) landing_type; + } + else if ("join_neighbors" == keyword) + { + llinfos << "found deprecated keyword join_neighbors" << llendl; + } + else if ("revert_sale" == keyword) + { + LLString::convertToS32(value, secs_until_revert); + if (secs_until_revert > 0) + { + mSaleTimerExpires.start(); + mSaleTimerExpires.setTimerExpirySec((F32)secs_until_revert); + } + } + else if("extended_grace" == keyword) + { + LLString::convertToS32(value, mGraceExtension); + } + else if ("user_list_type" == keyword) + { + // deprecated + } + else if("auction_id" == keyword) + { + LLString::convertToU32(value, mAuctionID); + } + else if ("allow_modify" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_CREATE_OBJECTS, setting); + } + else if ("allow_group_modify" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting); + } + else if ("allow_all_object_entry" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting); + } + else if ("allow_group_object_entry" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting); + } + else if ("allow_deed_to_group" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting); + } + else if("contribute_with_deed" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting); + } + else if ("allow_terraform" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_TERRAFORM, setting); + } + else if ("allow_damage" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_DAMAGE, setting); + } + else if ("allow_fly" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_FLY, setting); + } + else if ("allow_landmark" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_LANDMARK, setting); + } + else if ("sound_local" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_SOUND_LOCAL, setting); + } + else if ("allow_group_scripts" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); + } + else if ("allow_voice_chat" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); + } + else if ("use_estate_voice_chan" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); + } + else if ("allow_scripts" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting); + } + else if ("for_sale" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_FOR_SALE, setting); + } + else if ("sell_w_objects" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting); + } + else if ("use_pass_list" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_PASS_LIST, setting); + } + else if ("show_directory" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_SHOW_DIRECTORY, setting); + } + else if ("allow_publish" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_PUBLISH, setting); + } + else if ("mature_publish" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_MATURE_PUBLISH, setting); + } + else if ("claim_date" == keyword) + { + // BUG: This will fail when time rolls over in 2038. + S32 time; + LLString::convertToS32(value, time); + mClaimDate = time; + } + else if ("claim_price" == keyword) + { + LLString::convertToS32(value, mClaimPricePerMeter); + } + else if ("rent_price" == keyword) + { + LLString::convertToS32(value, mRentPricePerMeter); + } + else if ("discount_rate" == keyword) + { + LLString::convertToF32(value, mDiscountRate); + } + else if ("draw_distance" == keyword) + { + LLString::convertToF32(value, mDrawDistance); + } + else if ("sale_price" == keyword) + { + LLString::convertToS32(value, mSalePrice); + } + else if ("pass_price" == keyword) + { + LLString::convertToS32(value, mPassPrice); + } + else if ("pass_hours" == keyword) + { + LLString::convertToF32(value, mPassHours); + } + else if ("box" == keyword) + { + // deprecated + } + else if ("aabb_min" == keyword) + { + sscanf(value.c_str(), "%f %f %f", + &mAABBMin.mV[VX], &mAABBMin.mV[VY], &mAABBMin.mV[VZ]); + } + else if ("use_access_group" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_ACCESS_GROUP, setting); + } + else if ("use_access_list" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_ACCESS_LIST, setting); + } + else if ("use_ban_list" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_BAN_LIST, setting); + } + else if ("group_name" == keyword) + { + llinfos << "found deprecated keyword group_name" << llendl; + } + else if ("group_id" == keyword) + { + mGroupID.set( value.c_str() ); + } + // TODO: DEPRECATED FLAG + // Flag removed from simstate files in 1.11.1 + // Keep if statement until we have guarenteed this flag + // no longer exists anywhere in simstate files. + else if ("require_identified" == keyword) + { +// LLString::convertToU32(value, setting); +// setParcelFlag(PF_DENY_ANONYMOUS, setting); + } + // TODO: DEPRECATED FLAG + // Flag removed from simstate files in 1.11.1 + // Keep if statement until we have guarenteed this flag + // no longer exists anywhere in simstate files. + else if ("require_transacted" == keyword) + { +// LLString::convertToU32(value, setting); +// setParcelFlag(PF_DENY_ANONYMOUS, setting); +// setParcelFlag(PF_DENY_IDENTIFIED, setting); + } + else if ("restrict_pushobject" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting); + } + else if ("deny_anonymous" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_DENY_ANONYMOUS, setting); + } + // TODO: DEPRECATED FLAG + // Keep if statement until we have guarenteed this flag + // no longer exists anywhere in simstate files. else if ("deny_identified" == keyword) { - LLString::convertToU32(value, setting); - setParcelFlag(PF_DENY_IDENTIFIED, setting); +// LLString::convertToU32(value, setting); +// setParcelFlag(PF_DENY_IDENTIFIED, setting); } else if ("deny_transacted" == keyword) { - LLString::convertToU32(value, setting); - setParcelFlag(PF_DENY_TRANSACTED, setting); - } - else if ("access_list" == keyword) - { - S32 entry_count = 0; - LLString::convertToS32(value, entry_count); - for (S32 i = 0; i < entry_count; i++) - { - LLAccessEntry entry; - if (importAccessEntry(input_stream, &entry)) - { - mAccessList[entry.mID] = entry; - } - } - } - else if ("ban_list" == keyword) - { - S32 entry_count = 0; - LLString::convertToS32(value, entry_count); - for (S32 i = 0; i < entry_count; i++) - { - LLAccessEntry entry; - if (importAccessEntry(input_stream, &entry)) - { - mBanList[entry.mID] = entry; - } - } - } - else if ("renter_list" == keyword) - { - /* - S32 entry_count = 0; - LLString::convertToS32(value, entry_count); - for (S32 i = 0; i < entry_count; i++) - { - LLAccessEntry entry; - if (importAccessEntry(input_stream, &entry)) - { - mRenterList.put(entry); - } - }*/ - } - else if ("pass_list" == keyword) - { - // legacy - put into access list - S32 entry_count = 0; - LLString::convertToS32(value, entry_count); - for (S32 i = 0; i < entry_count; i++) - { - LLAccessEntry entry; - if (importAccessEntry(input_stream, &entry)) - { - mAccessList[entry.mID] = entry; - } - } - } - - else - { - llwarns << "Unknown keyword in parcel section: <" - << keyword << ">" << llendl; - } - } - - // this code block detects if we have loaded a 1.1 simstate file, - // and follows the conversion rules specified in - // design_docs/land/pay_for_parcel.txt. - F32 time_to_expire = 0.0f; - if(mID.isNull()) - { - mID.generate(); - mStatus = OS_LEASE_PENDING; - //mBuyerID = mOwnerID; - if(getIsGroupOwned()) - { - time_to_expire += GROUP_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; - } - else - { - time_to_expire += DEFAULT_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; - } - //mExpireAction = STEA_PUBLIC; - mRecordTransaction = TRUE; - } - - // this code block deals with giving an extension to pending - // parcels to the midday of 2004-01-19 if they were originally set - // for some time on 2004-01-12. - if((0 == mGraceExtension) - && (EXTEND_GRACE_IF_MORE_THAN_SEC < secs_until_revert)) - { - const S32 NEW_CONVERSION_DATE = 1074538800; // 2004-01-19T11:00:00 - time_t now = time(NULL); // now in epoch - secs_until_revert = (S32)(NEW_CONVERSION_DATE - now); - time_to_expire = (F32)secs_until_revert; - mGraceExtension = 1; - } - - // This code block adds yet another week to the deadline. :( - if(1 == mGraceExtension) - { - time_to_expire += SEVEN_DAYS_IN_USEC / SEC_TO_MICROSEC; - mGraceExtension = 2; - } - - if (time_to_expire > 0) - { - mSaleTimerExpires.setTimerExpirySec(time_to_expire); - mSaleTimerExpires.start(); - } - - // successful import - return TRUE; +// LLString::convertToU32(value, setting); +// setParcelFlag(PF_DENY_TRANSACTED, setting); + } + else if ("deny_age_unverified" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_DENY_AGEUNVERIFIED, setting); + } + else if ("access_list" == keyword) + { + S32 entry_count = 0; + LLString::convertToS32(value, entry_count); + for (S32 i = 0; i < entry_count; i++) + { + LLAccessEntry entry; + if (importAccessEntry(input_stream, &entry)) + { + mAccessList[entry.mID] = entry; + } + } + } + else if ("ban_list" == keyword) + { + S32 entry_count = 0; + LLString::convertToS32(value, entry_count); + for (S32 i = 0; i < entry_count; i++) + { + LLAccessEntry entry; + if (importAccessEntry(input_stream, &entry)) + { + mBanList[entry.mID] = entry; + } + } + } + else if ("renter_list" == keyword) + { + /* + S32 entry_count = 0; + LLString::convertToS32(value, entry_count); + for (S32 i = 0; i < entry_count; i++) + { + LLAccessEntry entry; + if (importAccessEntry(input_stream, &entry)) + { + mRenterList.put(entry); + } + }*/ + } + else if ("pass_list" == keyword) + { + // legacy - put into access list + S32 entry_count = 0; + LLString::convertToS32(value, entry_count); + for (S32 i = 0; i < entry_count; i++) + { + LLAccessEntry entry; + if (importAccessEntry(input_stream, &entry)) + { + mAccessList[entry.mID] = entry; + } + } + } + + else + { + llwarns << "Unknown keyword in parcel section: <" + << keyword << ">" << llendl; + } + } + + // this code block detects if we have loaded a 1.1 simstate file, + // and follows the conversion rules specified in + // design_docs/land/pay_for_parcel.txt. + F32 time_to_expire = 0.0f; + if(mID.isNull()) + { + mID.generate(); + mStatus = OS_LEASE_PENDING; + //mBuyerID = mOwnerID; + if(getIsGroupOwned()) + { + time_to_expire += GROUP_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; + } + else + { + time_to_expire += DEFAULT_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; + } + //mExpireAction = STEA_PUBLIC; + mRecordTransaction = TRUE; + } + + // this code block deals with giving an extension to pending + // parcels to the midday of 2004-01-19 if they were originally set + // for some time on 2004-01-12. + if((0 == mGraceExtension) + && (EXTEND_GRACE_IF_MORE_THAN_SEC < secs_until_revert)) + { + const S32 NEW_CONVERSION_DATE = 1074538800; // 2004-01-19T11:00:00 + time_t now = time(NULL); // now in epoch + secs_until_revert = (S32)(NEW_CONVERSION_DATE - now); + time_to_expire = (F32)secs_until_revert; + mGraceExtension = 1; + } + + // This code block adds yet another week to the deadline. :( + if(1 == mGraceExtension) + { + time_to_expire += SEVEN_DAYS_IN_USEC / SEC_TO_MICROSEC; + mGraceExtension = 2; + } + + if (time_to_expire > 0) + { + mSaleTimerExpires.setTimerExpirySec(time_to_expire); + mSaleTimerExpires.start(); + } + + // successful import + return TRUE; } BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) { - skip_to_end_of_next_keyword("{", input_stream); - while (input_stream.good()) - { - skip_comments_and_emptyspace(input_stream); - LLString line, keyword, value; - get_line(line, input_stream, MAX_STRING); - get_keyword_and_value(keyword, value, line); - - if ("}" == keyword) - { - break; - } - else if ("id" == keyword) - { - entry->mID.set( value.c_str() ); - } - else if ("name" == keyword) - { - // deprecated - } - else if ("time" == keyword) - { - S32 when; - LLString::convertToS32(value, when); - entry->mTime = when; - } - else if ("flags" == keyword) - { - U32 setting; - LLString::convertToU32(value, setting); - entry->mFlags = setting; - } - else - { - llwarns << "Unknown keyword in parcel access entry section: <" - << keyword << ">" << llendl; - } - } - return input_stream.good(); + skip_to_end_of_next_keyword("{", input_stream); + while (input_stream.good()) + { + skip_comments_and_emptyspace(input_stream); + LLString line, keyword, value; + get_line(line, input_stream, MAX_STRING); + get_keyword_and_value(keyword, value, line); + + if ("}" == keyword) + { + break; + } + else if ("id" == keyword) + { + entry->mID.set( value.c_str() ); + } + else if ("name" == keyword) + { + // deprecated + } + else if ("time" == keyword) + { + S32 when; + LLString::convertToS32(value, when); + entry->mTime = when; + } + else if ("flags" == keyword) + { + U32 setting; + LLString::convertToU32(value, setting); + entry->mFlags = setting; + } + else + { + llwarns << "Unknown keyword in parcel access entry section: <" + << keyword << ">" << llendl; + } + } + return input_stream.good(); } BOOL LLParcel::exportStream(std::ostream& output_stream) { - S32 setting; - char id_string[MAX_STRING]; /* Flawfinder: ignore */ - - std::ios::fmtflags old_flags = output_stream.flags(); - output_stream.setf(std::ios::showpoint); - output_stream << "\t{\n"; - - mID.toString(id_string); - output_stream << "\t\t parcel_id " << id_string << "\n"; - output_stream << "\t\t status " << ownership_status_to_string(mStatus) << "\n"; - output_stream << "\t\t category " << category_to_string(mCategory) << "\n"; - - output_stream << "\t\t local_id " << mLocalID << "\n"; - - const char* name = (mName.empty() ? "" : mName.c_str() ); - output_stream << "\t\t name " << name << "\n"; - - const char* desc = (mDesc.empty() ? "" : mDesc.c_str() ); - output_stream << "\t\t desc " << desc << "\n"; - - const char* music_url = (mMusicURL.empty() ? "" : mMusicURL.c_str() ); - output_stream << "\t\t music_url " << music_url << "\n"; - - const char* media_url = (mMediaURL.empty() ? "" : mMediaURL.c_str() ); - output_stream << "\t\t media_url " << media_url << "\n"; - - output_stream << "\t\t media_auto_scale " << (mMediaAutoScale ? 1 : 0) << "\n"; - - mMediaID.toString(id_string); - output_stream << "\t\t media_id " << id_string << "\n"; - - mOwnerID.toString(id_string); - output_stream << "\t\t owner_id " << id_string << "\n"; - output_stream << "\t\t group_owned " << (mGroupOwned ? 1 : 0) << "\n"; - output_stream << "\t\t clean_other_time " << getCleanOtherTime() << "\n"; - - if(!mAuthBuyerID.isNull()) - { - mAuthBuyerID.toString(id_string); - output_stream << "\t\t auth_buyer_id " << id_string << "\n"; - } - if (!mSnapshotID.isNull()) - { - mSnapshotID.toString(id_string); - output_stream << "\t\t snapshot_id " << id_string << "\n"; - } - if (!mUserLocation.isExactlyZero()) - { - output_stream << "\t\t user_location " - << (F64)mUserLocation.mV[VX] - << " " << (F64)mUserLocation.mV[VY] - << " " << (F64)mUserLocation.mV[VZ] << "\n"; - output_stream << "\t\t user_look_at " - << (F64)mUserLookAt.mV[VX] - << " " << (F64)mUserLookAt.mV[VY] - << " " << (F64)mUserLookAt.mV[VZ] << "\n"; - } - output_stream << "\t\t landing_type " << mLandingType << "\n"; - //if(mJoinNeighbors) - //{ - // output_stream << "\t\t join_neighbors " << mJoinNeighbors << "\n"; - //} - if(mSaleTimerExpires.getStarted()) - { - S32 dt_sec = (S32) mSaleTimerExpires.getRemainingTimeF32()+60; // Add a minute to prevent race conditions - output_stream << "\t\t revert_sale " << dt_sec << "\n"; - //output_stream << "\t\t revert_action " << revert_action_to_string(mExpireAction) << "\n"; - output_stream << "\t\t extended_grace " << mGraceExtension << "\n"; - } - - if(0 != mAuctionID) - { - output_stream << "\t\t auction_id " << mAuctionID << "\n"; - } - - output_stream << "\t\t allow_modify " << getAllowModify() << "\n"; - output_stream << "\t\t allow_group_modify " << getAllowGroupModify() << "\n"; - output_stream << "\t\t allow_all_object_entry " << getAllowAllObjectEntry() << "\n"; - output_stream << "\t\t allow_group_object_entry " << getAllowGroupObjectEntry() << "\n"; - output_stream << "\t\t allow_terraform " << getAllowTerraform() << "\n"; - output_stream << "\t\t allow_deed_to_group " << getAllowDeedToGroup() << "\n"; - output_stream << "\t\t contribute_with_deed " << getContributeWithDeed() << "\n"; - output_stream << "\t\t allow_damage " << getAllowDamage() << "\n"; - output_stream << "\t\t claim_date " << (S32)mClaimDate << "\n"; - output_stream << "\t\t claim_price " << mClaimPricePerMeter << "\n"; - output_stream << "\t\t rent_price " << mRentPricePerMeter << "\n"; - output_stream << "\t\t discount_rate " << mDiscountRate << "\n"; - output_stream << "\t\t allow_fly " << (getAllowFly() ? 1 : 0) << "\n"; - output_stream << "\t\t allow_landmark " << (getAllowLandmark() ? 1 : 0) << "\n"; - output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; - output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; - output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; - output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; - output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; - output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; - output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; - output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; - output_stream << "\t\t sale_price " << mSalePrice << "\n"; - - setting = (getParcelFlag(PF_USE_ACCESS_GROUP) ? 1 : 0); - output_stream << "\t\t use_access_group " << setting << "\n"; - - setting = (getParcelFlag(PF_USE_ACCESS_LIST) ? 1 : 0); - output_stream << "\t\t use_access_list " << setting << "\n"; - - setting = (getParcelFlag(PF_USE_BAN_LIST) ? 1 : 0); - output_stream << "\t\t use_ban_list " << setting << "\n"; - - mGroupID.toString(id_string); - output_stream << "\t\t group_id " << id_string << "\n"; - - //const char* group_name - // = (mGroupName.isEmpty() ? "" : mGroupName.c_str() ); - //output_stream << "\t\t group_name " << group_name << "\n"; - - setting = (getParcelFlag(PF_USE_PASS_LIST) ? 1 : 0); - output_stream << "\t\t use_pass_list " << setting << "\n"; - - output_stream << "\t\t pass_price " << mPassPrice << "\n"; - output_stream << "\t\t pass_hours " << mPassHours << "\n"; - - setting = (getParcelFlag(PF_SHOW_DIRECTORY) ? 1 : 0); - output_stream << "\t\t show_directory " << setting << "\n"; - - setting = (getParcelFlag(PF_ALLOW_PUBLISH) ? 1 : 0); - output_stream << "\t\t allow_publish " << setting << "\n"; - - setting = (getParcelFlag(PF_MATURE_PUBLISH) ? 1 : 0); - output_stream << "\t\t mature_publish " << setting << "\n"; - - setting = (getParcelFlag(PF_DENY_ANONYMOUS) ? 1 : 0); - output_stream << "\t\t deny_anonymous " << setting << "\n"; - - setting = (getParcelFlag(PF_DENY_IDENTIFIED) ? 1 : 0); - output_stream << "\t\t deny_identified " << setting << "\n"; - - setting = (getParcelFlag(PF_DENY_TRANSACTED) ? 1 : 0); - output_stream << "\t\t deny_transacted " << setting << "\n"; - - setting = (getParcelFlag(PF_RESTRICT_PUSHOBJECT) ? 1 : 0); - output_stream << "\t\t restrict_pushobject " << setting << "\n"; - - output_stream << "\t\t aabb_min " - << mAABBMin.mV[VX] - << " " << mAABBMin.mV[VY] - << " " << mAABBMin.mV[VZ] << "\n"; - - if (!mAccessList.empty()) - { - output_stream << "\t\t access_list " << mAccessList.size() << "\n"; - access_map_const_iterator cit = mAccessList.begin(); - access_map_const_iterator end = mAccessList.end(); - - for ( ; cit != end; ++cit) - { - output_stream << "\t\t{\n"; - const LLAccessEntry& entry = (*cit).second; - entry.mID.toString(id_string); - output_stream << "\t\t\tid " << id_string << "\n"; - output_stream << "\t\t\ttime " << entry.mTime << "\n"; - output_stream << "\t\t\tflags " << entry.mFlags << "\n"; - output_stream << "\t\t}\n"; - } - } - - if (!mBanList.empty()) - { - output_stream << "\t\t ban_list " << mBanList.size() << "\n"; - access_map_const_iterator cit = mBanList.begin(); - access_map_const_iterator end = mBanList.end(); - - for ( ; cit != end; ++cit) - { - output_stream << "\t\t{\n"; - const LLAccessEntry& entry = (*cit).second; - entry.mID.toString(id_string); - output_stream << "\t\t\tid " << id_string << "\n"; - output_stream << "\t\t\ttime " << entry.mTime << "\n"; - output_stream << "\t\t\tflags " << entry.mFlags << "\n"; - output_stream << "\t\t}\n"; - } - } - - /*if (mRenterList.count() > 0) - { - output_stream << "\t\t renter_list " << mRenterList.count() << "\n"; - for (i = 0; i < mRenterList.count(); i++) - { - output_stream << "\t\t{\n"; - const LLAccessEntry& entry = mRenterList.get(i); - entry.mID.toString(id_string); - output_stream << "\t\t\tid " << id_string << "\n"; - output_stream << "\t\t\ttime " << entry.mTime << "\n"; - output_stream << "\t\t\tflags " << entry.mFlags << "\n"; - output_stream << "\t\t}\n"; - } - }*/ - - output_stream << "\t}\n"; - output_stream.flags(old_flags); - - return TRUE; + S32 setting; + char id_string[MAX_STRING]; /* Flawfinder: ignore */ + + std::ios::fmtflags old_flags = output_stream.flags(); + output_stream.setf(std::ios::showpoint); + output_stream << "\t{\n"; + + mID.toString(id_string); + output_stream << "\t\t parcel_id " << id_string << "\n"; + output_stream << "\t\t status " << ownership_status_to_string(mStatus) << "\n"; + output_stream << "\t\t category " << category_to_string(mCategory) << "\n"; + + output_stream << "\t\t local_id " << mLocalID << "\n"; + + const char* name = (mName.empty() ? "" : mName.c_str() ); + output_stream << "\t\t name " << name << "\n"; + + const char* desc = (mDesc.empty() ? "" : mDesc.c_str() ); + output_stream << "\t\t desc " << desc << "\n"; + + const char* music_url = (mMusicURL.empty() ? "" : mMusicURL.c_str() ); + output_stream << "\t\t music_url " << music_url << "\n"; + + const char* media_url = (mMediaURL.empty() ? "" : mMediaURL.c_str() ); + output_stream << "\t\t media_url " << media_url << "\n"; + + output_stream << "\t\t media_auto_scale " << (mMediaAutoScale ? 1 : 0) << "\n"; + + mMediaID.toString(id_string); + output_stream << "\t\t media_id " << id_string << "\n"; + + mOwnerID.toString(id_string); + output_stream << "\t\t owner_id " << id_string << "\n"; + output_stream << "\t\t group_owned " << (mGroupOwned ? 1 : 0) << "\n"; + output_stream << "\t\t clean_other_time " << getCleanOtherTime() << "\n"; + + if(!mAuthBuyerID.isNull()) + { + mAuthBuyerID.toString(id_string); + output_stream << "\t\t auth_buyer_id " << id_string << "\n"; + } + if (!mSnapshotID.isNull()) + { + mSnapshotID.toString(id_string); + output_stream << "\t\t snapshot_id " << id_string << "\n"; + } + if (!mUserLocation.isExactlyZero()) + { + output_stream << "\t\t user_location " + << (F64)mUserLocation.mV[VX] + << " " << (F64)mUserLocation.mV[VY] + << " " << (F64)mUserLocation.mV[VZ] << "\n"; + output_stream << "\t\t user_look_at " + << (F64)mUserLookAt.mV[VX] + << " " << (F64)mUserLookAt.mV[VY] + << " " << (F64)mUserLookAt.mV[VZ] << "\n"; + } + output_stream << "\t\t landing_type " << mLandingType << "\n"; + //if(mJoinNeighbors) + //{ + // output_stream << "\t\t join_neighbors " << mJoinNeighbors << "\n"; + //} + if(mSaleTimerExpires.getStarted()) + { + S32 dt_sec = (S32) mSaleTimerExpires.getRemainingTimeF32()+60; // Add a minute to prevent race conditions + output_stream << "\t\t revert_sale " << dt_sec << "\n"; + //output_stream << "\t\t revert_action " << revert_action_to_string(mExpireAction) << "\n"; + output_stream << "\t\t extended_grace " << mGraceExtension << "\n"; + } + + if(0 != mAuctionID) + { + output_stream << "\t\t auction_id " << mAuctionID << "\n"; + } + + output_stream << "\t\t allow_modify " << getAllowModify() << "\n"; + output_stream << "\t\t allow_group_modify " << getAllowGroupModify() << "\n"; + output_stream << "\t\t allow_all_object_entry " << getAllowAllObjectEntry() << "\n"; + output_stream << "\t\t allow_group_object_entry " << getAllowGroupObjectEntry() << "\n"; + output_stream << "\t\t allow_terraform " << getAllowTerraform() << "\n"; + output_stream << "\t\t allow_deed_to_group " << getAllowDeedToGroup() << "\n"; + output_stream << "\t\t contribute_with_deed " << getContributeWithDeed() << "\n"; + output_stream << "\t\t allow_damage " << getAllowDamage() << "\n"; + output_stream << "\t\t claim_date " << (S32)mClaimDate << "\n"; + output_stream << "\t\t claim_price " << mClaimPricePerMeter << "\n"; + output_stream << "\t\t rent_price " << mRentPricePerMeter << "\n"; + output_stream << "\t\t discount_rate " << mDiscountRate << "\n"; + output_stream << "\t\t allow_fly " << (getAllowFly() ? 1 : 0) << "\n"; + output_stream << "\t\t allow_landmark " << (getAllowLandmark() ? 1 : 0) << "\n"; + output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; + output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; + output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; + output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; + output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; + output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; + output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; + output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; + output_stream << "\t\t sale_price " << mSalePrice << "\n"; + + setting = (getParcelFlag(PF_USE_ACCESS_GROUP) ? 1 : 0); + output_stream << "\t\t use_access_group " << setting << "\n"; + + setting = (getParcelFlag(PF_USE_ACCESS_LIST) ? 1 : 0); + output_stream << "\t\t use_access_list " << setting << "\n"; + + setting = (getParcelFlag(PF_USE_BAN_LIST) ? 1 : 0); + output_stream << "\t\t use_ban_list " << setting << "\n"; + + mGroupID.toString(id_string); + output_stream << "\t\t group_id " << id_string << "\n"; + + //const char* group_name + // = (mGroupName.isEmpty() ? "" : mGroupName.c_str() ); + //output_stream << "\t\t group_name " << group_name << "\n"; + + setting = (getParcelFlag(PF_USE_PASS_LIST) ? 1 : 0); + output_stream << "\t\t use_pass_list " << setting << "\n"; + + output_stream << "\t\t pass_price " << mPassPrice << "\n"; + output_stream << "\t\t pass_hours " << mPassHours << "\n"; + + setting = (getParcelFlag(PF_SHOW_DIRECTORY) ? 1 : 0); + output_stream << "\t\t show_directory " << setting << "\n"; + + setting = (getParcelFlag(PF_ALLOW_PUBLISH) ? 1 : 0); + output_stream << "\t\t allow_publish " << setting << "\n"; + + setting = (getParcelFlag(PF_MATURE_PUBLISH) ? 1 : 0); + output_stream << "\t\t mature_publish " << setting << "\n"; + + setting = (getParcelFlag(PF_DENY_ANONYMOUS) ? 1 : 0); + output_stream << "\t\t deny_anonymous " << setting << "\n"; + +// setting = (getParcelFlag(PF_DENY_IDENTIFIED) ? 1 : 0); +// output_stream << "\t\t deny_identified " << setting << "\n"; + +// setting = (getParcelFlag(PF_DENY_TRANSACTED) ? 1 : 0); +// output_stream << "\t\t deny_transacted " << setting << "\n"; + + setting = (getParcelFlag(PF_DENY_AGEUNVERIFIED) ? 1 : 0); + output_stream << "\t\t deny_age_unverified " << setting << "\n"; + + setting = (getParcelFlag(PF_RESTRICT_PUSHOBJECT) ? 1 : 0); + output_stream << "\t\t restrict_pushobject " << setting << "\n"; + + output_stream << "\t\t aabb_min " + << mAABBMin.mV[VX] + << " " << mAABBMin.mV[VY] + << " " << mAABBMin.mV[VZ] << "\n"; + + if (!mAccessList.empty()) + { + output_stream << "\t\t access_list " << mAccessList.size() << "\n"; + access_map_const_iterator cit = mAccessList.begin(); + access_map_const_iterator end = mAccessList.end(); + + for ( ; cit != end; ++cit) + { + output_stream << "\t\t{\n"; + const LLAccessEntry& entry = (*cit).second; + entry.mID.toString(id_string); + output_stream << "\t\t\tid " << id_string << "\n"; + output_stream << "\t\t\ttime " << entry.mTime << "\n"; + output_stream << "\t\t\tflags " << entry.mFlags << "\n"; + output_stream << "\t\t}\n"; + } + } + + if (!mBanList.empty()) + { + output_stream << "\t\t ban_list " << mBanList.size() << "\n"; + access_map_const_iterator cit = mBanList.begin(); + access_map_const_iterator end = mBanList.end(); + + for ( ; cit != end; ++cit) + { + output_stream << "\t\t{\n"; + const LLAccessEntry& entry = (*cit).second; + entry.mID.toString(id_string); + output_stream << "\t\t\tid " << id_string << "\n"; + output_stream << "\t\t\ttime " << entry.mTime << "\n"; + output_stream << "\t\t\tflags " << entry.mFlags << "\n"; + output_stream << "\t\t}\n"; + } + } + + /*if (mRenterList.count() > 0) + { + output_stream << "\t\t renter_list " << mRenterList.count() << "\n"; + for (i = 0; i < mRenterList.count(); i++) + { + output_stream << "\t\t{\n"; + const LLAccessEntry& entry = mRenterList.get(i); + entry.mID.toString(id_string); + output_stream << "\t\t\tid " << id_string << "\n"; + output_stream << "\t\t\ttime " << entry.mTime << "\n"; + output_stream << "\t\t\tflags " << entry.mFlags << "\n"; + output_stream << "\t\t}\n"; + } + }*/ + + output_stream << "\t}\n"; + output_stream.flags(old_flags); + + return TRUE; } // Assumes we are in a block "ParcelData" void LLParcel::packMessage(LLMessageSystem* msg) { - msg->addU32Fast( _PREHASH_ParcelFlags, getParcelFlags() ); - msg->addS32Fast( _PREHASH_SalePrice, getSalePrice() ); - msg->addStringFast( _PREHASH_Name, getName() ); - msg->addStringFast( _PREHASH_Desc, getDesc() ); - msg->addStringFast( _PREHASH_MusicURL, getMusicURL() ); - msg->addStringFast( _PREHASH_MediaURL, getMediaURL() ); - msg->addU8 ( "MediaAutoScale", getMediaAutoScale () ); - msg->addUUIDFast( _PREHASH_MediaID, getMediaID() ); - msg->addUUIDFast( _PREHASH_GroupID, getGroupID() ); - msg->addS32Fast( _PREHASH_PassPrice, mPassPrice ); - msg->addF32Fast( _PREHASH_PassHours, mPassHours ); - msg->addU8Fast( _PREHASH_Category, (U8)mCategory); - msg->addUUIDFast( _PREHASH_AuthBuyerID, mAuthBuyerID); - msg->addUUIDFast( _PREHASH_SnapshotID, mSnapshotID); - msg->addVector3Fast(_PREHASH_UserLocation, mUserLocation); - msg->addVector3Fast(_PREHASH_UserLookAt, mUserLookAt); - msg->addU8Fast( _PREHASH_LandingType, (U8)mLandingType); + msg->addU32Fast( _PREHASH_ParcelFlags, getParcelFlags() ); + msg->addS32Fast( _PREHASH_SalePrice, getSalePrice() ); + msg->addStringFast( _PREHASH_Name, getName() ); + msg->addStringFast( _PREHASH_Desc, getDesc() ); + msg->addStringFast( _PREHASH_MusicURL, getMusicURL() ); + msg->addStringFast( _PREHASH_MediaURL, getMediaURL() ); + msg->addU8 ( "MediaAutoScale", getMediaAutoScale () ); + msg->addUUIDFast( _PREHASH_MediaID, getMediaID() ); + msg->addUUIDFast( _PREHASH_GroupID, getGroupID() ); + msg->addS32Fast( _PREHASH_PassPrice, mPassPrice ); + msg->addF32Fast( _PREHASH_PassHours, mPassHours ); + msg->addU8Fast( _PREHASH_Category, (U8)mCategory); + msg->addUUIDFast( _PREHASH_AuthBuyerID, mAuthBuyerID); + msg->addUUIDFast( _PREHASH_SnapshotID, mSnapshotID); + msg->addVector3Fast(_PREHASH_UserLocation, mUserLocation); + msg->addVector3Fast(_PREHASH_UserLookAt, mUserLookAt); + msg->addU8Fast( _PREHASH_LandingType, (U8)mLandingType); } void LLParcel::unpackMessage(LLMessageSystem* msg) { - char buffer[256]; /* Flawfinder: ignore */ - - msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); - msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); - msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, 256, buffer ); - setName(buffer); - msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, 256, buffer ); - setDesc(buffer); - msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, 256, buffer ); - setMusicURL(buffer); - msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, 256, buffer ); - setMediaURL(buffer); - - // non-optimized version - msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); - - msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID ); - msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID ); - msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice ); - msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours ); - U8 category; - msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_Category, category); - mCategory = (ECategory)category; - msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID); - msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID); - msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation); - msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt); - U8 landing_type; - msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_LandingType, landing_type); - mLandingType = (ELandingType)landing_type; + char buffer[256]; /* Flawfinder: ignore */ + + msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); + msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); + msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, 256, buffer ); + setName(buffer); + msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, 256, buffer ); + setDesc(buffer); + msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, 256, buffer ); + setMusicURL(buffer); + msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, 256, buffer ); + setMediaURL(buffer); + + // non-optimized version + msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); + + msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID ); + msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID ); + msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice ); + msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours ); + U8 category; + msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_Category, category); + mCategory = (ECategory)category; + msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID); + msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID); + msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation); + msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt); + U8 landing_type; + msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_LandingType, landing_type); + mLandingType = (ELandingType)landing_type; } void LLParcel::packAccessEntries(LLMessageSystem* msg, const std::map& list) { - access_map_const_iterator cit = list.begin(); - access_map_const_iterator end = list.end(); - - if (cit == end) - { - msg->nextBlockFast(_PREHASH_List); - msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); - msg->addS32Fast(_PREHASH_Time, 0 ); - msg->addU32Fast(_PREHASH_Flags, 0 ); - return; - } - - for ( ; cit != end; ++cit) - { - const LLAccessEntry& entry = (*cit).second; - - msg->nextBlockFast(_PREHASH_List); - msg->addUUIDFast(_PREHASH_ID, entry.mID ); - msg->addS32Fast(_PREHASH_Time, entry.mTime ); - msg->addU32Fast(_PREHASH_Flags, entry.mFlags ); - } + access_map_const_iterator cit = list.begin(); + access_map_const_iterator end = list.end(); + + if (cit == end) + { + msg->nextBlockFast(_PREHASH_List); + msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); + msg->addS32Fast(_PREHASH_Time, 0 ); + msg->addU32Fast(_PREHASH_Flags, 0 ); + return; + } + + for ( ; cit != end; ++cit) + { + const LLAccessEntry& entry = (*cit).second; + + msg->nextBlockFast(_PREHASH_List); + msg->addUUIDFast(_PREHASH_ID, entry.mID ); + msg->addS32Fast(_PREHASH_Time, entry.mTime ); + msg->addU32Fast(_PREHASH_Flags, entry.mFlags ); + } } void LLParcel::unpackAccessEntries(LLMessageSystem* msg, - std::map* list) + std::map* list) { - LLUUID id; - S32 time; - U32 flags; - - S32 i; - S32 count = msg->getNumberOfBlocksFast(_PREHASH_List); - for (i = 0; i < count; i++) - { - msg->getUUIDFast(_PREHASH_List, _PREHASH_ID, id, i); - msg->getS32Fast( _PREHASH_List, _PREHASH_Time, time, i); - msg->getU32Fast( _PREHASH_List, _PREHASH_Flags, flags, i); - - if (id.notNull()) - { - LLAccessEntry entry; - entry.mID = id; - entry.mTime = time; - entry.mFlags = flags; - - (*list)[entry.mID] = entry; - } - } + LLUUID id; + S32 time; + U32 flags; + + S32 i; + S32 count = msg->getNumberOfBlocksFast(_PREHASH_List); + for (i = 0; i < count; i++) + { + msg->getUUIDFast(_PREHASH_List, _PREHASH_ID, id, i); + msg->getS32Fast( _PREHASH_List, _PREHASH_Time, time, i); + msg->getU32Fast( _PREHASH_List, _PREHASH_Flags, flags, i); + + if (id.notNull()) + { + LLAccessEntry entry; + entry.mID = id; + entry.mTime = time; + entry.mFlags = flags; + + (*list)[entry.mID] = entry; + } + } } void LLParcel::expirePasses(S32 now) { - access_map_iterator itor = mAccessList.begin(); - while (itor != mAccessList.end()) - { - const LLAccessEntry& entry = (*itor).second; - - if (entry.mTime != 0 && entry.mTime < now) - { - mAccessList.erase(itor++); - } - else - { - ++itor; - } - } + access_map_iterator itor = mAccessList.begin(); + while (itor != mAccessList.end()) + { + const LLAccessEntry& entry = (*itor).second; + + if (entry.mTime != 0 && entry.mTime < now) + { + mAccessList.erase(itor++); + } + else + { + ++itor; + } + } } bool LLParcel::operator==(const LLParcel &rhs) const { - if (mOwnerID != rhs.mOwnerID) - return FALSE; - - if (mParcelFlags != rhs.mParcelFlags) - return FALSE; - - if (mClaimDate != rhs.mClaimDate) - return FALSE; - - if (mClaimPricePerMeter != rhs.mClaimPricePerMeter) - return FALSE; - - if (mRentPricePerMeter != rhs.mRentPricePerMeter) - return FALSE; - - return TRUE; + if (mOwnerID != rhs.mOwnerID) + return FALSE; + + if (mParcelFlags != rhs.mParcelFlags) + return FALSE; + + if (mClaimDate != rhs.mClaimDate) + return FALSE; + + if (mClaimPricePerMeter != rhs.mClaimPricePerMeter) + return FALSE; + + if (mRentPricePerMeter != rhs.mRentPricePerMeter) + return FALSE; + + return TRUE; } // Calculate rent S32 LLParcel::getTotalRent() const { - return (S32)floor(0.5f + (F32)mArea * (F32)mRentPricePerMeter * (1.0f - mDiscountRate)); + return (S32)floor(0.5f + (F32)mArea * (F32)mRentPricePerMeter * (1.0f - mDiscountRate)); } F32 LLParcel::getAdjustedRentPerMeter() const { - return ((F32)mRentPricePerMeter * (1.0f - mDiscountRate)); + return ((F32)mRentPricePerMeter * (1.0f - mDiscountRate)); } LLVector3 LLParcel::getCenterpoint() const { - LLVector3 rv; - rv.mV[VX] = (getAABBMin().mV[VX] + getAABBMax().mV[VX]) * 0.5f; - rv.mV[VY] = (getAABBMin().mV[VY] + getAABBMax().mV[VY]) * 0.5f; - rv.mV[VZ] = 0.0f; - return rv; + LLVector3 rv; + rv.mV[VX] = (getAABBMin().mV[VX] + getAABBMax().mV[VX]) * 0.5f; + rv.mV[VY] = (getAABBMin().mV[VY] + getAABBMax().mV[VY]) * 0.5f; + rv.mV[VZ] = 0.0f; + return rv; } void LLParcel::extendAABB(const LLVector3& box_min, const LLVector3& box_max) { - // Patch up min corner of AABB - S32 i; - for (i=0; i<3; i++) - { - if (box_min.mV[i] < mAABBMin.mV[i]) - { - mAABBMin.mV[i] = box_min.mV[i]; - } - } - - // Patch up max corner of AABB - for (i=0; i<3; i++) - { - if (box_max.mV[i] > mAABBMax.mV[i]) - { - mAABBMax.mV[i] = box_max.mV[i]; - } - } + // Patch up min corner of AABB + S32 i; + for (i=0; i<3; i++) + { + if (box_min.mV[i] < mAABBMin.mV[i]) + { + mAABBMin.mV[i] = box_min.mV[i]; + } + } + + // Patch up max corner of AABB + for (i=0; i<3; i++) + { + if (box_max.mV[i] > mAABBMax.mV[i]) + { + mAABBMax.mV[i] = box_max.mV[i]; + } + } } BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) { - if (!((mParcelFlags & PF_USE_ACCESS_LIST) || (mParcelFlags & PF_USE_PASS_LIST)) - || mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) + if (mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { - // Not using access list, so not a rational thing to do return FALSE; } if (agent_id == getOwnerID()) @@ -1447,21 +1452,20 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) ++itor; } } - - removeFromBanList(agent_id); - - LLAccessEntry new_entry; - new_entry.mID = agent_id; - new_entry.mTime = time; - new_entry.mFlags = 0x0; - mAccessList[new_entry.mID] = new_entry; - return TRUE; + + removeFromBanList(agent_id); + + LLAccessEntry new_entry; + new_entry.mID = agent_id; + new_entry.mTime = time; + new_entry.mFlags = 0x0; + mAccessList[new_entry.mID] = new_entry; + return TRUE; } BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) { - if (!(mParcelFlags & PF_USE_BAN_LIST) - || mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) + if (mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { // Not using ban list, so not a rational thing to do return FALSE; @@ -1471,127 +1475,127 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) // Can't add owner to these lists return FALSE; } - - access_map_iterator itor = mBanList.begin(); - while (itor != mBanList.end()) - { - const LLAccessEntry& entry = (*itor).second; - if (entry.mID == agent_id) - { - if (time == 0 || (entry.mTime != 0 && entry.mTime < time)) - { - mBanList.erase(itor++); - } - else - { - // existing one expires later - return FALSE; - } - } - else - { - ++itor; - } - } - - removeFromAccessList(agent_id); - - LLAccessEntry new_entry; - new_entry.mID = agent_id; - new_entry.mTime = time; - new_entry.mFlags = 0x0; - mBanList[new_entry.mID] = new_entry; - return TRUE; + + access_map_iterator itor = mBanList.begin(); + while (itor != mBanList.end()) + { + const LLAccessEntry& entry = (*itor).second; + if (entry.mID == agent_id) + { + if (time == 0 || (entry.mTime != 0 && entry.mTime < time)) + { + mBanList.erase(itor++); + } + else + { + // existing one expires later + return FALSE; + } + } + else + { + ++itor; + } + } + + removeFromAccessList(agent_id); + + LLAccessEntry new_entry; + new_entry.mID = agent_id; + new_entry.mTime = time; + new_entry.mFlags = 0x0; + mBanList[new_entry.mID] = new_entry; + return TRUE; } BOOL remove_from_access_array(std::map* list, - const LLUUID& agent_id) + const LLUUID& agent_id) { - BOOL removed = FALSE; - access_map_iterator itor = list->begin(); - while (itor != list->end()) - { - const LLAccessEntry& entry = (*itor).second; - if (entry.mID == agent_id) - { - list->erase(itor++); - removed = TRUE; - } - else - { - ++itor; - } - } - return removed; + BOOL removed = FALSE; + access_map_iterator itor = list->begin(); + while (itor != list->end()) + { + const LLAccessEntry& entry = (*itor).second; + if (entry.mID == agent_id) + { + list->erase(itor++); + removed = TRUE; + } + else + { + ++itor; + } + } + return removed; } BOOL LLParcel::removeFromAccessList(const LLUUID& agent_id) { - return remove_from_access_array(&mAccessList, agent_id); + return remove_from_access_array(&mAccessList, agent_id); } BOOL LLParcel::removeFromBanList(const LLUUID& agent_id) { - return remove_from_access_array(&mBanList, agent_id); + return remove_from_access_array(&mBanList, agent_id); } // static const char* LLParcel::getOwnershipStatusString(EOwnershipStatus status) { - return ownership_status_to_string(status); + return ownership_status_to_string(status); } // static const char* LLParcel::getCategoryString(ECategory category) { - return category_to_string(category); + return category_to_string(category); } // static const char* LLParcel::getCategoryUIString(ECategory category) { - return category_to_ui_string(category); + return category_to_ui_string(category); } // static LLParcel::ECategory LLParcel::getCategoryFromString(const char* string) { - return category_string_to_category(string); + return category_string_to_category(string); } // static LLParcel::ECategory LLParcel::getCategoryFromUIString(const char* string) { - return category_ui_string_to_category(string); + return category_ui_string_to_category(string); } // static const char* LLParcel::getActionString(LLParcel::EAction action) { - S32 index = 0; - if((action >= 0) && (action < LLParcel::A_COUNT)) - { - index = action; - } - else - { - index = A_COUNT; - } - return PARCEL_ACTION_STRING[index]; + S32 index = 0; + if((action >= 0) && (action < LLParcel::A_COUNT)) + { + index = action; + } + else + { + index = A_COUNT; + } + return PARCEL_ACTION_STRING[index]; } BOOL LLParcel::isSaleTimerExpired(const U64& time) { - if (mSaleTimerExpires.getStarted() == FALSE) - { - return FALSE; - } - BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); - if (expired) - { - mSaleTimerExpires.stop(); - } - return expired; + if (mSaleTimerExpires.getStarted() == FALSE) + { + return FALSE; + } + BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); + if (expired) + { + mSaleTimerExpires.stop(); + } + return expired; } @@ -1623,22 +1627,22 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) void LLParcel::expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) { - mSaleTimerExpires.setTimerExpirySec(0.0); - mSaleTimerExpires.stop(); - setPreviousOwnerID(LLUUID::null); - setPreviouslyGroupOwned(FALSE); - setSellWithObjects(FALSE); - type = TRANS_LAND_RELEASE; - mStatus = OS_NONE; - flags = pack_transaction_flags(mGroupOwned, FALSE); - mAuthBuyerID.setNull(); - from_id = mOwnerID; - mOwnerID.setNull(); - to_id.setNull(); + mSaleTimerExpires.setTimerExpirySec(0.0); + mSaleTimerExpires.stop(); + setPreviousOwnerID(LLUUID::null); + setPreviouslyGroupOwned(FALSE); + setSellWithObjects(FALSE); + type = TRANS_LAND_RELEASE; + mStatus = OS_NONE; + flags = pack_transaction_flags(mGroupOwned, FALSE); + mAuthBuyerID.setNull(); + from_id = mOwnerID; + mOwnerID.setNull(); + to_id.setNull(); } void LLParcel::completeSale(U32& type, U8& flags, - LLUUID& to_id) + LLUUID& to_id) { mSaleTimerExpires.setTimerExpirySec(0.0); mSaleTimerExpires.stop(); @@ -1660,7 +1664,6 @@ void LLParcel::completeSale(U32& type, U8& flags, //should be cleared on sale. mAccessList.clear(); mBanList.clear(); - } void LLParcel::clearSale() @@ -1685,143 +1688,144 @@ void LLParcel::clearSale() BOOL LLParcel::isPublic() const { - return (mOwnerID.isNull()); + return (mOwnerID.isNull()); } BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const { - if(mAuthBuyerID.isNull()) - { - return TRUE; - } - return (mAuthBuyerID == buyer_id); + if(mAuthBuyerID.isNull()) + { + return TRUE; + } + return (mAuthBuyerID == buyer_id); } void LLParcel::clearParcel() { - overrideParcelFlags(PF_DEFAULT); - setName(NULL); - setDesc(NULL); - setMusicURL(NULL); - setMediaURL(NULL); - setMediaID(LLUUID::null); - setMediaAutoScale(0); - setInEscrow(FALSE); - setAuthorizedBuyerID(LLUUID::null); - setCategory(C_NONE); - setSnapshotID(LLUUID::null); - setUserLocation(LLVector3::zero); - setUserLookAt(LLVector3::x_axis); - setLandingType(L_LANDING_POINT); - setAuctionID(0); - setGroupID(LLUUID::null); - setPassPrice(0); - setPassHours(0.f); - mAccessList.clear(); - mBanList.clear(); - //mRenterList.reset(); + overrideParcelFlags(PF_DEFAULT); + setName(NULL); + setDesc(NULL); + setMusicURL(NULL); + setMediaURL(NULL); + setMediaID(LLUUID::null); + setMediaAutoScale(0); + setInEscrow(FALSE); + setAuthorizedBuyerID(LLUUID::null); + setCategory(C_NONE); + setSnapshotID(LLUUID::null); + setUserLocation(LLVector3::zero); + setUserLookAt(LLVector3::x_axis); + setLandingType(L_LANDING_POINT); + setAuctionID(0); + setGroupID(LLUUID::null); + setPassPrice(0); + setPassHours(0.f); + mAccessList.clear(); + mBanList.clear(); + //mRenterList.reset(); } void LLParcel::dump() { - llinfos << "parcel " << mLocalID << " area " << mArea << llendl; - llinfos << " name <" << mName << ">" << llendl; - llinfos << " desc <" << mDesc << ">" << llendl; + llinfos << "parcel " << mLocalID << " area " << mArea << llendl; + llinfos << " name <" << mName << ">" << llendl; + llinfos << " desc <" << mDesc << ">" << llendl; } const char* ownership_status_to_string(LLParcel::EOwnershipStatus status) { - if(status >= 0 && status < LLParcel::OS_COUNT) - { - return PARCEL_OWNERSHIP_STATUS_STRING[status]; - } - return "none"; + if(status >= 0 && status < LLParcel::OS_COUNT) + { + return PARCEL_OWNERSHIP_STATUS_STRING[status]; + } + return "none"; } LLParcel::EOwnershipStatus ownership_string_to_status(const char* s) { - for(S32 i = 0; i < LLParcel::OS_COUNT; ++i) - { - if(0 == strcmp(s, PARCEL_OWNERSHIP_STATUS_STRING[i])) - { - return (LLParcel::EOwnershipStatus)i; - } - } - return LLParcel::OS_NONE; + for(S32 i = 0; i < LLParcel::OS_COUNT; ++i) + { + if(0 == strcmp(s, PARCEL_OWNERSHIP_STATUS_STRING[i])) + { + return (LLParcel::EOwnershipStatus)i; + } + } + return LLParcel::OS_NONE; } //const char* revert_action_to_string(LLParcel::ESaleTimerExpireAction action) //{ -// S32 index = 0; -// if(action >= 0 && action < LLParcel::STEA_COUNT) -// { -// index = action; -// } -// return PARCEL_SALE_TIMER_ACTION[index]; +// S32 index = 0; +// if(action >= 0 && action < LLParcel::STEA_COUNT) +// { +// index = action; +// } +// return PARCEL_SALE_TIMER_ACTION[index]; //} - + //LLParcel::ESaleTimerExpireAction revert_string_to_action(const char* s) //{ -// for(S32 i = 0; i < LLParcel::STEA_COUNT; ++i) -// { -// if(0 == strcmp(s, PARCEL_SALE_TIMER_ACTION[i])) -// { -// return (LLParcel::ESaleTimerExpireAction)i; -// } -// } -// return LLParcel::STEA_REVERT; +// for(S32 i = 0; i < LLParcel::STEA_COUNT; ++i) +// { +// if(0 == strcmp(s, PARCEL_SALE_TIMER_ACTION[i])) +// { +// return (LLParcel::ESaleTimerExpireAction)i; +// } +// } +// return LLParcel::STEA_REVERT; //} - + const char* category_to_string(LLParcel::ECategory category) { - S32 index = 0; - if((category >= 0) && (category < LLParcel::C_COUNT)) - { - index = category; - } - return PARCEL_CATEGORY_STRING[index]; + S32 index = 0; + if((category >= 0) && (category < LLParcel::C_COUNT)) + { + index = category; + } + return PARCEL_CATEGORY_STRING[index]; } const char* category_to_ui_string(LLParcel::ECategory category) { - S32 index = 0; - if((category >= 0) && (category < LLParcel::C_COUNT)) - { - index = category; - } - else - { - // C_ANY = -1 , but the "Any" string is at the end of the list - index = ((S32) LLParcel::C_COUNT); - } - return PARCEL_CATEGORY_UI_STRING[index]; + S32 index = 0; + if((category >= 0) && (category < LLParcel::C_COUNT)) + { + index = category; + } + else + { + // C_ANY = -1 , but the "Any" string is at the end of the list + index = ((S32) LLParcel::C_COUNT); + } + return PARCEL_CATEGORY_UI_STRING[index]; } LLParcel::ECategory category_string_to_category(const char* s) { - for(S32 i = 0; i < LLParcel::C_COUNT; ++i) - { - if(0 == strcmp(s, PARCEL_CATEGORY_STRING[i])) - { - return (LLParcel::ECategory)i; - } - } - llwarns << "Parcel category outside of possibilities " << s << llendl; - return LLParcel::C_NONE; + for(S32 i = 0; i < LLParcel::C_COUNT; ++i) + { + if(0 == strcmp(s, PARCEL_CATEGORY_STRING[i])) + { + return (LLParcel::ECategory)i; + } + } + llwarns << "Parcel category outside of possibilities " << s << llendl; + return LLParcel::C_NONE; } LLParcel::ECategory category_ui_string_to_category(const char* s) { - for(S32 i = 0; i < LLParcel::C_COUNT; ++i) - { - if(0 == strcmp(s, PARCEL_CATEGORY_UI_STRING[i])) - { - return (LLParcel::ECategory)i; - } - } - // "Any" is a valid category for searches, and - // is a distinct option from "None" and "Other" - return LLParcel::C_ANY; + for(S32 i = 0; i < LLParcel::C_COUNT; ++i) + { + if(0 == strcmp(s, PARCEL_CATEGORY_UI_STRING[i])) + { + return (LLParcel::ECategory)i; + } + } + // "Any" is a valid category for searches, and + // is a distinct option from "None" and "Other" + return LLParcel::C_ANY; } + diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h index 3af1824..a8143f2 100644 --- a/linden/indra/llinventory/llparcel.h +++ b/linden/indra/llinventory/llparcel.h @@ -253,8 +253,7 @@ public: void setForSale(BOOL b) { setParcelFlag(PF_FOR_SALE, b); } void setSoundOnly(BOOL b) { setParcelFlag(PF_SOUND_LOCAL, b); } void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } - void setDenyIdentified(BOOL b) { setParcelFlag(PF_DENY_IDENTIFIED, b); } - void setDenyTransacted(BOOL b) { setParcelFlag(PF_DENY_TRANSACTED, b); } + void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } void setDrawDistance(F32 dist) { mDrawDistance = dist; } @@ -444,10 +443,8 @@ public: { return mRegionPushOverride; } BOOL getRegionDenyAnonymousOverride() const { return mRegionDenyAnonymousOverride; } - BOOL getRegionDenyIdentifiedOverride() const - { return mRegionDenyIdentifiedOverride; } - BOOL getRegionDenyTransactedOverride() const - { return mRegionDenyTransactedOverride; } + BOOL getRegionDenyAgeUnverifiedOverride() const + { return mRegionDenyAgeUnverifiedOverride; } F32 getDrawDistance() const { return mDrawDistance; } S32 getSalePrice() const { return mSalePrice; } @@ -471,7 +468,11 @@ public: BOOL allowTerraformBy(const LLUUID &agent_id) const; // Returns 0 if access is OK, otherwise a BA_ return code above. - S32 blockAccess(const LLUUID& agent_id, const LLUUID& group_id, const BOOL is_agent_identified, const BOOL is_agent_transacted) const; + S32 blockAccess(const LLUUID& agent_id, + const LLUUID& group_id, + const BOOL is_agent_identified, + const BOOL is_agent_transacted, + const BOOL is_agent_ageverified) const; // Only checks if the agent is explicitly banned from this parcel BOOL isAgentBanned(const LLUUID& agent_id) const; @@ -480,7 +481,8 @@ public: const LLUUID& agent_id, const std::vector& group_ids, const BOOL is_agent_identified, - const BOOL is_agent_transacted); + const BOOL is_agent_transacted, + const BOOL is_agent_ageverified); bool operator==(const LLParcel &rhs) const; @@ -524,8 +526,7 @@ public: void setCleanOtherTime(S32 time) { mCleanOtherTime = time; } void setRegionPushOverride(BOOL override) {mRegionPushOverride = override; } void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } - void setRegionDenyIdentifiedOverride(BOOL override) { mRegionDenyIdentifiedOverride = override; } - void setRegionDenyTransactedOverride(BOOL override) { mRegionDenyTransactedOverride = override; } + void setRegionDenyAgeUnverifiedOverride(BOOL override) { mRegionDenyAgeUnverifiedOverride = override; } // Accessors for parcel sellWithObjects void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } @@ -594,8 +595,7 @@ protected: S32 mCleanOtherTime; BOOL mRegionPushOverride; BOOL mRegionDenyAnonymousOverride; - BOOL mRegionDenyIdentifiedOverride; - BOOL mRegionDenyTransactedOverride; + BOOL mRegionDenyAgeUnverifiedOverride; public: diff --git a/linden/indra/llinventory/llparcelflags.h b/linden/indra/llinventory/llparcelflags.h index d691d4d..1806142 100644 --- a/linden/indra/llinventory/llparcelflags.h +++ b/linden/indra/llinventory/llparcelflags.h @@ -58,16 +58,20 @@ const U32 PF_URL_WEB_PAGE = 1 << 19; // The "media URL" is an HTML page const U32 PF_URL_RAW_HTML = 1 << 20; // The "media URL" is a raw HTML string like

Foo

const U32 PF_RESTRICT_PUSHOBJECT = 1 << 21; // Restrict push object to either on agent or on scripts owned by parcel owner const U32 PF_DENY_ANONYMOUS = 1 << 22; // Deny all non identified/transacted accounts -const U32 PF_DENY_IDENTIFIED = 1 << 23; // Deny identified accounts -const U32 PF_DENY_TRANSACTED = 1 << 24; // Deny identified accounts +// const U32 PF_DENY_IDENTIFIED = 1 << 23; // Deny identified accounts +// const U32 PF_DENY_TRANSACTED = 1 << 24; // Deny identified accounts const U32 PF_ALLOW_GROUP_SCRIPTS = 1 << 25; // Allow scripts owned by group const U32 PF_CREATE_GROUP_OBJECTS = 1 << 26; // Allow object creation by group members or objects const U32 PF_ALLOW_ALL_OBJECT_ENTRY = 1 << 27; // Allow all objects to enter a parcel const U32 PF_ALLOW_GROUP_OBJECT_ENTRY = 1 << 28; // Only allow group (and owner) objects to enter the parcel const U32 PF_ALLOW_VOICE_CHAT = 1 << 29; // Allow residents to use voice chat on this parcel const U32 PF_USE_ESTATE_VOICE_CHAN = 1 << 30; +const U32 PF_DENY_AGEUNVERIFIED = 1 << 31; // Prevent residents who aren't age-verified +// NOTE: At one point we have used all of the bits. +// We have deprecated two of them in 1.19.0 which *could* be reused, +// but only after we are certain there are no simstates using those bits. -const U32 PF_RESERVED = 1U << 31; +//const U32 PF_RESERVED = 1U << 31; // If any of these are true the parcel is restricting access in some maner. const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP @@ -75,8 +79,7 @@ const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP | PF_USE_BAN_LIST | PF_USE_PASS_LIST | PF_DENY_ANONYMOUS - | PF_DENY_IDENTIFIED - | PF_DENY_TRANSACTED; + | PF_DENY_AGEUNVERIFIED; const U32 PF_NONE = 0x00000000; const U32 PF_ALL = 0x7FFFFFFF; const U32 PF_DEFAULT = PF_ALLOW_FLY @@ -104,6 +107,7 @@ const S32 BA_NOT_IN_GROUP = 1; const S32 BA_NOT_ON_LIST = 2; const S32 BA_BANNED = 3; const S32 BA_NO_ACCESS_LEVEL = 4; +const S32 BA_NOT_AGE_VERIFIED = 5; // ParcelRelease flags const U32 PR_NONE = 0x0; diff --git a/linden/indra/llmessage/llcircuit.cpp b/linden/indra/llmessage/llcircuit.cpp index 1d1be56..0db9f8e 100644 --- a/linden/indra/llmessage/llcircuit.cpp +++ b/linden/indra/llmessage/llcircuit.cpp @@ -1170,13 +1170,11 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit) return s; } -const LLString LLCircuitData::getInfoString() const +void LLCircuitData::getInfo(LLSD& info) const { - std::ostringstream info; - info << "Circuit: " << mHost << std::endl - << (mbAlive ? "Alive" : "Not Alive") << std::endl - << "Age: " << mExistenceTimer.getElapsedTimeF32() << std::endl; - return LLString(info.str()); + info["Host"] = mHost.getIPandPort(); + info["Alive"] = mbAlive; + info["Age"] = mExistenceTimer.getElapsedTimeF32(); } void LLCircuitData::dumpResendCountAndReset() @@ -1200,17 +1198,16 @@ std::ostream& operator<<(std::ostream& s, LLCircuit &circuit) return s; } -const LLString LLCircuit::getInfoString() const +void LLCircuit::getInfo(LLSD& info) const { - std::ostringstream info; - info << "Circuit Info:" << std::endl; LLCircuit::circuit_data_map::const_iterator end = mCircuitData.end(); LLCircuit::circuit_data_map::const_iterator it; + LLSD circuit_info; for(it = mCircuitData.begin(); it != end; ++it) { - info << (*it).second->getInfoString() << std::endl; + (*it).second->getInfo(circuit_info); + info["Circuits"].append(circuit_info); } - return LLString(info.str()); } void LLCircuit::getCircuitRange( diff --git a/linden/indra/llmessage/llcircuit.h b/linden/indra/llmessage/llcircuit.h index 128b1bc..1a6611f 100644 --- a/linden/indra/llmessage/llcircuit.h +++ b/linden/indra/llmessage/llcircuit.h @@ -75,6 +75,7 @@ const S32 LL_MAX_ACKED_PACKETS_PER_FRAME = 200; // class LLMessageSystem; class LLEncodedDatagramService; +class LLSD; // // Classes @@ -158,7 +159,7 @@ public: // void checkPeriodTime(); // Reset per-period counters if necessary. friend std::ostream& operator<<(std::ostream& s, LLCircuitData &circuit); - const LLString getInfoString() const; + void getInfo(LLSD& info) const; friend class LLCircuit; friend class LLMessageSystem; @@ -304,7 +305,7 @@ public: void sendAcks(); friend std::ostream& operator<<(std::ostream& s, LLCircuit &circuit); - const LLString getInfoString() const; + void getInfo(LLSD& info) const; void dumpResends(); diff --git a/linden/indra/llmessage/llcurl.cpp b/linden/indra/llmessage/llcurl.cpp index 01976b1..9b5e6cd 100644 --- a/linden/indra/llmessage/llcurl.cpp +++ b/linden/indra/llmessage/llcurl.cpp @@ -367,6 +367,11 @@ LLCurl::getByteRange(const std::string& url, S32 offset, S32 length, ResponderPt mainMulti()->getByteRange(url, offset, length, responder); } +void LLCurl::initClass() +{ + curl_global_init(CURL_GLOBAL_ALL); +} + void LLCurl::process() { diff --git a/linden/indra/llmessage/llcurl.h b/linden/indra/llmessage/llcurl.h index d21cdc4..53287c2 100644 --- a/linden/indra/llmessage/llcurl.h +++ b/linden/indra/llmessage/llcurl.h @@ -130,8 +130,9 @@ public: static void get(const std::string& url, ResponderPtr); static void getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr responder); + static void initClass(); // *NOTE:Mani - not thread safe! static void process(); - static void cleanup(); + static void cleanup(); // *NOTE:Mani - not thread safe! }; namespace boost diff --git a/linden/indra/llmessage/llregionflags.h b/linden/indra/llmessage/llregionflags.h index 72272c0..5f3fad8 100644 --- a/linden/indra/llmessage/llregionflags.h +++ b/linden/indra/llmessage/llregionflags.h @@ -84,8 +84,8 @@ const U32 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21); const U32 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22); const U32 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23); -const U32 REGION_FLAGS_DENY_IDENTIFIED = (1 << 24); -const U32 REGION_FLAGS_DENY_TRANSACTED = (1 << 25); +// const U32 REGION_FLAGS_DENY_IDENTIFIED = (1 << 24); +// const U32 REGION_FLAGS_DENY_TRANSACTED = (1 << 25); const U32 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26); @@ -94,6 +94,7 @@ const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27); const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28); const U32 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29); +const U32 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30); const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK | @@ -110,8 +111,7 @@ const U32 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE | REGION_FLAGS_PUBLIC_ALLOWED | REGION_FLAGS_SUN_FIXED | REGION_FLAGS_DENY_ANONYMOUS - | REGION_FLAGS_DENY_IDENTIFIED - | REGION_FLAGS_DENY_TRANSACTED; + | REGION_FLAGS_DENY_AGEUNVERIFIED; inline BOOL is_prelude( U32 flags ) { diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp index e2cd19b..d446730 100644 --- a/linden/indra/llmessage/message.cpp +++ b/linden/indra/llmessage/message.cpp @@ -1562,12 +1562,9 @@ U32 LLMessageSystem::getOurCircuitCode() return mOurCircuitCode; } -LLString LLMessageSystem::getCircuitInfoString() +void LLMessageSystem::getCircuitInfo(LLSD& info) const { - LLString info_string; - - info_string += mCircuitInfo.getInfoString(); - return info_string; + mCircuitInfo.getInfo(info); } // returns whether the given host is on a trusted circuit diff --git a/linden/indra/llmessage/message.h b/linden/indra/llmessage/message.h index 4454b40..3381ece 100644 --- a/linden/indra/llmessage/message.h +++ b/linden/indra/llmessage/message.h @@ -529,7 +529,7 @@ public: bool isMatchingDigestForWindow(const char* digest, const S32 window) const; void showCircuitInfo(); - LLString getCircuitInfoString(); + void getCircuitInfo(LLSD& info) const; U32 getOurCircuitCode(); diff --git a/linden/indra/llmessage/message_prehash.cpp b/linden/indra/llmessage/message_prehash.cpp index 0185c0f..0b614d8 100644 --- a/linden/indra/llmessage/message_prehash.cpp +++ b/linden/indra/llmessage/message_prehash.cpp @@ -1369,6 +1369,9 @@ char * _PREHASH_AvatarNotesReply; char * _PREHASH_CacheID; char * _PREHASH_OwnerMask; char * _PREHASH_TransferInventoryAck; +char * _PREHASH_RegionDenyAgeUnverified; +char * _PREHASH_AgeVerificationBlock; + void init_prehash_data() { @@ -2702,4 +2705,6 @@ void init_prehash_data() _PREHASH_CacheID = gMessageStringTable.getString("CacheID"); _PREHASH_OwnerMask = gMessageStringTable.getString("OwnerMask"); _PREHASH_TransferInventoryAck = gMessageStringTable.getString("TransferInventoryAck"); + _PREHASH_RegionDenyAgeUnverified = gMessageStringTable.getString("RegionDenyAgeUnverified"); + _PREHASH_AgeVerificationBlock = gMessageStringTable.getString("AgeVerificationBlock"); } diff --git a/linden/indra/llmessage/message_prehash.h b/linden/indra/llmessage/message_prehash.h index 2cea924..4210665 100644 --- a/linden/indra/llmessage/message_prehash.h +++ b/linden/indra/llmessage/message_prehash.h @@ -1369,6 +1369,8 @@ extern char * _PREHASH_AvatarNotesReply; extern char * _PREHASH_CacheID; extern char * _PREHASH_OwnerMask; extern char * _PREHASH_TransferInventoryAck; +extern char * _PREHASH_RegionDenyAgeUnverified; +extern char * _PREHASH_AgeVerificationBlock; void init_prehash_data(); diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp index 258b523..716fffd 100644 --- a/linden/indra/llui/llalertdialog.cpp +++ b/linden/indra/llui/llalertdialog.cpp @@ -58,6 +58,8 @@ const S32 MSG_PAD = 8; /*static*/ LLAlertDialog::display_callback_t LLAlertDialog::sDisplayCallback; /*static*/ LLString LLAlertDialog::sStringSkipNextTime("Skip this dialog next time"); /*static*/ LLString LLAlertDialog::sStringAlwaysChoose("Always choose this option"); +/*static*/ LLAlertDialog::URLLoader* LLAlertDialog::sURLLoader; + //static LLAlertDialog* LLAlertDialog::createXml( const LLString& xml_desc, @@ -147,8 +149,11 @@ LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template, mIgnoreLabel(xml_template->mIgnoreLabel), mButtonData(NULL), mLineEditor(NULL), - mTextCallback(NULL) + mTextCallback(NULL), + mURLOption(0) { + mURL = xml_template->mURL; + mURLOption = xml_template->mURLOption; createDialog(&(xml_template->mOptions), xml_template->mDefaultOption, xml_template->mMessage, args, xml_template->mEditLineText); @@ -237,12 +242,12 @@ bool LLAlertDialog::show() return true; } -//static void LLAlertDialog::format(LLString& msg, const LLString::format_map_t& args) { // XUI:translate! LLString::format_map_t targs = args; targs["[SECOND_LIFE]"] = "Second Life"; + targs["[_URL]"] = mURL; LLString::format(msg, targs); } @@ -288,7 +293,7 @@ void LLAlertDialog::createDialog(const std::vector* optionsp, S32 defa // Message: create text box using raw string, as text has been structure deliberately // Use size of created text box to generate dialog box size LLString msg = msg_in; - LLAlertDialog::format( msg, args ); + format( msg, args ); llwarns << "Alert: " << msg << llendl; LLTextBox* msg_box = new LLTextBox( "Alert message", msg, (F32)MAX_ALLOWED_MSG_WIDTH, font ); @@ -424,6 +429,15 @@ LLAlertDialog::~LLAlertDialog() mCallback(mOptionChosen, mUserData); } + // If we declared a URL and chose the URL option, go to the url + if (mOptionChosen == mURLOption) + { + if (!mURL.empty() && sURLLoader != NULL) + { + sURLLoader->load(mURL); + } + } + // Only change warn state if we actually warned. if (mCheck && sSettings->getWarning(mIgnoreLabel)) @@ -547,7 +561,7 @@ void LLAlertDialog::setEditTextArgs(const LLString::format_map_t& edit_args) if (mLineEditor) { LLString msg = mLineEditor->getText(); - LLAlertDialog::format(msg, edit_args); + format(msg, edit_args); mLineEditor->setText(msg); } else @@ -790,6 +804,19 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se } } } + + // + if (child->hasName("url")) + { + S32 url_option = 0; + child->getAttributeS32("option", url_option); + if (xml_template) + { + xml_template->mURL = child->getTextContents(); + xml_template->mURLOption = url_option; + } + } + } if (xml_template) { diff --git a/linden/indra/llui/llalertdialog.h b/linden/indra/llui/llalertdialog.h index ddf4112..07d20dc 100644 --- a/linden/indra/llui/llalertdialog.h +++ b/linden/indra/llui/llalertdialog.h @@ -50,6 +50,18 @@ public: typedef bool (*display_callback_t)(S32 modal); enum { IGNORE_USE_DEFAULT=1, IGNORE_USE_SAVED=2, IGNORE_SHOW_AGAIN=3 }; + class URLLoader + { + public: + virtual void load(const std::string& url) = 0; + virtual ~URLLoader() {} + }; + + static void setURLLoader(URLLoader* loader) + { + sURLLoader = loader; + }; + protected: struct ButtonData { @@ -98,7 +110,7 @@ public: LLAlertDialog( const LLAlertDialogTemplate* xml_template, const LLString::format_map_t& args, alert_callback_t callback = NULL, void *user_data = NULL); - static void format(LLString& msg, const LLString::format_map_t& args); + void format(LLString& msg, const LLString::format_map_t& args); protected: void createDialog(const std::vector* options, S32 default_option, @@ -126,6 +138,9 @@ protected: // For Dialogs that take a line as text as input: LLLineEditor* mLineEditor; alert_text_callback_t mTextCallback; + // For Dialogs linked to a URL + LLString mURL; // Some alerts will direct the resident to a URL + S32 mURLOption; public: // use LLPointer so they delete themselves when sTemplates is destroyed @@ -138,6 +153,9 @@ public: static LLString sStringSkipNextTime; static LLString sStringAlwaysChoose; + +private: + static URLLoader* sURLLoader; }; //============================================================================ @@ -145,7 +163,7 @@ public: class LLAlertDialogTemplate : public LLRefCount { public: - LLAlertDialogTemplate() : mTitle(), mModal(FALSE), mUnique(FALSE), mIgnorable(0), mDefaultOption(0) {} + LLAlertDialogTemplate() : mTitle(), mURLOption(0), mModal(FALSE), mUnique(FALSE), mIgnorable(0), mDefaultOption(0) {} void addOption(const LLString& label, const LLString& ignore_text, BOOL is_default = FALSE) { @@ -184,6 +202,8 @@ public: LLString mMessage; // Message to display LLString mIgnoreListText; // Text to display in enable/disable dialog (if mIgnorable == TRUE) LLString mIgnoreLabel; // Handle for ignore variable (may be shared by multiple templates) + LLString mURL; // Some alerts will direct the resident to a URL + S32 mURLOption; BOOL mModal; BOOL mUnique; S32 mIgnorable; // 0 = Never Ignore, 1 = Do default option, 2 = Do saved option diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 36ccc32..26ce473 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp @@ -368,9 +368,6 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) (*mClickedCallback)( mCallbackUserData ); } } - - mMouseDownTimer.stop(); - mMouseDownTimer.reset(); } return TRUE; diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 41a67f2..ab6bc00 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -834,7 +834,7 @@ void LLFloater::setMinimized(BOOL minimize) LLView* viewp = *child_it; if (!viewp->getVisible()) { - mMinimizedHiddenChildren.push_back(viewp); + mMinimizedHiddenChildren.push_back(viewp->mViewHandle); } viewp->setVisible(FALSE); } @@ -897,11 +897,14 @@ void LLFloater::setMinimized(BOOL minimize) viewp->setVisible(TRUE); } - std::vector::iterator itor = mMinimizedHiddenChildren.begin(); - while (itor != mMinimizedHiddenChildren.end()) + std::vector::iterator itor = mMinimizedHiddenChildren.begin(); + for ( ; itor != mMinimizedHiddenChildren.end(); ++itor) { - (*itor)->setVisible(FALSE); - ++itor; + LLView* viewp = LLView::getViewByHandle(*itor); + if(viewp) + { + viewp->setVisible(FALSE); + } } mMinimizedHiddenChildren.clear(); @@ -2220,7 +2223,6 @@ BOOL LLFloaterView::allChildrenClosed() { // see if there are any visible floaters (some floaters "close" // by setting themselves invisible) - S32 visible_count = 0; for (child_list_const_iter_t it = getChildList()->begin(); it != getChildList()->end(); ++it) { LLView* viewp = *it; @@ -2228,11 +2230,10 @@ BOOL LLFloaterView::allChildrenClosed() if (floaterp->getVisible() && floaterp->canClose()) { - visible_count++; + return false; } } - - return (visible_count == 0); + return true; } @@ -2270,14 +2271,22 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out S32 min_height; floater->getResizeLimits( &min_width, &min_height ); + // Make sure floater isn't already smaller than its min height/width? S32 new_width = llmax( min_width, view_width ); S32 new_height = llmax( min_height, view_height ); - if( (new_width > screen_width) || (new_height > screen_height) ) + if( !allow_partial_outside + && ( (new_width > screen_width) + || (new_height > screen_height) ) ) { + // We have to force this window to be inside the screen. new_width = llmin(new_width, screen_width); new_height = llmin(new_height, screen_height); + // Still respect minimum width/height + new_width = llmax(new_width, min_width); + new_height = llmax(new_height, min_height); + floater->reshape( new_width, new_height, TRUE ); // Make sure the damn thing is actually onscreen. diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index d0494ea..1d88501 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -286,7 +286,7 @@ protected: typedef std::map::iterator handle_map_iter_t; static handle_map_t sFloaterMap; - std::vector mMinimizedHiddenChildren; + std::vector mMinimizedHiddenChildren; BOOL mHasBeenDraggedWhileMinimized; S32 mPreviousMinimizedBottom; @@ -429,3 +429,4 @@ extern LLFloaterView* gFloaterView; #endif // LL_FLOATER_H + diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index 78fe29c..420970a 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -158,8 +158,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, mHandleEditKeysDirectly( FALSE ), mSelectAllonFocusReceived( FALSE ), mPassDelete(FALSE), - mReadOnly(FALSE), - mLastIMEPosition( -1, -1 ) + mReadOnly(FALSE) { llassert( max_length_bytes > 0 ); @@ -1638,15 +1637,10 @@ void LLLineEditor::draw() S32 pixels_after_scroll = findPixelNearestPos(); // RCalculcate for IME position LLRect screen_pos = getScreenRect(); LLCoordGL ime_pos( screen_pos.mLeft + pixels_after_scroll, screen_pos.mTop - UI_LINEEDITOR_V_PAD ); - if ( ime_pos.mX != mLastIMEPosition.mX || ime_pos.mY != mLastIMEPosition.mY ) - { - mLastIMEPosition.mX = ime_pos.mX; - mLastIMEPosition.mY = ime_pos.mY; - ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); - ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]); - getWindow()->setLanguageTextInput( ime_pos ); - } + ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); + ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]); + getWindow()->setLanguageTextInput( ime_pos ); } } diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index 2cd2ebf..f1b9fbe 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h @@ -279,8 +279,6 @@ protected: S32 mBorderThickness; - LLCoordGL mLastIMEPosition; // Last screen position used for the IME editor - BOOL mIgnoreArrowKeys; BOOL mIgnoreTab; BOOL mDrawAsterixes; diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index 3a0ee9b..ca1bc9c 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp @@ -982,6 +982,16 @@ BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LL return FALSE; } +BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text) +{ + LLView* child = getChildByName(id, true); + if (child) + { + return child->setToolTipArg(key, text); + } + return FALSE; +} + void LLPanel::childSetMinValue(const LLString& id, LLSD min_value) { LLUICtrl* child = (LLUICtrl*)getChildByName(id, true); diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h index dfd7a51..78aa7cf 100644 --- a/linden/indra/llui/llpanel.h +++ b/linden/indra/llui/llpanel.h @@ -194,6 +194,7 @@ public: // Not implemented for all types, defaults to noop, returns FALSE if not applicaple BOOL childSetTextArg(const LLString& id, const LLString& key, const LLStringExplicit& text); BOOL childSetLabelArg(const LLString& id, const LLString& key, const LLStringExplicit& text); + BOOL childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text); // LLSlider / LLSpinCtrl void childSetMinValue(const LLString& id, LLSD min_value); diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index f5eef29..96a7394 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp @@ -701,7 +701,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos ) break; } - updateLineHeight(); + updateLineHeightInsert(item); mPageLines = mLineHeight ? mItemListRect.getHeight() / mLineHeight : 0; BOOL scrollbar_visible = mPageLines < getItemCount(); @@ -753,12 +753,11 @@ void LLScrollListCtrl::updateMaxContentWidth(LLScrollListItem* added_item) } } +const S32 SCROLL_LIST_ROW_PAD = 2; // Line height is the max height of all the cells in all the items. void LLScrollListCtrl::updateLineHeight() { - const S32 ROW_PAD = 2; - mLineHeight = 0; item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -768,11 +767,23 @@ void LLScrollListCtrl::updateLineHeight() S32 i = 0; for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) { - mLineHeight = llmax( mLineHeight, cell->getHeight() + ROW_PAD ); + mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); } } } +// when the only change to line height is from an insert, we needn't scan the entire list +void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp) +{ + S32 num_cols = itemp->getNumColumns(); + S32 i = 0; + for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) + { + mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); + } +} + + void LLScrollListCtrl::updateColumns() { mColumnsIndexed.resize(mColumns.size()); diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index 5ceee2e..a98a411 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h @@ -589,6 +589,7 @@ protected: void selectNextItem(BOOL extend_selection); void drawItems(); void updateLineHeight(); + void updateLineHeightInsert(LLScrollListItem* item); void reportInvalidInput(); BOOL isRepeatedChars(const LLWString& string) const; void selectItem(LLScrollListItem* itemp, BOOL single_select = TRUE); diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index c0b0788..efd4245 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp @@ -49,6 +49,9 @@ LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& t mDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), mBackgroundColor( LLUI::sColorsGroup->getColor( "DefaultBackgroundColor" ) ), mBorderColor( LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ) ), + mHoverColor( LLUI::sColorsGroup->getColor( "LabelSelectedColor" ) ), + mHoverActive( FALSE ), + mHasHover( FALSE ), mBackgroundVisible( FALSE ), mBorderVisible( FALSE ), mFontStyle(LLFontGL::DROP_SHADOW_SOFT), @@ -74,6 +77,9 @@ LLTextBox::LLTextBox(const LLString& name, const LLString& text, F32 max_width, mDisabledColor(LLUI::sColorsGroup->getColor("LabelDisabledColor")), mBackgroundColor(LLUI::sColorsGroup->getColor("DefaultBackgroundColor")), mBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight")), + mHoverColor( LLUI::sColorsGroup->getColor( "LabelSelectedColor" ) ), + mHoverActive( FALSE ), + mHasHover( FALSE ), mBackgroundVisible(FALSE), mBorderVisible(FALSE), mFontStyle(LLFontGL::DROP_SHADOW_SOFT), @@ -161,6 +167,16 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) +{ + if(mHoverActive) + { + mHasHover = TRUE; // This should be set every frame during a hover. + return TRUE; + } + return FALSE; +} + void LLTextBox::setText(const LLStringExplicit& text) { mText.assign(text); @@ -334,7 +350,15 @@ void LLTextBox::draw() if ( getEnabled() ) { - drawText( text_x, text_y, mTextColor ); + if(mHasHover) + { + drawText( text_x, text_y, mHoverColor ); + } + else + { + drawText( text_x, text_y, mTextColor ); + } + } else { @@ -346,6 +370,8 @@ void LLTextBox::draw() drawDebugRect(); } } + + mHasHover = FALSE; // This is reset every frame. } void LLTextBox::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -468,5 +494,20 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f text_box->setColor(color); } + if(node->hasAttribute("hover_color")) + { + LLColor4 color; + LLUICtrlFactory::getAttributeColor(node, "hover_color", color); + text_box->setHoverColor(color); + text_box->setHoverActive(true); + } + + BOOL hover_active = FALSE; + if(node->getAttributeBOOL("hover", hover_active)) + { + text_box->setHoverActive(hover_active); + } + + return text_box; } diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h index 7e7018a..c7c7946 100644 --- a/linden/indra/llui/lltextbox.h +++ b/linden/indra/llui/lltextbox.h @@ -66,11 +66,16 @@ public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleHover(S32 x, S32 y, MASK mask); void setColor( const LLColor4& c ) { mTextColor = c; } void setDisabledColor( const LLColor4& c) { mDisabledColor = c; } void setBackgroundColor( const LLColor4& c) { mBackgroundColor = c; } void setBorderColor( const LLColor4& c) { mBorderColor = c; } + + void setHoverColor( const LLColor4& c ) { mHoverColor = c; } + void setHoverActive( BOOL active ) { mHoverActive = active; } + void setText( const LLStringExplicit& text ); void setWrappedText(const LLStringExplicit& text, F32 max_width = -1.0); // default width means use existing control width @@ -108,10 +113,12 @@ protected: const LLFontGL* mFontGL; LLColor4 mTextColor; LLColor4 mDisabledColor; - LLColor4 mBackgroundColor; LLColor4 mBorderColor; - + LLColor4 mHoverColor; + + BOOL mHoverActive; + BOOL mHasHover; BOOL mBackgroundVisible; BOOL mBorderVisible; diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 200cf29..d08997c 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -310,8 +310,7 @@ LLTextEditor::LLTextEditor( mMouseDownX(0), mMouseDownY(0), mLastSelectionX(-1), - mLastSelectionY(-1), - mLastIMEPosition(-1,-1) + mLastSelectionY(-1) { mSourceID.generate(); @@ -2817,15 +2816,10 @@ void LLTextEditor::drawCursor() // Make sure the IME is in the right place LLRect screen_pos = getScreenRect(); LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_left), screen_pos.mBottom + llfloor(cursor_top) ); - if ( ime_pos.mX != mLastIMEPosition.mX || ime_pos.mY != mLastIMEPosition.mY ) - { - mLastIMEPosition.mX = ime_pos.mX; - mLastIMEPosition.mY = ime_pos.mY; - ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); - ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]); - getWindow()->setLanguageTextInput( ime_pos ); - } + ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); + ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]); + getWindow()->setLanguageTextInput( ime_pos ); } } } diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 55aba57..d38accc 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h @@ -439,8 +439,6 @@ protected: BOOL mParseHTML; LLString mHTML; - - LLCoordGL mLastIMEPosition; // Last position of the IME editor }; class LLTextSegment diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 9442a5c..a047f99 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -224,11 +224,17 @@ void LLView::setMouseOpaque(BOOL b) mMouseOpaque = b; } -void LLView::setToolTip(const LLString& msg) +void LLView::setToolTip(const LLStringExplicit& msg) { mToolTipMsg = msg; } +BOOL LLView::setToolTipArg(const LLStringExplicit& key, const LLStringExplicit& text) +{ + mToolTipMsg.setArg(key, text); + return TRUE; +} + // virtual void LLView::setRect(const LLRect& rect) { @@ -288,7 +294,7 @@ void LLView::setSpanChildren( BOOL span_children ) const LLString& LLView::getToolTip() { - return mToolTipMsg; + return mToolTipMsg.getString(); } // virtual @@ -884,18 +890,14 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre } } - if (LLUI::sShowXUINames && (mToolTipMsg.find(".xml", 0) == LLString::npos) && + tool_tip = mToolTipMsg.getString(); + if (LLUI::sShowXUINames && (tool_tip.find(".xml", 0) == LLString::npos) && (mName.find("Drag", 0) == LLString::npos)) { tool_tip = getShowNamesToolTip(); } - else - { - tool_tip = mToolTipMsg; - } - BOOL showNamesTextBox = LLUI::sShowXUINames && (getWidgetType() == WIDGET_TYPE_TEXT_BOX); if( !handled && (mMouseOpaque || showNamesTextBox) && pointInView( x, y ) && !tool_tip.empty()) diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index 63c1efc..8248d50 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h @@ -45,6 +45,7 @@ #include "llstring.h" #include "llrect.h" #include "llui.h" +#include "lluistring.h" #include "lluixmltags.h" #include "llviewquery.h" #include "llxmlnode.h" @@ -154,7 +155,7 @@ protected: BOOL mEnabled; // Enabled means "accepts input that has an effect on the state of the application." // A disabled view, for example, may still have a scrollbar that responds to mouse events. BOOL mMouseOpaque; // Opaque views handle all mouse events that are over their rect. - LLString mToolTipMsg; // isNull() is true if none. + LLUIString mToolTipMsg; // isNull() is true if none. U8 mSoundFlags; BOOL mSaveToXML; @@ -214,7 +215,8 @@ public: // MANIPULATORS // void setMouseOpaque( BOOL b ); - void setToolTip( const LLString& msg ); + void setToolTip( const LLStringExplicit& msg ); + BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); virtual void setRect(const LLRect &rect); void setFollows(U32 flags); diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp index b5db6ef..f415fe5 100644 --- a/linden/indra/llvfs/lldir_win32.cpp +++ b/linden/indra/llvfs/lldir_win32.cpp @@ -42,7 +42,6 @@ #include #include #include -#include // Utility stuff to get versions of the sh #define PACKVERSION(major,minor) MAKELONG(minor,major) diff --git a/linden/indra/llwindow/lldxhardware.cpp b/linden/indra/llwindow/lldxhardware.cpp index 1a39e68..2aff052 100644 --- a/linden/indra/llwindow/lldxhardware.cpp +++ b/linden/indra/llwindow/lldxhardware.cpp @@ -411,6 +411,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) } std::string device_name = get_string(device_containerp, L"szDescription"); + std::string device_id = get_string(device_containerp, L"szDeviceID"); LLDXDevice *dxdevicep = new LLDXDevice; @@ -451,6 +452,8 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) } + + // Now, iterate through the related drivers hr = device_containerp->GetChildContainer(L"Drivers", &driver_containerp); if (FAILED(hr) || !driver_containerp) @@ -468,6 +471,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) S32 file_num = 0; for (file_num = 0; file_num < (S32)num_files; file_num++ ) { + hr = driver_containerp->EnumChildContainerNames(file_num, wszContainer, 256); if (FAILED(hr)) { @@ -522,6 +526,104 @@ LCleanup: return ok; } +LLSD LLDXHardware::getDisplayInfo() +{ + LLTimer hw_timer; + HRESULT hr; + LLSD ret; + CoInitialize(NULL); + + IDxDiagProvider *dx_diag_providerp = NULL; + IDxDiagContainer *dx_diag_rootp = NULL; + IDxDiagContainer *devices_containerp = NULL; + IDxDiagContainer *device_containerp = NULL; + IDxDiagContainer *file_containerp = NULL; + IDxDiagContainer *driver_containerp = NULL; + + // CoCreate a IDxDiagProvider* + llinfos << "CoCreateInstance IID_IDxDiagProvider" << llendl; + hr = CoCreateInstance(CLSID_DxDiagProvider, + NULL, + CLSCTX_INPROC_SERVER, + IID_IDxDiagProvider, + (LPVOID*) &dx_diag_providerp); + + if (FAILED(hr)) + { + llwarns << "No DXDiag provider found! DirectX 9 not installed!" << llendl; + gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n"); + goto LCleanup; + } + if (SUCCEEDED(hr)) // if FAILED(hr) then dx9 is not installed + { + // Fill out a DXDIAG_INIT_PARAMS struct and pass it to IDxDiagContainer::Initialize + // Passing in TRUE for bAllowWHQLChecks, allows dxdiag to check if drivers are + // digital signed as logo'd by WHQL which may connect via internet to update + // WHQL certificates. + DXDIAG_INIT_PARAMS dx_diag_init_params; + ZeroMemory(&dx_diag_init_params, sizeof(DXDIAG_INIT_PARAMS)); + + dx_diag_init_params.dwSize = sizeof(DXDIAG_INIT_PARAMS); + dx_diag_init_params.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION; + dx_diag_init_params.bAllowWHQLChecks = TRUE; + dx_diag_init_params.pReserved = NULL; + + llinfos << "dx_diag_providerp->Initialize" << llendl; + hr = dx_diag_providerp->Initialize(&dx_diag_init_params); + if(FAILED(hr)) + { + goto LCleanup; + } + + llinfos << "dx_diag_providerp->GetRootContainer" << llendl; + hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp ); + if(FAILED(hr) || !dx_diag_rootp) + { + goto LCleanup; + } + + HRESULT hr; + + // Get display driver information + llinfos << "dx_diag_rootp->GetChildContainer" << llendl; + hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp); + if(FAILED(hr) || !devices_containerp) + { + goto LCleanup; + } + + // Get device 0 + llinfos << "devices_containerp->GetChildContainer" << llendl; + hr = devices_containerp->GetChildContainer(L"0", &device_containerp); + if(FAILED(hr) || !device_containerp) + { + goto LCleanup; + } + + // Get the English VRAM string + std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish"); + + + // Dump the string as an int into the structure + char *stopstring; + ret["VRAM"] = strtol(ram_str.c_str(), &stopstring, 10); + std::string device_name = get_string(device_containerp, L"szDescription"); + ret["DeviceName"] = device_name; + std::string device_driver= get_string(device_containerp, L"szDriverVersion"); + ret["DriverVersion"] = device_driver; + } +LCleanup: + SAFE_RELEASE(file_containerp); + SAFE_RELEASE(driver_containerp); + SAFE_RELEASE(device_containerp); + SAFE_RELEASE(devices_containerp); + SAFE_RELEASE(dx_diag_rootp); + SAFE_RELEASE(dx_diag_providerp); + + CoUninitialize(); + return ret; +} + void LLDXHardware::setWriteDebugFunc(void (*func)(const char*)) { gWriteDebug = func; diff --git a/linden/indra/llwindow/lldxhardware.h b/linden/indra/llwindow/lldxhardware.h index 1d5d69d..e2a255d 100644 --- a/linden/indra/llwindow/lldxhardware.h +++ b/linden/indra/llwindow/lldxhardware.h @@ -36,6 +36,7 @@ #include "stdtypes.h" #include "llstring.h" +#include "llsd.h" class LLVersion { @@ -93,6 +94,8 @@ public: S32 getVRAM() const { return mVRAM; } + LLSD getDisplayInfo(); + // Find a particular device that matches the following specs. // Empty strings indicate that you don't care. // You can separate multiple devices with '|' chars to indicate you want diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp index 35f20d3..df87591 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llwindow/llgl.cpp @@ -36,6 +36,8 @@ #include "linden_common.h" +#include "boost/tokenizer.hpp" + #include "llsys.h" #include "llgl.h" @@ -459,6 +461,23 @@ bool LLGLManager::initGL() return true; } +void LLGLManager::getGLInfo(LLSD& info) +{ + info["GLInfo"]["GLVendor"] = LLString((const char *)glGetString(GL_VENDOR)); + info["GLInfo"]["GLRenderer"] = LLString((const char *)glGetString(GL_RENDERER)); + info["GLInfo"]["GLVersion"] = LLString((const char *)glGetString(GL_VERSION)); + +#if !LL_MESA_HEADLESS + LLString all_exts = (const char *)gGLHExts.mSysExts; + boost::char_separator sep(" "); + boost::tokenizer > tok(all_exts, sep); + for(boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + { + info["GLInfo"]["GLExtensions"].append(*i); + } +#endif +} + LLString LLGLManager::getGLInfoString() { LLString info_str; diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llwindow/llgl.h index 2a23a23..a8e14b7 100644 --- a/linden/indra/llwindow/llgl.h +++ b/linden/indra/llwindow/llgl.h @@ -48,6 +48,8 @@ #define LL_GL_ERRS llerrs +class LLSD; + // Manage GL extensions... class LLGLManager { @@ -122,6 +124,7 @@ public: void getPixelFormat(); // Get the best pixel format LLString getGLInfoString(); + void getGLInfo(LLSD& info); // In ALL CAPS LLString mGLVendor; diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index c84611b..1fa50de 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -93,6 +93,7 @@ BOOL LLWindowWin32::sWinIMEOpened = FALSE; HKL LLWindowWin32::sWinInputLocale = 0; DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; +LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); // The following class LLWinImm delegates Windows IMM APIs. // We need this because some language versions of Windows, @@ -3381,7 +3382,8 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) LLCoordWindow win_pos; convertCoords( position, &win_pos ); - if ( win_pos.mX >= 0 && win_pos.mY >= 0 ) + if ( win_pos.mX >= 0 && win_pos.mY >= 0 && + (win_pos.mX != sWinIMEWindowPosition.mX) || (win_pos.mY != sWinIMEWindowPosition.mY) ) { COMPOSITIONFORM ime_form; memset( &ime_form, 0, sizeof(ime_form) ); @@ -3390,10 +3392,11 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position ) ime_form.ptCurrentPos.y = win_pos.mY; LLWinImm::setCompositionWindow( himc, &ime_form ); + + sWinIMEWindowPosition.set( win_pos.mX, win_pos.mY ); } LLWinImm::releaseContext(mWindowHandle, himc); - } } diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index f1e977e..602e066 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h @@ -188,6 +188,7 @@ protected: static HKL sWinInputLocale; static DWORD sWinIMEConversionMode; static DWORD sWinIMESentenceMode; + static LLCoordWindow sWinIMEWindowPosition; friend class LLWindowManager; }; diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 69e77fb..57aef07 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/indra/lscript/lscript_compile/indra.l @@ -651,14 +651,6 @@ int yyerror(const char *fmt, ...) return 0; } -#define LL_MKS_YACC 0 -#if LL_WINDOWS && LL_MKS_YACC -int yyinput(void) -{ - return input(); -} -#endif - //#define EMERGENCY_DEBUG_PRINTOUTS //#define EMIT_CIL_ASSEMBLER @@ -685,11 +677,9 @@ BOOL lscript_compile(const char* src_filename, const char* dst_filename, yyout = LLFile::fopen(err_filename, "w"); // Reset the lexer's internal buffering. -#if LL_DARWIN || LL_LINUX || !LL_MKS_YACC - yyrestart(yyin); -#else - yy_reset(); -#endif + + yyrestart(yyin); + b_parse_ok = !yyparse(); if (b_parse_ok) diff --git a/linden/indra/lscript/lscript_compile/lscript_compile.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile.vcproj index fd03fa0..59822f2 100644 --- a/linden/indra/lscript/lscript_compile/lscript_compile.vcproj +++ b/linden/indra/lscript/lscript_compile/lscript_compile.vcproj @@ -30,7 +30,8 @@ WarningLevel="3" WarnAsError="FALSE" Detect64BitPortabilityProblems="FALSE" - DebugInformationFormat="4"/> + DebugInformationFormat="4" + DisableSpecificWarnings="4065"/> + DebugInformationFormat="3" + DisableSpecificWarnings="4065"/> + DebugInformationFormat="3" + DisableSpecificWarnings="4065"/>
@@ -86,7 +85,7 @@ @@ -95,7 +94,8 @@ diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj index c61e6ec..1b2e3b7 100644 --- a/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj +++ b/linden/indra/lscript/lscript_compile/lscript_compile_fb_vc8.vcproj @@ -1,106 +1,131 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linden/indra/mac_crash_logger/llcrashloggermac.cpp b/linden/indra/mac_crash_logger/llcrashloggermac.cpp new file mode 100644 index 0000000..3d8abe5 --- /dev/null +++ b/linden/indra/mac_crash_logger/llcrashloggermac.cpp @@ -0,0 +1,342 @@ +/** + * @file llcrashloggermac.cpp + * @brief Mac OSX crash logger implementation + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llcrashloggermac.h" + +#include +#include +#include + +#include "boost/tokenizer.hpp" + +#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME +#include "llerror.h" +#include "llfile.h" +#include "lltimer.h" +#include "llstring.h" +#include "lldir.h" +#include "llsdserialize.h" + +#define MAX_LOADSTRING 100 +const char* const SETTINGS_FILE_HEADER = "version"; +const S32 SETTINGS_FILE_VERSION = 101; + +// Windows Message Handlers + +BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog? +FILE *gDebugFile = NULL; + +WindowRef gWindow = NULL; +EventHandlerRef gEventHandler = NULL; +LLString gUserNotes = ""; +bool gSendReport = false; +bool gRememberChoice = false; +IBNibRef nib = NULL; + +OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) +{ + OSStatus result = eventNotHandledErr; + OSStatus err; + UInt32 evtClass = GetEventClass(event); + UInt32 evtKind = GetEventKind(event); + if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) + { + HICommand cmd; + err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); + + + + if(err == noErr) + { + //Get the value of the checkbox + ControlID id; + ControlRef checkBox = NULL; + id.signature = 'remb'; + id.id = 0; + err = GetControlByID(gWindow, &id, &checkBox); + + if(err == noErr) + { + if(GetControl32BitValue(checkBox) == kControlCheckBoxCheckedValue) + { + gRememberChoice = true; + } + else + { + gRememberChoice = false; + } + } + switch(cmd.commandID) + { + case kHICommandOK: + { + char buffer[65535]; /* Flawfinder: ignore */ + Size size = sizeof(buffer) - 1; + ControlRef textField = NULL; + + id.signature = 'text'; + id.id = 0; + + err = GetControlByID(gWindow, &id, &textField); + if(err == noErr) + { + // Get the user response text + err = GetControlData(textField, kControlNoPart, kControlEditTextTextTag, size, (Ptr)buffer, &size); + } + if(err == noErr) + { + // Make sure the string is terminated. + buffer[size] = 0; + gUserNotes = buffer; + + llinfos << buffer << llendl; + } + + // Send the report. + + QuitAppModalLoopForWindow(gWindow); + gSendReport = true; + result = noErr; + } + break; + + case kHICommandCancel: + QuitAppModalLoopForWindow(gWindow); + result = noErr; + break; + } + } + } + + return(result); +} + + +LLCrashLoggerMac::LLCrashLoggerMac(void) +{ +} + +LLCrashLoggerMac::~LLCrashLoggerMac(void) +{ +} + +bool LLCrashLoggerMac::init(void) +{ + bool ok = LLCrashLogger::init(); + if(!ok) return false; + if(mCrashBehavior != CRASH_BEHAVIOR_ASK) return true; + + // Real UI... + OSStatus err; + + err = CreateNibReference(CFSTR("CrashReporter"), &nib); + + if(err == noErr) + { + err = CreateWindowFromNib(nib, CFSTR("CrashReporter"), &gWindow); + } + + if(err == noErr) + { + // Set focus to the edit text area + ControlRef textField = NULL; + ControlID id; + + id.signature = 'text'; + id.id = 0; + + // Don't set err if any of this fails, since it's non-critical. + if(GetControlByID(gWindow, &id, &textField) == noErr) + { + SetKeyboardFocus(gWindow, textField, kControlFocusNextPart); + } + } + + if(err == noErr) + { + ShowWindow(gWindow); + } + + if(err == noErr) + { + // Set up an event handler for the window. + EventTypeSpec handlerEvents[] = + { + { kEventClassCommand, kEventCommandProcess } + }; + + InstallWindowEventHandler( + gWindow, + NewEventHandlerUPP(dialogHandler), + GetEventTypeCount (handlerEvents), + handlerEvents, + 0, + &gEventHandler); + } + return true; +} + +void LLCrashLoggerMac::gatherPlatformSpecificFiles() +{ + updateApplication("Gathering hardware information..."); + char path[MAX_PATH]; + FSRef folder; + + if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) + { + // folder is an FSRef to ~/Library/Logs/ + if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) + { + struct stat dw_stat; + LLString mBuf; + bool isLeopard = false; + // Try the 10.3 path first... + LLString dw_file_name = LLString(path) + LLString("/CrashReporter/Second Life.crash.log"); + int res = stat(dw_file_name.c_str(), &dw_stat); + + if (res) + { + // Try the 10.2 one next... + dw_file_name = LLString(path) + LLString("/Second Life.crash.log"); + res = stat(dw_file_name.c_str(), &dw_stat); + } + + if(res) + { + //10.5: Like 10.3+, except it puts the crash time in the file instead of dividing it up + //using asterisks. Get a directory listing, search for files starting with second life, + //use the last one found. + LLString old_file_name, current_file_name, pathname, mask; + pathname = LLString(path) + LLString("/CrashReporter/"); + mask = "Second Life*"; + while(gDirUtilp->getNextFileInDir(pathname, mask, current_file_name, false)) + { + old_file_name = current_file_name; + } + if(old_file_name != "") + { + dw_file_name = pathname + old_file_name; + res=stat(dw_file_name.c_str(), &dw_stat); + isLeopard = true; + } + } + + if (!res) + { + std::ifstream fp(dw_file_name.c_str()); + std::stringstream str; + if(!fp.is_open()) return; + str << fp.rdbuf(); + mBuf = str.str(); + + if(!isLeopard) + { + // Crash logs consist of a number of entries, one per crash. + // Each entry is preceeded by "**********" on a line by itself. + // We want only the most recent (i.e. last) one. + const char *sep = "**********"; + const char *start = mBuf.c_str(); + const char *cur = start; + const char *temp = strstr(cur, sep); + + while(temp != NULL) + { + // Skip past the marker we just found + cur = temp + strlen(sep); /* Flawfinder: ignore */ + + // and try to find another + temp = strstr(cur, sep); + } + + // If there's more than one entry in the log file, strip all but the last one. + if(cur != start) + { + mBuf.erase(0, cur - start); + } + } + mCrashInfo["CrashLog"] = mBuf; + } + else + { + llwarns << "Couldn't find any CrashReporter files..." << llendl; + } + } + } +} + +bool LLCrashLoggerMac::mainLoop() +{ + OSStatus err = noErr; + + if(err == noErr && mCrashBehavior == CRASH_BEHAVIOR_ASK) + { + RunAppModalLoopForWindow(gWindow); + } + else if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND) + { + gSendReport = true; + } + + if(gRememberChoice) + { + if(gSendReport) saveCrashBehaviorSetting(CRASH_BEHAVIOR_ALWAYS_SEND); + else saveCrashBehaviorSetting(CRASH_BEHAVIOR_NEVER_SEND); + } + + if(gSendReport) + { + setUserText(gUserNotes); + sendCrashLogs(); + } + + if(gWindow != NULL) + { + DisposeWindow(gWindow); + } + + if(nib != NULL) + { + DisposeNibReference(nib); + } + + return true; +} + +void LLCrashLoggerMac::updateApplication(LLString message) +{ + LLCrashLogger::updateApplication(); +} + +bool LLCrashLoggerMac::cleanup() +{ + return true; +} diff --git a/linden/indra/mac_crash_logger/llcrashloggermac.h b/linden/indra/mac_crash_logger/llcrashloggermac.h new file mode 100644 index 0000000..cf4e766 --- /dev/null +++ b/linden/indra/mac_crash_logger/llcrashloggermac.h @@ -0,0 +1,51 @@ +/** + * @file llcrashloggermac.h + * @brief Mac OSX crash logger definition + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLCRASHLOGGERMAC_H +#define LLCRASHLOGGERMAC_H + +#include "linden_common.h" +#include "llcrashlogger.h" +#include "llstring.h" + +class LLCrashLoggerMac : public LLCrashLogger +{ +public: + LLCrashLoggerMac(void); + ~LLCrashLoggerMac(void); + virtual bool init(); + virtual bool mainLoop(); + virtual void updateApplication(LLString message = ""); + virtual bool cleanup(); + virtual void gatherPlatformSpecificFiles(); +}; + +#endif diff --git a/linden/indra/mac_crash_logger/mac_crash_logger.cpp b/linden/indra/mac_crash_logger/mac_crash_logger.cpp index 2501b4a..bf3151a 100644 --- a/linden/indra/mac_crash_logger/mac_crash_logger.cpp +++ b/linden/indra/mac_crash_logger/mac_crash_logger.cpp @@ -31,675 +31,21 @@ #include "linden_common.h" -#include -#include -#include - -#include - -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" - -#include "llstring.h" - -class LLFileEncoder -{ -public: - LLFileEncoder(const char *formname, const char *filename, bool isCrashLog = false); - - BOOL isValid() const { return mIsValid; } - LLString encodeURL(const S32 max_length = 0); -public: - BOOL mIsValid; - LLString mFilename; - LLString mFormname; - LLString mBuf; -}; - -LLString encode_string(const char *formname, const LLString &str); - -#include - -LLString gServerResponse; -BOOL gSendReport = FALSE; -LLString gUserserver; -LLString gUserText; -WindowRef gWindow = NULL; -EventHandlerRef gEventHandler = NULL; -BOOL gCrashInPreviousExec = FALSE; -time_t gLaunchTime; - -size_t curl_download_callback(void *data, size_t size, size_t nmemb, - void *user_data) -{ - S32 bytes = size * nmemb; - char *cdata = (char *) data; - for (int i =0; i < bytes; i += 1) - { - gServerResponse += (cdata[i]); - } - return bytes; -} - -OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandOK: - { - char buffer[65535]; /* Flawfinder: ignore */ - Size size = sizeof(buffer) - 1; - ControlRef textField = NULL; - ControlID id; - - id.signature = 'text'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &textField); - if(err == noErr) - { - // Get the user response text - err = GetControlData(textField, kControlNoPart, kControlEditTextTextTag, size, (Ptr)buffer, &size); - } - if(err == noErr) - { - // Make sure the string is terminated. - buffer[size] = 0; - gUserText = buffer; - llinfos << buffer << llendl; - } - - // Send the report. - gSendReport = TRUE; - - QuitAppModalLoopForWindow(gWindow); - result = noErr; - } - break; - - case kHICommandCancel: - QuitAppModalLoopForWindow(gWindow); - result = noErr; - break; - } - } - } - - return(result); -} +#include "llcrashloggermac.h" int main(int argc, char **argv) { - const S32 DW_MAX_SIZE = 100000; // Maximum size to transmit of the Dr. Watson log file - const S32 SL_MAX_SIZE = 100000; // Maximum size of the Second Life log file. - int i; - - time(&gLaunchTime); + //time(&gLaunchTime); llinfos << "Starting Second Life Viewer Crash Reporter" << llendl; - - for(i=1; iinitAppDirs("SecondLife"); - - int res; - - // Lots of silly variable, replicated for each log file. - LLString db_file_name; - LLString sl_file_name; - LLString dw_file_name; // DW file name is a hack for now... - LLString st_file_name; // stats.log file - LLString si_file_name; // settings.ini file - - LLFileEncoder *db_filep = NULL; - LLFileEncoder *sl_filep = NULL; - LLFileEncoder *st_filep = NULL; - LLFileEncoder *dw_filep = NULL; - LLFileEncoder *si_filep = NULL; - - /////////////////////////////////// - // - // We do the parsing for the debug_info file first, as that will - // give us the location of the SecondLife.log file. - // - - // Figure out the filename of the debug log - db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log").c_str(); - db_filep = new LLFileEncoder("DB", db_file_name.c_str()); - - // Get the filename of the SecondLife.log file - - // *NOTE: changing the size of either of these buffers will - // require changing the sscanf() format string to correctly - // account for it. - char tmp_sl_name[LL_MAX_PATH]; /* Flawfinder: ignore */ - tmp_sl_name[0] = '\0'; - char tmp_space[MAX_STRING]; /* Flawfinder: ignore */ - tmp_space[0] = '\0'; - - // Look for it in the debug_info.log file - if (db_filep->isValid()) - { - // This was originally scanning for "SL Log: %[^\r\n]", which happily skipped to the next line - // on debug logs (which don't have anything after "SL Log:" and tried to open a nonsensical filename. - sscanf( - db_filep->mBuf.c_str(), - "SL Log:%254[ ]%1023[^\r\n]", - tmp_space, - tmp_sl_name); - } - else - { - delete db_filep; - db_filep = NULL; - } - - // If we actually have a legitimate file name, use it. - if (tmp_sl_name[0]) - { - sl_file_name = tmp_sl_name; - llinfos << "Using log file from debug log " << sl_file_name << llendl; - } - else - { - // Figure out the filename of the second life log - sl_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log").c_str(); - } - - // Now we get the SecondLife.log file if it's there, and recent enough... - sl_filep = new LLFileEncoder("SL", sl_file_name.c_str()); - if (!sl_filep->isValid()) - { - delete sl_filep; - sl_filep = NULL; - } - - st_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log").c_str(); - st_filep = new LLFileEncoder("ST", st_file_name.c_str()); - if (!st_filep->isValid()) - { - delete st_filep; - st_filep = NULL; - } - - si_file_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.ini").c_str(); - si_filep = new LLFileEncoder("SI", si_file_name.c_str()); - if (!si_filep->isValid()) - { - delete si_filep; - si_filep = NULL; - } - - // MBW -- This needs to go find "~/Library/Logs/CrashReporter/Second Life.crash.log" on 10.3 - // or "~/Library/Logs/Second Life.crash.log" on 10.2. - { - char path[MAX_PATH]; /* Flawfinder: ignore */ - FSRef folder; - - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - struct stat dw_stat; -// printf("path is %s\n", path); - - // Try the 10.3 path first... - dw_file_name = LLString(path) + LLString("/CrashReporter/Second Life.crash.log"); - res = stat(dw_file_name.c_str(), &dw_stat); - - if (res) - { - // Try the 10.2 one next... - dw_file_name = LLString(path) + LLString("/Second Life.crash.log"); - res = stat(dw_file_name.c_str(), &dw_stat); - } - - if (!res) - { - dw_filep = new LLFileEncoder("DW", dw_file_name.c_str(), true); - if (!dw_filep->isValid()) - { - delete dw_filep; - dw_filep = NULL; - } - } - else - { - llwarns << "Couldn't find any CrashReporter files..." << llendl; - } - } - } - } - - LLString post_data; - LLString tmp_url_buf; - - // Append the userserver - tmp_url_buf = encode_string("USER", gUserserver); - post_data += tmp_url_buf; - llinfos << "PostData:" << post_data << llendl; - - if (gCrashInPreviousExec) - { - post_data.append("&"); - tmp_url_buf = encode_string("EF", "Y"); - post_data += tmp_url_buf; - } - - if (db_filep) - { - post_data.append("&"); - tmp_url_buf = db_filep->encodeURL(); - post_data += tmp_url_buf; - llinfos << "Sending DB log file" << llendl; - } - else - { - llinfos << "Not sending DB log file" << llendl; - } - - if (sl_filep) - { - post_data.append("&"); - tmp_url_buf = sl_filep->encodeURL(SL_MAX_SIZE); - post_data += tmp_url_buf; - llinfos << "Sending SL log file" << llendl; - } - else - { - llinfos << "Not sending SL log file" << llendl; - } - - if (st_filep) - { - post_data.append("&"); - tmp_url_buf = st_filep->encodeURL(SL_MAX_SIZE); - post_data += tmp_url_buf; - llinfos << "Sending stats log file" << llendl; - } - else - { - llinfos << "Not sending stats log file" << llendl; - } - if (dw_filep) + LLCrashLoggerMac app; + app.parseCommandOptions(argc, argv); + if(!app.init()) { - post_data.append("&"); - tmp_url_buf = dw_filep->encodeURL(DW_MAX_SIZE); - post_data += tmp_url_buf; + return 0; } - else - { - llinfos << "Not sending crash log file" << llendl; - } - - if (si_filep) - { - post_data.append("&"); - tmp_url_buf = si_filep->encodeURL(); - post_data += tmp_url_buf; - llinfos << "Sending settings log file" << llendl; - } - else - { - llinfos << "Not sending settings.ini file" << llendl; - } - - if (gUserText.size()) - { - post_data.append("&"); - tmp_url_buf = encode_string("UN", gUserText); - post_data += tmp_url_buf; - } - - delete db_filep; - db_filep = NULL; - delete sl_filep; - sl_filep = NULL; - delete dw_filep; - dw_filep = NULL; - - // Debugging spam -#if 0 - printf("Crash report post data:\n--------\n"); - printf("%s", post_data.getString()); - printf("\n--------\n"); -#endif - - // Send the report. Yes, it's this easy. - { - CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); - curl_easy_setopt(curl, CURLOPT_POST, 1); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data.c_str()); - curl_easy_setopt(curl, CURLOPT_URL, "http://secondlife.com/cgi-bin/viewer_crash_reporter2"); - - llinfos << "Connecting to crash report server" << llendl; - CURLcode result = curl_easy_perform(curl); - - curl_easy_cleanup(curl); + app.mainLoop(); - if(result != CURLE_OK) - { - llinfos << "Couldn't talk to crash report server" << llendl; - } - else - { - llinfos << "Response from crash report server:" << llendl; - llinfos << gServerResponse << llendl; - } - } - return 0; } - -LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool isCrashLog) -{ - mFormname = form_name; - mFilename = filename; - mIsValid = FALSE; - - int res; - - struct stat stat_data; - res = stat(mFilename.c_str(), &stat_data); - if (res) - { - llwarns << "File " << mFilename << " is missing!" << llendl; - return; - } - else - { - // Debugging spam -// llinfos << "File " << mFilename << " is present..." << llendl; - - if(!gCrashInPreviousExec && isCrashLog) - { - // Make sure the file isn't too old. - double age = difftime(gLaunchTime, stat_data.st_mtimespec.tv_sec); - -// llinfos << "age is " << age << llendl; - - if(age > 60.0) - { - // The file was last modified more than 60 seconds before the crash reporter was launched. Assume it's stale. - llwarns << "File " << mFilename << " is too old!" << llendl; - return; - } - } - - } - - S32 buf_size = stat_data.st_size; - FILE* fp = fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */ - U8 *buf = new U8[buf_size + 1]; - fread(buf, 1, buf_size, fp); - fclose(fp); - buf[buf_size] = 0; - - mBuf = (char *)buf; - - if(isCrashLog) - { - // Crash logs consist of a number of entries, one per crash. - // Each entry is preceeded by "**********" on a line by itself. - // We want only the most recent (i.e. last) one. - const char *sep = "**********"; - const char *start = mBuf.c_str(); - const char *cur = start; - const char *temp = strstr(cur, sep); - - while(temp != NULL) - { - // Skip past the marker we just found - cur = temp + strlen(sep); /* Flawfinder: ignore */ - - // and try to find another - temp = strstr(cur, sep); - } - - // If there's more than one entry in the log file, strip all but the last one. - if(cur != start) - { - mBuf.erase(0, cur - start); - } - } - - mIsValid = TRUE; - delete[] buf; -} - -LLString LLFileEncoder::encodeURL(const S32 max_length) -{ - LLString result = mFormname; - result.append("="); - - S32 i = 0; - - if (max_length) - { - if (mBuf.size() > max_length) - { - i = mBuf.size() - max_length; - } - } - -#if 0 - // Plain text version for debugging - result.append(mBuf); -#else - // Not using LLString because of bad performance issues - S32 buf_size = mBuf.size(); - S32 url_buf_size = 3*mBuf.size() + 1; - char *url_buf = new char[url_buf_size]; - if (url_buf == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return result; - } - S32 cur_pos = 0; - for (; i < buf_size; i++) - { - sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); /* Flawfinder: ignore */ - cur_pos += 3; - } - url_buf[i*3] = 0; - - result.append(url_buf); - delete[] url_buf; -#endif - return result; -} - -LLString encode_string(const char *formname, const LLString &str) -{ - LLString result = formname; - result.append("="); - // Not using LLString because of bad performance issues - S32 buf_size = str.size(); - S32 url_buf_size = 3*str.size() + 1; - char *url_buf = new char[url_buf_size]; - if (url_buf == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return result; - } - - S32 cur_pos = 0; - S32 i; - for (i = 0; i < buf_size; i++) - { - sprintf(url_buf + cur_pos, "%%%02x", str[i]); /* Flawfinder: ignore */ - cur_pos += 3; - } - url_buf[i*3] = 0; - - result.append(url_buf); - delete[] url_buf; - return result; -} diff --git a/linden/indra/mac_updater/AutoUpdater.nib/classes.nib b/linden/indra/mac_updater/AutoUpdater.nib/classes.nib new file mode 100644 index 0000000..ea58db1 --- /dev/null +++ b/linden/indra/mac_updater/AutoUpdater.nib/classes.nib @@ -0,0 +1,4 @@ +{ +IBClasses = (); +IBVersion = 1; +} diff --git a/linden/indra/mac_updater/AutoUpdater.nib/info.nib b/linden/indra/mac_updater/AutoUpdater.nib/info.nib new file mode 100644 index 0000000..a49a923 --- /dev/null +++ b/linden/indra/mac_updater/AutoUpdater.nib/info.nib @@ -0,0 +1,14 @@ + + + + + IBDocumentLocation + 103 138 356 240 0 0 1280 1002 + IBFramework Version + 362.0 + IBSystem Version + 7D24 + targetFramework + IBCarbonFramework + + diff --git a/linden/indra/mac_updater/AutoUpdater.nib/objects.xib b/linden/indra/mac_updater/AutoUpdater.nib/objects.xib new file mode 100644 index 0000000..310411b --- /dev/null +++ b/linden/indra/mac_updater/AutoUpdater.nib/objects.xib @@ -0,0 +1,56 @@ + + + IBCarbonFramework + + NSApplication + + + + 405 222 533 663 + Second Life Updater + + 0 0 128 441 + + + 20 20 44 421 + what + Initializing… + + + 88 351 108 421 + Cancel + not! + 2 + + + 51 19 70 422 + prog + 50 + + + + FALSE + 2 + 3 + 7 + + + + + + + + + + + + + + + File's Owner + + Updater + + + 194 + diff --git a/linden/indra/newview/CrashReporter.nib/info.nib b/linden/indra/newview/CrashReporter.nib/info.nib index 62e9cee..8eba931 100644 --- a/linden/indra/newview/CrashReporter.nib/info.nib +++ b/linden/indra/newview/CrashReporter.nib/info.nib @@ -3,11 +3,15 @@ IBDocumentLocation - 508 20 476 367 0 0 1680 1028 + 791 275 476 367 0 0 1600 1178 IBFramework Version 446.1 + IBOpenObjects + + 166 + IBSystem Version - 8L2127 + 8R2218 targetFramework IBCarbonFramework diff --git a/linden/indra/newview/CrashReporter.nib/objects.xib b/linden/indra/newview/CrashReporter.nib/objects.xib index 7ff2838..f62b8d5 100644 --- a/linden/indra/newview/CrashReporter.nib/objects.xib +++ b/linden/indra/newview/CrashReporter.nib/objects.xib @@ -4,33 +4,38 @@ NSApplication - + - 123 251 577 758 + 257 653 711 1160 Second Life Crash Logger 0 0 454 507 - + - 20 20 177 487 - Second Life appears to have crashed. This crash reporter collects information about your computer's hardware configuration, operating system, and some Second Life logs. In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help! If you don't wish to send Linden Lab a crash report, press Cancel. + 20 20 231 487 + Second Life appears to have crashed or frozen the last time it ran. This crash reporter collects information about your computer's hardware configuration, operating system, and some Second Life logs, all of which are used for debugging purposes only. In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help! This report is NOT read by Customer Support. If you have billing or other questions, please go to: http://www.secondlife.com/support/ If you don't wish to send Linden Lab a crash report, press Cancel. - 414 417 434 487 - OK + 414 273 434 378 + Send Report ok - 414 335 434 405 - Cancel + 414 390 434 487 + Don't Send not! 2 - 188 23 391 484 + 242 23 391 484 text TRUE + + 415 20 433 186 + Remember This Choice + remb + 2 @@ -42,65 +47,22 @@ - - 414 335 434 405 - Cancel - not! - 2 - - - 414 417 434 487 - OK - ok - - - 188 23 391 484 - text - TRUE - - - 104 65 558 572 - Second Life Crash Logger - - 0 0 454 507 - - - 20 20 177 487 - Second Life appears to have crashed or frozen the last time it ran. This crash reporter collects information about your computer's hardware configuration, operating system, and some Second Life logs. In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help! If you don't wish to send Linden Lab a crash report, press Cancel. - - - - - - - 2 - 3 - 7 - - - + - + - - - - - - + - + CrashReporter - CrashReporterDelayed - File's Owner - 193 + 194 diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings index da89514..85f7e25 100644 --- a/linden/indra/newview/English.lproj/InfoPlist.strings +++ b/linden/indra/newview/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 1.18.5.3"; -CFBundleGetInfoString = "Second Life version 1.18.5.3, Copyright 2004-2007 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 1.18.6.0"; +CFBundleGetInfoString = "Second Life version 1.18.6.0, Copyright 2004-2007 Linden Research, Inc."; diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist index 427651c..59822a1 100644 --- a/linden/indra/newview/Info-SecondLife.plist +++ b/linden/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ CFBundleVersion - 1.18.5.3 + 1.18.6.0 CSResourcesFileMapped diff --git a/linden/indra/newview/files.lst b/linden/indra/newview/files.lst index fe864a3..a13abb7 100644 --- a/linden/indra/newview/files.lst +++ b/linden/indra/newview/files.lst @@ -3,6 +3,8 @@ newview/llagent.cpp newview/llagentdata.cpp newview/llagentpilot.cpp newview/llanimalcontrols.cpp +newview/llappviewer.cpp +newview/llappviewerlinux.cpp newview/llassetuploadresponders.cpp newview/llaudiosourcevo.cpp newview/llbbox.cpp @@ -269,9 +271,11 @@ newview/llurldispatcher.cpp newview/llurlsimstring.cpp newview/llurlwhitelist.cpp newview/lluserauth.cpp +newview/llvectorperfoptions.cpp newview/llvelocitybar.cpp newview/llviewchildren.cpp newview/llviewerassetstorage.cpp +newview/llvieweraudio.cpp newview/llviewercamera.cpp newview/llviewercontrol.cpp newview/llviewerdisplay.cpp @@ -341,7 +345,6 @@ newview/llxmlrpctransaction.cpp newview/moviemaker.cpp newview/noise.cpp newview/pipeline.cpp -newview/viewer.cpp newview/llremoteparcelrequest.cpp newview/llfloaterurldisplay.cpp newview/llfloaterevent.cpp diff --git a/linden/indra/newview/linux_tools/handle_secondlifeprotocol.sh b/linden/indra/newview/linux_tools/handle_secondlifeprotocol.sh new file mode 100755 index 0000000..7ff86d1 --- /dev/null +++ b/linden/indra/newview/linux_tools/handle_secondlifeprotocol.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Send a URL of the form secondlife://... to Second Life. +# + +URL="$1" + +if [ -z "$URL" ]; then + echo Usage: $0 secondlife://... + exit +fi + +RUN_PATH=`dirname "$0" || echo .` +cd "${RUN_PATH}" + +exec ./secondlife -url \'"${URL}"\' + diff --git a/linden/indra/newview/linux_tools/register_secondlifeprotocol.sh b/linden/indra/newview/linux_tools/register_secondlifeprotocol.sh new file mode 100755 index 0000000..4ab96f9 --- /dev/null +++ b/linden/indra/newview/linux_tools/register_secondlifeprotocol.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Register a protocol handler (default: handle_secondlifeprotocol.sh) for +# URLs of the form secondlife://... +# + +HANDLER="$1" + +RUN_PATH=`dirname "$0" || echo .` +cd "${RUN_PATH}" + +if [ -z "$HANDLER" ]; then + HANDLER=`pwd`/handle_secondlifeprotocol.sh +fi + +# Register handler for GNOME-aware apps +LLGCONFTOOL2=gconftool-2 +if which ${LLGCONFTOOL2} >/dev/null; then + (${LLGCONFTOOL2} -s -t string /desktop/gnome/url-handlers/secondlife/command "${HANDLER} \"%s\"" && ${LLGCONFTOOL2} -s -t bool /desktop/gnome/url-handlers/secondlife/enabled true) || echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} failed. +else + echo Warning: Did not register secondlife:// handler with GNOME: ${LLGCONFTOOL2} not found. +fi + +# Register handler for KDE-aware apps +if [ -z "$KDEHOME" ]; then + KDEHOME=~/.kde +fi +LLKDEPROTDIR=${KDEHOME}/share/services +if [ -d "$LLKDEPROTDIR" ]; then + LLKDEPROTFILE=${LLKDEPROTDIR}/secondlife.protocol + cat > ${LLKDEPROTFILE} <clearSavedTool(); + } +} + + void LLAgent::ageChat() { if (mAvatarObject) @@ -2545,8 +2564,8 @@ void LLAgent::updateLookAt(const S32 mouse_x, const S32 mouse_y) LLVector3 headLookAxis; LLCoordFrame frameCamera = *((LLCoordFrame*)gCamera); - F32 x_from_center = mouse_x_from_center( mouse_x ); // range from -0.5 to 0.5 - F32 y_from_center = mouse_y_from_center( mouse_y ); // range from -0.5 to 0.5 + F32 x_from_center = ((F32) mouse_x / (F32) gViewerWindow->getWindowWidth() ) - 0.5f; + F32 y_from_center = ((F32) mouse_y / (F32) gViewerWindow->getWindowHeight() ) - 0.5f; if (cameraMouselook()) { @@ -2811,7 +2830,7 @@ void LLAgent::endAnimationUpdateUI() // HACK: If we're quitting, and we were in customize avatar, don't // let the mini-map go visible again. JC - if (!gQuitRequested) + if (!LLAppViewer::instance()->quitRequested()) { gFloaterMap->popVisible(); } @@ -5836,7 +5855,7 @@ void LLAgent::requestEnterGodMode() msg->addBOOLFast(_PREHASH_Godlike, TRUE); msg->addUUIDFast(_PREHASH_Token, LLUUID::null); - // simulator and userserver need to know about your request + // simulators need to know about your request sendReliableMessage(); } @@ -5851,7 +5870,7 @@ void LLAgent::requestLeaveGodMode() msg->addBOOLFast(_PREHASH_Godlike, FALSE); msg->addUUIDFast(_PREHASH_Token, LLUUID::null); - // simulator and userserver need to know about your request + // simulator needs to know about your request sendReliableMessage(); } diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index ad0606a..c6de97f 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h @@ -141,6 +141,8 @@ public: // default position behind the avatar. void unlockView(); + void onAppFocusGained(); + void sendMessage(); // Send message to this agent's region. void sendReliableMessage(); diff --git a/linden/indra/newview/llagentpilot.cpp b/linden/indra/newview/llagentpilot.cpp index 9637c54..f0bd452 100644 --- a/linden/indra/newview/llagentpilot.cpp +++ b/linden/indra/newview/llagentpilot.cpp @@ -38,7 +38,7 @@ #include "llagentpilot.h" #include "llagent.h" #include "llframestats.h" -#include "viewer.h" +#include "llappviewer.h" #include "llviewercontrol.h" LLAgentPilot gAgentPilot; @@ -221,7 +221,7 @@ void LLAgentPilot::updateTarget() else if (mQuitAfterRuns) { llinfos << "Done with all runs, quitting viewer!" << llendl; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); } else { diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp new file mode 100644 index 0000000..45eaaa9 --- /dev/null +++ b/linden/indra/newview/llappviewer.cpp @@ -0,0 +1,3894 @@ +/** + * @file llappviewer.cpp + * @brief The LLAppViewer class definitions + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" +#include "llappviewer.h" + +#include "llversionviewer.h" +#include "llfeaturemanager.h" +#include "llvieweruictrlfactory.h" +#include "llalertdialog.h" +#include "llerrorcontrol.h" +#include "llviewerimagelist.h" +#include "llgroupmgr.h" +#include "llagent.h" +#include "llwindow.h" +#include "llviewerstats.h" +#include "llmd5.h" +#include "llpumpio.h" +#include "llfloateractivespeakers.h" +#include "llimpanel.h" +#include "llstartup.h" +#include "llfocusmgr.h" +#include "llviewerjoystick.h" +#include "llcurl.h" +#include "llfloatersnapshot.h" +#include "llviewerwindow.h" +#include "llviewerdisplay.h" +#include "llviewermessage.h" +#include "llviewerobjectlist.h" +#include "llworldmap.h" +#include "llmutelist.h" +#include "llurldispatcher.h" + +#include "llweb.h" +#include "llsecondlifeurls.h" + +#if LL_WINDOWS + #include "llwindebug.h" +#endif + +#if LL_WINDOWS +# include // For _SH_DENYWR in initMarkerFile +#else +# include // For initMarkerFile support +#endif + + + +#include "llnotify.h" +#include "llmediaengine.h" +#include "llviewerkeyboard.h" +#include "lllfsthread.h" +#include "llworkerthread.h" +#include "lltexturecache.h" +#include "lltexturefetch.h" +#include "llimageworker.h" + +// The files below handle dependencies from cleanup. +#include "llkeyframemotion.h" +#include "llworldmap.h" +#include "llhudmanager.h" +#include "lltoolmgr.h" +#include "llassetstorage.h" +#include "llpolymesh.h" +#include "lleconomy.h" +#include "llcachename.h" +#include "audioengine.h" +#include "llviewermenu.h" +#include "llselectmgr.h" +#include "lltracker.h" +#include "llmozlib.h" +#include "llviewerparcelmgr.h" +#include "llworldmapview.h" + +#include "lldebugview.h" +#include "llconsole.h" +#include "llcontainerview.h" +#include "llhoverview.h" + +#include "llsdserialize.h" + +#include "llworld.h" +#include "llhudeffecttrail.h" +#include "llvectorperfoptions.h" +#include "llurlsimstring.h" + +// Included so that constants/settings might be initialized +// in save_settings_to_globals() +#include "llbutton.h" +#include "llcombobox.h" +#include "llstatusbar.h" +#include "llsurface.h" +#include "llvosky.h" +#include "llvotree.h" +#include "llvoavatar.h" +#include "llfolderview.h" +#include "lltoolbar.h" +#include "llframestats.h" +#include "llagentpilot.h" +#include "llsrv.h" + +// includes for idle() idleShutdown() +#include "llviewercontrol.h" +#include "lleventnotifier.h" +#include "llcallbacklist.h" +#include "pipeline.h" +#include "llgesturemgr.h" +#include "llsky.h" +#include "llvlmanager.h" +#include "llviewercamera.h" +#include "lldrawpoolbump.h" +#include "llvieweraudio.h" +#include "llimview.h" +#include "llviewerthrottle.h" +// + +#include "llinventoryview.h" + +// *FIX: Remove these once the command line params thing is figured out. +// Yuck! +static int gTempArgC = 0; +static char** gTempArgV; + +// *FIX: These extern globals should be cleaned up. +// The globals either represent state/config/resource-storage of either +// this app, or another 'component' of the viewer. App globals should be +// moved into the app class, where as the other globals should be +// moved out of here. +// If a global symbol reference seems valid, it will be included +// via header files above. + +//---------------------------------------------------------------------------- +// llviewernetwork.h +#include "llviewernetwork.h" +// extern EGridInfo gGridChoice; + + +////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor +// +#if LL_WINDOWS && LL_LCD_COMPILE + #include "lllcd.h" +#endif +// +#if LL_QUICKTIME_ENABLED + #if LL_DARWIN + #include + #else + // quicktime specific includes + #include "MacTypes.h" + #include "QTML.h" + #include "Movies.h" + #include "FixMath.h" + #endif +#endif +// +////// + + +//---------------------------------------------------------------------------- +// viewer.cpp - these are only used in viewer, should be easily moved. +extern void disable_win_error_reporting(); + +//#define APPLE_PREVIEW // Define this if you're doing a preview build on the Mac +#if LL_RELEASE_FOR_DOWNLOAD +// Default userserver for production builds is agni +#ifndef APPLE_PREVIEW +static EGridInfo GridDefaultChoice = GRID_INFO_AGNI; +#else +static EGridInfo GridDefaultChoice = GRID_INFO_ADITI; +#endif +#else +// Default userserver for development builds is dmz +static EGridInfo GridDefaultChoice = GRID_INFO_DMZ; +#endif + +#if LL_WINDOWS +extern void create_console(); +#endif + + +#if LL_DARWIN +#include +extern void init_apple_menu(const char* product); +extern OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn); +extern OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn); +extern OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata); +extern OSStatus DisplayReleaseNotes(void); +#include +#endif // LL_DARWIN + + +#include "moviemaker.h" +extern BOOL gbCapturing; + +#if !LL_SOLARIS + extern MovieMaker gMovieMaker; +#endif + +extern BOOL gRandomizeFramerate; +extern BOOL gPeriodicSlowFrame; + +#if LL_GSTREAMER_ENABLED +void UnloadGStreamer(); +#endif + +//////////////////////////////////////////////////////////// +// All from the last globals push... +bool gVerifySSLCert = true; +BOOL gHandleKeysAsync = FALSE; + +BOOL gProbeHardware = TRUE; // Use DirectX 9 to probe for hardware + +S32 gYieldMS = 0; // set in parse_args, used in mainLoop +BOOL gYieldTime = FALSE; + +const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard + +F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() +F32 gSimFrames; + +LLString gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle_startup + +BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally + +BOOL gInProductionGrid = FALSE; + +BOOL gAllowIdleAFK = TRUE; +F32 gAFKTimeout = DEFAULT_AFK_TIMEOUT; +BOOL gShowObjectUpdates = FALSE; +BOOL gLogMessages = FALSE; +std::string gChannelName = LL_CHANNEL; +BOOL gUseAudio = TRUE; +LLString gCmdLineFirstName; +LLString gCmdLineLastName; +LLString gCmdLinePassword; + +BOOL gAutoLogin = FALSE; + +const char* DEFAULT_SETTINGS_FILE = "settings.xml"; +BOOL gRequestInventoryLibrary = TRUE; +BOOL gGodConnect = FALSE; +BOOL gAcceptTOS = FALSE; +BOOL gAcceptCriticalMessage = FALSE; + +LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. +BOOL gLastExecFroze = FALSE; + +LLSD gDebugInfo; + +U32 gFrameCount = 0; +U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground +LLPumpIO* gServicePump = NULL; + +BOOL gPacificDaylightTime = FALSE; + +U64 gFrameTime = 0; +F32 gFrameTimeSeconds = 0.f; +F32 gFrameIntervalSeconds = 0.f; +F32 gFPSClamped = 10.f; // Pretend we start at target rate. +F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets +U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds + +LLTimer gRenderStartTime; +LLFrameTimer gForegroundTime; +LLTimer gLogoutTimer; +static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg. +F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; + +LLUUID gInventoryLibraryOwner; +LLUUID gInventoryLibraryRoot; + +BOOL gDisableVoice = FALSE; +BOOL gDisconnected = FALSE; + +// Map scale in pixels per region +F32 gMapScale = 128.f; +F32 gMiniMapScale = 128.f; + +// used to restore texture state after a mode switch +LLFrameTimer gRestoreGLTimer; +BOOL gRestoreGL = FALSE; +BOOL gUseWireframe = FALSE; + +F32 gMouseSensitivity = 3.f; +BOOL gInvertMouse = FALSE; + +// VFS globals - see llappviewer.h +LLVFS* gStaticVFS = NULL; + +LLMemoryInfo gSysMemory; + +bool gPreloadImages = true; +bool gPreloadSounds = true; + +LLString gLastVersionChannel; + +LLVector3 gWindVec(3.0, 3.0, 0.0); +LLVector3 gRelativeWindVec(0.0, 0.0, 0.0); + +U32 gPacketsIn = 0; + +BOOL gPrintMessagesThisFrame = FALSE; + +BOOL gUseConsole = TRUE; + +BOOL gRandomizeFramerate = FALSE; +BOOL gPeriodicSlowFrame = FALSE; + +BOOL gQAMode = FALSE; + +//////////////////////////////////////////////////////////// +// Internal globals... that should be removed. +static F32 gQuitAfterSeconds = 0.f; +static BOOL gRotateRight = FALSE; +static BOOL gIgnorePixelDepth = FALSE; + +// Allow multiple viewers in ReleaseForDownload +#if LL_RELEASE_FOR_DOWNLOAD +static BOOL gMultipleViewersOK = FALSE; +#else +static BOOL gMultipleViewersOK = TRUE; +#endif + +static std::map gCommandLineSettings; +static std::map gCommandLineForcedSettings; + +static LLString gArgs; + +static LLString gOldSettingsFileName; +static const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; +static BOOL gDoDisconnect = FALSE; +static LLString gLaunchFileOnQuit; + +//---------------------------------------------------------------------------- +// File scope definitons +const char *VFS_DATA_FILE_BASE = "data.db2.x."; +const char *VFS_INDEX_FILE_BASE = "index.db2.x."; + +static LLString gSecondLife; +static LLString gWindowTitle; +#ifdef LL_WINDOWS + static char sWindowClass[] = "Second Life"; +#endif + +std::vector gLoginURIs; +static std::string gHelperURI; + +static const char USAGE[] = "\n" +"usage:\tviewer [options]\n" +"options:\n" +" -login log in as a user\n" +" -autologin log in as last saved user\n" +" -loginuri login server and CGI script to use\n" +" -helperuri helper web CGI prefix to use\n" +" -settings specify the filename of a\n" +" configuration file\n" +" default is settings.xml\n" +" -setdefault specify the value of a particular\n" +" configuration variable which can be\n" +" overridden by settings.xml\n" +" -set specify the value of a particular\n" +" configuration variable that\n" +" overrides all other settings\n" +" -user specify userserver in dotted quad\n" +#if !LL_RELEASE_FOR_DOWNLOAD +" -sim specify the simulator ip address\n" +#endif +" -god log in as god if you have god access\n" +" -purge delete files in cache\n" +" -safe reset preferences, run in safe mode\n" +" -noutc logs in local time, not UTC\n" +" -nothread run vfs in single thread\n" +" -noinvlib Do not request inventory library\n" +" -multiple allow multiple viewers\n" +" -nomultiple block multiple viewers\n" +" -novoice disable voice\n" +" -ignorepixeldepth ignore pixel depth settings\n" +" -cooperative [ms] yield some idle time to local host\n" +" -skin ui/branding skin folder to use\n" +#if LL_WINDOWS +" -noprobe disable hardware probe\n" +#endif +" -noquicktime disable QuickTime movies, speeds startup\n" +" -nopreload don't preload UI images or sounds, speeds startup\n" +// these seem to be unused +//" -noenv turn off environmental effects\n" +//" -proxy specify the proxy ip address\n" +"\n"; + +void idle_afk_check() +{ + // check idle timers + if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gAFKTimeout)) + { + gAgent.setAFK(); + } +} + +// A callback set in LLAppViewer::init() +static void ui_audio_callback(const LLUUID& uuid) +{ + if (gAudiop) + { + F32 volume = gSavedSettings.getF32("AudioLevelUI"); + gAudiop->triggerSound(uuid, gAgent.getID(), volume); + } +} + +void request_initial_instant_messages() +{ + static BOOL requested = FALSE; + if (!requested + && gMuteListp + && gMuteListp->isLoaded() + && gAgent.getAvatarObject()) + { + // Auto-accepted inventory items may require the avatar object + // to build a correct name. Likewise, inventory offers from + // muted avatars require the mute list to properly mute. + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RetrieveInstantMessages); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + requested = TRUE; + } +} + +// Use these strictly for things that are constructed at startup, +// or for things that are performance critical. JC +static void saved_settings_to_globals() +{ + LLBUTTON_H_PAD = gSavedSettings.getS32("ButtonHPad"); + LLBUTTON_V_PAD = gSavedSettings.getS32("ButtonVPad"); + BTN_HEIGHT_SMALL = gSavedSettings.getS32("ButtonHeightSmall"); + BTN_HEIGHT = gSavedSettings.getS32("ButtonHeight"); + + MENU_BAR_HEIGHT = gSavedSettings.getS32("MenuBarHeight"); + MENU_BAR_WIDTH = gSavedSettings.getS32("MenuBarWidth"); + STATUS_BAR_HEIGHT = gSavedSettings.getS32("StatusBarHeight"); + + LLCOMBOBOX_HEIGHT = BTN_HEIGHT - 2; + LLCOMBOBOX_WIDTH = 128; + + LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); + + LLVOSky::sNighttimeBrightness = gSavedSettings.getF32("RenderNightBrightness"); + + LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); + LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); + LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; + LLVolumeImplFlexible::sUpdateFactor = gSavedSettings.getF32("RenderFlexTimeFactor"); + LLVOTree::sTreeFactor = gSavedSettings.getF32("RenderTreeLODFactor"); + LLVOAvatar::sLODFactor = gSavedSettings.getF32("RenderAvatarLODFactor"); + LLVOAvatar::sMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible"); + LLVOAvatar::sVisibleInFirstPerson = gSavedSettings.getBOOL("FirstPersonAvatarVisible"); + // clamp auto-open time to some minimum usable value + LLFolderView::sAutoOpenTime = llmax(0.25f, gSavedSettings.getF32("FolderAutoOpenDelay")); + LLToolBar::sInventoryAutoOpenTime = gSavedSettings.getF32("InventoryAutoOpenDelay"); + LLSelectMgr::sRectSelectInclusive = gSavedSettings.getBOOL("RectangleSelectInclusive"); + LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections"); + LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); + + gFrameStats.setTrackStats(gSavedSettings.getBOOL("StatsSessionTrackFrameStats")); + gAgentPilot.mNumRuns = gSavedSettings.getS32("StatsNumRuns"); + gAgentPilot.mQuitAfterRuns = gSavedSettings.getBOOL("StatsQuitAfterRuns"); + gAgent.mHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle"); + + gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); + gAllowIdleAFK = gSavedSettings.getBOOL("AllowIdleAFK"); + gAFKTimeout = gSavedSettings.getF32("AFKTimeout"); + gMouseSensitivity = gSavedSettings.getF32("MouseSensitivity"); + gInvertMouse = gSavedSettings.getBOOL("InvertMouse"); + gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); + gMapScale = gSavedSettings.getF32("MapScale"); + gMiniMapScale = gSavedSettings.getF32("MiniMapScale"); + gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard"); + LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); + +#if LL_VECTORIZE + if (gSysCPU.hasAltivec()) + { + gSavedSettings.setBOOL("VectorizeEnable", TRUE ); + gSavedSettings.setU32("VectorizeProcessor", 0 ); + } + else + if (gSysCPU.hasSSE2()) + { + gSavedSettings.setBOOL("VectorizeEnable", TRUE ); + gSavedSettings.setU32("VectorizeProcessor", 2 ); + } + else + if (gSysCPU.hasSSE()) + { + gSavedSettings.setBOOL("VectorizeEnable", TRUE ); + gSavedSettings.setU32("VectorizeProcessor", 1 ); + } + else + { + // Don't bother testing or running if CPU doesn't support it. JC + gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); + gSavedSettings.setBOOL("VectorizeEnable", FALSE ); + gSavedSettings.setU32("VectorizeProcessor", 0 ); + gSavedSettings.setBOOL("VectorizeSkin", FALSE); + } +#else + // This build target doesn't support SSE, don't test/run. + gSavedSettings.setBOOL("VectorizePerfTest", FALSE ); + gSavedSettings.setBOOL("VectorizeEnable", FALSE ); + gSavedSettings.setU32("VectorizeProcessor", 0 ); + gSavedSettings.setBOOL("VectorizeSkin", FALSE); +#endif + + // propagate push to talk preference to current status + gSavedSettings.setBOOL("PTTCurrentlyEnabled", gSavedSettings.getBOOL("EnablePushToTalk")); + + settings_setup_listeners(); + + // gAgent.init() also loads from saved settings. +} + +int parse_args(int argc, char **argv) +{ + // Sometimes IP addresses passed in on the command line have leading + // or trailing white space. Use LLString to clean that up. + LLString ip_string; + S32 j; + + for (j = 1; j < argc; j++) + { + gArgs += argv[j]; + gArgs += " "; + + LLString argument = argv[j]; + if ((!strcmp(argv[j], "-port")) && (++j < argc)) + { + sscanf(argv[j], "%u", &(gAgent.mViewerPort)); + } + else if ((!strcmp(argv[j], "-drop")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gPacketDropPercentage); + } + else if ((!strcmp(argv[j], "-inbw")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gInBandwidth); + } + else if ((!strcmp(argv[j], "-outbw")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gOutBandwidth); + } + else if (!strcmp(argv[j], "--aditi")) + { + gGridChoice = GRID_INFO_ADITI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--agni")) + { + gGridChoice = GRID_INFO_AGNI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--dmz")) + { + gGridChoice = GRID_INFO_DMZ; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--siva")) + { + gGridChoice = GRID_INFO_SIVA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--shakti")) + { + gGridChoice = GRID_INFO_SHAKTI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--durga")) + { + gGridChoice = GRID_INFO_DURGA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--soma")) + { + gGridChoice = GRID_INFO_SOMA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--ganga")) + { + gGridChoice = GRID_INFO_GANGA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--vaak")) + { + gGridChoice = GRID_INFO_VAAK; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--uma")) + { + gGridChoice = GRID_INFO_UMA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "-user") && (++j < argc)) + { + if (!strcmp(argv[j], "-")) + { + gGridChoice = GRID_INFO_LOCAL; + snprintf(gGridName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); // Flawfinder: ignore + } + else + { + gGridChoice = GRID_INFO_OTHER; + ip_string.assign( argv[j] ); + LLString::trim(ip_string); + snprintf(gGridName, MAX_STRING, "%s", ip_string.c_str()); // Flawfinder: ignore + } + } + else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) + { + LLAppViewer::instance()->addLoginURI(utf8str_trim(argv[j])); + } + else if (!strcmp(argv[j], "-helperuri") && (++j < argc)) + { + LLAppViewer::instance()->setHelperURI(utf8str_trim(argv[j])); + } + else if (!strcmp(argv[j], "-debugviews")) + { + LLView::sDebugRects = TRUE; + } + else if (!strcmp(argv[j], "-skin") && (++j < argc)) + { + std::string folder(argv[j]); + gDirUtilp->setSkinFolder(folder); + } + else if (!strcmp(argv[j], "-autologin") || !strcmp(argv[j], "--autologin")) // keep --autologin for compatibility + { + gAutoLogin = TRUE; + } + else if (!strcmp(argv[j], "-quitafter") && (++j < argc)) + { + gQuitAfterSeconds = (F32)atof(argv[j]); + } + else if (!strcmp(argv[j], "-rotate")) + { + gRotateRight = TRUE; + } +// else if (!strcmp(argv[j], "-noenv")) +// { + //turn OFF environmental effects for slow machines/video cards +// gRequestParaboloidMap = FALSE; +// } + else if (!strcmp(argv[j], "-noaudio")) + { + gUseAudio = FALSE; + } + else if (!strcmp(argv[j], "-nosound")) // tends to be popular cmdline on Linux. + { + gUseAudio = FALSE; + } + else if (!strcmp(argv[j], "-noprobe")) + { + gProbeHardware = FALSE; + } + else if (!strcmp(argv[j], "-noquicktime")) + { + // Developers can log in faster if they don't load all the + // quicktime dlls. + gUseQuickTime = false; + } + else if (!strcmp(argv[j], "-nopreload")) + { + // Developers can log in faster if they don't decode sounds + // or images on startup, ~5 seconds faster. + gPreloadSounds = false; + gPreloadImages = false; + } + else if (!strcmp(argv[j], "-purge")) + { + LLAppViewer::instance()->purgeCache(); + } + else if(!strcmp(argv[j], "-noinvlib")) + { + gRequestInventoryLibrary = FALSE; + } + else if (!strcmp(argv[j], "-log")) + { + gLogMessages = TRUE; + continue; + } + else if (!strcmp(argv[j], "-logfile") && (++j < argc)) + { + // *NOTE: This buffer size is hard coded into scanf() below. + char logfile[256]; // Flawfinder: ignore + sscanf(argv[j], "%255s", logfile); // Flawfinder: ignore + llinfos << "Setting log file to " << logfile << llendl; + LLFile::remove(logfile); + LLError::logToFile(logfile); + } + else if (!strcmp(argv[j], "-settings") && (++j < argc)) + { + gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, argv[j]); + } + else if (!strcmp(argv[j], "-setdefault") && (j + 2 < argc)) + { + std::string control_name; + std::string control_value; + + j++; + if (argv[j]) control_name = std::string(argv[j]); + + j++; + if (argv[j]) control_value = std::string(argv[j]); + + // grab control name and value + if (!control_name.empty()) + { + gCommandLineSettings[control_name] = control_value; + } + } + else if (!strcmp(argv[j], "-set") && (j + 2 < argc)) + { + std::string control_name; + std::string control_value; + + j++; + if (argv[j]) control_name = std::string(argv[j]); + + j++; + if (argv[j]) control_value = std::string(argv[j]); + + // grab control name and value + if (!control_name.empty()) + { + gCommandLineForcedSettings[control_name] = control_value; + } + } + else if (!strcmp(argv[j], "-login")) + { + if (j + 3 < argc) + { + j++; + gCmdLineFirstName = argv[j]; + j++; + gCmdLineLastName = argv[j]; + j++; + gCmdLinePassword = argv[j]; + } + else + { + // only works if -login is last parameter on command line + llerrs << "Not enough parameters to -login. Did you mean -loginuri?" << llendl; + } + } + else if (!strcmp(argv[j], "-god")) + { + gGodConnect = TRUE; + } + else if (!strcmp(argv[j], "-noconsole")) + { + gUseConsole = FALSE; + } + else if (!strcmp(argv[j], "-safe")) + { + llinfos << "Setting viewer feature table to run in safe mode, resetting prefs" << llendl; + gFeatureManagerp->setSafe(TRUE); + } + else if (!strcmp(argv[j], "-multiple")) + { + gMultipleViewersOK = TRUE; + } + else if (!strcmp(argv[j], "-nomultiple")) + { + gMultipleViewersOK = FALSE; + } + else if (!strcmp(argv[j], "-novoice")) + { + gDisableVoice = TRUE; + } + else if (!strcmp(argv[j], "-nothread")) + { + LLVFile::ALLOW_ASYNC = FALSE; + llinfos << "Running VFS in nothread mode" << llendl; + } + // some programs don't respect the command line options in protocol handlers (I'm looking at you, Opera) + // so this allows us to parse the URL straight off the command line without a "-url" paramater + else if (LLURLDispatcher::isSLURL(argv[j]) + || !strcmp(argv[j], "-url") && (++j < argc)) + { + std::string slurl = argv[j]; + if (LLURLDispatcher::isSLURLCommand(slurl)) + { + LLStartUp::sSLURLCommand = slurl; + } + else + { + LLURLSimString::setString(slurl); + } + // *NOTE: After setting the url, bail. What can happen is + // that someone can use IE (or potentially other browsers) + // and do the rough equivalent of command injection and + // steal passwords. Phoenix. SL-55321 + } + else if (!strcmp(argv[j], "-ignorepixeldepth")) + { + gIgnorePixelDepth = TRUE; + } + else if (!strcmp(argv[j], "-cooperative")) + { + S32 ms_to_yield = 0; + if(++j < argc) + { + S32 rv = sscanf(argv[j], "%d", &ms_to_yield); + if(0 == rv) + { + --j; + } + } + else + { + --j; + } + gYieldMS = ms_to_yield; + gYieldTime = TRUE; + } + else if (!strcmp(argv[j], "-no-verify-ssl-cert")) + { + gVerifySSLCert = false; + } + else if ( (!strcmp(argv[j], "--channel") || !strcmp(argv[j], "-channel")) && (++j < argc)) + { + gChannelName = argv[j]; + } +#if LL_DARWIN + else if (!strncmp(argv[j], "-psn_", 5)) + { + // this is the Finder passing the process session number + // we ignore this + } +#endif + else if(!strncmp(argv[j], "-qa", 3)) + { + gQAMode = TRUE; + } + else + { + + // DBC - Mac OS X passes some stuff by default on the command line (e.g. psn). + // Second Life URLs are passed this way as well? + llwarns << "Possible unknown keyword " << argv[j] << llendl; + + // print usage information + llinfos << USAGE << llendl; + // return 1; + } + } + return 0; +} + +bool send_url_to_other_instance(const std::string& url) +{ +#if LL_WINDOWS + wchar_t window_class[256]; /* Flawfinder: ignore */ // Assume max length < 255 chars. + mbstowcs(window_class, sWindowClass, 255); + window_class[255] = 0; + // Use the class instead of the window name. + HWND other_window = FindWindow(window_class, NULL); + if (other_window != NULL) + { + lldebugs << "Found other window with the name '" << gWindowTitle << "'" << llendl; + COPYDATASTRUCT cds; + const S32 SLURL_MESSAGE_TYPE = 0; + cds.dwData = SLURL_MESSAGE_TYPE; + cds.cbData = url.length() + 1; + cds.lpData = (void*)url.c_str(); + + LRESULT msg_result = SendMessage(other_window, WM_COPYDATA, NULL, (LPARAM)&cds); + lldebugs << "SendMessage(WM_COPYDATA) to other window '" + << gWindowTitle << "' returned " << msg_result << llendl; + return true; + } +#endif + return false; +} + +//---------------------------------------------------------------------------- +// LLAppViewer definition + +// Static members. +// The single viewer app. +LLAppViewer* LLAppViewer::sInstance = NULL; + +LLTextureCache* LLAppViewer::sTextureCache = NULL; +LLWorkerThread* LLAppViewer::sImageDecodeThread = NULL; +LLTextureFetch* LLAppViewer::sTextureFetch = NULL; + +LLAppViewer::LLAppViewer() : + mMarkerFile(NULL), + mLastExecFroze(false), + mCrashBehavior(CRASH_BEHAVIOR_ASK), + mReportedCrash(false), + mNumSessions(0), + mPurgeCache(false), + mPurgeOnExit(false), + mSecondInstance(false), + mSavedFinalSnapshot(false), + mQuitRequested(false), + mLogoutRequestSent(false) +{ + if(NULL != sInstance) + { + llerrs << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << llendl; + } + + sInstance = this; +} + +LLAppViewer::~LLAppViewer() +{ + // If we got to this destructor somehow, the app didn't hang. + removeMarkerFile(); +} + +bool LLAppViewer::tempStoreCommandOptions(int argc, char** argv) +{ + gTempArgC = argc; + gTempArgV = argv; + return true; +} + +bool LLAppViewer::init() +{ + // *NOTE:Mani - LLCurl::initClass is not thread safe. + // Called before threads are created. + LLCurl::initClass(); + + initThreads(); + + initEarlyConfiguration(); + + // + // Start of the application + // + // IMPORTANT! Do NOT put anything that will write + // into the log files during normal startup until AFTER + // we run the "program crashed last time" error handler below. + // + + // Need to do this initialization before we do anything else, since anything + // that touches files should really go through the lldir API + gDirUtilp->initAppDirs("SecondLife"); + + + initLogging(); + + // + // OK to write stuff to logs now, we've now crash reported if necessary + // + + // Set up some defaults... + gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE); + gOldSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE); + + if (!initConfiguration()) + return false; + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // *FIX: The following code isn't grouped into functions yet. + + // + // Write system information into the debug log (CPU, OS, etc.) + // + writeSystemInfo(); + + // Build a string representing the current version number. + gCurrentVersion = llformat("%d.%d.%d", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH ); + + // + // Load the feature tables + // + llinfos << "Loading feature tables." << llendl; + + gFeatureManagerp->loadFeatureTables(); + gFeatureManagerp->initCPUFeatureMasks(); + + // Merge with the command line overrides + gSavedSettings.applyOverrides(gCommandLineSettings); + + // Need to do this before calling parseAlerts + gUICtrlFactory = new LLViewerUICtrlFactory(); + + // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/) + // Do this *before* loading the settings file + LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); + + // Overwrite default settings with user settings + llinfos << "Loading configuration file " << gSettingsFileName << llendl; + if (0 == gSavedSettings.loadFromFile(gSettingsFileName)) + { + llinfos << "Failed to load settings from " << gSettingsFileName << llendl; + llinfos << "Loading legacy settings from " << gOldSettingsFileName << llendl; + gSavedSettings.loadFromFileLegacy(gOldSettingsFileName); + } + + // need to do this here - need to have initialized global settings first + LLString nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); + if ( nextLoginLocation.length() ) + { + LLURLSimString::setString( nextLoginLocation.c_str() ); + }; + + // Merge with the command line overrides + gSavedSettings.applyOverrides(gCommandLineForcedSettings); + + gLastRunVersion = gSavedSettings.getString("LastRunVersion"); + + fixup_settings(); + + // Get the single value from the crash settings file, if it exists + std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); + gCrashSettings.loadFromFile(crash_settings_filename.c_str()); + + ///////////////////////////////////////////////// + // OS-specific login dialogs + ///////////////////////////////////////////////// +#if LL_WINDOWS + /* + // Display initial login screen, comes up quickly. JC + { + LLSplashScreen::hide(); + + INT_PTR result = DialogBox(hInstance, L"CONNECTBOX", NULL, login_dialog_func); + if (result < 0) + { + llwarns << "Connect dialog box failed, returned " << result << llendl; + return 1; + } + // success, result contains which button user clicked + llinfos << "Connect dialog box clicked " << result << llendl; + + LLSplashScreen::show(); + } + */ +#endif + + // track number of times that app has run + mNumSessions = gSavedSettings.getS32("NumSessions"); + mNumSessions++; + gSavedSettings.setS32("NumSessions", mNumSessions); + + gSavedSettings.setString("HelpLastVisitedURL",gSavedSettings.getString("HelpHomeURL")); + + if (gSavedSettings.getBOOL("VerboseLogs")) + { + LLError::setPrintLocation(true); + } + +#if !LL_RELEASE_FOR_DOWNLOAD + if (gGridChoice == GRID_INFO_NONE) + { + // Development version: load last server choice by default (overridden by cmd line args) + + S32 server = gSavedSettings.getS32("ServerChoice"); + if (server != 0) + gGridChoice = (EGridInfo)llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); + if (server == GRID_INFO_OTHER) + { + LLString custom_server = gSavedSettings.getString("CustomServer"); + if (custom_server.empty()) + { + snprintf(gGridName, MAX_STRING, "none"); /* Flawfinder: ignore */ + } + else + { + snprintf(gGridName, MAX_STRING, "%s", custom_server.c_str()); /* Flawfinder: ignore */ + } + } + } +#endif + + if (gGridChoice == GRID_INFO_NONE) + { + gGridChoice = GridDefaultChoice; + } + + // Load art UUID information, don't require these strings to be declared in code. + LLString viewer_art_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"viewerart.xml"); + llinfos << "Loading art table from " << viewer_art_filename << llendl; + gViewerArt.loadFromFile(viewer_art_filename.c_str(), FALSE); + LLString textures_filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "textures", "textures.xml"); + llinfos << "Loading art table from " << textures_filename << llendl; + gViewerArt.loadFromFile(textures_filename.c_str(), FALSE); + + LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); + llinfos << "Loading base colors from " << colors_base_filename << llendl; + gColors.loadFromFile(colors_base_filename.c_str(), FALSE, TYPE_COL4U); + + // Load overrides from user colors file + LLString user_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.xml"); + llinfos << "Loading user colors from " << user_colors_filename << llendl; + if (gColors.loadFromFile(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) + { + llinfos << "Failed to load user colors from " << user_colors_filename << llendl; + LLString user_legacy_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.ini"); + llinfos << "Loading legacy colors from " << user_legacy_colors_filename << llendl; + gColors.loadFromFileLegacy(user_legacy_colors_filename.c_str(), FALSE, TYPE_COL4U); + } + + // Widget construction depends on LLUI being initialized + LLUI::initClass(&gSavedSettings, + &gColors, + &gViewerArt, + &gImageList, + ui_audio_callback, + &LLUI::sGLScaleFactor); + + LLWeb::initClass(); // do this after LLUI + gUICtrlFactory->setupPaths(); // update paths with correct language set + + ///////////////////////////////////////////////// + // + // Load settings files + // + // + LLGroupMgr::parseRoleActions("role_actions.xml"); + + LLAgent::parseTeleportMessages("teleport_strings.xml"); + + mCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); + + LLVectorPerformanceOptions::initClass(); + + // Move certain saved settings into global variables for speed + saved_settings_to_globals(); + + + // Find partition serial number (Windows) or hardware serial (Mac) + mSerialNumber = generateSerialNumber(); + + if(false == initHardwareTest()) + { + // Early out from user choice. + return false; + } + + // Always fetch the Ethernet MAC address, needed both for login + // and password load. + LLUUID::getNodeID(gMACAddress); + + // Prepare for out-of-memory situations, during which we will crash on + // purpose and save a dump. +#if LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP + MemSetErrorHandler(first_mem_error_handler); +#endif // LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP + + gViewerStats = new LLViewerStats(); + + // + // Initialize the VFS, and gracefully handle initialization errors + // + + if (!initCache()) + { + std::ostringstream msg; + msg << + gSecondLife << " is unable to access a file that it needs.\n" + "\n" + "This can be because you somehow have multiple copies running, " + "or your system incorrectly thinks a file is open. " + "If this message persists, restart your computer and try again. " + "If it continues to persist, you may need to completely uninstall " << + gSecondLife << " and reinstall it."; + OSMessageBox( + msg.str().c_str(), + NULL, + OSMB_OK); + return 1; + } + +#if LL_DARWIN + // Display the release notes for the current version + if(!gHideLinks && gCurrentVersion != gLastRunVersion) + { + // Current version and last run version don't match exactly. Display the release notes. + DisplayReleaseNotes(); + } +#endif + + // + // Initialize the window + // + initWindow(); + + #if LL_WINDOWS && LL_LCD_COMPILE + // start up an LCD window on a logitech keyboard, if there is one + HINSTANCE hInstance = GetModuleHandle(NULL); + gLcdScreen = new llLCD(hInstance); + CreateLCDDebugWindows(); + #endif + + gGLManager.getGLInfo(gDebugInfo); + llinfos << gGLManager.getGLInfoString() << llendl; + + //load key settings + bind_keyboard_functions(); + + // Load Default bindings + if (!gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keys.ini").c_str())) + { + llerrs << "Unable to open keys.ini" << llendl; + } + // Load Custom bindings (override defaults) + gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini").c_str()); + + // Calculate the digest for the executable (takes < 90ms on a fast machine). + FILE* app_file = LLFile::fopen( gDirUtilp->getExecutablePathAndName().c_str(), "rb" ); /* Flawfinder: ignore */ + if( app_file ) + { + LLMD5 app_md5; + app_md5.update( app_file ); // Automatically closes the file + app_md5.finalize(); + app_md5.raw_digest( gViewerDigest.mData ); + } + llinfos << "Viewer Digest: " << gViewerDigest << llendl; + + // If we don't have the right GL requirements, exit. + // BUG: This should just be changed to a generic GL "Not good enough" flag + if (!gGLManager.mHasMultitexture && !gNoRender) + { + std::ostringstream msg; + msg << + "You do not appear to have the proper hardware requirements " + "for " << gSecondLife << ". " << gSecondLife << " requires an OpenGL graphics " + "card that has multitexture support. If this is the case, " + "you may want to make sure that you have the latest drivers for " + "your graphics card, and service packs and patches for your " + "operating system.\n" + "If you continue to have problems, please go to: " + "www.secondlife.com/support "; + OSMessageBox( + msg.str().c_str(), + NULL, + OSMB_OK); + return 0; + } + + // Save the current version to the prefs file + gSavedSettings.setString("LastRunVersion", gCurrentVersion); + + gSimLastTime = gRenderStartTime.getElapsedTimeF32(); + gSimFrames = (F32)gFrameCount; + + return true; +} + +bool LLAppViewer::mainLoop() +{ + //------------------------------------------- + // Run main loop until time to quit + //------------------------------------------- + + // Create IO Pump to use for HTTP Requests. + gServicePump = new LLPumpIO(gAPRPoolp); + LLHTTPClient::setPump(*gServicePump); + LLHTTPClient::setCABundle(gDirUtilp->getCAFile()); + + // initialize voice stuff here + gLocalSpeakerMgr = new LLLocalSpeakerMgr(); + gActiveChannelSpeakerMgr = new LLActiveSpeakerMgr(); + + LLVoiceChannel::initClass(); + LLVoiceClient::init(gServicePump); + + LLMemType mt1(LLMemType::MTYPE_MAIN); + LLTimer frameTimer,idleTimer; + LLTimer debugTime; + + // Handle messages + while (!LLApp::isExiting()) + { + LLFastTimer::reset(); // Should be outside of any timer instances + { + LLFastTimer t(LLFastTimer::FTM_FRAME); + + { + LLFastTimer t2(LLFastTimer::FTM_MESSAGES); + #if LL_WINDOWS + if (!LLWinDebug::setupExceptionHandler()) + { + llwarns << " Someone took over my exception handler (post messagehandling)!" << llendl; + } + #endif + + gViewerWindow->mWindow->gatherInput(); + } + +#if 1 && !RELEASE_FOR_DOWNLOAD + // once per second debug info + if (debugTime.getElapsedTimeF32() > 1.f) + { + debugTime.reset(); + } +#endif + if (!LLApp::isExiting()) + { + // Scan keyboard for movement keys. Command keys and typing + // are handled by windows callbacks. Don't do this until we're + // done initializing. JC + if (gViewerWindow->mWindow->getVisible() + && gViewerWindow->getActive() + && !gViewerWindow->mWindow->getMinimized() + && LLStartUp::getStartupState() == STATE_STARTED + && !gViewerWindow->getShowProgress() + && !gFocusMgr.focusLocked()) + { + gKeyboard->scanKeyboard(); + LLViewerJoystick::scanJoystick(); + } + + // Update state based on messages, user input, object idle. + { + LLFastTimer t3(LLFastTimer::FTM_IDLE); + idle(); + LLCurl::process(); + // this pump is necessary to make the login screen show up + gServicePump->pump(); + gServicePump->callback(); + } + + if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) + { + saveFinalSnapshot(); + disconnectViewer(); + } + + // Render scene. + if (!LLApp::isExiting()) + { + display(); + + LLFloaterSnapshot::update(); // take snapshots + +#if !LL_SOLARIS + if (gbCapturing) + { + gMovieMaker.Snap(); + } +#endif +#if LL_WINDOWS && LL_LCD_COMPILE + // update LCD Screen + gLcdScreen->UpdateDisplay(); +#endif + } + + } + + // Sleep and run background threads + { + LLFastTimer t2(LLFastTimer::FTM_SLEEP); + bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); + + // yield some time to the os based on command line option + if(gYieldTime) + { + ms_sleep(gYieldMS); + } + + // yield cooperatively when not running as foreground window + if ( gNoRender + || !gViewerWindow->mWindow->getVisible() + || !gFocusMgr.getAppHasFocus()) + { + // Sleep if we're not rendering, or the window is minimized. + S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); + // don't sleep when BackgroundYieldTime set to 0, since this will still yield to other threads + // of equal priority on Windows + if (milliseconds_to_sleep > 0) + { + ms_sleep(milliseconds_to_sleep); + // also pause worker threads during this wait period + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + } + } + + if (gRandomizeFramerate) + { + ms_sleep(rand() % 200); + } + + if (gPeriodicSlowFrame + && (gFrameCount % 10 == 0)) + { + llinfos << "Periodic slow frame - sleeping 500 ms" << llendl; + ms_sleep(500); + } + + + const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps + const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms + const F64 max_idle_time = run_multiple_threads ? min_idle_time : .005; // 5 ms + idleTimer.reset(); + while(1) + { + S32 work_pending = 0; + S32 io_pending = 0; + work_pending += LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread + work_pending += LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread + work_pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread + io_pending += LLVFSThread::updateClass(1); + io_pending += LLLFSThread::updateClass(1); + if (io_pending > 1000) + { + ms_sleep(llmin(io_pending/100,100)); // give the vfs some time to catch up + } + + F64 frame_time = frameTimer.getElapsedTimeF64(); + F64 idle_time = idleTimer.getElapsedTimeF64(); + if (frame_time >= min_frame_time && + idle_time >= min_idle_time && + (!work_pending || idle_time >= max_idle_time)) + { + break; + } + } + frameTimer.reset(); + + // Prevent the worker threads from running while rendering. + // if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client... + if (run_multiple_threads == FALSE) + { + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + // LLAppViewer::getTextureFetch()->pause(); // Don't pause the fetch (IO) thread + } + //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. + //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. + } + + } + } + + // Save snapshot for next time, if we made it through initialization + if (STATE_STARTED == LLStartUp::getStartupState()) + { + saveFinalSnapshot(); + } + + delete gServicePump; + + llinfos << "Exiting main_loop" << llendflush; + + return true; +} + +bool LLAppViewer::cleanup() +{ + //flag all elements as needing to be destroyed immediately + // to ensure shutdown order + LLMortician::setZealous(TRUE); + + LLVoiceClient::terminate(); + + disconnectViewer(); + + llinfos << "Viewer disconnected" << llendflush; + + display_cleanup(); + + release_start_screen(); // just in case + + LLError::logToFixedBuffer(NULL); + + llinfos << "Cleaning Up" << llendflush; + + LLKeyframeDataCache::clear(); + + // Must clean up texture references before viewer window is destroyed. + LLHUDObject::cleanupHUDObjects(); + llinfos << "HUD Objects cleaned up" << llendflush; + + // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) +#if 0 // this seems to get us stuck in an infinite loop... + gTransferManager.cleanup(); +#endif + + // Clean up map data storage + delete gWorldMap; + gWorldMap = NULL; + + delete gHUDManager; + gHUDManager = NULL; + + delete gToolMgr; + gToolMgr = NULL; + + delete gAssetStorage; + gAssetStorage = NULL; + + LLPolyMesh::freeAllMeshes(); + + delete gCacheName; + gCacheName = NULL; + + delete gGlobalEconomy; + gGlobalEconomy = NULL; + + delete gLocalSpeakerMgr; + gLocalSpeakerMgr = NULL; + + LLNotifyBox::cleanup(); + + llinfos << "Global stuff deleted" << llendflush; + +#if !LL_RELEASE_FOR_DOWNLOAD + if (gAudiop) + { + gAudiop->shutdown(); + } +#else + // This hack exists because fmod likes to occasionally hang forever + // when shutting down for no apparent reason. + llwarns << "Hack, skipping audio engine cleanup" << llendflush; +#endif + + + // moved to main application shutdown for now because it's non-trivial and only needs to be done once + // (even though it goes against the media framework design) + + LLMediaEngine::cleanupClass(); + +#if LL_QUICKTIME_ENABLED + if (gQuickTimeInitialized) + { + // clean up media stuff + llinfos << "Cleaning up QuickTime" << llendl; + ExitMovies (); + #if LL_WINDOWS + // Only necessary/available on Windows. + TerminateQTML (); + #endif + } + llinfos << "Quicktime cleaned up" << llendflush; +#endif + +#if LL_GSTREAMER_ENABLED + llinfos << "Cleaning up GStreamer" << llendl; + UnloadGStreamer(); + llinfos << "GStreamer cleaned up" << llendflush; +#endif + + llinfos << "Cleaning up feature manager" << llendflush; + delete gFeatureManagerp; + gFeatureManagerp = NULL; + + // Patch up settings for next time + // Must do this before we delete the viewer window, + // such that we can suck rectangle information out of + // it. + cleanupSavedSettings(); + llinfos << "Settings patched up" << llendflush; + + delete gAudiop; + gAudiop = NULL; + + // delete some of the files left around in the cache. + removeCacheFiles("*.wav"); + removeCacheFiles("*.tmp"); + removeCacheFiles("*.lso"); + removeCacheFiles("*.out"); + removeCacheFiles("*.dsf"); + removeCacheFiles("*.bodypart"); + removeCacheFiles("*.clothing"); + + llinfos << "Cache files removed" << llendflush; + + + cleanup_menus(); + + // Wait for any pending VFS IO + while (1) + { + S32 pending = LLVFSThread::updateClass(0); + pending += LLLFSThread::updateClass(0); + if (!pending) + { + break; + } + llinfos << "Waiting for pending IO to finish: " << pending << llendflush; + ms_sleep(100); + } + llinfos << "Shutting down." << llendflush; + + // Destroy Windows(R) window, and make sure we're not fullscreen + // This may generate window reshape and activation events. + // Therefore must do this before destroying the message system. + delete gViewerWindow; + gViewerWindow = NULL; + llinfos << "ViewerWindow deleted" << llendflush; + + // viewer UI relies on keyboard so keep it aound until viewer UI isa gone + delete gKeyboard; + gKeyboard = NULL; + + // Clean up selection managers after UI is destroyed, as UI + // may be observing them. + LLSelectMgr::cleanupGlobals(); + + LLViewerObject::cleanupVOClasses(); + + LLTracker::cleanupInstance(); + +#if LL_LIBXUL_ENABLED + // this must be done after floater cleanup (delete gViewerWindow) since + // floaters potentially need the manager to destroy their contents. + LLMozLib::getInstance()->reset(); +#endif + + // *FIX: This is handled in LLAppViewerWin32::cleanup(). + // I'm keeping the comment to remember its order in cleanup, + // in case of unforseen dependency. +//#if LL_WINDOWS +// gDXHardware.cleanup(); +//#endif // LL_WINDOWS + +#if LL_WINDOWS && LL_LCD_COMPILE + // shut down the LCD window on a logitech keyboard, if there is one + delete gLcdScreen; + gLcdScreen = NULL; +#endif + + if (!gVolumeMgr->cleanup()) + { + llwarns << "Remaining references in the volume manager!" << llendflush; + } + + LLViewerParcelMgr::cleanupGlobals(); + + delete gViewerStats; + gViewerStats = NULL; + + //end_messaging_system(); + + LLFollowCamMgr::cleanupClass(); + LLVolumeMgr::cleanupClass(); + LLWorldMapView::cleanupClass(); + LLUI::cleanupClass(); + + // + // Shut down the VFS's AFTER the decode manager cleans up (since it cleans up vfiles). + // Also after viewerwindow is deleted, since it may have image pointers (which have vfiles) + // Also after shutting down the messaging system since it has VFS dependencies + // + LLVFile::cleanupClass(); + llinfos << "VFS cleaned up" << llendflush; + + // Store the time of our current logoff + gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); + + // Must do this after all panels have been deleted because panels that have persistent rects + // save their rects on delete. + gSavedSettings.saveToFile(gSettingsFileName, TRUE); + if (!gPerAccountSettingsFileName.empty()) + { + gSavedPerAccountSettings.saveToFile(gPerAccountSettingsFileName, TRUE); + } + llinfos << "Saved settings" << llendflush; + + std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); + // save all settings, even if equals defaults + gCrashSettings.saveToFile(crash_settings_filename.c_str(), FALSE); + + delete gUICtrlFactory; + gUICtrlFactory = NULL; + + gSavedSettings.cleanup(); + gViewerArt.cleanup(); + gColors.cleanup(); + gCrashSettings.cleanup(); + + if (gMuteListp) + { + // save mute list + gMuteListp->cache(gAgent.getID()); + + delete gMuteListp; + gMuteListp = NULL; + } + + if (mPurgeOnExit) + { + llinfos << "Purging all cache files on exit" << llendflush; + char mask[LL_MAX_PATH]; /* Flawfinder: ignore */ + snprintf(mask, LL_MAX_PATH, "%s*.*", gDirUtilp->getDirDelimiter().c_str()); /* Flawfinder: ignore */ + gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); + } + + removeMarkerFile(); // Any crashes from here on we'll just have to ignore + + closeDebug(); + + // Let threads finish + LLTimer idleTimer; + idleTimer.reset(); + const F64 max_idle_time = 5.f; // 5 seconds + while(1) + { + S32 pending = 0; + pending += LLAppViewer::getTextureCache()->update(1); // unpauses the worker thread + pending += LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread + pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread + pending += LLVFSThread::updateClass(0); + pending += LLLFSThread::updateClass(0); + F64 idle_time = idleTimer.getElapsedTimeF64(); + if (!pending || idle_time >= max_idle_time) + { + llwarns << "Quitting with pending background tasks." << llendl; + break; + } + } + + // Delete workers first + // shotdown all worker threads before deleting them in case of co-dependencies + sTextureCache->shutdown(); + sTextureFetch->shutdown(); + sImageDecodeThread->shutdown(); + delete sTextureCache; + sTextureCache = NULL; + delete sTextureFetch; + sTextureFetch = NULL; + delete sImageDecodeThread; + sImageDecodeThread = NULL; + + gImageList.shutdown(); // shutdown again in case a callback added something + + // This should eventually be done in LLAppViewer + LLImageJ2C::closeDSO(); + LLImageFormatted::cleanupClass(); + LLVFSThread::cleanupClass(); + LLLFSThread::cleanupClass(); + + llinfos << "VFS Thread finished" << llendflush; + +#ifndef LL_RELEASE_FOR_DOWNLOAD + llinfos << "Auditing VFS" << llendl; + gVFS->audit(); +#endif + + // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. + // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve + delete gStaticVFS; + gStaticVFS = NULL; + delete gVFS; + gVFS = NULL; + + end_messaging_system(); + + // *NOTE:Mani - The following call is not thread safe. + LLCurl::cleanup(); + + // If we're exiting to launch an URL, do that here so the screen + // is at the right resolution before we launch IE. + if (!gLaunchFileOnQuit.empty()) + { +#if LL_WINDOWS + // Indicate an application is starting. + SetCursor(LoadCursor(NULL, IDC_WAIT)); +#endif + + // HACK: Attempt to wait until the screen res. switch is complete. + ms_sleep(1000); + + LLWeb::loadURLExternal( gLaunchFileOnQuit ); + } + + + llinfos << "Goodbye" << llendflush; + // return 0; + return true; +} + +bool LLAppViewer::initEarlyConfiguration() +{ + // *FIX: globals - This method sets a bunch of globals early in the init process. + int argc = gTempArgC; + char** argv = gTempArgV; + + // HACK! We REALLY want to know what grid they were trying to connect to if they + // crashed hard. + // So we walk through the command line args ONLY looking for the + // userserver arguments first. And we don't do ANYTHING but set + // the gGridName (which gets passed to the crash reporter). + // We're assuming that they're trying to log into the same grid as last + // time, which seems fairly reasonable. + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GridDefaultChoice].mName); // Flawfinder: ignore + S32 j; + for (j = 1; j < argc; j++) + { + if (!strcmp(argv[j], "--aditi")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_ADITI].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--agni")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_AGNI].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--dmz")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_DMZ].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--siva")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_SIVA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--shakti")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_SHAKTI].mName); + } + else if (!strcmp(argv[j], "--durga")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_DURGA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--soma")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_SOMA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--ganga")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_GANGA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--vaak")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_VAAK].mName); + } + else if (!strcmp(argv[j], "--uma")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_UMA].mName); + } + else if (!strcmp(argv[j], "-user") && (++j < argc)) + { + if (!strcmp(argv[j], "-")) + { + snprintf(gGridName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); // Flawfinder: ignore + } + else + { + snprintf(gGridName, MAX_STRING, "%s", argv[j]); // Flawfinder: ignore + } + } + else if (!strcmp(argv[j], "-multiple")) + { + // Hack to detect -multiple so we can disable the marker file check (which will always fail) + gMultipleViewersOK = TRUE; + } + else if (!strcmp(argv[j], "-novoice")) + { + // May need to know this early also + gDisableVoice = TRUE; + } + else if (!strcmp(argv[j], "-url") && (++j < argc)) + { + LLURLSimString::setString(argv[j]); + } + } + + return true; +} + +bool LLAppViewer::initThreads() +{ +#if MEM_TRACK_MEM + static const bool enable_threads = false; +#else + static const bool enable_threads = true; +#endif + LLVFSThread::initClass(enable_threads && true); + LLLFSThread::initClass(enable_threads && true); + + // Image decoding + LLAppViewer::sImageDecodeThread = new LLWorkerThread("ImageDecode", enable_threads && true); + LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true); + LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), enable_threads && false); + LLImageWorker::initClass(LLAppViewer::getImageDecodeThread()); + LLImageJ2C::openDSO(); + + // *FIX: no error handling here! + return true; +} + +void errorCallback(const std::string &error_string) +{ +#ifndef LL_RELEASE_FOR_DOWNLOAD + OSMessageBox(error_string.c_str(), "Fatal Error", OSMB_OK); +#endif + LLError::crashAndLoop(error_string); +} + +bool LLAppViewer::initLogging() +{ + // + // Set up logging defaults for the viewer + // + LLError::initForApplication( + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); + LLError::setFatalFunction(errorCallback); + + // Remove the last ".old" log file. + std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.old"); + LLFile::remove(old_log_file.c_str()); + + // Rename current log file to ".old" + std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLife.log"); + LLFile::rename(log_file.c_str(), old_log_file.c_str()); + + // Set the log file to SecondLife.log + + LLError::logToFile(log_file); + + // *FIX:Mani no error handling here! + return true; +} + +bool LLAppViewer::initConfiguration() +{ + // Ye olde parse_args()... + if(!doConfigFromCommandLine()) + { + return false; + } + + // XUI:translate + gSecondLife = "Second Life"; + + // Read skin/branding settings if specified. + if (! gDirUtilp->getSkinDir().empty() ) + { + std::string skin_def_file = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "skin.xml"); + LLXmlTree skin_def_tree; + + if (!skin_def_tree.parseFile(skin_def_file)) + { + llerrs << "Failed to parse skin definition." << llendl; + } + + LLXmlTreeNode* rootp = skin_def_tree.getRoot(); + LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message"); + if (disabled_message_node) + { + gDisabledMessage = disabled_message_node->getContents(); + } + + static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links"); + rootp->getFastAttributeBOOL(hide_links_string, gHideLinks); + + // Legacy string. This flag really meant we didn't want to expose references to "Second Life". + // Just set gHideLinks instead. + static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update"); + BOOL silent_update; + rootp->getFastAttributeBOOL(silent_string, silent_update); + gHideLinks = (gHideLinks || silent_update); + } + +#if LL_DARWIN + // Initialize apple menubar and various callbacks + init_apple_menu(gSecondLife.c_str()); + +#if __ppc__ + // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. + // Only test PowerPC - all Intel Macs have SSE. + if(!gSysCPU.hasAltivec()) + { + std::ostringstream msg; + msg << gSecondLife << " requires a processor with AltiVec (G4 or later)."; + OSMessageBox( + msg.str().c_str(), + NULL, + OSMB_OK); + removeMarkerFile(); + return false; + } +#endif + +#endif // LL_DARWIN + + // Display splash screen. Must be after above check for previous + // crash as this dialog is always frontmost. + std::ostringstream splash_msg; + splash_msg << "Loading " << gSecondLife << "..."; + LLSplashScreen::show(); + LLSplashScreen::update(splash_msg.str().c_str()); + + LLVolumeMgr::initClass(); + + // Initialize the feature manager + // The feature manager is responsible for determining what features + // are turned on/off in the app. + gFeatureManagerp = new LLFeatureManager; + + gStartTime = totalTime(); + + //////////////////////////////////////// + // + // Process ini files + // + + // declare all possible setting variables + declare_settings(); + +#if !LL_RELEASE_FOR_DOWNLOAD +// only write the defaults for non-release builds! + gSavedSettings.saveToFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings_default.xml").c_str(), FALSE); +#endif + + // + // Set the name of the window + // +#if LL_RELEASE_FOR_DOWNLOAD + gWindowTitle = gSecondLife; +#elif LL_DEBUG + gWindowTitle = gSecondLife + LLString(" [DEBUG] ") + gArgs; +#else + gWindowTitle = gSecondLife + LLString(" ") + gArgs; +#endif + LLString::truncate(gWindowTitle, 255); + + if (!gMultipleViewersOK) + { + // + // Check for another instance of the app running + // + //RN: if we received a URL, hand it off to the existing instance + // don't call anotherInstanceRunning() when doing URL handoff, as + // it relies on checking a marker file which will not work when running + // out of different directories + std::string slurl; + if (!LLStartUp::sSLURLCommand.empty()) + { + slurl = LLStartUp::sSLURLCommand; + } + else if (LLURLSimString::parse()) + { + slurl = LLURLSimString::getURL(); + } + if (!slurl.empty()) + { + if (send_url_to_other_instance(slurl)) + { + // successfully handed off URL to existing instance, exit + return false; + } + } + + mSecondInstance = anotherInstanceRunning(); + + if (mSecondInstance) + { + std::ostringstream msg; + msg << + gSecondLife << " is already running.\n" + "\n" + "Check your task bar for a minimized copy of the program.\n" + "If this message persists, restart your computer.", + OSMessageBox( + msg.str().c_str(), + NULL, + OSMB_OK); + return false; + } + + initMarkerFile(); + +#if LL_SEND_CRASH_REPORTS + if (gLastExecFroze) + { + llinfos << "Last execution froze, requesting to send crash report." << llendl; + // + // Pop up a freeze or crash warning dialog + // + std::ostringstream msg; + msg << gSecondLife + << " appears to have frozen or crashed on the previous run.\n" + << "Would you like to send a crash report?"; + std::string alert; + alert = gSecondLife; + alert += " Alert"; + S32 choice = OSMessageBox(msg.str().c_str(), + alert.c_str(), + OSMB_YESNO); + if (OSBTN_YES == choice) + { + llinfos << "Sending crash report." << llendl; + + removeMarkerFile(); +#if LL_WINDOWS + std::string exe_path = gDirUtilp->getAppRODataDir(); + exe_path += gDirUtilp->getDirDelimiter(); + exe_path += "win_crash_logger.exe"; + + std::string arg_string = "-previous -user "; + arg_string += gGridName; + arg_string += " -name \""; + arg_string += gSecondLife; + arg_string += "\""; + // Spawn crash logger. + // NEEDS to wait until completion, otherwise log files will get smashed. + _spawnl(_P_WAIT, exe_path.c_str(), exe_path.c_str(), arg_string.c_str(), NULL); +#elif LL_DARWIN + std::string command_str; + command_str = "crashreporter.app/Contents/MacOS/crashreporter "; + command_str += "-previous -user "; + command_str += gGridName; + // XXX -- We need to exit fullscreen mode for this to work. + // XXX -- system() also doesn't wait for completion. Hmm... + system(command_str.c_str()); /* Flawfinder: Ignore */ +#elif LL_LINUX || LL_SOLARIS + std::string cmd =gDirUtilp->getAppRODataDir(); + cmd += gDirUtilp->getDirDelimiter(); +#if LL_LINUX + cmd += "linux-crash-logger.bin"; +#else // LL_SOLARIS + cmd += "bin/solaris-crash-logger"; +#endif + char* const cmdargv[] = + {(char*)cmd.c_str(), + (char*)"-previous", + (char*)"-user", + (char*)gGridName, + (char*)"-name", + (char*)gSecondLife.c_str(), + NULL}; + pid_t pid = fork(); + if (pid == 0) + { // child + execv(cmd.c_str(), cmdargv); /* Flawfinder: Ignore */ + llwarns << "execv failure when trying to start " << cmd << llendl; + _exit(1); // avoid atexit() + } else { + if (pid > 0) + { + // wait for child proc to die + int childExitStatus; + waitpid(pid, &childExitStatus, 0); + } else { + llwarns << "fork failure." << llendl; + } + } +#endif + } + else + { + llinfos << "Not sending crash report." << llendl; + } + } +#endif // #if LL_SEND_CRASH_REPORTS + } + else + { + mSecondInstance = anotherInstanceRunning(); + + if (mSecondInstance) + { + gDisableVoice = TRUE; + /* Don't start another instance if using -multiple + //RN: if we received a URL, hand it off to the existing instance + if (LLURLSimString::parse()) + { + LLURLSimString::send_to_other_instance(); + return 1; + } + */ + } + + initMarkerFile(); + } + + return true; // Config was successful. +} + +bool LLAppViewer::doConfigFromCommandLine() +{ + // *FIX: This is what parse args used to do, minus the arg reading part. + // Now the arg parsing is handled by LLApp::parseCommandOptions() and this + // method need only interpret settings. Perhaps some day interested parties + // can ask an app about a setting rather than have the app set + // a gazzillion globals. + + ///////////////////////////////////////// + // + // Process command line arguments + // + S32 args_result = 0; + +#if LL_DARWIN + { + // On the Mac, read in arguments.txt (if it exists) and process it for additional arguments. + LLString args; + if(_read_file_into_string(args, "arguments.txt")) /* Flawfinder: ignore*/ + { + // The arguments file exists. + // It should consist of command line arguments separated by newlines. + // Split it into individual arguments and build a fake argv[] to pass to parse_args. + std::vector arglist; + + arglist.push_back("newview"); + + llinfos << "Reading additional command line arguments from arguments.txt..." << llendl; + + typedef boost::tokenizer > tokenizer; + boost::escaped_list_separator sep("\\", "\r\n ", "\"'"); + tokenizer tokens(args, sep); + tokenizer::iterator token_iter; + + for(token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + llinfos << "argument: '" << (token_iter->c_str()) << "'" << llendl; + + arglist.push_back(*token_iter); + } + + char **fakeargv = new char*[arglist.size()]; + int i; + for(i=0; i < arglist.size(); i++) + fakeargv[i] = const_cast(arglist[i].c_str()); + + args_result = parse_args(arglist.size(), fakeargv); + delete[] fakeargv; + } + + // Get the user's preferred language string based on the Mac OS localization mechanism. + // To add a new localization: + // go to the "Resources" section of the project + // get info on "language.txt" + // in the "General" tab, click the "Add Localization" button + // create a new localization for the language you're adding + // set the contents of the new localization of the file to the string corresponding to our localization + // (i.e. "en-us", "ja", etc. Use the existing ones as a guide.) + CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("language"), CFSTR("txt"), NULL); + char path[MAX_PATH]; + if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) + { + LLString lang; + if(_read_file_into_string(lang, path)) /* Flawfinder: ignore*/ + { + gCommandLineForcedSettings["SystemLanguage"] = lang; + } + } + CFRelease(url); + } +#endif + + int argc = gTempArgC; + char** argv = gTempArgV; + + // + // Parse the command line arguments + // + args_result |= parse_args(argc, argv); + if (args_result) + { + removeMarkerFile(); + return false; + } + + if (!strcmp(gGridName, gGridInfo[GRID_INFO_AGNI].mName)) + { + gInProductionGrid = TRUE; + } + + return true; +} + +bool LLAppViewer::initWindow() +{ + llinfos << "Initializing window..." << llendl; + + // store setting in a global for easy access and modification + gNoRender = gSavedSettings.getBOOL("DisableRendering"); + + // Hide the splash screen + LLSplashScreen::hide(); + + // HACK: Need a non-const char * for stupid window name (propagated deep down) + char window_title_str[256]; /* Flawfinder: ignore */ + strncpy(window_title_str, gWindowTitle.c_str(), sizeof(window_title_str) - 1); /* Flawfinder: ignore */ + window_title_str[sizeof(window_title_str) - 1] = '\0'; + + // always start windowed + gViewerWindow = new LLViewerWindow(window_title_str, "Second Life", + gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), + gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), + FALSE, gIgnorePixelDepth); + + if (gSavedSettings.getBOOL("FullScreen")) + { + gViewerWindow->toggleFullscreen(FALSE); + // request to go full screen... which will be delayed until login + } + + if (gSavedSettings.getBOOL("WindowMaximized")) + { + gViewerWindow->mWindow->maximize(); + gViewerWindow->getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio")); + } + + LLUI::sWindow = gViewerWindow->getWindow(); + + LLAlertDialog::parseAlerts("alerts.xml"); + LLNotifyBox::parseNotify("notify.xml"); + + LLMediaEngine::initClass(); + + // + // Clean up the feature manager lookup table - settings were updated + // in the LLViewerWindow constructor + // + gFeatureManagerp->cleanupFeatureTables(); + + // Show watch cursor + gViewerWindow->setCursor(UI_CURSOR_WAIT); + + // Finish view initialization + gViewerWindow->initBase(); + + // show viewer window + gViewerWindow->mWindow->show(); + + return true; +} + +void LLAppViewer::closeDebug() +{ + std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); + llinfos << "Opening debug file " << debug_filename << llendl; + std::ofstream out_file(debug_filename.c_str()); + LLSDSerialize::toPrettyXML(gDebugInfo, out_file); + out_file.close(); +} + +void LLAppViewer::cleanupSavedSettings() +{ + gSavedSettings.setBOOL("MouseSun", FALSE); + + gSavedSettings.setBOOL("FlyBtnState", FALSE); + + gSavedSettings.setBOOL("FirstPersonBtnState", FALSE); + gSavedSettings.setBOOL("ThirdPersonBtnState", TRUE); + gSavedSettings.setBOOL("BuildBtnState", FALSE); + + gSavedSettings.setBOOL("UseEnergy", TRUE); // force toggle to turn off, since sends message to simulator + + gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc); + + gSavedSettings.setBOOL("AllowIdleAFK", gAllowIdleAFK); + gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); + + if (!gNoRender) + { + if (gDebugView) + { + gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible()); + gSavedSettings.setBOOL("ShowDebugStats", gDebugView->mStatViewp->getVisible()); + } + } + + // save window position if not fullscreen + // as we don't track it in callbacks + BOOL fullscreen = gViewerWindow->mWindow->getFullscreen(); + BOOL maximized = gViewerWindow->mWindow->getMaximized(); + if (!fullscreen && !maximized) + { + LLCoordScreen window_pos; + + if (gViewerWindow->mWindow->getPosition(&window_pos)) + { + gSavedSettings.setS32("WindowX", window_pos.mX); + gSavedSettings.setS32("WindowY", window_pos.mY); + } + } + + gSavedSettings.setF32("MapScale", gMapScale ); + gSavedSettings.setF32("MiniMapScale", gMiniMapScale ); + gSavedSettings.setBOOL("AsyncKeyboard", gHandleKeysAsync); + gSavedSettings.setBOOL("ShowHoverTips", LLHoverView::sShowHoverTips); + + // Some things are cached in LLAgent. + if (gAgent.mInitialized) + { + gSavedSettings.setF32("RenderFarClip", gAgent.mDrawDistance); + } + + // *REMOVE: This is now done via LLAppViewer::setCrashBehavior() + // Left vestigially in case I borked it. + // gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); +} + +void LLAppViewer::removeCacheFiles(const char* file_mask) +{ + char mask[LL_MAX_PATH]; /* Flawfinder: ignore */ + snprintf(mask, LL_MAX_PATH, "%s%s", gDirUtilp->getDirDelimiter().c_str(), file_mask); /* Flawfinder: ignore */ + gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "").c_str(), mask); +} + +void LLAppViewer::writeSystemInfo() +{ + gDebugInfo["SLLog"] = LLError::logFileName(); + + gDebugInfo["ClientInfo"]["Name"] = gSecondLife; + gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR; + gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR; + gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; + gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD; + + gDebugInfo["CPUInfo"]["CPUFamily"] = gSysCPU.getFamily(); + gDebugInfo["CPUInfo"]["CPUMhz"] = gSysCPU.getMhz(); + gDebugInfo["CPUInfo"]["CPUAltivec"] = gSysCPU.hasAltivec(); + gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE(); + gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2(); + + gDebugInfo["RAMInfo"] = llformat("%u", gSysMemory.getPhysicalMemoryKB()); + gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); + + // Dump some debugging info + llinfos << gSecondLife + << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH + << llendl; + + // Dump the local time and time zone + time_t now; + time(&now); + char tbuffer[256]; /* Flawfinder: ignore */ + strftime(tbuffer, 256, "%Y-%m-%dT%H:%M:%S %Z", localtime(&now)); + llinfos << "Local time: " << tbuffer << llendl; + + // query some system information + llinfos << "CPU info:\n" << gSysCPU << llendl; + llinfos << "Memory info:\n" << gSysMemory << llendl; + llinfos << "OS: " << getOSInfo().getOSStringSimple() << llendl; + llinfos << "OS info: " << getOSInfo() << llendl; +} + +void LLAppViewer::handleViewerCrash() +{ + LLAppViewer* pApp = LLAppViewer::instance(); + if (pApp->beingDebugged()) + { + // This will drop us into the debugger. + abort(); + } + + // Returns whether a dialog was shown. + // Only do the logic in here once + if (pApp->mReportedCrash) + { + return; + } + pApp->mReportedCrash = TRUE; + + gDebugInfo["SettingsFilename"] = gSettingsFileName; + gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); + gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName().c_str(); + gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath().c_str(); + gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); + + if (gMessageSystem && gDirUtilp) + { + std::string filename; + filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "stats.log"); + llofstream file(filename.c_str(), llofstream::binary); + if(file.good()) + { + gMessageSystem->summarizeLogs(file); + file.close(); + } + } + + if (gMessageSystem) + { + gMessageSystem->getCircuitInfo(gDebugInfo["CircuitInfo"]); + gMessageSystem->stopLogging(); + } + if (gWorldp) + { + gWorldp->getInfo(gDebugInfo); + } + + // Close the debug file + pApp->closeDebug(); + LLError::logToFile(""); + + // Call to pure virtual, handled by platform specifc llappviewer instance. + pApp->handleCrashReporting(); + + return; +} + +void LLAppViewer::setCrashBehavior(S32 cb) +{ + mCrashBehavior = cb; + gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, mCrashBehavior); +} + +bool LLAppViewer::anotherInstanceRunning() +{ + // We create a marker file when the program starts and remove the file when it finishes. + // If the file is currently locked, that means another process is already running. + + std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); + llinfos << "Checking marker file for lock..." << llendl; + + // If file doesn't exist, we create it + // If file does exist, try to get writing privilages + FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore + if (fMarker != NULL) + { + // File exists, try opening with write permissions + fclose(fMarker); + fMarker = LLFile::fopen(marker_file.c_str(), "wb"); // Flawfinder: ignore + if (fMarker == NULL) + { + llinfos << "Marker file is locked." << llendl; + return TRUE; + } + + // *FIX:Mani - rather than have this exception here, + // LLFile::fopen() have consistent behavior across platforms? +#if LL_DARWIN + // Try to lock it. On Mac, this is the only way to test if it's actually locked. + if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) + { + // Lock failed - somebody else has it. + fclose(fMarker); + llinfos << "Marker file is locked." << llendl; + return TRUE; + } +#endif + fclose(fMarker); + } + llinfos << "Marker file isn't locked." << llendl; + return FALSE; + +} + +void LLAppViewer::initMarkerFile() +{ + // *FIX:Mani - an actually cross platform LLFile lib would be nice. + +#if LL_SOLARIS + struct flock fl; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 1; +#endif + // We create a marker file when the program starts and remove the file when it finishes. + // If the file is currently locked, that means another process is already running. + // If the file exists and isn't locked, we crashed on the last run. + + std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); + llinfos << "Checking marker file for lock..." << llendl; + + FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore + if (fMarker != NULL) + { + // File exists, try opening with write permissions + fclose(fMarker); + fMarker = LLFile::fopen(marker_file.c_str(), "wb"); // Flawfinder: ignxore + if (fMarker == NULL) + { + // Another instance is running. Skip the rest of these operations. + llinfos << "Marker file is locked." << llendl; + return; + } +#if LL_DARWIN + // Try to lock it. On Mac, this is the only way to test if it's actually locked. + if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) + { + // Lock failed - somebody else has it. + fclose(fMarker); + llinfos << "Marker file is locked." << llendl; + return; + } +#endif + + // No other instances; we'll lock this file now & delete on quit. + fclose(fMarker); + gLastExecFroze = TRUE; + llinfos << "Exec marker found: program froze on previous execution" << llendl; + } + + // Create the marker file for this execution & lock it +// FILE *fp_executing_marker; +#if LL_WINDOWS + mMarkerFile = LLFile::_fsopen(marker_file.c_str(), "w", _SH_DENYWR); +#else + mMarkerFile = LLFile::fopen(marker_file.c_str(), "w"); // Flawfinder: ignore + if (mMarkerFile) + { + int fd = fileno(mMarkerFile); + // Attempt to lock +#if LL_SOLARIS + fl.l_type = F_WRLCK; + if (fcntl(fd, F_SETLK, &fl) == -1) +#else + if (flock(fd, LOCK_EX | LOCK_NB) == -1) +#endif + { + llinfos << "Failed to lock file." << llendl; + } + } +#endif + if (mMarkerFile) + { + llinfos << "Marker file created." << llendl; + } + else + { + llinfos << "Failed to create marker file." << llendl; + } + +#if LL_WINDOWS + // Clean up SecondLife.dmp files, to avoid confusion + llinfos << "Removing SecondLife.dmp" << llendl; + std::string dmp_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.dmp"); + LLFile::remove(dmp_filename.c_str()); +#endif + + // This is to keep the crash reporter from constantly sending stale message logs + // We wipe the message file now. + llinfos << "Removing message.log" << llendl; + std::string message_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "message.log"); + LLFile::remove(message_filename.c_str()); + + llinfos << "Exiting initMarkerFile()." << llendl; +} + +void LLAppViewer::removeMarkerFile() +{ + llinfos << "removeMarkerFile()" << llendl; + if (mMarkerFile != NULL) + { + fclose(mMarkerFile); + mMarkerFile = NULL; + } + if( gDirUtilp ) + { + LLString marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); + ll_apr_file_remove( marker_file ); + } +} + +void LLAppViewer::forceQuit() +{ + LLApp::setQuitting(); +} + +void LLAppViewer::requestQuit() +{ + llinfos << "requestQuit" << llendl; + + LLViewerRegion* region = gAgent.getRegion(); + + if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) + { + // Quit immediately + forceQuit(); + return; + } + + if (gHUDManager) + { + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + effectp->setPositionGlobal(gAgent.getPositionGlobal()); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + gHUDManager->sendEffects(); + } + + // Attempt to close all floaters that might be + // editing things. + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + + send_stats(); + + gLogoutTimer.reset(); + mQuitRequested = true; +} + +static void finish_quit(S32 option, void *userdata) +{ + if (option == 0) + { + LLAppViewer::instance()->requestQuit(); + } +} + +void LLAppViewer::userQuit() +{ + gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL); +} + +static void finish_early_exit(S32 option, void* userdata) +{ + LLAppViewer::instance()->forceQuit(); +} + +void LLAppViewer::earlyExit(const LLString& msg) +{ + llwarns << "app_early_exit: " << msg << llendl; + gDoDisconnect = TRUE; +// LLStringBase::format_map_t args; +// args["[MESSAGE]"] = mesg; +// gViewerWindow->alertXml("AppEarlyExit", args, finish_early_exit); + LLAlertDialog::showCritical(msg, finish_early_exit, NULL); +} + +void LLAppViewer::forceExit(S32 arg) +{ + removeMarkerFile(); + + // *FIX:Mani - This kind of exit hardly seems appropriate. + exit(arg); +} + +void LLAppViewer::abortQuit() +{ + llinfos << "abortQuit()" << llendl; + mQuitRequested = false; +} + +bool LLAppViewer::initCache() +{ + mPurgeCache = false; + // Purge cache if user requested it + if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || + gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) + { + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); + mPurgeCache = true; + } + // Purge cache if it belongs to an old version + else + { + static const S32 cache_version = 5; + if (gSavedSettings.getS32("LocalCacheVersion") != cache_version) + { + mPurgeCache = true; + gSavedSettings.setS32("LocalCacheVersion", cache_version); + } + } + + // Setup and verify the cache location + LLString cache_location = gSavedSettings.getString("CacheLocation"); + LLString new_cache_location = gSavedSettings.getString("NewCacheLocation"); + if (new_cache_location != cache_location) + { + gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); + purgeCache(); // purge old cache + gSavedSettings.setString("CacheLocation", new_cache_location); + } + + if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"))) + { + llwarns << "Unable to set cache location" << llendl; + gSavedSettings.setString("CacheLocation", ""); + } + + if (mPurgeCache) + { + LLSplashScreen::update("Clearing cache..."); + purgeCache(); + } + + LLSplashScreen::update("Initializing Texture Cache..."); + + // Init the texture cache + // Allocate 80% of the cache size for textures + BOOL read_only = mSecondInstance ? true : false; + const S32 MB = 1024*1024; + S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; + const S64 MAX_CACHE_SIZE = 1024*MB; + cache_size = llmin(cache_size, MAX_CACHE_SIZE); + S64 texture_cache_size = ((cache_size * 8)/10); + S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, read_only); + texture_cache_size -= extra; + + LLSplashScreen::update("Initializing VFS..."); + + // Init the VFS + S64 vfs_size = cache_size - texture_cache_size; + const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB + vfs_size = llmin(vfs_size, MAX_VFS_SIZE); + vfs_size = (vfs_size / MB) * MB; // make sure it is MB aligned + U32 vfs_size_u32 = (U32)vfs_size; + U32 old_vfs_size = gSavedSettings.getU32("VFSOldSize") * MB; + bool resize_vfs = (vfs_size_u32 != old_vfs_size); + if (resize_vfs) + { + gSavedSettings.setU32("VFSOldSize", vfs_size_u32/MB); + } + llinfos << "VFS CACHE SIZE: " << vfs_size/(1024*1024) << " MB" << llendl; + + // This has to happen BEFORE starting the vfs + //time_t ltime; + srand(time(NULL)); // Flawfinder: ignore + U32 old_salt = gSavedSettings.getU32("VFSSalt"); + U32 new_salt; + char old_vfs_data_file[LL_MAX_PATH]; // Flawfinder: ignore + char old_vfs_index_file[LL_MAX_PATH]; // Flawfinder: ignore + char new_vfs_data_file[LL_MAX_PATH]; // Flawfinder: ignore + char new_vfs_index_file[LL_MAX_PATH]; // Flawfinder: ignore + char static_vfs_index_file[LL_MAX_PATH]; // Flawfinder: ignore + char static_vfs_data_file[LL_MAX_PATH]; // Flawfinder: ignore + + if (gMultipleViewersOK) + { + // don't mess with renaming the VFS in this case + new_salt = old_salt; + } + else + { + do + { + new_salt = rand(); + } while( new_salt == old_salt ); + } + + snprintf(old_vfs_data_file, LL_MAX_PATH, "%s%u", // Flawfinder: ignore + gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(), + old_salt); + + // make sure this file exists + llstat s; + S32 stat_result = LLFile::stat(old_vfs_data_file, &s); + if (stat_result) + { + // doesn't exist, look for a data file + std::string mask; + mask = gDirUtilp->getDirDelimiter(); + mask += VFS_DATA_FILE_BASE; + mask += "*"; + + std::string dir; + dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""); + + std::string found_file; + if (gDirUtilp->getNextFileInDir(dir, mask, found_file, false)) + { + snprintf(old_vfs_data_file, LL_MAX_PATH, "%s%s%s", dir.c_str(), gDirUtilp->getDirDelimiter().c_str(), found_file.c_str()); // Flawfinder: ignore + + S32 start_pos; + S32 length = strlen(found_file.c_str()); /* Flawfinder: ignore*/ + for (start_pos = length - 1; start_pos >= 0; start_pos--) + { + if (found_file[start_pos] == '.') + { + start_pos++; + break; + } + } + if (start_pos > 0) + { + sscanf(found_file.c_str() + start_pos, "%d", &old_salt); + } + llinfos << "Default vfs data file not present, found " << old_vfs_data_file << llendl; + llinfos << "Old salt: " << old_salt << llendl; + } + } + + snprintf(old_vfs_index_file, LL_MAX_PATH, "%s%u", // Flawfinder: ignore + gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_INDEX_FILE_BASE).c_str(), + old_salt); + + stat_result = LLFile::stat(old_vfs_index_file, &s); + if (stat_result) + { + // We've got a bad/missing index file, nukem! + llwarns << "Bad or missing vfx index file " << old_vfs_index_file << llendl; + llwarns << "Removing old vfs data file " << old_vfs_data_file << llendl; + LLFile::remove(old_vfs_data_file); + LLFile::remove(old_vfs_index_file); + + // Just in case, nuke any other old cache files in the directory. + std::string dir; + dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""); + + std::string mask; + mask = gDirUtilp->getDirDelimiter(); + mask += VFS_DATA_FILE_BASE; + mask += "*"; + + gDirUtilp->deleteFilesInDir(dir, mask); + + mask = gDirUtilp->getDirDelimiter(); + mask += VFS_INDEX_FILE_BASE; + mask += "*"; + + gDirUtilp->deleteFilesInDir(dir, mask); + } + + snprintf(new_vfs_data_file, LL_MAX_PATH, "%s%u", // Flawfinder: ignore + gDirUtilp->getExpandedFilename(LL_PATH_CACHE,VFS_DATA_FILE_BASE).c_str(), + new_salt); + + snprintf(new_vfs_index_file, LL_MAX_PATH, "%s%u", gDirUtilp->getExpandedFilename(LL_PATH_CACHE, VFS_INDEX_FILE_BASE).c_str(), // Flawfinder: ignore + new_salt); + + + strncpy(static_vfs_data_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_data.db2").c_str(), LL_MAX_PATH -1); // Flawfinder: ignore + static_vfs_data_file[LL_MAX_PATH -1] = '\0'; + strncpy(static_vfs_index_file, gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"static_index.db2").c_str(), LL_MAX_PATH -1); // Flawfinder: ignore + static_vfs_index_file[LL_MAX_PATH -1] = '\0'; + + if (resize_vfs) + { + llinfos << "Removing old vfs and re-sizing" << llendl; + + LLFile::remove(old_vfs_data_file); + LLFile::remove(old_vfs_index_file); + } + else if (old_salt != new_salt) + { + // move the vfs files to a new name before opening + llinfos << "Renaming " << old_vfs_data_file << " to " << new_vfs_data_file << llendl; + llinfos << "Renaming " << old_vfs_index_file << " to " << new_vfs_index_file << llendl; + LLFile::rename(old_vfs_data_file, new_vfs_data_file); + LLFile::rename(old_vfs_index_file, new_vfs_index_file); + } + + // Startup the VFS... + gSavedSettings.setU32("VFSSalt", new_salt); + + // Don't remove VFS after viewer crashes. If user has corrupt data, they can reinstall. JC + gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); + if( VFSVALID_BAD_CORRUPT == gVFS->getValidState() ) + { + // Try again with fresh files + // (The constructor deletes corrupt files when it finds them.) + llwarns << "VFS corrupt, deleted. Making new VFS." << llendl; + delete gVFS; + gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); + } + + gStaticVFS = new LLVFS(static_vfs_index_file, static_vfs_data_file, true, 0, false); + + BOOL success = gVFS->isValid() && gStaticVFS->isValid(); + if( !success ) + { + return false; + } + else + { + LLVFile::initClass(); + return true; + } +} + +void LLAppViewer::purgeCache() +{ + llinfos << "Purging Texture Cache..." << llendl; + LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); + llinfos << "Purging Cache..." << llendl; + std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; + gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); +} + +const LLString& LLAppViewer::getSecondLifeTitle() const +{ + return gSecondLife; +} + +const LLString& LLAppViewer::getWindowTitle() const +{ + return gWindowTitle; +} + +void LLAppViewer::resetURIs() const +{ + // Clear URIs when picking a new server + gLoginURIs.clear(); + gHelperURI.clear(); +} + +const std::vector& LLAppViewer::getLoginURIs() const +{ + if (gLoginURIs.empty()) + { + // not specified on the command line, use value from table + gLoginURIs = LLSRV::rewriteURI(gGridInfo[gGridChoice].mLoginURI); + } + return gLoginURIs; +} + +const std::string& LLAppViewer::getHelperURI() const +{ + if (gHelperURI.empty()) + { + // not specified on the command line, use value from table + gHelperURI = gGridInfo[gGridChoice].mHelperURI; + } + return gHelperURI; +} + +void LLAppViewer::addLoginURI(const std::string& uri) +{ + gLoginURIs.push_back(uri); +} + +void LLAppViewer::setHelperURI(const std::string& uri) +{ + gHelperURI = uri; +} + +// Callback from a dialog indicating user was logged out. +void finish_disconnect(S32 option, void* userdata) +{ + if (1 == option) + { + LLAppViewer::instance()->forceQuit(); + } +} + +// Callback from an early disconnect dialog, force an exit +void finish_forced_disconnect(S32 /* option */, void* /* userdata */) +{ + LLAppViewer::instance()->forceQuit(); +} + + +void LLAppViewer::forceDisconnect(const LLString& mesg) +{ + if (gDoDisconnect) + { + // Already popped up one of these dialogs, don't + // do this again. + return; + } + + // Translate the message if possible + LLString big_reason = LLAgent::sTeleportErrorMessages[mesg]; + if ( big_reason.size() == 0 ) + { + big_reason = mesg; + } + + LLStringBase::format_map_t args; + gDoDisconnect = TRUE; + + if (LLStartUp::getStartupState() < STATE_STARTED) + { + // Tell users what happened + args["[ERROR_MESSAGE]"] = big_reason; + gViewerWindow->alertXml("ErrorMessage", args, finish_forced_disconnect); + } + else + { + args["[MESSAGE]"] = big_reason; + gViewerWindow->alertXml("YouHaveBeenLoggedOut", args, finish_disconnect ); + } +} + +void LLAppViewer::badNetworkHandler() +{ + // Dump the packet + gMessageSystem->dumpPacketToLog(); + + // Flush all of our caches on exit in the case of disconnect due to + // invalid packets. + + mPurgeOnExit = TRUE; + +#if LL_WINDOWS + // Generates the minidump. + LLWinDebug::handleException(NULL); +#endif + LLAppViewer::handleViewerCrash(); + + std::ostringstream message; + message << + "The viewer has detected mangled network data indicative\n" + "of a bad upstream network connection or an incomplete\n" + "local installation of " << LLAppViewer::instance()->getSecondLifeTitle() << ". \n" + " \n" + "Try uninstalling and reinstalling to see if this resolves \n" + "the issue. \n" + " \n" + "If the problem continues, see the Tech Support FAQ at: \n" + "www.secondlife.com/support"; + forceDisconnect(message.str()); +} + +// This routine may get called more than once during the shutdown process. +// This can happen because we need to get the screenshot before the window +// is destroyed. +void LLAppViewer::saveFinalSnapshot() +{ + if (!mSavedFinalSnapshot && !gNoRender) + { + gSavedSettings.setVector3d("FocusPosOnLogout", gAgent.calcFocusPositionTargetGlobal()); + gSavedSettings.setVector3d("CameraPosOnLogout", gAgent.calcCameraPositionTargetGlobal()); + gViewerWindow->setCursor(UI_CURSOR_WAIT); + gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch + gSavedSettings.setBOOL("ShowParcelOwners", FALSE); + idle(); + + LLString snap_filename = gDirUtilp->getLindenUserDir(); + snap_filename += gDirUtilp->getDirDelimiter(); + snap_filename += SCREEN_LAST_FILENAME; + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE); + mSavedFinalSnapshot = TRUE; + } +} + +void LLAppViewer::loadNameCache() +{ + if (!gCacheName) return; + + std::string name_cache; + name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); + FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "r"); // Flawfinder: ignore + if (name_cache_fp) + { + gCacheName->importFile(name_cache_fp); + fclose(name_cache_fp); + } +} + +void LLAppViewer::saveNameCache() +{ + if (!gCacheName) return; + + std::string name_cache; + name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); + FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "w"); // Flawfinder: ignore + if (name_cache_fp) + { + gCacheName->exportFile(name_cache_fp); + fclose(name_cache_fp); + } +} + +/*! @brief This class is an LLFrameTimer that can be created with + an elapsed time that starts counting up from the given value + rather than 0.0. + + Otherwise it behaves the same way as LLFrameTimer. +*/ +class LLFrameStatsTimer : public LLFrameTimer +{ +public: + LLFrameStatsTimer(F64 elapsed_already = 0.0) + : LLFrameTimer() + { + mStartTime -= elapsed_already; + } +}; + +/////////////////////////////////////////////////////// +// idle() +// +// Called every time the window is not doing anything. +// Receive packets, update statistics, and schedule a redisplay. +/////////////////////////////////////////////////////// +void LLAppViewer::idle() +{ + // Update frame timers + static LLTimer idle_timer; + + LLControlBase::updateAllListeners(); + + LLFrameTimer::updateFrameTime(); + LLEventTimer::updateClass(); + LLCriticalDamp::updateInterpolants(); + LLMortician::updateClass(); + F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); + + // Cap out-of-control frame times + // Too low because in menus, swapping, debugger, etc. + // Too high because idle called with no objects in view, etc. + const F32 MIN_FRAME_RATE = 1.f; + const F32 MAX_FRAME_RATE = 200.f; + + F32 frame_rate_clamped = 1.f / dt_raw; + frame_rate_clamped = llclamp(frame_rate_clamped, MIN_FRAME_RATE, MAX_FRAME_RATE); + gFrameDTClamped = 1.f / frame_rate_clamped; + + // Global frame timer + // Smoothly weight toward current frame + gFPSClamped = (frame_rate_clamped + (4.f * gFPSClamped)) / 5.f; + + if (gQuitAfterSeconds > 0.f) + { + if (gRenderStartTime.getElapsedTimeF32() > gQuitAfterSeconds) + { + LLAppViewer::instance()->forceQuit(); + } + } + + // Must wait until both have avatar object and mute list, so poll + // here. + request_initial_instant_messages(); + + /////////////////////////////////// + // + // Special case idle if still starting up + // + + if (LLStartUp::getStartupState() < STATE_STARTED) + { + // Skip rest if idle startup returns false (essentially, no world yet) + if (!idle_startup()) + { + return; + } + } + + + F32 yaw = 0.f; // radians + + if (!gDisconnected) + { + LLFastTimer t(LLFastTimer::FTM_NETWORK); + + // Update spaceserver timeinfo + gWorldp->setSpaceTimeUSec(gWorldp->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); + + + ////////////////////////////////////// + // + // Update simulator agent state + // + + if (gRotateRight) + { + gAgent.moveYaw(-1.f); + } + + // Handle automatic walking towards points + gAgentPilot.updateTarget(); + gAgent.autoPilot(&yaw); + + static LLFrameTimer agent_update_timer; + static U32 last_control_flags; + + // When appropriate, update agent location to the simulator. + F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); + BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags()); + + if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) + { + // Send avatar and camera info + last_control_flags = gAgent.getControlFlags(); + send_agent_update(TRUE); + agent_update_timer.reset(); + } + } + + ////////////////////////////////////// + // + // Manage statistics + // + // + + { + // Initialize the viewer_stats_timer with an already elapsed time + // of SEND_STATS_PERIOD so that the initial stats report will + // be sent immediately. + static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD); + reset_statistics(); + + // Update session stats every large chunk of time + // *FIX: (???) SAMANTHA + if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected) + { + llinfos << "Transmitting sessions stats" << llendl; + send_stats(); + viewer_stats_timer.reset(); + } + + // Print the object debugging stats + static LLFrameTimer object_debug_timer; + if (object_debug_timer.getElapsedTimeF32() > 5.f) + { + object_debug_timer.reset(); + if (gObjectList.mNumDeadObjectUpdates) + { + llinfos << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << llendl; + gObjectList.mNumDeadObjectUpdates = 0; + } + if (gObjectList.mNumUnknownKills) + { + llinfos << "Kills on unknown objects: " << gObjectList.mNumUnknownKills << llendl; + gObjectList.mNumUnknownKills = 0; + } + if (gObjectList.mNumUnknownUpdates) + { + llinfos << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << llendl; + gObjectList.mNumUnknownUpdates = 0; + } + } + gFrameStats.addFrameData(); + } + + if (!gDisconnected) + { + LLFastTimer t(LLFastTimer::FTM_NETWORK); + + //////////////////////////////////////////////// + // + // Network processing + // + // NOTE: Starting at this point, we may still have pointers to "dead" objects + // floating throughout the various object lists. + // + + gFrameStats.start(LLFrameStats::IDLE_NETWORK); + idleNetwork(); + stop_glerror(); + + gFrameStats.start(LLFrameStats::AGENT_MISC); + + // Check for away from keyboard, kick idle agents. + idle_afk_check(); + + // Update statistics for this frame + update_statistics(gFrameCount); + + gViewerWindow->updateDebugText(); + } + + //////////////////////////////////////// + // + // Handle the regular UI idle callbacks as well as + // hover callbacks + // + + { +// LLFastTimer t(LLFastTimer::FTM_IDLE_CB); + + // Do event notifications if necessary. Yes, we may want to move this elsewhere. + gEventNotifier.update(); + + gIdleCallbacks.callFunctions(); + } + + if (gDisconnected) + { + return; + } + + gViewerWindow->handlePerFrameHover(); + + /////////////////////////////////////// + // Agent and camera movement + // + LLCoordGL current_mouse = gViewerWindow->getCurrentMouse(); + +// BOOL was_in_prelude = gAgent.inPrelude(); + + { + //LLFastTimer t(LLFastTimer::FTM_TEMP1); + + // After agent and camera moved, figure out if we need to + // deselect objects. + gSelectMgr->deselectAllIfTooFar(); + + } + + { + LLFastTimer t(LLFastTimer::FTM_RESET_DRAWORDER); + + ////////////////////////////////////////////// + // + // Clear draw orders + // + // Should actually be done after render, but handlePerFrameHover actually does a "render" + // to do its selection. + // + + gPipeline.resetDrawOrders(); + } + { + // Handle pending gesture processing + gGestureManager.update(); + + gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY); + } + + { + LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update" + gFrameStats.start(LLFrameStats::OBJECT_UPDATE); + + if (!(logoutRequestSent() && hasSavedFinalSnapshot())) + { + gObjectList.update(gAgent, *gWorldp); + } + } + + { + LLFastTimer t(LLFastTimer::FTM_UPDATE_SKY); + gSky.updateSky(); + } + + ////////////////////////////////////// + // + // Deletes objects... + // Has to be done after doing idleUpdates (which can kill objects) + // + + { + LLFastTimer t(LLFastTimer::FTM_CLEANUP); + gFrameStats.start(LLFrameStats::CLEAN_DEAD); + gObjectList.cleanDeadObjects(); + LLDrawable::cleanupDeadDrawables(); + } + + // + // After this point, in theory we should never see a dead object + // in the various object/drawable lists. + // + + ////////////////////////////////////// + // + // Update/send HUD effects + // + // At this point, HUD effects may clean up some references to + // dead objects. + // + + { + //LLFastTimer t(LLFastTimer::FTM_TEMP3); + + gFrameStats.start(LLFrameStats::UPDATE_EFFECTS); + gSelectMgr->updateEffects(); + gHUDManager->cleanupEffects(); + gHUDManager->sendEffects(); + } + + stop_glerror(); + + //////////////////////////////////////// + // + // Unpack layer data that we've received + // + + { + LLFastTimer t(LLFastTimer::FTM_NETWORK); + gVLManager.unpackData(); + } + + ///////////////////////// + // + // Update surfaces, and surface textures as well. + // + + gWorldp->updateVisibilities(); + { + const F32 max_region_update_time = .001f; // 1ms + LLFastTimer t(LLFastTimer::FTM_REGION_UPDATE); + gWorldp->updateRegions(max_region_update_time); + } + + ///////////////////////// + // + // Update weather effects + // + + if (!gNoRender) + { + gWorldp->updateClouds(gFrameDTClamped); + gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets + + // Update wind vector + LLVector3 wind_position_region; + static LLVector3 average_wind; + + LLViewerRegion *regionp; + regionp = gWorldp->resolveRegionGlobal(wind_position_region, gAgent.getPositionGlobal()); // puts agent's local coords into wind_position + if (regionp) + { + gWindVec = regionp->mWind.getVelocity(wind_position_region); + + // Compute average wind and use to drive motion of water + + average_wind = regionp->mWind.getAverage(); + F32 cloud_density = regionp->mCloudLayer.getDensityRegion(wind_position_region); + + gSky.setCloudDensityAtAgent(cloud_density); + gSky.setWind(average_wind); + //LLVOWater::setWind(average_wind); + } + else + { + gWindVec.setVec(0.0f, 0.0f, 0.0f); + } + } + stop_glerror(); + + ////////////////////////////////////// + // + // Update images, using the image stats generated during object update/culling + // + // Can put objects onto the retextured list. + // + gFrameStats.start(LLFrameStats::IMAGE_UPDATE); + + LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE); + + LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(), + gCamera->getAngularVelocityStat()->getMean()); + + gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first. + + const F32 max_image_decode_time = 0.005f; // 5 ms decode time + gImageList.updateImages(max_image_decode_time); + stop_glerror(); + + ////////////////////////////////////// + // + // Sort and cull in the new renderer are moved to pipeline.cpp + // Here, particles are updated and drawables are moved. + // + + if (!gNoRender) + { + gFrameStats.start(LLFrameStats::UPDATE_MOVE); + gPipeline.updateMove(); + + gFrameStats.start(LLFrameStats::UPDATE_PARTICLES); + gWorldp->updateParticles(); + } + stop_glerror(); + + if (!LLViewerJoystick::sOverrideCamera) + { + gAgent.updateCamera(); + } + else + { + LLViewerJoystick::updateCamera(); + } + + // objects and camera should be in sync, do LOD calculations now + { + LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE); + gObjectList.updateApparentAngles(gAgent); + } + + { + gFrameStats.start(LLFrameStats::AUDIO); + LLFastTimer t(LLFastTimer::FTM_AUDIO_UPDATE); + + if (gAudiop) + { + audio_update_volume(false); + audio_update_listener(); + audio_update_wind(false); + + // this line actually commits the changes we've made to source positions, etc. + const F32 max_audio_decode_time = 0.002f; // 2 ms decode time + gAudiop->idle(max_audio_decode_time); + } + } + + // Handle shutdown process, for example, + // wait for floaters to close, send quit message, + // forcibly quit if it has taken too long + if (mQuitRequested) + { + idleShutdown(); + } + + stop_glerror(); +} + +void LLAppViewer::idleShutdown() +{ + // Wait for all modal alerts to get resolved + if (LLModalDialog::activeCount() > 0) + { + return; + } + + // close IM interface + if(gIMMgr) + { + gIMMgr->disconnectAllSessions(); + } + + // Wait for all floaters to get resolved + if (gFloaterView + && !gFloaterView->allChildrenClosed()) + { + return; + } + + static bool saved_snapshot = false; + if (!saved_snapshot) + { + saved_snapshot = true; + saveFinalSnapshot(); + return; + } + + const F32 SHUTDOWN_UPLOAD_SAVE_TIME = 5.f; + + S32 pending_uploads = gAssetStorage->getNumPendingUploads(); + if (pending_uploads > 0 + && gLogoutTimer.getElapsedTimeF32() < SHUTDOWN_UPLOAD_SAVE_TIME + && !logoutRequestSent()) + { + static S32 total_uploads = 0; + // Sometimes total upload count can change during logout. + total_uploads = llmax(total_uploads, pending_uploads); + gViewerWindow->setShowProgress(TRUE); + S32 finished_uploads = total_uploads - pending_uploads; + F32 percent = 100.f * finished_uploads / total_uploads; + gViewerWindow->setProgressPercent(percent); + char buffer[MAX_STRING]; // Flawfinder: ignore + snprintf(buffer, MAX_STRING, "Saving final data..."); // Flawfinder: ignore + gViewerWindow->setProgressString(buffer); + return; + } + + // All floaters are closed. Tell server we want to quit. + if( !logoutRequestSent() ) + { + sendLogoutRequest(); + + // Wait for a LogoutReply message + gViewerWindow->setShowProgress(TRUE); + gViewerWindow->setProgressPercent(100.f); + gViewerWindow->setProgressString("Logging out..."); + return; + } + + // Make sure that we quit if we haven't received a reply from the server. + if( logoutRequestSent() + && gLogoutTimer.getElapsedTimeF32() > gLogoutMaxTime ) + { + forceQuit(); + return; + } +} + +void LLAppViewer::sendLogoutRequest() +{ + if(!mLogoutRequestSent) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_LogoutRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + + gLogoutTimer.reset(); + gLogoutMaxTime = LOGOUT_REQUEST_TIME; + mLogoutRequestSent = TRUE; + + gVoiceClient->leaveChannel(); + } +} + +// +// Handle messages, and all message related stuff +// + +#define TIME_THROTTLE_MESSAGES + +#ifdef TIME_THROTTLE_MESSAGES +#define CHECK_MESSAGES_DEFAULT_MAX_TIME .020f // 50 ms = 50 fps (just for messages!) +static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; +#endif + +void LLAppViewer::idleNetwork() +{ + gObjectList.mNumNewObjects = 0; + S32 total_decoded = 0; + + if (!gSavedSettings.getBOOL("SpeedTest")) + { + LLFastTimer t(LLFastTimer::FTM_IDLE_NETWORK); // decode + + // deal with any queued name requests and replies. + gCacheName->processPending(); + + LLTimer check_message_timer; + // Read all available packets from network + stop_glerror(); + const S64 frame_count = gFrameCount; // U32->S64 + F32 total_time = 0.0f; + while (gMessageSystem->checkAllMessages(frame_count, gServicePump)) + { + if (gDoDisconnect) + { + // We're disconnecting, don't process any more messages from the server + // We're usually disconnecting due to either network corruption or a + // server going down, so this is OK. + break; + } + stop_glerror(); + + total_decoded++; + gPacketsIn++; + + if (total_decoded > MESSAGE_MAX_PER_FRAME) + { + break; + } + +#ifdef TIME_THROTTLE_MESSAGES + // Prevent slow packets from completely destroying the frame rate. + // This usually happens due to clumps of avatars taking huge amount + // of network processing time (which needs to be fixed, but this is + // a good limit anyway). + total_time = check_message_timer.getElapsedTimeF32(); + if (total_time >= CheckMessagesMaxTime) + break; +#endif + } + // Handle per-frame message system processing. + gMessageSystem->processAcks(); + +#ifdef TIME_THROTTLE_MESSAGES + if (total_time >= CheckMessagesMaxTime) + { + // Increase CheckMessagesMaxTime so that we will eventually catch up + CheckMessagesMaxTime *= 1.035f; // 3.5% ~= x2 in 20 frames, ~8x in 60 frames + } + else + { + // Reset CheckMessagesMaxTime to default value + CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; + } +#endif + + + + // we want to clear the control after sending out all necessary agent updates + gAgent.resetControlFlags(); + stop_glerror(); + + + // Decode enqueued messages... + S32 remaining_possible_decodes = MESSAGE_MAX_PER_FRAME - total_decoded; + + if( remaining_possible_decodes <= 0 ) + { + llinfos << "Maxed out number of messages per frame at " << MESSAGE_MAX_PER_FRAME << llendl; + } + + if (gPrintMessagesThisFrame) + { + llinfos << "Decoded " << total_decoded << " msgs this frame!" << llendl; + gPrintMessagesThisFrame = FALSE; + } + } + + gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); + + // Retransmit unacknowledged packets. + gXferManager->retransmitUnackedPackets(); + gAssetStorage->checkForTimeouts(); + + gViewerThrottle.updateDynamicThrottle(); +} + +void LLAppViewer::disconnectViewer() +{ + if (gDisconnected) + { + return; + } + // + // Cleanup after quitting. + // + // Save snapshot for next time, if we made it through initialization + + llinfos << "Disconnecting viewer!" << llendl; + + // Dump our frame statistics + gFrameStats.dump(); + + // Remember if we were flying + gSavedSettings.setBOOL("FlyingAtExit", gAgent.getFlying() ); + + // Un-minimize all windows so they don't get saved minimized + if (!gNoRender) + { + if (gFloaterView) + { + gFloaterView->restoreAll(); + } + } + + if (gSelectMgr) + { + gSelectMgr->deselectAll(); + } + + if (!gNoRender) + { + // save inventory if appropriate + gInventory.cache(gAgent.getInventoryRootID(), gAgent.getID()); + if(gInventoryLibraryRoot.notNull() && gInventoryLibraryOwner.notNull()) + { + gInventory.cache(gInventoryLibraryRoot, gInventoryLibraryOwner); + } + } + + saveNameCache(); + + // close inventory interface, close all windows + LLInventoryView::cleanup(); + + // Also writes cached agent settings to gSavedSettings + gAgent.cleanup(); + + gObjectList.destroy(); + delete gWorldp; + gWorldp = NULL; + + cleanup_xfer_manager(); + gDisconnected = TRUE; +} + +void LLAppViewer::forceErrorLLError() +{ + llerrs << "This is an llerror" << llendl; +} + +void LLAppViewer::forceErrorBreakpoint() +{ +#ifdef LL_WINDOWS + DebugBreak(); +#endif + return; +} + +void LLAppViewer::forceErrorBadMemoryAccess() +{ + S32* crash = NULL; + *crash = 0xDEADBEEF; + return; +} + +void LLAppViewer::forceErrorInifiniteLoop() +{ + while(true) + { + ; + } + return; +} + +void LLAppViewer::forceErrorSoftwareException() +{ + // *FIX: Any way to insure it won't be handled? + throw; +} diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h new file mode 100644 index 0000000..e97aead --- /dev/null +++ b/linden/indra/newview/llappviewer.h @@ -0,0 +1,294 @@ +/** + * @file llappviewer.h + * @brief The LLAppViewer class declaration + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPVIEWER_H +#define LL_LLAPPVIEWER_H + +class LLTextureCache; +class LLWorkerThread; +class LLTextureFetch; + +class LLAppViewer : public LLApp +{ +public: + LLAppViewer(); + virtual ~LLAppViewer(); + + // *NOTE:Mani - Don't use this! + // Having + static LLAppViewer* instance() {return sInstance; } + + // + // Main application logic + // + virtual bool init(); // Override to do application initialization + virtual bool cleanup(); // Override to do application cleanup + virtual bool mainLoop(); // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit. + + // Application control + void forceQuit(); // Puts the viewer into 'shutting down without error' mode. + void requestQuit(); // Request a quit. A kinder, gentler quit. + void userQuit(); // The users asks to quit. Confirm, then requestQuit() + void earlyExit(const LLString& msg); // Display an error dialog and forcibly quit. + void forceExit(S32 arg); // exit() immediately (after some cleanup). + void abortQuit(); // Called to abort a quit request. + + bool quitRequested() { return mQuitRequested; } + bool logoutRequestSent() { return mLogoutRequestSent; } + + // *FIX: This is meant to stay only until the command line issues are hashed out with repect to LLApp::parseCommandLine + // This version stores the argc and argv for later usage, make sure the params passed in last as long as this class. + bool tempStoreCommandOptions(int argc, char** argv); + + void closeDebug(); + + const LLOSInfo& getOSInfo() const { return mSysOSInfo; } + + // Report true if under the control of a debugger. A null-op default. + virtual bool beingDebugged() { return false; } + + S32 getCrashBehavior() const { return mCrashBehavior; } + void setCrashBehavior(S32 cb); + virtual void handleCrashReporting() = 0; // What to do with crash report? + static void handleViewerCrash(); // Hey! The viewer crashed. Do this. + + // Thread accessors + static LLTextureCache* getTextureCache() { return sTextureCache; } + static LLWorkerThread* getImageDecodeThread() { return sImageDecodeThread; } + static LLTextureFetch* getTextureFetch() { return sTextureFetch; } + + const std::string& getSerialNumber() { return mSerialNumber; } + + // *FIX:Mani purgeCache was made public for parse_args(). + // If that beast is gone, make it private. + void purgeCache(); // Clear the local cache. + bool getPurgeCache() const { return mPurgeCache; } + + const LLString& getSecondLifeTitle() const; // The Second Life title. + const LLString& getWindowTitle() const; // The window display name. + + // Helpers for URIs + void addLoginURI(const std::string& uri); + void setHelperURI(const std::string& uri); + const std::vector& getLoginURIs() const; + const std::string& getHelperURI() const; + void resetURIs() const; + + void forceDisconnect(const LLString& msg); // Force disconnection, with a message to the user. + void badNetworkHandler(); // Cause a crash state due to bad network packet. + + bool hasSavedFinalSnapshot() { return mSavedFinalSnapshot; } + void saveFinalSnapshot(); + + void loadNameCache(); + void saveNameCache(); + + // LLAppViewer testing helpers. + // *NOTE: These will potentially crash the viewer. Only for debugging. + virtual void forceErrorLLError(); + virtual void forceErrorBreakpoint(); + virtual void forceErrorBadMemoryAccess(); + virtual void forceErrorInifiniteLoop(); + virtual void forceErrorSoftwareException(); + +protected: + virtual bool initWindow(); // Initialize the viewer's window. + virtual bool initLogging(); // Initialize log files, logging system, return false on failure. + virtual bool initHardwareTest() { return true; } // A false result indicates the app should quit. + + virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. + + +private: + + bool initEarlyConfiguration(); // Initialize setting needed by crash reporting. + bool initThreads(); // Initialize viewer threads, return false on failure. + bool initConfiguration(); // Initialize settings from the command line/config file. + + bool initCache(); // Initialize local client cache. + + bool doConfigFromCommandLine(); // calls parse args. + + void cleanupSavedSettings(); // Sets some config data to current or default values during cleanup. + void removeCacheFiles(const char *filemask); // Deletes cached files the match the given wildcard. + + void writeSystemInfo(); // Write system info to "debug_info.log" + + bool anotherInstanceRunning(); + void initMarkerFile(); + void removeMarkerFile(); + + void idle(); + void idleShutdown(); + void idleNetwork(); + + void sendLogoutRequest(); + void disconnectViewer(); + + // *FIX: the app viewer class should be some sort of singleton, no? + // Perhaps its child class is the singleton and this should be an abstract base. + static LLAppViewer* sInstance; + + bool mSecondInstance; // Is this a second instance of the app? + + FILE *mMarkerFile; // A file created to indicate the app is running. + bool mLastExecFroze; // Set on init if the marker file was found. + + LLOSInfo mSysOSInfo; + S32 mCrashBehavior; + bool mReportedCrash; + + // Thread objects. + static LLTextureCache* sTextureCache; + static LLWorkerThread* sImageDecodeThread; + static LLTextureFetch* sTextureFetch; + + S32 mNumSessions; + + std::string mSerialNumber; + bool mPurgeCache; + bool mPurgeOnExit; + + bool mSavedFinalSnapshot; + + bool mQuitRequested; // User wants to quit, may have modified documents open. + bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. +}; + +// consts from viewer.h +const S32 AGENT_UPDATES_PER_SECOND = 10; + +// Globals with external linkage. From viewer.h +// *NOTE:Mani - These will be removed as the Viewer App Cleanup project continues. +// +// "// llstartup" indicates that llstartup is the only client for this global. + +extern bool gVerifySSLCert; // parse_args setting used by llxmlrpctransaction.cpp +extern BOOL gHandleKeysAsync; // gSavedSettings used by llviewerdisplay.cpp & llviewermenu.cpp +extern BOOL gProbeHardware; +extern LLString gDisabledMessage; // llstartup +extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup +extern BOOL gInProductionGrid; +extern LLSD gDebugInfo; + +extern BOOL gAllowIdleAFK; +extern F32 gAFKTimeout; +extern BOOL gShowObjectUpdates; + +extern BOOL gLogMessages; // llstartup +extern std::string gChannelName; +extern BOOL gUseAudio; // llstartup + +extern LLString gCmdLineFirstName; // llstartup +extern LLString gCmdLineLastName; +extern LLString gCmdLinePassword; + +extern BOOL gAutoLogin; // llstartup +extern const char* DEFAULT_SETTINGS_FILE; // llstartup + +extern BOOL gRequestInventoryLibrary; // llstartup +extern BOOL gGodConnect; // llstartup + +extern BOOL gAcceptTOS; +extern BOOL gAcceptCriticalMessage; + +extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. +extern BOOL gLastExecFroze; // llstartup + +extern U32 gFrameCount; +extern U32 gForegroundFrameCount; + +extern LLPumpIO* gServicePump; + +// Is the Pacific time zone (aka server time zone) +// currently in daylight savings time? +extern BOOL gPacificDaylightTime; + +extern U64 gFrameTime; // The timestamp of the most-recently-processed frame +extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours... +extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds +extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame +extern F32 gFrameDTClamped; +extern U64 gStartTime; + +extern LLTimer gRenderStartTime; +extern LLFrameTimer gForegroundTime; + +extern F32 gLogoutMaxTime; +extern LLTimer gLogoutTimer; + +extern F32 gSimLastTime; +extern F32 gSimFrames; + +extern LLUUID gInventoryLibraryOwner; +extern LLUUID gInventoryLibraryRoot; + +extern BOOL gDisconnected; +extern BOOL gDisableVoice; + +// Map scale in pixels per region +extern F32 gMapScale; +extern F32 gMiniMapScale; + +extern LLFrameTimer gRestoreGLTimer; +extern BOOL gRestoreGL; +extern BOOL gUseWireframe; + +extern F32 gMouseSensitivity; +extern BOOL gInvertMouse; + +// VFS globals - gVFS is for general use +// gStaticVFS is read-only and is shipped w/ the viewer +// it has pre-cache data like the UI .TGAs +extern LLVFS *gStaticVFS; + +extern LLMemoryInfo gSysMemory; + +extern bool gPreloadImages; +extern bool gPreloadSounds; + +extern LLString gLastVersionChannel; + +extern LLVector3 gWindVec; +extern LLVector3 gRelativeWindVec; +extern U32 gPacketsIn; +extern BOOL gPrintMessagesThisFrame; + +extern LLUUID gSunTextureID; +extern LLUUID gMoonTextureID; + +extern BOOL gUseConsole; + +extern BOOL gRandomizeFramerate; +extern BOOL gPeriodicSlowFrame; + +extern BOOL gQAMode; +#endif // LL_LLAPPVIEWER_H diff --git a/linden/indra/newview/llappviewerlinux.cpp b/linden/indra/newview/llappviewerlinux.cpp new file mode 100644 index 0000000..1993fd0 --- /dev/null +++ b/linden/indra/newview/llappviewerlinux.cpp @@ -0,0 +1,414 @@ +/** + * @file llappviewerlinux.cpp + * @brief The LLAppViewerWin32 class definitions + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llmemtype.h" +#include "llappviewerlinux.h" + +#include "llviewernetwork.h" +#include "llmd5.h" + + #if LL_LINUX + # include // RTLD_LAZY + # include // backtrace - glibc only + # ifndef LL_ELFBIN + #define LL_ELFBIN 1 + # endif // LL_ELFBIN + # if LL_ELFBIN + # include // for symbol demangling + # include "ELFIO.h" // for better backtraces + # endif // LL_ELFBIN + #elif LL_SOLARIS + # include + # include + # include + # include + #endif + +int main( int argc, char **argv ) +{ + LLMemType mt1(LLMemType::MTYPE_STARTUP); + +#if LL_SOLARIS && defined(__sparc) + asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC +#endif + + LLAppViewer* viewer_app_ptr = new LLAppViewerLinux(); + + viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); + + bool ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + + ok = viewer_app_ptr->init(); + if(!ok) + { + llwarns << "Application init failed." << llendl; + return -1; + } + + // Run the application main loop + if(!LLApp::isQuitting()) + { + viewer_app_ptr->mainLoop(); + } + + if (!LLApp::isError()) + { + // + // We don't want to do cleanup here if the error handler got called - + // the assumption is that the error handler is responsible for doing + // app cleanup if there was a problem. + // + viewer_app_ptr->cleanup(); + } + delete viewer_app_ptr; + viewer_app_ptr = NULL; + return 0; +} + +#ifdef LL_SOLARIS +static inline BOOL do_basic_glibc_backtrace() +{ + BOOL success = FALSE; + + std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); + llinfos << "Opening stack trace file " << strace_filename << llendl; + FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); + if (!StraceFile) + { + llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; + StraceFile = stderr; + } + + printstack(fileno(StraceFile)); + + if (StraceFile != stderr) + fclose(StraceFile); + + return success; +} +#else +#define MAX_STACK_TRACE_DEPTH 40 +// This uses glibc's basic built-in stack-trace functions for a not very +// amazing backtrace. +static inline BOOL do_basic_glibc_backtrace() +{ + void *array[MAX_STACK_TRACE_DEPTH]; + size_t size; + char **strings; + size_t i; + BOOL success = FALSE; + + size = backtrace(array, MAX_STACK_TRACE_DEPTH); + strings = backtrace_symbols(array, size); + + std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); + llinfos << "Opening stack trace file " << strace_filename << llendl; + FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); // Flawfinder: ignore + if (!StraceFile) + { + llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; + StraceFile = stderr; + } + + if (size) + { + for (i = 0; i < size; i++) + fputs((std::string(strings[i])+"\n").c_str(), + StraceFile); + + success = TRUE; + } + + if (StraceFile != stderr) + fclose(StraceFile); + + free (strings); + return success; +} + +#if LL_ELFBIN +// This uses glibc's basic built-in stack-trace functions together with +// ELFIO's ability to parse the .symtab ELF section for better symbol +// extraction without exporting symbols (which'd cause subtle, fatal bugs). +static inline BOOL do_elfio_glibc_backtrace() +{ + void *array[MAX_STACK_TRACE_DEPTH]; + size_t btsize; + char **strings; + BOOL success = FALSE; + + std::string appfilename = gDirUtilp->getExecutablePathAndName(); + + std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); + llinfos << "Opening stack trace file " << strace_filename << llendl; + FILE* StraceFile = LLFile::fopen(strace_filename.c_str(), "w"); // Flawfinder: ignore + if (!StraceFile) + { + llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; + StraceFile = stderr; + } + + // get backtrace address list and basic symbol info + btsize = backtrace(array, MAX_STACK_TRACE_DEPTH); + strings = backtrace_symbols(array, btsize); + + // create ELF reader for our app binary + IELFI* pReader; + const IELFISection* pSec = NULL; + IELFISymbolTable* pSymTbl = 0; + if (ERR_ELFIO_NO_ERROR != ELFIO::GetInstance()->CreateELFI(&pReader) || + ERR_ELFIO_NO_ERROR != pReader->Load(appfilename.c_str()) || + // find symbol table, create reader-object + NULL == (pSec = pReader->GetSection( ".symtab" )) || + ERR_ELFIO_NO_ERROR != pReader->CreateSectionReader(IELFI::ELFI_SYMBOL, pSec, (void**)&pSymTbl) ) + { + // Failed to open our binary and read its symbol table somehow + llinfos << "Could not initialize ELF symbol reading - doing basic backtrace." << llendl; + if (StraceFile != stderr) + fclose(StraceFile); + // note that we may be leaking some of the above ELFIO + // objects now, but it's expected that we'll be dead soon + // and we want to tread delicately until we get *some* kind + // of useful backtrace. + return do_basic_glibc_backtrace(); + } + + // iterate over trace and symtab, looking for plausible symbols + std::string name; + Elf32_Addr value; + Elf32_Word ssize; + unsigned char bind; + unsigned char type; + Elf32_Half section; + int nSymNo = pSymTbl->GetSymbolNum(); + size_t btpos; + for (btpos = 0; btpos < btsize; ++btpos) + { + fprintf(StraceFile, "%d:\t", btpos); + int symidx; + for (symidx = 0; symidx < nSymNo; ++symidx) + { + if (ERR_ELFIO_NO_ERROR == + pSymTbl->GetSymbol(symidx, name, value, ssize, + bind, type, section)) + { + // check if trace address within symbol range + if (uintptr_t(array[btpos]) >= value && + uintptr_t(array[btpos]) < value+ssize) + { + char *demangled_str = NULL; + int demangle_result = 1; + demangled_str = + abi::__cxa_demangle + (name.c_str(), NULL, NULL, + &demangle_result); + if (0 == demangle_result && + NULL != demangled_str) { + fprintf(StraceFile, + "ELF(%s", demangled_str); + free(demangled_str); + } + else // failed demangle; print it raw + { + fprintf(StraceFile, + "ELF(%s", name.c_str()); + } + // print offset from symbol start + fprintf(StraceFile, + "+0x%lx) [%p]\n", + uintptr_t(array[btpos]) - + value, + array[btpos]); + goto got_sym; // early escape + } + } + } + // Fallback: + // Didn't find a suitable symbol in the binary - it's probably + // a symbol in a DSO; use glibc's idea of what it should be. + fprintf(StraceFile, "%s\n", strings[btpos]); + got_sym:; + } + + if (StraceFile != stderr) + fclose(StraceFile); + + pSymTbl->Release(); + pSec->Release(); + pReader->Release(); + + free(strings); + + llinfos << "Finished generating stack trace." << llendl; + + success = TRUE; + return success; +} +#endif // LL_ELFBIN + +#endif // LL_SOLARIS + + +LLAppViewerLinux::LLAppViewerLinux() +{ +} + +LLAppViewerLinux::~LLAppViewerLinux() +{ +} + +bool LLAppViewerLinux::init() +{ + return LLAppViewer::init(); +} + +void LLAppViewerLinux::handleCrashReporting() +{ + + // Always generate the report, have the logger do the asking, and + // don't wait for the logger before exiting (-> total cleanup). + if (CRASH_BEHAVIOR_NEVER_SEND != LLAppViewer::instance()->getCrashBehavior()) + { + // This backtrace writes into stack_trace.log +# if LL_ELFBIN + do_elfio_glibc_backtrace(); // more useful backtrace +# else + do_basic_glibc_backtrace(); // only slightly useful backtrace +# endif // LL_ELFBIN + // launch the actual crash logger + char* ask_dialog = "-dialog"; + if (CRASH_BEHAVIOR_ASK != LLAppViewer::instance()->getCrashBehavior()) + ask_dialog = ""; // omit '-dialog' option + std::string cmd =gDirUtilp->getAppRODataDir(); + cmd += gDirUtilp->getDirDelimiter(); + cmd += "linux-crash-logger.bin"; + char* const cmdargv[] = + {(char*)cmd.c_str(), + ask_dialog, + (char*)"-user", + (char*)gGridName, + (char*)"-name", + (char*)LLAppViewer::instance()->getSecondLifeTitle().c_str(), + NULL}; + pid_t pid = fork(); + if (pid == 0) + { // child + execv(cmd.c_str(), cmdargv); /* Flawfinder: ignore */ + llwarns << "execv failure when trying to start " << cmd << llendl; + _exit(1); // avoid atexit() + } + else + { + if (pid > 0) + { + // DO NOT wait for child proc to die; we want + // the logger to outlive us while we quit to + // free up the screen/keyboard/etc. + ////int childExitStatus; + ////waitpid(pid, &childExitStatus, 0); + } + else + { + llwarns << "fork failure." << llendl; + } + } + } + // Sometimes signals don't seem to quit the viewer. + // Make sure we exit so as to not totally confuse the user. + exit(1); +} + +bool LLAppViewerLinux::beingDebugged() +{ + static enum {unknown, no, yes} debugged = unknown; + + if (debugged == unknown) + { + pid_t ppid = getppid(); + char *name; + int ret; + + ret = asprintf(&name, "/proc/%d/exe", ppid); + if (ret != -1) + { + char buf[1024]; + ssize_t n; + + n = readlink(name, buf, sizeof(buf) - 1); + if (n != -1) + { + char *base = strrchr(buf, '/'); + buf[n + 1] = '\0'; + if (base == NULL) + { + base = buf; + } else { + base += 1; + } + + if (strcmp(base, "gdb") == 0) + { + debugged = yes; + } + } + free(name); + } + } + + return debugged == yes; +} + +bool LLAppViewerLinux::initLogging() +{ + // Remove the last stack trace, if any + std::string old_stack_file = + gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); + LLFile::remove(old_stack_file.c_str()); + + return LLAppViewer::initLogging(); +} + +std::string LLAppViewerLinux::generateSerialNumber() +{ + char serial_md5[MD5HEX_STR_SIZE]; + serial_md5[0] = 0; + + // TODO + + return serial_md5; +} diff --git a/linden/indra/newview/llappviewerlinux.h b/linden/indra/newview/llappviewerlinux.h new file mode 100644 index 0000000..f38a64a --- /dev/null +++ b/linden/indra/newview/llappviewerlinux.h @@ -0,0 +1,59 @@ +/** + * @file llappviewerlinux.h + * @brief The LLAppViewerLinux class declaration + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPVIEWERLINUX_H +#define LL_LLAPPVIEWERLINUX_H + +#ifndef LL_LLAPPVIEWER_H +#include "llappviewer.h" +#endif + +class LLAppViewerLinux : public LLAppViewer +{ +public: + LLAppViewerLinux(); + virtual ~LLAppViewerLinux(); + + // + // Main application logic + // + virtual bool init(); // Override to do application initialization + std::string generateSerialNumber(); + +protected: + virtual bool beingDebugged(); + + virtual void handleCrashReporting(); + + virtual bool initLogging(); +}; + +#endif // LL_LLAPPVIEWERLINUX_H diff --git a/linden/indra/newview/llappviewermacosx.cpp b/linden/indra/newview/llappviewermacosx.cpp new file mode 100644 index 0000000..e80491e --- /dev/null +++ b/linden/indra/newview/llappviewermacosx.cpp @@ -0,0 +1,373 @@ +/** + * @file llappviewermacosx.cpp + * @brief The LLAppViewerWin32 class definitions + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#if !defined LL_DARWIN + #error "Use only with Mac OS X" +#endif + +#include "llappviewermacosx.h" +#include "llmemtype.h" + +#include "llviewernetwork.h" +#include "llmd5.h" +#include "llurlsimstring.h" +#include "llfloaterworldmap.h" +#include "llurldispatcher.h" +#include + + +int main( int argc, char **argv ) +{ + LLMemType mt1(LLMemType::MTYPE_STARTUP); + +#if LL_SOLARIS && defined(__sparc) + asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC +#endif + + // Set the working dir to /Contents/Resources + (void) chdir(gDirUtilp->getAppRODataDir().c_str()); + + LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); + + viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); + + bool ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + + ok = viewer_app_ptr->init(); + if(!ok) + { + llwarns << "Application init failed." << llendl; + return -1; + } + + // Run the application main loop + if(!LLApp::isQuitting()) + { + viewer_app_ptr->mainLoop(); + } + + if (!LLApp::isError()) + { + // + // We don't want to do cleanup here if the error handler got called - + // the assumption is that the error handler is responsible for doing + // app cleanup if there was a problem. + // + viewer_app_ptr->cleanup(); + } + delete viewer_app_ptr; + viewer_app_ptr = NULL; + return 0; +} + +LLAppViewerMacOSX::LLAppViewerMacOSX() +{ +} + +LLAppViewerMacOSX::~LLAppViewerMacOSX() +{ +} + +bool LLAppViewerMacOSX::init() +{ + return LLAppViewer::init(); +} + +void LLAppViewerMacOSX::handleCrashReporting() +{ + // Macintosh + LLString command_str; + command_str = "crashreporter.app/Contents/MacOS/crashreporter "; + command_str += "-user "; + command_str += gGridName; + command_str += " &"; // This backgrounds the command so system() doesn't block until the crashreporter exits. + system(command_str.c_str()); /* Flawfinder: ignore */ + + // Sometimes signals don't seem to quit the viewer. + // Make sure we exit so as to not totally confuse the user. + exit(1); +} + +std::string LLAppViewerMacOSX::generateSerialNumber() +{ + char serial_md5[MD5HEX_STR_SIZE]; // Flawfinder: ignore + serial_md5[0] = 0; + + // JC: Sample code from http://developer.apple.com/technotes/tn/tn1103.html + CFStringRef serialNumber = NULL; + io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, + IOServiceMatching("IOPlatformExpertDevice")); + if (platformExpert) { + serialNumber = (CFStringRef) IORegistryEntryCreateCFProperty(platformExpert, + CFSTR(kIOPlatformSerialNumberKey), + kCFAllocatorDefault, 0); + IOObjectRelease(platformExpert); + } + + if (serialNumber) + { + char buffer[MAX_STRING]; // Flawfinder: ignore + if (CFStringGetCString(serialNumber, buffer, MAX_STRING, kCFStringEncodingASCII)) + { + LLMD5 md5( (unsigned char*)buffer ); + md5.hex_digest(serial_md5); + } + CFRelease(serialNumber); + } + + return serial_md5; +} + +OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) +{ + OSErr result = noErr; + DescType actualType; + char buffer[1024]; // Flawfinder: ignore + Size size; + + result = AEGetParamPtr ( + messagein, + keyDirectObject, + typeCString, + &actualType, + (Ptr)buffer, + sizeof(buffer), + &size); + + if(result == noErr) + { + std::string url = buffer; + LLURLDispatcher::dispatch(url); + } + + return(result); +} + +OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) +{ + OSErr result = noErr; + + LLAppViewer::instance()->userQuit(); + + return(result); +} + +OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) +{ + OSStatus result = eventNotHandledErr; + OSStatus err; + UInt32 evtClass = GetEventClass(event); + UInt32 evtKind = GetEventKind(event); + WindowRef window = (WindowRef)userdata; + + if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) + { + HICommand cmd; + err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); + + if(err == noErr) + { + switch(cmd.commandID) + { + case kHICommandOK: + QuitAppModalLoopForWindow(window); + result = noErr; + break; + + case kHICommandCancel: + QuitAppModalLoopForWindow(window); + result = userCanceledErr; + break; + } + } + } + + return(result); +} + +OSStatus DisplayReleaseNotes(void) +{ + OSStatus err; + IBNibRef nib = NULL; + WindowRef window = NULL; + + err = CreateNibReference(CFSTR("SecondLife"), &nib); + + if(err == noErr) + { + CreateWindowFromNib(nib, CFSTR("Release Notes"), &window); + } + + if(err == noErr) + { + // Get the text view control + HIViewRef textView; + ControlID id; + + id.signature = 'text'; + id.id = 0; + + LLString releaseNotesText; + + _read_file_into_string(releaseNotesText, "releasenotes.txt"); // Flawfinder: ignore + + err = HIViewFindByID(HIViewGetRoot(window), id, &textView); + + if(err == noErr) + { + // Convert from the encoding used in the release notes. + CFStringRef str = CFStringCreateWithBytes( + NULL, + (const UInt8*)releaseNotesText.c_str(), + releaseNotesText.size(), + kCFStringEncodingWindowsLatin1, // This matches the way the Windows version displays the release notes. + FALSE); + + if(str != NULL) + { + int size = CFStringGetLength(str); + + if(size > 0) + { + UniChar *chars = new UniChar[size + 1]; + CFStringGetCharacters(str, CFRangeMake(0, size), chars); + + err = TXNSetData(HITextViewGetTXNObject(textView), kTXNUnicodeTextData, chars, size * sizeof(UniChar), kTXNStartOffset, kTXNStartOffset); + + delete[] chars; + } + + CFRelease(str); + } + else + { + // Creating the string failed. Probably an encoding problem. Display SOMETHING... + err = TXNSetData(HITextViewGetTXNObject(textView), kTXNTextData, releaseNotesText.c_str(), releaseNotesText.size(), kTXNStartOffset, kTXNStartOffset); + } + } + + // Set the selection to the beginning of the text and scroll it into view. + if(err == noErr) + { + err = TXNSetSelection(HITextViewGetTXNObject(textView), kTXNStartOffset, kTXNStartOffset); + } + + if(err == noErr) + { + // This function returns void. + TXNShowSelection(HITextViewGetTXNObject(textView), false); + } + } + + if(err == noErr) + { + ShowWindow(window); + } + + if(err == noErr) + { + // Set up an event handler for the window. + EventHandlerRef handler = NULL; + EventTypeSpec handlerEvents[] = + { + { kEventClassCommand, kEventCommandProcess } + }; + + InstallWindowEventHandler( + window, + NewEventHandlerUPP(simpleDialogHandler), + GetEventTypeCount (handlerEvents), + handlerEvents, + (void*)window, + &handler); + } + + if(err == noErr) + { + RunAppModalLoopForWindow(window); + } + + if(window != NULL) + { + DisposeWindow(window); + } + + if(nib != NULL) + { + DisposeNibReference(nib); + } + + return(err); +} + +void init_apple_menu(const char* product) +{ + // Load up a proper menu bar. + { + OSStatus err; + IBNibRef nib = NULL; + // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. + err = CreateNibReference(CFSTR("SecondLife"), &nib); + + if(err == noErr) + { + // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. + SetMenuBarFromNib(nib, CFSTR("MenuBar")); + } + + if(nib != NULL) + { + DisposeNibReference(nib); + } + } + + // Install a handler for 'gurl' AppleEvents. This is how secondlife:// URLs get passed to the viewer. + + if(AEInstallEventHandler('GURL', 'GURL', NewAEEventHandlerUPP(AEGURLHandler),0, false) != noErr) + { + // Couldn't install AppleEvent handler. This error shouldn't be fatal. + llinfos << "Couldn't install 'GURL' AppleEvent handler. Continuing..." << llendl; + } + + // Install a handler for 'quit' AppleEvents. This makes quitting the application from the dock work. + if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler),0, false) != noErr) + { + // Couldn't install AppleEvent handler. This error shouldn't be fatal. + llinfos << "Couldn't install Quit AppleEvent handler. Continuing..." << llendl; + } +} diff --git a/linden/indra/newview/llappviewermacosx.h b/linden/indra/newview/llappviewermacosx.h new file mode 100644 index 0000000..2c61e5a --- /dev/null +++ b/linden/indra/newview/llappviewermacosx.h @@ -0,0 +1,56 @@ +/** + * @file llappviewermacosx.h + * @brief The LLAppViewerMacOSX class declaration + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPVIEWERMACOSX_H +#define LL_LLAPPVIEWERMACOSX_H + +#ifndef LL_LLAPPVIEWER_H +#include "llappviewer.h" +#endif + +class LLAppViewerMacOSX : public LLAppViewer +{ +public: + LLAppViewerMacOSX(); + virtual ~LLAppViewerMacOSX(); + + // + // Main application logic + // + virtual bool init(); // Override to do application initialization + + +protected: + virtual void handleCrashReporting(); + std::string generateSerialNumber(); +}; + +#endif // LL_LLAPPVIEWERMACOSX_H diff --git a/linden/indra/newview/llappviewerwin32.cpp b/linden/indra/newview/llappviewerwin32.cpp new file mode 100644 index 0000000..814c209 --- /dev/null +++ b/linden/indra/newview/llappviewerwin32.cpp @@ -0,0 +1,461 @@ +/** + * @file llappviewerwin32.cpp + * @brief The LLAppViewerWin32 class definitions + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llappviewerwin32.h" + +#include "llmemtype.h" + +#include "llwindowwin32.cpp" // *FIX: for setting gIconResource. +#include "res/resource.h" // *FIX: for setting gIconResource. + +#include //_O_APPEND +#include //_open_osfhandle() +#include // for AddERExcludedApplicationA() +#include // _spawnl() +#include // For TCHAR support + +#include "llviewercontrol.h" +#include "lldxhardware.h" + +#include "llweb.h" +#include "llsecondlifeurls.h" + +#include "llwindebug.h" + +#include "llviewernetwork.h" +#include "llmd5.h" + +void fill_args(int& argc, char** argv, const S32 max_args, LPSTR cmd_line) +{ + char *token = NULL; + if( cmd_line[0] == '\"' ) + { + // Exe name is enclosed in quotes + token = strtok( cmd_line, "\"" ); + argv[argc++] = token; + token = strtok( NULL, " \t," ); + } + else + { + // Exe name is not enclosed in quotes + token = strtok( cmd_line, " \t," ); + } + + while( (token != NULL) && (argc < max_args) ) + { + argv[argc++] = token; + /* Get next token: */ + if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore*/ + { + token = strtok( NULL, "\""); + } + else + { + token = strtok( NULL, " \t," ); + } + } +} + +// *NOTE:Mani - this code is stolen from LLApp, where its never actually used. +LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) +{ + // Translate the signals/exceptions into cross-platform stuff + // Windows implementation + llinfos << "Entering Windows Exception Handler..." << llendl; + + // Make sure the user sees something to indicate that the app crashed. + LONG retval; + + if (LLApp::isError()) + { + llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; + retval = EXCEPTION_EXECUTE_HANDLER; + return retval; + } + + // Generate a minidump if we can. + // Before we wake the error thread... + // Which will start the crash reporting. + LLWinDebug::handleException(exception_infop); + + // Flag status to error, so thread_error starts its work + LLApp::setError(); + + // Block in the exception handler until the app has stopped + // This is pretty sketchy, but appears to work just fine + while (!LLApp::isStopped()) + { + ms_sleep(10); + } + + // + // At this point, we always want to exit the app. There's no graceful + // recovery for an unhandled exception. + // + // Just kill the process. + retval = EXCEPTION_EXECUTE_HANDLER; + return retval; +} + +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + LLMemType mt1(LLMemType::MTYPE_STARTUP); + + // *FIX: global + gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); + + // In Win32, we need to generate argc and argv ourselves... + // Note: GetCommandLine() returns a potentially return a LPTSTR + // which can resolve to a LPWSTR (unicode string). + // (That's why it's different from lpCmdLine which is a LPSTR.) + // We don't currently do unicode, so call the non-unicode version + // directly. + LPSTR cmd_line_including_exe_name = GetCommandLineA(); + + const S32 MAX_ARGS = 100; + int argc = 0; + char* argv[MAX_ARGS]; /* Flawfinder: ignore */ + + fill_args(argc, argv, MAX_ARGS, cmd_line_including_exe_name); + + LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(); + + // *FIX:Mani This method is poorly named, since the exception + // is now handled by LLApp. + bool ok = LLWinDebug::setupExceptionHandler(); + + // Actually here's the exception setup. + LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; + prev_filter = SetUnhandledExceptionFilter(viewer_windows_exception_handler); + if (!prev_filter) + { + llwarns << "Our exception handler (" << (void *)LLWinDebug::handleException << ") replaced with NULL!" << llendl; + ok = FALSE; + } + if (prev_filter != LLWinDebug::handleException) + { + llwarns << "Our exception handler (" << (void *)LLWinDebug::handleException << ") replaced with " << prev_filter << "!" << llendl; + ok = FALSE; + } + + viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); + + ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + + ok = viewer_app_ptr->init(); + if(!ok) + { + llwarns << "Application init failed." << llendl; + return -1; + } + + // Run the application main loop + if(!LLApp::isQuitting()) + { + viewer_app_ptr->mainLoop(); + } + + if (!LLApp::isError()) + { + // + // We don't want to do cleanup here if the error handler got called - + // the assumption is that the error handler is responsible for doing + // app cleanup if there was a problem. + // + viewer_app_ptr->cleanup(); + } + delete viewer_app_ptr; + viewer_app_ptr = NULL; + return 0; +} + +void LLAppViewerWin32::disableWinErrorReporting() +{ + const char win_xp_string[] = "Microsoft Windows XP"; + BOOL is_win_xp = ( getOSInfo().getOSString().substr(0, strlen(win_xp_string) ) == win_xp_string ); /* Flawfinder: ignore*/ + if( is_win_xp ) + { + // Note: we need to use run-time dynamic linking, because load-time dynamic linking will fail + // on systems that don't have the library installed (all non-Windows XP systems) + HINSTANCE fault_rep_dll_handle = LoadLibrary(L"faultrep.dll"); /* Flawfinder: ignore */ + if( fault_rep_dll_handle ) + { + pfn_ADDEREXCLUDEDAPPLICATIONA pAddERExcludedApplicationA = (pfn_ADDEREXCLUDEDAPPLICATIONA) GetProcAddress(fault_rep_dll_handle, "AddERExcludedApplicationA"); + if( pAddERExcludedApplicationA ) + { + + // Strip the path off the name + const char* executable_name = gDirUtilp->getExecutableFilename().c_str(); + + if( 0 == pAddERExcludedApplicationA( executable_name ) ) + { + U32 error_code = GetLastError(); + llinfos << "AddERExcludedApplication() failed with error code " << error_code << llendl; + } + else + { + llinfos << "AddERExcludedApplication() success for " << executable_name << llendl; + } + } + FreeLibrary( fault_rep_dll_handle ); + } + } +} + +const S32 MAX_CONSOLE_LINES = 500; + +void create_console() +{ + int h_con_handle; + long l_std_handle; + + CONSOLE_SCREEN_BUFFER_INFO coninfo; + FILE *fp; + + // allocate a console for this app + AllocConsole(); + + // set the screen buffer to be big enough to let us scroll text + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); + coninfo.dwSize.Y = MAX_CONSOLE_LINES; + SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize); + + // redirect unbuffered STDOUT to the console + l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE); + h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); + fp = _fdopen( h_con_handle, "w" ); + *stdout = *fp; + setvbuf( stdout, NULL, _IONBF, 0 ); + + // redirect unbuffered STDIN to the console + l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE); + h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); + fp = _fdopen( h_con_handle, "r" ); + *stdin = *fp; + setvbuf( stdin, NULL, _IONBF, 0 ); + + // redirect unbuffered STDERR to the console + l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE); + h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); + fp = _fdopen( h_con_handle, "w" ); + *stderr = *fp; + setvbuf( stderr, NULL, _IONBF, 0 ); +} + +LLAppViewerWin32::LLAppViewerWin32() +{ +} + +LLAppViewerWin32::~LLAppViewerWin32() +{ +} + +bool LLAppViewerWin32::init() +{ + // Platform specific initialization. + + // Turn off Windows XP Error Reporting + // (Don't send our data to Microsoft--at least until we are Logo approved and have a way + // of getting the data back from them.) + // + llinfos << "Turning off Windows error reporting." << llendl; + disableWinErrorReporting(); + + return LLAppViewer::init(); +} + +bool LLAppViewerWin32::cleanup() +{ + bool result = LLAppViewer::cleanup(); + + gDXHardware.cleanup(); + + return result; +} + +bool LLAppViewerWin32::initWindow() +{ + // pop up debug console if necessary + if (gUseConsole && gSavedSettings.getBOOL("ShowConsoleWindow")) + { + create_console(); + } + + return LLAppViewer::initWindow(); +} + +void write_debug_dx(const char* str) +{ + LLString value = gDebugInfo["DXInfo"].asString(); + value += str; + gDebugInfo["DXInfo"] = value; +} + +void write_debug_dx(const std::string& str) +{ + write_debug_dx(str.c_str()); +} + +bool LLAppViewerWin32::initHardwareTest() +{ + // + // Do driver verification and initialization based on DirectX + // hardware polling and driver versions + // + if (gProbeHardware) + { + BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); + + LLSplashScreen::update("Detecting hardware..."); + + llinfos << "Attempting to poll DirectX for hardware info" << llendl; + gDXHardware.setWriteDebugFunc(write_debug_dx); + BOOL probe_ok = gDXHardware.getInfo(vram_only); + + if (!probe_ok + && gSavedSettings.getWarning("AboutDirectX9")) + { + llinfos << "DirectX probe failed, alerting user." << llendl; + + // Warn them that runnin without DirectX 9 will + // not allow us to tell them about driver issues + std::ostringstream msg; + msg << + LLAppViewer::instance()->getSecondLifeTitle() << " is unable to detect DirectX 9.0b or greater.\n" + "\n" << + LLAppViewer::instance()->getSecondLifeTitle() << " uses DirectX to detect hardware and/or\n" + "outdated drivers that can cause stability problems,\n" + "poor performance and crashes. While you can run\n" << + LLAppViewer::instance()->getSecondLifeTitle() << " without it, we highly recommend running\n" + "with DirectX 9.0b\n" + "\n" + "Do you wish to continue?\n"; + S32 button = OSMessageBox( + msg.str().c_str(), + "Warning", + OSMB_YESNO); + if (OSBTN_NO== button) + { + llinfos << "User quitting after failed DirectX 9 detection" << llendl; + LLWeb::loadURLExternal(DIRECTX_9_URL); + return false; + } + gSavedSettings.setWarning("AboutDirectX9", FALSE); + } + llinfos << "Done polling DirectX for hardware info" << llendl; + + // Only probe once after installation + gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); + + // Disable so debugger can work + std::ostringstream splash_msg; + splash_msg << "Loading " << LLAppViewer::instance()->getSecondLifeTitle() << "..."; + + LLSplashScreen::update(splash_msg.str().c_str()); + } + + if (!LLWinDebug::setupExceptionHandler()) + { + llwarns << " Someone took over my exception handler (post hardware probe)!" << llendl; + } + + gGLManager.mVRAM = gDXHardware.getVRAM(); + llinfos << "Detected VRAM: " << gGLManager.mVRAM << llendl; + + return true; +} + +void LLAppViewerWin32::handleCrashReporting() +{ + // Windows only behaivor. Spawn win crash reporter. + std::string exe_path = gDirUtilp->getAppRODataDir(); + exe_path += gDirUtilp->getDirDelimiter(); + exe_path += "win_crash_logger.exe"; + + std::string arg_string = "-user "; + arg_string += gGridName; + + switch(getCrashBehavior()) + { + case CRASH_BEHAVIOR_ASK: + default: + arg_string += " -dialog "; + _spawnl(_P_NOWAIT, exe_path.c_str(), exe_path.c_str(), arg_string.c_str(), NULL); + break; + + case CRASH_BEHAVIOR_ALWAYS_SEND: + _spawnl(_P_NOWAIT, exe_path.c_str(), exe_path.c_str(), arg_string.c_str(), NULL); + break; + + case CRASH_BEHAVIOR_NEVER_SEND: + break; + } +} + +std::string LLAppViewerWin32::generateSerialNumber() +{ + char serial_md5[MD5HEX_STR_SIZE]; // Flawfinder: ignore + serial_md5[0] = 0; + + DWORD serial = 0; + DWORD flags = 0; + BOOL success = GetVolumeInformation( + L"C:\\", + NULL, // volume name buffer + 0, // volume name buffer size + &serial, // volume serial + NULL, // max component length + &flags, // file system flags + NULL, // file system name buffer + 0); // file system name buffer size + if (success) + { + LLMD5 md5; + md5.update( (unsigned char*)&serial, sizeof(DWORD)); + md5.finalize(); + md5.hex_digest(serial_md5); + } + else + { + llwarns << "GetVolumeInformation failed" << llendl; + } + return serial_md5; +} \ No newline at end of file diff --git a/linden/indra/newview/llappviewerwin32.h b/linden/indra/newview/llappviewerwin32.h new file mode 100644 index 0000000..23e7337 --- /dev/null +++ b/linden/indra/newview/llappviewerwin32.h @@ -0,0 +1,63 @@ +/** + * @file llappviewerwin32.h + * @brief The LLAppViewerWin32 class declaration + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAPPVIEWERWIN32_H +#define LL_LLAPPVIEWERWIN32_H + +#ifndef LL_LLAPPVIEWER_H +#include "llappviewer.h" +#endif + +class LLAppViewerWin32 : public LLAppViewer +{ +public: + LLAppViewerWin32(); + virtual ~LLAppViewerWin32(); + + // + // Main application logic + // + virtual bool init(); // Override to do application initialization + virtual bool cleanup(); + +protected: + virtual bool initWindow(); // Initialize the viewer's window. + virtual bool initHardwareTest(); // Win32 uses DX9 to test hardware. + virtual void handleCrashReporting(); + + std::string generateSerialNumber(); + +private: + void disableWinErrorReporting(); + +}; + +#endif // LL_LLAPPVIEWERWIN32_H diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp index 866fa34..c3c892a 100644 --- a/linden/indra/newview/llassetuploadresponders.cpp +++ b/linden/indra/newview/llassetuploadresponders.cpp @@ -52,7 +52,6 @@ #include "llviewerobjectlist.h" #include "llviewermenufile.h" #include "llviewerwindow.h" -#include "viewer.h" void dialog_refresh_all(); diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp index b80c2bb..6d0244e 100644 --- a/linden/indra/newview/llcallingcard.cpp +++ b/linden/indra/newview/llcallingcard.cpp @@ -466,7 +466,7 @@ void LLAvatarTracker::findAgent() msg->nextBlockFast(_PREHASH_AgentBlock); msg->addUUIDFast(_PREHASH_Hunter, gAgentID); msg->addUUIDFast(_PREHASH_Prey, mTrackingData->mAvatarID); - msg->addU32Fast(_PREHASH_SpaceIP, 0); // will get filled in by userserver + msg->addU32Fast(_PREHASH_SpaceIP, 0); // will get filled in by simulator msg->nextBlockFast(_PREHASH_LocationBlock); const F64 NO_LOCATION = 0.0; msg->addF64Fast(_PREHASH_GlobalX, NO_LOCATION); diff --git a/linden/indra/newview/llcameraview.cpp b/linden/indra/newview/llcameraview.cpp index 6db0f20..405e4f1 100644 --- a/linden/indra/newview/llcameraview.cpp +++ b/linden/indra/newview/llcameraview.cpp @@ -42,7 +42,7 @@ #include "lljoystickbutton.h" #include "llviewercontrol.h" #include "llviewerwindow.h" -#include "viewer.h" +#include "llappviewer.h" // Constants const char *CAMERA_TITLE = ""; @@ -73,7 +73,7 @@ LLFloaterCamera::LLFloaterCamera(const std::string& name) "cam_rotate_in.tga" ); mRotate->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); mRotate->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mRotate->setToolTip( "Rotate Camera Around Focus" ); + mRotate->setToolTip( LLString("Rotate Camera Around Focus" )); // *TODO: Translate mRotate->setSoundFlags(MOUSE_DOWN | MOUSE_UP); addChild(mRotate); @@ -88,7 +88,7 @@ LLFloaterCamera::LLFloaterCamera(const std::string& name) "cam_zoom_minus_in.tga"); mZoom->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); mZoom->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mZoom->setToolTip( "Zoom Camera Towards Focus" ); + mZoom->setToolTip( LLString("Zoom Camera Towards Focus" )); // *TODO: Translate mZoom->setSoundFlags(MOUSE_DOWN | MOUSE_UP); addChild(mZoom); @@ -101,7 +101,7 @@ LLFloaterCamera::LLFloaterCamera(const std::string& name) "cam_tracking_in.tga"); mTrack->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); mTrack->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mTrack->setToolTip( "Move Camera Up and Down, Left and Right" ); + mTrack->setToolTip( LLString("Move Camera Up and Down, Left and Right" )); // *TODO: Translate mTrack->setSoundFlags(MOUSE_DOWN | MOUSE_UP); addChild(mTrack); } diff --git a/linden/indra/newview/llclassifiedinfo.cpp b/linden/indra/newview/llclassifiedinfo.cpp index a49af23..28d5f50 100644 --- a/linden/indra/newview/llclassifiedinfo.cpp +++ b/linden/indra/newview/llclassifiedinfo.cpp @@ -32,7 +32,6 @@ #include "llviewerprecompiledheaders.h" #include "llclassifiedinfo.h" -#include "viewer.h" // for gPacificDaylightTime #include "lluuid.h" LLClassifiedInfo::cat_map LLClassifiedInfo::sCategories; diff --git a/linden/indra/newview/llcommandhandler.cpp b/linden/indra/newview/llcommandhandler.cpp index fd3aef9..95a30e8 100644 --- a/linden/indra/newview/llcommandhandler.cpp +++ b/linden/indra/newview/llcommandhandler.cpp @@ -46,7 +46,7 @@ class LLCommandHandlerRegistry public: static LLCommandHandlerRegistry& instance(); void add(const char* cmd, LLCommandHandler* handler); - bool dispatch(const std::string& cmd, const std::vector& params); + bool dispatch(const std::string& cmd, const LLSD& params, const LLSD& queryMap); private: std::map mMap; @@ -68,13 +68,14 @@ void LLCommandHandlerRegistry::add(const char* cmd, LLCommandHandler* handler) } bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, - const std::vector& params) + const LLSD& params, + const LLSD& queryMap) { std::map::iterator it = mMap.find(cmd); if (it == mMap.end()) return false; LLCommandHandler* handler = it->second; if (!handler) return false; - return handler->handle(params); + return handler->handle(params, queryMap); } //--------------------------------------------------------------------------- @@ -97,7 +98,7 @@ LLCommandHandler::~LLCommandHandler() //--------------------------------------------------------------------------- // static -bool LLCommandDispatcher::dispatch(const std::string& cmd, const std::vector& params) +bool LLCommandDispatcher::dispatch(const std::string& cmd, const LLSD& params, const LLSD& queryMap) { - return LLCommandHandlerRegistry::instance().dispatch(cmd, params); + return LLCommandHandlerRegistry::instance().dispatch(cmd, params, queryMap); } diff --git a/linden/indra/newview/llcommandhandler.h b/linden/indra/newview/llcommandhandler.h index 50928e2..0cb9d12 100644 --- a/linden/indra/newview/llcommandhandler.h +++ b/linden/indra/newview/llcommandhandler.h @@ -44,7 +44,7 @@ public: LLFooHandler() : LLCommandHandler("foo") { } // Your code here - bool handle(const std::vector& tokens) + bool handle(const LLSD& tokens, const LLSD& queryMap) { if (tokens.size() < 1) return false; LLUUID id( tokens[0] ); @@ -65,7 +65,8 @@ public: virtual ~LLCommandHandler(); - virtual bool handle(const std::vector& params) = 0; + virtual bool handle(const LLSD& params, + const LLSD& queryMap) = 0; // Execute the command with a provided (possibly empty) // list of parameters. // Return true if you did something, false if the parameters @@ -76,7 +77,9 @@ public: class LLCommandDispatcher { public: - static bool dispatch(const std::string& cmd, const std::vector& params); + static bool dispatch(const std::string& cmd, + const LLSD& params, + const LLSD& queryMap); // Execute a command registered via the above mechanism, // passing string parameters. // Returns true if command was found and executed correctly. diff --git a/linden/indra/newview/llcompass.cpp b/linden/indra/newview/llcompass.cpp index b9e1d0e..f6df741 100644 --- a/linden/indra/newview/llcompass.cpp +++ b/linden/indra/newview/llcompass.cpp @@ -43,7 +43,6 @@ #include "llagent.h" #include "llcompass.h" -#include "viewer.h" #include "llviewerimage.h" #include "llviewerimagelist.h" #include "llviewercontrol.h" diff --git a/linden/indra/newview/llconsole.cpp b/linden/indra/newview/llconsole.cpp index 51ee1f6..5b1e88e 100644 --- a/linden/indra/newview/llconsole.cpp +++ b/linden/indra/newview/llconsole.cpp @@ -47,7 +47,6 @@ #include "llmath.h" #include "llstartup.h" -#include "viewer.h" // Used for LCD display extern void AddNewDebugConsoleToLCD(const LLWString &newLine); diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp index 929dfe4..66b5b92 100644 --- a/linden/indra/newview/llcontroldef.cpp +++ b/linden/indra/newview/llcontroldef.cpp @@ -58,6 +58,7 @@ #include "llpanelgeneral.h" #include "llpanelinput.h" #include "llsky.h" +#include "llvieweraudio.h" #include "llviewerimagelist.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" @@ -67,7 +68,6 @@ #include "llvovolume.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" #include "llviewerjoystick.h" #include "llviewerparcelmgr.h" #include "llparcel.h" @@ -683,7 +683,6 @@ void declare_settings() gSavedSettings.declareF32("SelectionHighlightVAnim", 0.5f, "Rate at which texture animates along V direction in selection highlight line (fraction of texture per second)"); gSavedSettings.declareBOOL("LogMessages", FALSE, "Log network traffic"); - gSavedSettings.declareBOOL("LoggedIn", FALSE, "Login status at end of last session"); gSavedSettings.declareBOOL("MouseSun", FALSE, "", NO_PERSIST); gSavedSettings.declareBOOL("ShowAxes", FALSE, "Render coordinate frame at your position"); @@ -1111,6 +1110,7 @@ void declare_settings() gSavedSettings.declareBOOL("LoginLastLocation", TRUE, "Login at same location you last logged out"); gSavedSettings.declareBOOL("ShowStartLocation", FALSE, "Display starting location menu on login screen"); gSavedSettings.declareBOOL("FlyingAtExit", FALSE, "Was flying when last logged out, so fly when logging in"); + gSavedSettings.declareBOOL("ForceShowGrid", FALSE, "Always show grid dropdown on login screen"); // gSavedSettings.declareString("AvatarTexture", "be20de2d-7812-4e0e-80f2-33aadf185a9f"); gSavedSettings.declareU32("RegionTextureSize", 256, "Terrain texture dimensions (power of 2)"); @@ -1243,7 +1243,7 @@ void declare_settings() // Secret debug stuff. gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "Turns on \"Debug\" menu"); gSavedSettings.declareS32("ServerChoice", 0, "[DO NOT MODIFY] Controls which grid you connect to"); - gSavedSettings.declareString("CustomServer", "", "Specifies IP address or hostname of userserver to which you connect"); + gSavedSettings.declareString("CustomServer", "", "Specifies IP address or hostname of grid to which you connect"); gSavedSettings.declareBOOL("UseDebugLogin", FALSE, "Provides extra control over which grid to connect to"); // First run is true on the first startup of a given installation. @@ -1383,8 +1383,9 @@ void declare_settings() gSavedSettings.declareString("SearchURLQuery", "http://secondlife.com/app/search/search_proxy.php?q=[QUERY]&s=[COLLECTION]&", "URL to use for searches"); - gSavedSettings.declareString("SearchURLSuffix", - "m=[MATURE]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]", + // Version 2 added [SESSION], must invalidate old saved settings. + gSavedSettings.declareString("SearchURLSuffix2", + "m=[MATURE]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]", "Parameters added to end of search queries"); // Arrow keys move avatar while in chat? diff --git a/linden/indra/newview/llcurrencyuimanager.cpp b/linden/indra/newview/llcurrencyuimanager.cpp index 1e97df0..eeb970e 100644 --- a/linden/indra/newview/llcurrencyuimanager.cpp +++ b/linden/indra/newview/llcurrencyuimanager.cpp @@ -44,8 +44,7 @@ #include "lllineeditor.h" #include "llviewchildren.h" #include "llxmlrpctransaction.h" -#include "viewer.h" - +#include "llappviewer.h" const F64 CURRENCY_ESTIMATE_FREQUENCY = 2.0; @@ -239,7 +238,7 @@ void LLCurrencyUIManager::Impl::startTransaction(TransactionType type, static std::string transactionURI; if (transactionURI.empty()) { - transactionURI = getHelperURI() + "currency.php"; + transactionURI = LLAppViewer::instance()->getHelperURI() + "currency.php"; } delete mTransaction; diff --git a/linden/indra/newview/lldirpicker.cpp b/linden/indra/newview/lldirpicker.cpp index a63c687..3672939 100644 --- a/linden/indra/newview/lldirpicker.cpp +++ b/linden/indra/newview/lldirpicker.cpp @@ -32,7 +32,6 @@ #include "llviewerprecompiledheaders.h" #include "lldirpicker.h" -//#include "viewer.h" //#include "llviewermessage.h" #include "llworld.h" #include "llviewerwindow.h" diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h index c10c49c..52082ad 100644 --- a/linden/indra/newview/lldrawable.h +++ b/linden/indra/newview/lldrawable.h @@ -48,6 +48,7 @@ #include "llstat.h" #include "llviewerobject.h" #include "llrect.h" +#include "llappviewer.h" // for gFrameTimeSeconds class LLCamera; class LLDrawPool; @@ -59,8 +60,6 @@ class LLSpatialPartition; class LLVOVolume; class LLViewerImage; -extern F32 gFrameTimeSeconds; - // Can have multiple silhouettes for each object const U32 SILHOUETTE_HIGHLIGHT = 0; diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index 67a379d..9df9c11 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp @@ -45,13 +45,13 @@ #include "noise.h" #include "pipeline.h" #include "llglslshader.h" +#include "llappviewer.h" static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; static U32 sShaderLevel = 0; static LLGLSLShader* sVertexProgram = NULL; -extern F32 gFrameDTClamped; extern BOOL gUseGLPick; F32 CLOTHING_GRAVITY_EFFECT = 0.7f; diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp index 54a33f2..4a7760f 100644 --- a/linden/indra/newview/lldrawpoolwater.cpp +++ b/linden/indra/newview/lldrawpoolwater.cpp @@ -50,7 +50,6 @@ #include "llvowater.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" // gSunTextureID, gMoonTextureID #include "llglslshader.h" const LLUUID WATER_TEST("2bfd3884-7e27-69b9-ba3a-3e673f680004"); diff --git a/linden/indra/newview/lleventinfo.cpp b/linden/indra/newview/lleventinfo.cpp index 17b33f1..0e69891 100644 --- a/linden/indra/newview/lleventinfo.cpp +++ b/linden/indra/newview/lleventinfo.cpp @@ -32,7 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "lleventinfo.h" -#include "viewer.h" // for gPacificDaylightTime +#include "llappviewer.h" // for gPacificDaylightTime #include "lluuid.h" #include "message.h" diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp index 424f47e..ee9177c 100644 --- a/linden/indra/newview/llfasttimerview.cpp +++ b/linden/indra/newview/llfasttimerview.cpp @@ -40,7 +40,7 @@ #include "llmath.h" #include "llfontgl.h" -#include "viewer.h" +#include "llappviewer.h" #include "llviewerimagelist.h" #include "llui.h" #include "llviewercontrol.h" diff --git a/linden/indra/newview/llfeaturemanager.cpp b/linden/indra/newview/llfeaturemanager.cpp index 6b6eacd..1bcd1e1 100644 --- a/linden/indra/newview/llfeaturemanager.cpp +++ b/linden/indra/newview/llfeaturemanager.cpp @@ -58,8 +58,6 @@ // extern LLMemoryInfo gSysMemory; extern LLCPUInfo gSysCPU; -extern void write_debug(const char *str); -extern void write_debug(const std::string& str); #if LL_DARWIN const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; @@ -493,8 +491,6 @@ void LLFeatureManager::initGraphicsFeatureMasks() } } -extern LLOSInfo gSysOS; - void LLFeatureManager::applyRecommendedFeatures() { // see featuretable.txt / featuretable_linux.txt / featuretable_mac.txt diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index 0782586..2772a13 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -41,7 +41,7 @@ #include "llfloatervoicewizard.h" #include "llviewercontrol.h" #include "llui.h" -#include "viewer.h" +#include "llappviewer.h" // static std::set LLFirstUse::sConfigVariables; diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp index 460b719..01e5290 100644 --- a/linden/indra/newview/llfloaterabout.cpp +++ b/linden/indra/newview/llfloaterabout.cpp @@ -47,7 +47,7 @@ #include "llversionviewer.h" #include "llviewerbuild.h" #include "llvieweruictrlfactory.h" -#include "viewer.h" // for gViewerDigest +#include "llappviewer.h" #if LL_LIBXUL_ENABLED #include "llmozlib.h" @@ -57,7 +57,6 @@ extern LLCPUInfo gSysCPU; extern LLMemoryInfo gSysMemory; -extern LLOSInfo gSysOS; extern U32 gPacketsIn; ///---------------------------------------------------------------------------- @@ -78,13 +77,13 @@ LLFloaterAbout::LLFloaterAbout() // Support for changing product name. LLString title("About "); - title += gSecondLife; + title += LLAppViewer::instance()->getSecondLifeTitle(); setTitle(title); LLString support; // Version string - LLString version = gSecondLife + LLString version = LLAppViewer::instance()->getSecondLifeTitle() + llformat(" %d.%d.%d (%d) %s %s (%s)", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, __DATE__, __TIME__, @@ -133,7 +132,7 @@ LLFloaterAbout::LLFloaterAbout() support.append(mem_text); support.append("OS Version: "); - support.append( gSysOS.getOSString().c_str() ); + support.append( LLAppViewer::instance()->getOSInfo().getOSString().c_str() ); support.append("\n"); support.append("Graphics Card Vendor: "); diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 71c2217..693ffe0 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -60,7 +60,6 @@ #include "llviewermenufile.h" // upload_new_resource() #include "llvoavatar.h" #include "pipeline.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" S32 LLFloaterAnimPreview::sUploadAmount = 10; diff --git a/linden/indra/newview/llfloaterauction.cpp b/linden/indra/newview/llfloaterauction.cpp index bc00565..e044ead 100644 --- a/linden/indra/newview/llfloaterauction.cpp +++ b/linden/indra/newview/llfloaterauction.cpp @@ -50,7 +50,8 @@ #include "llviewerregion.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" -#include "viewer.h" +#include "llviewerdisplay.h" +#include "llviewercontrol.h" #include "llui.h" ///---------------------------------------------------------------------------- diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index 58fe1ab..a7deb6d 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp @@ -80,7 +80,7 @@ class LLAgentHandler : public LLCommandHandler { public: LLAgentHandler() : LLCommandHandler("agent") { } - bool handle(const std::vector& params) + bool handle(const LLSD& params, const LLSD& queryMap) { if (params.size() < 2) return false; LLUUID agent_id; @@ -89,7 +89,7 @@ public: return false; } - if (params[1] == "about") + if (params[1].asString() == "about") { LLFloaterAvatarInfo::show(agent_id); return true; diff --git a/linden/indra/newview/llfloateravatarpicker.cpp b/linden/indra/newview/llfloateravatarpicker.cpp index 50f7387..a2ea8c2 100644 --- a/linden/indra/newview/llfloateravatarpicker.cpp +++ b/linden/indra/newview/llfloateravatarpicker.cpp @@ -42,7 +42,7 @@ #include "llscrolllistctrl.h" #include "lltextbox.h" #include "llvieweruictrlfactory.h" -#include "viewer.h" +#include "llagent.h" const S32 MIN_WIDTH = 200; const S32 MIN_HEIGHT = 340; @@ -265,13 +265,13 @@ void LLFloaterAvatarPicker::find() msg->newMessage("AvatarPickerRequest"); msg->nextBlock("AgentData"); - msg->addUUID("AgentID", agent_get_id()); - msg->addUUID("SessionID", agent_get_session_id()); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); msg->addUUID("QueryID", mQueryID); // not used right now msg->nextBlock("Data"); msg->addString("Name", text); - agent_send_reliable_message(); + gAgent.sendReliableMessage(); if (mListNames) { @@ -309,7 +309,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* msg->getUUID("AgentData", "QueryID", query_id); // Not for us - if (agent_id != agent_get_id()) return; + if (agent_id != gAgent.getID()) return; // Dialog already closed LLFloaterAvatarPicker *self = sInstance; diff --git a/linden/indra/newview/llfloateravatartextures.cpp b/linden/indra/newview/llfloateravatartextures.cpp index 904f47d..64dc968 100644 --- a/linden/indra/newview/llfloateravatartextures.cpp +++ b/linden/indra/newview/llfloateravatartextures.cpp @@ -110,7 +110,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp, if (id == IMG_DEFAULT_AVATAR) { ctrl->setImageAssetID(LLUUID::null); - ctrl->setToolTip("IMG_DEFAULT_AVATAR"); + ctrl->setToolTip(LLString("IMG_DEFAULT_AVATAR")); } else { diff --git a/linden/indra/newview/llfloaterbump.cpp b/linden/indra/newview/llfloaterbump.cpp index e891bbe..abae92a 100644 --- a/linden/indra/newview/llfloaterbump.cpp +++ b/linden/indra/newview/llfloaterbump.cpp @@ -37,7 +37,7 @@ #include "llscrolllistctrl.h" #include "llvieweruictrlfactory.h" -#include "viewer.h" // gPacificDaylightTime +#include "llappviewer.h" // gPacificDaylightTime ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/linden/indra/newview/llfloaterbuycurrency.cpp b/linden/indra/newview/llfloaterbuycurrency.cpp index a7233c3..4b5bb35 100644 --- a/linden/indra/newview/llfloaterbuycurrency.cpp +++ b/linden/indra/newview/llfloaterbuycurrency.cpp @@ -43,7 +43,7 @@ #include "llvieweruictrlfactory.h" #include "llweb.h" #include "llwindow.h" -#include "viewer.h" +#include "llappviewer.h" static const S32 STANDARD_BUY_AMOUNT = 1000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp index 9ae634c..12722b6 100644 --- a/linden/indra/newview/llfloaterbuyland.cpp +++ b/linden/indra/newview/llfloaterbuyland.cpp @@ -62,7 +62,7 @@ #include "llwindow.h" #include "llworld.h" #include "llxmlrpctransaction.h" -#include "viewer.h" +#include "llappviewer.h" #include "roles_constants.h" // NOTE: This is duplicated in lldatamoney.cpp ... @@ -847,7 +847,7 @@ void LLFloaterBuyLandUI::startTransaction(TransactionType type, static std::string transaction_uri; if (transaction_uri.empty()) { - transaction_uri = getHelperURI() + "landtool.php"; + transaction_uri = LLAppViewer::instance()->getHelperURI() + "landtool.php"; } const char* method; diff --git a/linden/indra/newview/llfloaterclassified.cpp b/linden/indra/newview/llfloaterclassified.cpp index aa57c6f..cc5ee59 100644 --- a/linden/indra/newview/llfloaterclassified.cpp +++ b/linden/indra/newview/llfloaterclassified.cpp @@ -46,7 +46,7 @@ class LLClassifiedHandler : public LLCommandHandler { public: LLClassifiedHandler() : LLCommandHandler("classified") { } - bool handle(const std::vector& tokens) + bool handle(const LLSD& tokens, const LLSD& queryMap) { if (tokens.size() < 2) { @@ -58,7 +58,7 @@ public: return false; } - if (tokens[1] == "about") + if (tokens[1].asString() == "about") { LLFloaterClassifiedInfo::show(classified_id); return true; diff --git a/linden/indra/newview/llfloatercolorpicker.cpp b/linden/indra/newview/llfloatercolorpicker.cpp index 03e3a2e..324da68 100644 --- a/linden/indra/newview/llfloatercolorpicker.cpp +++ b/linden/indra/newview/llfloatercolorpicker.cpp @@ -46,7 +46,6 @@ #include "v4coloru.h" #include "llbutton.h" #include "llviewercontrol.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" #include "llgl.h" diff --git a/linden/indra/newview/llfloaterdirectory.cpp b/linden/indra/newview/llfloaterdirectory.cpp index 1693532..f453794 100644 --- a/linden/indra/newview/llfloaterdirectory.cpp +++ b/linden/indra/newview/llfloaterdirectory.cpp @@ -65,6 +65,10 @@ #include "llvieweruictrlfactory.h" LLFloaterDirectory* LLFloaterDirectory::sInstance = NULL; +//static +S32 LLFloaterDirectory::sOldSearchCount = 0; // debug +S32 LLFloaterDirectory::sNewSearchCount = 0; // debug + LLFloaterDirectory::LLFloaterDirectory(const std::string& name) : LLFloater(name, "FloaterFindRect2", ""), diff --git a/linden/indra/newview/llfloaterdirectory.h b/linden/indra/newview/llfloaterdirectory.h index 4b0d81e..b7193b3 100644 --- a/linden/indra/newview/llfloaterdirectory.h +++ b/linden/indra/newview/llfloaterdirectory.h @@ -33,6 +33,7 @@ #define LL_LLFLOATERDIRECTORY_H #include "llfloater.h" +#include "lltabcontainer.h" class LLDirectoryCore; class LLPanelDirBrowser; @@ -128,6 +129,9 @@ public: LLPanelPlace* mPanelPlaceSmallp; LLPanelClassified* mPanelClassifiedp; + static S32 sOldSearchCount; // debug + static S32 sNewSearchCount; // debug + private: bool mMinimizing; // HACK: see reshape() for details static LLFloaterDirectory *sInstance; diff --git a/linden/indra/newview/llfloaterevent.cpp b/linden/indra/newview/llfloaterevent.cpp index d237fc9..9ef18cd 100644 --- a/linden/indra/newview/llfloaterevent.cpp +++ b/linden/indra/newview/llfloaterevent.cpp @@ -47,14 +47,14 @@ class LLEventHandler : public LLCommandHandler { public: LLEventHandler() : LLCommandHandler("event") { } - bool handle(const std::vector& tokens) + bool handle(const LLSD& tokens, const LLSD& queryMap) { if (tokens.size() < 2) { return false; } - U32 event_id = atoi(tokens[0].c_str()); - if (tokens[1] == "about") + U32 event_id = tokens[0].asInteger(); + if (tokens[1].asString() == "about") { LLFloaterEventInfo::show(event_id); return true; diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 6f792e0..6f4945e 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp @@ -61,19 +61,43 @@ //Maximum number of people you can select to do an operation on at once. #define MAX_FRIEND_SELECT 20 #define RIGHTS_CHANGE_TIMEOUT 5.0 +#define OBSERVER_TIMEOUT 0.5 // simple class to observe the calling cards. -class LLLocalFriendsObserver : public LLFriendObserver +class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer { -public: - LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater) {} - virtual ~LLLocalFriendsObserver() { mFloater = NULL; } +public: + LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT) + { + mEventTimer.stop(); + } + virtual ~LLLocalFriendsObserver() + { + mFloater = NULL; + } virtual void changed(U32 mask) { - mFloater->updateFriends(mask); + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); + mEventTimer.reset(); + + // save-up all the mask-bits which have come-in + mMask |= mask; + } + virtual BOOL tick() + { + mFloater->updateFriends(mMask); + + mEventTimer.stop(); + mMask = 0; + + return FALSE; } + protected: LLPanelFriends* mFloater; + U32 mMask; }; LLPanelFriends::LLPanelFriends() : diff --git a/linden/indra/newview/llfloatergroupinfo.cpp b/linden/indra/newview/llfloatergroupinfo.cpp index eb3b692..b274a51 100644 --- a/linden/indra/newview/llfloatergroupinfo.cpp +++ b/linden/indra/newview/llfloatergroupinfo.cpp @@ -56,7 +56,7 @@ class LLGroupHandler : public LLCommandHandler { public: LLGroupHandler() : LLCommandHandler("group") { } - bool handle(const std::vector& tokens) + bool handle(const LLSD& tokens, const LLSD& queryMap) { if (tokens.size() < 2) { @@ -69,7 +69,7 @@ public: return false; } - if (tokens[1] == "about") + if (tokens[1].asString() == "about") { LLFloaterGroupInfo::showFromUUID(group_id); return true; diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp index c24d435..53779b6 100644 --- a/linden/indra/newview/llfloaterimagepreview.cpp +++ b/linden/indra/newview/llfloaterimagepreview.cpp @@ -51,7 +51,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "pipeline.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" #include "llviewerimagelist.h" diff --git a/linden/indra/newview/llfloaterimport.cpp b/linden/indra/newview/llfloaterimport.cpp index 4923497..edb1edb 100644 --- a/linden/indra/newview/llfloaterimport.cpp +++ b/linden/indra/newview/llfloaterimport.cpp @@ -57,7 +57,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "pipeline.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" #include "llmd5.h" diff --git a/linden/indra/newview/llfloaterlagmeter.cpp b/linden/indra/newview/llfloaterlagmeter.cpp index 399d0b6..04a5cf6 100644 --- a/linden/indra/newview/llfloaterlagmeter.cpp +++ b/linden/indra/newview/llfloaterlagmeter.cpp @@ -37,7 +37,8 @@ #include "llviewerstats.h" #include "llviewerimage.h" #include "llviewercontrol.h" -#include "viewer.h" +#include "llappviewer.h" + #include "lltexturefetch.h" #include "llbutton.h" @@ -189,7 +190,7 @@ void LLFloaterLagMeter::determineClient() { mClientCause->setText( childGetText("client_draw_distance_cause_msg") ); } - else if(gTextureFetch->getNumRequests() > 2) + else if(LLAppViewer::instance()->getTextureFetch()->getNumRequests() > 2) { mClientCause->setText( childGetText("client_texture_loading_cause_msg") ); } diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 283b3f4..543dd94 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp @@ -239,7 +239,6 @@ LLFloaterLand::LLFloaterLand() factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - factory_map["land_ban_panel"] = LLCallbackMap(createPanelLandBan, this); gUICtrlFactory->buildFloater(this, "floater_about_land.xml", &factory_map); @@ -271,7 +270,6 @@ void LLFloaterLand::refresh() mPanelOptions->refresh(); mPanelMedia->refresh(); mPanelAccess->refresh(); - mPanelBan->refresh(); } @@ -326,15 +324,6 @@ void* LLFloaterLand::createPanelLandAccess(void* data) return self->mPanelAccess; } -// static -void* LLFloaterLand::createPanelLandBan(void* data) -{ - LLFloaterLand* self = (LLFloaterLand*)data; - self->mPanelBan = new LLPanelLandBan(self->mParcel); - return self->mPanelBan; -} - - //--------------------------------------------------------------------------- // LLPanelLandGeneral //--------------------------------------------------------------------------- @@ -2558,35 +2547,27 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) BOOL LLPanelLandAccess::postBuild() { - - - mCheckGroup = LLUICtrlFactory::getCheckBoxByName(this, "GroupCheck"); + childSetCommitCallback("public_access", onCommitAny, this); + childSetCommitCallback("limit_payment", onCommitAny, this); + childSetCommitCallback("limit_age_verified", onCommitAny, this); childSetCommitCallback("GroupCheck", onCommitAny, this); - - mCheckAccess = LLUICtrlFactory::getCheckBoxByName(this, "AccessCheck"); - childSetCommitCallback("AccessCheck", onCommitAny, this); - - mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList"); - mListAccess->sortByColumn(0, TRUE); // ascending - - mBtnAddAccess = LLUICtrlFactory::getButtonByName(this, "Add..."); - - mBtnAddAccess->setClickedCallback(onClickAdd, this); - - mBtnRemoveAccess = LLUICtrlFactory::getButtonByName(this, "Remove"); - - mBtnRemoveAccess->setClickedCallback(onClickRemove, this); - - mCheckPass = LLUICtrlFactory::getCheckBoxByName(this, "PassCheck"); childSetCommitCallback("PassCheck", onCommitAny, this); - - - mSpinPrice = LLUICtrlFactory::getSpinnerByName(this, "PriceSpin"); + childSetCommitCallback("pass_combo", onCommitAny, this); childSetCommitCallback("PriceSpin", onCommitAny, this); - - mSpinHours = LLUICtrlFactory::getSpinnerByName(this, "HoursSpin"); childSetCommitCallback("HoursSpin", onCommitAny, this); + childSetAction("add_allowed", onClickAddAccess, this); + childSetAction("remove_allowed", onClickRemoveAccess, this); + childSetAction("add_banned", onClickAddBanned, this); + childSetAction("remove_banned", onClickRemoveBanned, this); + + mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList"); + if (mListAccess) + mListAccess->sortByColumn(0, TRUE); // ascending + + mListBanned = LLUICtrlFactory::getNameListByName(this, "BannedList"); + if (mListBanned) + mListBanned->sortByColumn(0, TRUE); // ascending return TRUE; } @@ -2598,106 +2579,241 @@ LLPanelLandAccess::~LLPanelLandAccess() void LLPanelLandAccess::refresh() { - mListAccess->deleteAllItems(); - + if (mListAccess) + mListAccess->deleteAllItems(); + if (mListBanned) + mListBanned->deleteAllItems(); + LLParcel *parcel = mParcel->getParcel(); - + + // Display options if (parcel) { - // Display options + BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); - mCheckGroup->set( use_group ); + BOOL public_access = !use_access_list && !use_group; + + childSetValue("public_access", public_access ); + childSetValue("GroupCheck", use_group ); char group_name[MAX_STRING]; /*Flawfinder: ignore*/ gCacheName->getGroupName(parcel->getGroupID(), group_name); - mCheckGroup->setLabelArg( "[GROUP]", LLString(group_name) ); - - S32 count = parcel->mAccessList.size(); - - BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); - mCheckAccess->set( use_list ); - mCheckAccess->setLabelArg( "[LISTED]", llformat("%d",count)); - mCheckAccess->setLabelArg( "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - - access_map_const_iterator cit = parcel->mAccessList.begin(); - access_map_const_iterator end = parcel->mAccessList.end(); - - for (; cit != end; ++cit) + childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name) ); + + // Allow list { - const LLAccessEntry& entry = (*cit).second; - LLString suffix; - if (entry.mTime != 0) + S32 count = parcel->mAccessList.size(); + childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count)); + childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + + // *TODO: Translate + for (access_map_const_iterator cit = parcel->mAccessList.begin(); + cit != parcel->mAccessList.end(); ++cit) { - S32 now = time(NULL); - S32 seconds = entry.mTime - now; - if (seconds < 0) seconds = 0; - suffix.assign(" ("); - if (seconds >= 120) + const LLAccessEntry& entry = (*cit).second; + LLString suffix; + if (entry.mTime != 0) { - char buf[30]; /*Flawfinder: ignore*/ - snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */ - suffix.append(buf); + S32 now = time(NULL); + S32 seconds = entry.mTime - now; + if (seconds < 0) seconds = 0; + suffix.assign(" ("); + if (seconds >= 120) + { + std::string buf = llformat("%d minutes", (seconds/60)); + suffix.append(buf); + } + else if (seconds >= 60) + { + suffix.append("1 minute"); + } + else + { + std::string buf = llformat("%d seconds", seconds); + suffix.append(buf); + } + suffix.append(" remaining)"); } - else if (seconds >= 60) - { - suffix.append("1 minute"); - } - else - { - char buf[30]; /*Flawfinder: ignore*/ - snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */ - suffix.append(buf); - } - suffix.append(" remaining)"); + if (mListAccess) + mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); } - mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); } - BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); - - BOOL enable_add = can_manage_allowed && (count < PARCEL_MAX_ACCESS_LIST); - mBtnAddAccess->setEnabled(enable_add); + // Ban List + { + S32 count = parcel->mBanList.size(); - BOOL enable_remove = can_manage_allowed && (count > 0); - mBtnRemoveAccess->setEnabled(enable_remove); + childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count)); + childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - // Can only sell passes when limiting the access. - BOOL can_manage_passes = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_PASSES); - mCheckPass->setEnabled( (use_group || use_list) && can_manage_passes ); + for (access_map_const_iterator cit = parcel->mBanList.begin(); + cit != parcel->mBanList.end(); ++cit) + { + const LLAccessEntry& entry = (*cit).second; + LLString suffix; + if (entry.mTime != 0) + { + S32 now = time(NULL); + S32 seconds = entry.mTime - now; + if (seconds < 0) seconds = 0; + suffix.assign(" ("); + if (seconds >= 120) + { + std::string buf = llformat("%d minutes", (seconds/60)); + suffix.append(buf); + } + else if (seconds >= 60) + { + suffix.append("1 minute"); + } + else + { + std::string buf = llformat("%d seconds", seconds); + suffix.append(buf); + } + suffix.append(" remaining)"); + } + mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); + } + } + if(parcel->getRegionDenyAnonymousOverride()) + { + childSetValue("limit_payment", TRUE); + } + else + { + childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS))); + } + if(parcel->getRegionDenyAgeUnverifiedOverride()) + { + childSetValue("limit_age_verified", TRUE); + } + else + { + childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); + } + BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - mCheckPass->set( use_pass ); - - BOOL enable_pass = can_manage_passes && use_pass; - mSpinPrice->setEnabled( enable_pass ); - mSpinHours->setEnabled( enable_pass ); - + childSetValue("PassCheck", use_pass ); + LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); + if (passcombo) + { + if (public_access || !use_pass || !use_group) + { + passcombo->selectByValue("anyone"); + } + } + S32 pass_price = parcel->getPassPrice(); - mSpinPrice->set( F32(pass_price) ); + childSetValue( "PriceSpin", (F32)pass_price ); F32 pass_hours = parcel->getPassHours(); - mSpinHours->set( pass_hours ); - - mCheckGroup->setEnabled( can_manage_allowed ); - mCheckAccess->setEnabled( can_manage_allowed ); - + childSetValue( "HoursSpin", pass_hours ); } else { - mCheckGroup->set(FALSE); - mCheckGroup->setLabelArg( "[GROUP]", LLString::null ); - mCheckAccess->set(FALSE); - mCheckAccess->setLabelArg( "[LISTED]", llformat("%d",0)); - mBtnAddAccess->setEnabled(FALSE); - mBtnRemoveAccess->setEnabled(FALSE); - mSpinPrice->set((F32)PARCEL_PASS_PRICE_DEFAULT); - mSpinPrice->setEnabled(FALSE); - mSpinHours->set( PARCEL_PASS_HOURS_DEFAULT ); - mSpinHours->setEnabled(FALSE); - mCheckGroup->setEnabled(FALSE); - mCheckAccess->setEnabled(FALSE); + childSetValue("public_access", FALSE); + childSetValue("limit_payment", FALSE); + childSetValue("limit_age_verified", FALSE); + childSetValue("GroupCheck", FALSE); + childSetLabelArg("GroupCheck", "[GROUP]", LLString::null ); + childSetValue("PassCheck", FALSE); + childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); + childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); + childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",0)); + childSetToolTipArg("AccessList", "[MAX]", llformat("%d",0)); + childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",0)); + childSetToolTipArg("BannedList", "[MAX]", llformat("%d",0)); + } +} + +void LLPanelLandAccess::refresh_ui() +{ + childSetEnabled("public_access", FALSE); + childSetEnabled("limit_payment", FALSE); + childSetEnabled("limit_age_verified", FALSE); + childSetEnabled("GroupCheck", FALSE); + childSetEnabled("PassCheck", FALSE); + childSetEnabled("pass_combo", FALSE); + childSetEnabled("PriceSpin", FALSE); + childSetEnabled("HoursSpin", FALSE); + childSetEnabled("AccessList", FALSE); + childSetEnabled("BannedList", FALSE); + + LLParcel *parcel = mParcel->getParcel(); + if (parcel) + { + BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); + BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); + + childSetEnabled("public_access", can_manage_allowed); + BOOL public_access = childGetValue("public_access").asBoolean(); + if (public_access) + { + bool override = false; + if(parcel->getRegionDenyAnonymousOverride()) + { + override = true; + childSetEnabled("limit_payment", FALSE); + } + else + { + childSetEnabled("limit_payment", can_manage_allowed); + } + if(parcel->getRegionDenyAgeUnverifiedOverride()) + { + override = true; + childSetEnabled("limit_age_verified", FALSE); + } + else + { + childSetEnabled("limit_age_verified", can_manage_allowed); + } + if (override) + { + childSetToolTip("Only Allow", getUIString("estate_override")); + } + else + { + childSetToolTip("Only Allow", LLString()); + } + childSetEnabled("GroupCheck", FALSE); + childSetEnabled("PassCheck", FALSE); + childSetEnabled("pass_combo", FALSE); + childSetEnabled("AccessList", FALSE); + } + else + { + childSetEnabled("limit_payment", FALSE); + childSetEnabled("limit_age_verified", FALSE); + char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) + { + childSetEnabled("GroupCheck", can_manage_allowed); + } + BOOL group_access = childGetValue("GroupCheck").asBoolean(); + BOOL sell_passes = childGetValue("PassCheck").asBoolean(); + childSetEnabled("PassCheck", can_manage_allowed); + if (sell_passes) + { + childSetEnabled("pass_combo", group_access && can_manage_allowed); + childSetEnabled("PriceSpin", can_manage_allowed); + childSetEnabled("HoursSpin", can_manage_allowed); + } + } + childSetEnabled("AccessList", can_manage_allowed); + S32 allowed_list_count = parcel->mAccessList.size(); + childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); + childSetEnabled("remove_allowed", can_manage_allowed && allowed_list_count > 0); + + childSetEnabled("BannedList", can_manage_banned); + S32 banned_list_count = parcel->mBanList.size(); + childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); + childSetEnabled("remove_banned", can_manage_banned && banned_list_count > 0); } } + // public void LLPanelLandAccess::refreshNames() @@ -2709,23 +2825,19 @@ void LLPanelLandAccess::refreshNames() { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - mCheckGroup->setLabelArg("[GROUP]", LLString(group_name)); + childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name)); } // virtual void LLPanelLandAccess::draw() { + refresh_ui(); refreshNames(); LLPanel::draw(); } -void LLPanelLandAccess::onAccessLevelChange(LLUICtrl*, void *userdata) -{ - LLPanelLandAccess::onCommitAny(NULL, userdata); -} - // static void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { @@ -2738,27 +2850,53 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL use_access_group = self->mCheckGroup->get(); - BOOL use_access_list = self->mCheckAccess->get(); - BOOL use_pass_list = self->mCheckPass->get(); - - - - // Must be limiting access to sell passes - if (!use_access_group && !use_access_list) + BOOL public_access = self->childGetValue("public_access").asBoolean(); + BOOL limit_payment = FALSE, limit_age_verified = FALSE; + BOOL use_access_group = FALSE; + BOOL use_access_list = FALSE; + BOOL use_pass_list = FALSE; + if (public_access) { - use_pass_list = FALSE; + use_access_list = FALSE; + limit_payment = self->childGetValue("limit_payment").asBoolean(); + limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); + } + else + { + use_access_list = TRUE; + use_access_group = self->childGetValue("GroupCheck").asBoolean(); + use_pass_list = self->childGetValue("PassCheck").asBoolean(); + if (use_access_group) + { + char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + if (!gCacheName->getGroupName(parcel->getGroupID(), group_name)) + { + use_access_group = FALSE; + } + if (use_pass_list) + { + LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + if (passcombo) + { + if (passcombo->getSimpleSelectedValue().asString() == "group") + { + use_access_list = FALSE; + } + } + } + } } - S32 pass_price = llfloor(self->mSpinPrice->get()); - F32 pass_hours = self->mSpinHours->get(); - - // Validate extracted data + S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal()); + F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); parcel->setParcelFlag(PF_USE_ACCESS_LIST, use_access_list); parcel->setParcelFlag(PF_USE_PASS_LIST, use_pass_list); + parcel->setParcelFlag(PF_USE_BAN_LIST, TRUE); + parcel->setParcelFlag(PF_DENY_ANONYMOUS, limit_payment); + parcel->setParcelFlag(PF_DENY_AGEUNVERIFIED, limit_age_verified); parcel->setPassPrice( pass_price ); parcel->setPassHours( pass_hours ); @@ -2771,287 +2909,100 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // static -void LLPanelLandAccess::onClickAdd(void* data) +void LLPanelLandAccess::onClickAddAccess(void* data) { LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, data) ); -} - -// static -void LLPanelLandAccess::callbackAvatarID(const std::vector& names, const std::vector& ids, void* userdata) -{ - LLPanelLandAccess* self = (LLPanelLandAccess*)userdata; - if (names.empty() || ids.empty()) return; - self->addAvatar(ids[0]); -} - - -void LLPanelLandAccess::addAvatar(LLUUID id) -{ - LLParcel* parcel = mParcel->getParcel(); - if (!parcel) return; - - parcel->addToAccessList(id, 0); - - gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); - - refresh(); + if (panelp) + { + gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBAccess, data) ); + } } - // static -void LLPanelLandAccess::onClickRemove(void* data) +void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector& names, const std::vector& ids, void* userdata) { - LLPanelLandAccess* self = (LLPanelLandAccess*)data; - if (!self) return; - - LLScrollListItem* item = self->mListAccess->getFirstSelected(); - if (!item) return; - - LLParcel* parcel = self->mParcel->getParcel(); - if (!parcel) return; - - const LLUUID& agent_id = item->getUUID(); - - parcel->removeFromAccessList(agent_id); - - gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); - - self->refresh(); -} - - - -//--------------------------------------------------------------------------- -// LLPanelLandBan -//--------------------------------------------------------------------------- -LLPanelLandBan::LLPanelLandBan(LLParcelSelectionHandle& parcel) -: LLPanel("land_ban_panel"), mParcel(parcel) -{ - -} - - - -BOOL LLPanelLandBan::postBuild() -{ - - mCheck = LLUICtrlFactory::getCheckBoxByName(this, "LandBanCheck"); - childSetCommitCallback("LandBanCheck", onCommitAny, this); - - mList = LLUICtrlFactory::getNameListByName(this, "LandBanList"); - mList->sortByColumn(0, TRUE); // ascending - - mBtnAdd = LLUICtrlFactory::getButtonByName(this, "Add..."); - - mBtnAdd->setClickedCallback(onClickAdd, this); - - mBtnRemove = LLUICtrlFactory::getButtonByName(this, "Remove"); - - mBtnRemove->setClickedCallback(onClickRemove, this); - - mCheckDenyAnonymous = LLUICtrlFactory::getCheckBoxByName(this, "DenyAnonymousCheck"); - childSetCommitCallback("DenyAnonymousCheck", onCommitAny, this); - - mCheckDenyIdentified = LLUICtrlFactory::getCheckBoxByName(this, "DenyIdentifiedCheck"); - childSetCommitCallback("DenyIdentifiedCheck", onCommitAny, this); - - mCheckDenyTransacted = LLUICtrlFactory::getCheckBoxByName(this, "DenyTransactedCheck"); - childSetCommitCallback("DenyTransactedCheck", onCommitAny, this); - - return TRUE; - -} - - -LLPanelLandBan::~LLPanelLandBan() -{ } - -void LLPanelLandBan::refresh() -{ - mList->deleteAllItems(); - - LLParcel *parcel = mParcel->getParcel(); - - if (parcel) + LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata; + if (!names.empty() && !ids.empty()) { - // Display options - - S32 count = parcel->mBanList.size(); - - BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST); - mCheck->set( use_ban ); - mCheck->setLabelArg( "[LISTED]", llformat("%d",count)); - mCheck->setLabelArg( "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - - access_map_const_iterator cit = parcel->mBanList.begin(); - access_map_const_iterator end = parcel->mBanList.end(); - for ( ; cit != end; ++cit) - { - const LLAccessEntry& entry = (*cit).second; - LLString suffix; - if (entry.mTime != 0) - { - S32 now = time(NULL); - S32 seconds = entry.mTime - now; - if (seconds < 0) seconds = 0; - suffix.assign(" ("); - if (seconds >= 120) - { - char buf[30]; /*Flawfinder: ignore*/ - snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /* Flawfinder: ignore */ - suffix.append(buf); - } - else if (seconds >= 60) - { - suffix.append("1 minute"); - } - else - { - char buf[30]; /*Flawfinder: ignore*/ - snprintf(buf, sizeof(buf), "%d seconds", seconds); /* Flawfinder: ignore */ - suffix.append(buf); - } - suffix.append(" remaining)"); - } - mList->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); - } - - BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); - mCheck->setEnabled( can_manage_banned ); - mCheckDenyAnonymous->setEnabled( FALSE ); - mCheckDenyIdentified->setEnabled( FALSE ); - mCheckDenyTransacted->setEnabled( FALSE ); - - if(parcel->getRegionDenyAnonymousOverride()) - { - mCheckDenyAnonymous->set(TRUE); - } - else if(can_manage_banned) - { - mCheckDenyAnonymous->setEnabled(TRUE); - mCheckDenyAnonymous->set(parcel->getParcelFlag(PF_DENY_ANONYMOUS)); - } - if(parcel->getRegionDenyIdentifiedOverride()) - { - mCheckDenyIdentified->set(TRUE); - } - else if(can_manage_banned) - { - mCheckDenyIdentified->setEnabled(TRUE); - mCheckDenyIdentified->set(parcel->getParcelFlag(PF_DENY_IDENTIFIED)); - } - if(parcel->getRegionDenyTransactedOverride()) - { - mCheckDenyTransacted->set(TRUE); - } - else if(can_manage_banned) + LLUUID id = ids[0]; + LLParcel* parcel = panelp->mParcel->getParcel(); + if (parcel) { - mCheckDenyTransacted->setEnabled(TRUE); - mCheckDenyTransacted->set(parcel->getParcelFlag(PF_DENY_TRANSACTED)); + parcel->addToAccessList(id, 0); + gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); + panelp->refresh(); } - - - BOOL enable_add = can_manage_banned && (count < PARCEL_MAX_ACCESS_LIST); - mBtnAdd->setEnabled(enable_add); - - BOOL enable_remove = can_manage_banned && (count > 0); - mBtnRemove->setEnabled(enable_remove); - } - else - { - mCheck->set(FALSE); - mCheck->setLabelArg( "[LISTED]", llformat("%d",0)); - mCheck->setEnabled(FALSE); - mBtnAdd->setEnabled(FALSE); - mBtnRemove->setEnabled(FALSE); - mCheckDenyAnonymous->set(FALSE); - mCheckDenyAnonymous->setEnabled(FALSE); - mCheckDenyIdentified->set(FALSE); - mCheckDenyIdentified->setEnabled(FALSE); - mCheckDenyTransacted->set(FALSE); - mCheckDenyTransacted->setEnabled(FALSE); } } // static -void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata) +void LLPanelLandAccess::onClickRemoveAccess(void* data) { - LLPanelLandBan *self = (LLPanelLandBan*)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); - if (!parcel) + LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; + if (panelp && panelp->mListAccess) { - return; + LLParcel* parcel = panelp->mParcel->getParcel(); + if (parcel) + { + std::vector names = panelp->mListAccess->getAllSelected(); + for (std::vector::iterator iter = names.begin(); + iter != names.end(); ) + { + LLScrollListItem* item = *iter++; + const LLUUID& agent_id = item->getUUID(); + parcel->removeFromAccessList(agent_id); + } + gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); + panelp->refresh(); + } } - - // Extract data from UI - BOOL use_ban_list = self->mCheck->get(); - BOOL deny_access_anonymous = self->mCheckDenyAnonymous->get(); - BOOL deny_access_identified = self->mCheckDenyIdentified->get(); - BOOL deny_access_transacted = self->mCheckDenyTransacted->get(); - - // Push data into current parcel - parcel->setParcelFlag(PF_USE_BAN_LIST, use_ban_list); - parcel->setParcelFlag(PF_DENY_ANONYMOUS, deny_access_anonymous); - parcel->setParcelFlag(PF_DENY_IDENTIFIED, deny_access_identified); - parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted); - - // Send current parcel data upstream to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); - - // Might have changed properties, so let's redraw! - self->refresh(); } // static -void LLPanelLandBan::onClickAdd(void* data) +void LLPanelLandAccess::onClickAddBanned(void* data) { - LLPanelLandBan* panelp = (LLPanelLandBan*)data; - gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, data) ); + LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; + gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBBanned, data) ); } // static -void LLPanelLandBan::callbackAvatarID(const std::vector& names, const std::vector& ids, void* userdata) +void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector& names, const std::vector& ids, void* userdata) { - LLPanelLandBan* self = (LLPanelLandBan*)userdata; - if (names.empty() || ids.empty()) return; - self->addAvatar(ids[0]); -} - - -void LLPanelLandBan::addAvatar(LLUUID id) -{ - LLParcel* parcel = mParcel->getParcel(); - if (!parcel) return; - - parcel->addToBanList(id, 0); - - gParcelMgr->sendParcelAccessListUpdate(AL_BAN); - - refresh(); + LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata; + if (!names.empty() && !ids.empty()) + { + LLUUID id = ids[0]; + LLParcel* parcel = panelp->mParcel->getParcel(); + if (parcel) + { + parcel->addToBanList(id, 0); + gParcelMgr->sendParcelAccessListUpdate(AL_BAN); + panelp->refresh(); + } + } } - // static -void LLPanelLandBan::onClickRemove(void* data) +void LLPanelLandAccess::onClickRemoveBanned(void* data) { - LLPanelLandBan* self = (LLPanelLandBan*)data; - if (!self) return; - - LLScrollListItem* item = self->mList->getFirstSelected(); - if (!item) return; - - LLParcel* parcel = self->mParcel->getParcel(); - if (!parcel) return; - - const LLUUID& agent_id = item->getUUID(); - - parcel->removeFromBanList(agent_id); - - gParcelMgr->sendParcelAccessListUpdate(AL_BAN); - - self->refresh(); + LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; + if (panelp && panelp->mListBanned) + { + LLParcel* parcel = panelp->mParcel->getParcel(); + if (parcel) + { + std::vector names = panelp->mListBanned->getAllSelected(); + for (std::vector::iterator iter = names.begin(); + iter != names.end(); ) + { + LLScrollListItem* item = *iter++; + const LLUUID& agent_id = item->getUUID(); + parcel->removeFromBanList(agent_id); + } + gParcelMgr->sendParcelAccessListUpdate(AL_BAN); + panelp->refresh(); + } + } } //--------------------------------------------------------------------------- diff --git a/linden/indra/newview/llfloaterland.h b/linden/indra/newview/llfloaterland.h index d8b7ecf..9be813f 100644 --- a/linden/indra/newview/llfloaterland.h +++ b/linden/indra/newview/llfloaterland.h @@ -112,7 +112,6 @@ protected: LLPanelLandOptions* mPanelOptions; LLPanelLandMedia* mPanelMedia; LLPanelLandAccess* mPanelAccess; - LLPanelLandBan* mPanelBan; LLPanelLandCovenant* mPanelCovenant; LLHandle mParcel; @@ -392,93 +391,28 @@ public: LLPanelLandAccess(LLHandle& parcelp); virtual ~LLPanelLandAccess(); void refresh(); + void refresh_ui(); void refreshNames(); virtual void draw(); - void addAvatar(LLUUID id); - static void onCommitAny(LLUICtrl* ctrl, void *userdata); - static void onClickAdd(void*); - static void onClickRemove(void*); - static void callbackAvatarID(const std::vector& names, const std::vector& ids, void* userdata); - static void onAccessLevelChange(LLUICtrl* ctrl, void* userdata); + static void onClickAddAccess(void*); + static void callbackAvatarCBAccess(const std::vector& names, const std::vector& ids, void* userdata); + static void onClickRemoveAccess(void*); + static void onClickAddBanned(void*); + static void callbackAvatarCBBanned(const std::vector& names, const std::vector& ids, void* userdata); + static void onClickRemoveBanned(void*); virtual BOOL postBuild(); protected: - LLTextBox* mLabelTitle; - - LLCheckBoxCtrl* mCheckGroup; - - LLCheckBoxCtrl* mCheckAccess; LLNameListCtrl* mListAccess; - LLButton* mBtnAddAccess; - LLButton* mBtnRemoveAccess; - - LLCheckBoxCtrl* mCheckPass; - LLSpinCtrl* mSpinPrice; - LLSpinCtrl* mSpinHours; - - LLCheckBoxCtrl* mCheckIdentified; - LLCheckBoxCtrl* mCheckTransacted; - LLRadioGroup* mCheckStatusLevel; + LLNameListCtrl* mListBanned; LLHandle& mParcel; }; -class LLPanelLandBan -: public LLPanel -{ -public: - LLPanelLandBan(LLHandle& parcelp); - virtual ~LLPanelLandBan(); - void refresh(); - - void addAvatar(LLUUID id); - - static void onCommitAny(LLUICtrl* ctrl, void *userdata); - static void onClickAdd(void*); - static void onClickRemove(void*); - static void callbackAvatarID(const std::vector& names, const std::vector& ids, void* userdata); - - virtual BOOL postBuild(); - -protected: - LLTextBox* mLabelTitle; - - LLCheckBoxCtrl* mCheck; - LLNameListCtrl* mList; - LLButton* mBtnAdd; - LLButton* mBtnRemove; - LLCheckBoxCtrl* mCheckDenyAnonymous; - LLCheckBoxCtrl* mCheckDenyIdentified; - LLCheckBoxCtrl* mCheckDenyTransacted; - - LLHandle& mParcel; -}; - - -class LLPanelLandRenters -: public LLPanel -{ -public: - LLPanelLandRenters(LLHandle& parcelp); - virtual ~LLPanelLandRenters(); - void refresh(); - - static void onClickAdd(void*); - static void onClickRemove(void*); - -protected: - LLCheckBoxCtrl* mCheckRenters; - LLNameListCtrl* mListRenters; - LLButton* mBtnAddRenter; - LLButton* mBtnRemoveRenter; - - LLHandle& mParcel; -}; - class LLPanelLandCovenant : public LLPanel { diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index a158000..ef628be 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp @@ -63,7 +63,7 @@ #include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llviewerstats.h" -#include "viewer.h" +#include "llurlsimstring.h" #include "llglheaders.h" @@ -178,7 +178,7 @@ void LLFloaterMap::onClose(bool app_quitting) BOOL LLFloaterMap::canClose() { - return !gQuit; + return !LLApp::isExiting(); } diff --git a/linden/indra/newview/llfloaternewim.cpp b/linden/indra/newview/llfloaternewim.cpp index b21ad31..bd7107d 100644 --- a/linden/indra/newview/llfloaternewim.cpp +++ b/linden/indra/newview/llfloaternewim.cpp @@ -53,7 +53,6 @@ #include "lltextbox.h" extern LLAudioEngine* gAudiop; -extern BOOL gInitializationComplete; S32 COL_1_WIDTH = 200; static LLString sOnlineDescriptor = "*"; diff --git a/linden/indra/newview/llfloaterparcel.cpp b/linden/indra/newview/llfloaterparcel.cpp index a63987a..8cb91a0 100644 --- a/linden/indra/newview/llfloaterparcel.cpp +++ b/linden/indra/newview/llfloaterparcel.cpp @@ -42,7 +42,7 @@ class LLParcelHandler : public LLCommandHandler { public: LLParcelHandler() : LLCommandHandler("parcel") { } - bool handle(const std::vector& params) + bool handle(const LLSD& params, const LLSD& queryMap) { if (params.size() < 2) { @@ -53,7 +53,7 @@ public: { return false; } - if (params[1] == "about") + if (params[1].asString() == "about") { LLFloaterParcelInfo::show(parcel_id); return true; diff --git a/linden/indra/newview/llfloaterpostcard.cpp b/linden/indra/newview/llfloaterpostcard.cpp index cab9d37..a00f512 100644 --- a/linden/indra/newview/llfloaterpostcard.cpp +++ b/linden/indra/newview/llfloaterpostcard.cpp @@ -60,7 +60,6 @@ #include "llimagej2c.h" #include "llvfile.h" #include "llvfs.h" -#include "viewer.h" #include "llassetuploadresponders.h" diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp index 100ae0c..25a88e6 100644 --- a/linden/indra/newview/llfloaterpreference.cpp +++ b/linden/indra/newview/llfloaterpreference.cpp @@ -47,13 +47,16 @@ #include "llspinctrl.h" #include "message.h" +#include "llcommandhandler.h" #include "llfloaterabout.h" +#include "llfloaterpreference.h" #include "llpanelnetwork.h" #include "llpanelaudioprefs.h" #include "llpaneldisplay.h" #include "llpaneldebug.h" #include "llpanelgeneral.h" #include "llpanelinput.h" +#include "llpanellogin.h" #include "llpanelLCD.h" #include "llpanelmsgs.h" #include "llpanelweb.h" @@ -71,6 +74,13 @@ #include "llkeyboard.h" #include "llscrollcontainer.h" +#if LL_WINDOWS +// for Logitech LCD keyboards / speakers +#ifndef LL_LOGITECH_LCD_H +#include "lllogitechlcd.h" +#endif +extern llLCD *gLcdScreen; +#endif const S32 PREF_BORDER = 4; const S32 PREF_PAD = 5; @@ -81,13 +91,20 @@ const S32 PREF_FLOATER_MIN_HEIGHT = 2 * SCROLLBAR_SIZE + 2 * LLPANEL_BORDER_WIDT LLFloaterPreference* LLFloaterPreference::sInstance = NULL; -#if LL_WINDOWS -// for Logitech LCD keyboards / speakers -#ifndef LL_LOGITECH_LCD_H -#include "lllogitechlcd.h" -#endif -extern llLCD *gLcdScreen; -#endif + +class LLPreferencesHandler : public LLCommandHandler +{ +public: + LLPreferencesHandler() : LLCommandHandler("preferences") { } + bool handle(const LLSD& tokens, const LLSD& queryMap) + { + LLFloaterPreference::show(NULL); + return true; + } +}; + +LLPreferencesHandler gPreferencesHandler; + // Must be done at run time, not compile time. JC S32 pref_min_width() @@ -410,6 +427,8 @@ void LLFloaterPreference::show(void*) gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); gAgent.sendReliableMessage(); } + + LLPanelLogin::setAlwaysRefresh(true); } @@ -423,6 +442,9 @@ void LLFloaterPreference::onClickAbout(void*) // static void LLFloaterPreference::onBtnOK( void* userdata ) { + //refresh splash page if we're displaying it + LLPanelLogin::loadLoginPage(); + LLFloaterPreference *fp =(LLFloaterPreference *)userdata; // commit any outstanding text entry if (fp->hasFocus()) @@ -466,6 +488,16 @@ void LLFloaterPreference::onBtnApply( void* userdata ) } } fp->apply(); + + //refresh splash page if we're displaying it + LLPanelLogin::loadLoginPage(); +} + + +void LLFloaterPreference::onClose(bool app_quitting) +{ + LLPanelLogin::setAlwaysRefresh(false); + LLFloater::onClose(app_quitting); } diff --git a/linden/indra/newview/llfloaterpreference.h b/linden/indra/newview/llfloaterpreference.h index a4c43fc..bf55476 100644 --- a/linden/indra/newview/llfloaterpreference.h +++ b/linden/indra/newview/llfloaterpreference.h @@ -117,6 +117,7 @@ protected: LLPreferenceCore *mPreferenceCore; /*virtual*/ void draw(); + /*virtual*/ void onClose(bool app_quitting); LLButton* mAboutBtn; LLButton *mOKBtn; diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp index 20f3192..3306142 100644 --- a/linden/indra/newview/llfloaterregioninfo.cpp +++ b/linden/indra/newview/llfloaterregioninfo.cpp @@ -408,6 +408,15 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) region)); } +// public +void LLFloaterRegionInfo::refresh() +{ + for(info_panels_t::iterator iter = mInfoPanels.begin(); + iter != mInfoPanels.end(); ++iter) + { + (*iter)->refresh(); + } +} ///---------------------------------------------------------------------------- @@ -447,6 +456,7 @@ void LLPanelRegionInfo::onChangeAnything(LLUICtrl* ctrl, void* user_data) if(panel) { panel->enableButton("apply_btn"); + panel->refresh(); } } @@ -455,6 +465,7 @@ BOOL LLPanelRegionInfo::postBuild() { childSetAction("apply_btn", onBtnSet, this); childDisable("apply_btn"); + refresh(); return TRUE; } @@ -716,6 +727,8 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() body["allow_land_resell"] = childGetValue("allow_land_resell_check"); body["agent_limit"] = childGetValue("agent_limit_spin"); body["prim_bonus"] = childGetValue("object_bonus_spin"); + // the combo box stores strings "Mature" and "PG", but we have to convert back to a number, + // because the sim doesn't know from strings for this stuff body["sim_access"] = LLViewerRegion::stringToAccess(childGetValue("access_combo").asString().c_str()); body["restrict_pushobject"] = childGetValue("restrict_pushobject"); body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); @@ -1907,6 +1920,7 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) BOOL owner = (region && (region->getOwner() == gAgent.getID())); BOOL manager = (region && region->isEstateManager()); setCtrlsEnabled(god || owner || manager); + childDisable("apply_btn"); childSetEnabled("add_allowed_avatar_btn", god || owner || manager); childSetEnabled("remove_allowed_avatar_btn", god || owner || manager); @@ -1942,8 +1956,7 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings); - - + refresh(); return rv; } @@ -1974,9 +1987,8 @@ BOOL LLPanelEstateInfo::postBuild() initCtrl("use_global_time_check"); initCtrl("fixed_sun_check"); initCtrl("allow_direct_teleport"); - initCtrl("deny_anonymous"); - initCtrl("deny_identified"); - initCtrl("deny_transacted"); + initCtrl("limit_payment"); + initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); @@ -2043,6 +2055,19 @@ BOOL LLPanelEstateInfo::postBuild() return LLPanelRegionInfo::postBuild(); } +void LLPanelEstateInfo::refresh() +{ + bool public_access = childGetValue("externally_visible_check").asBoolean(); + childSetEnabled("Only Allow", public_access); + childSetEnabled("limit_payment", public_access); + childSetEnabled("limit_age_verified", public_access); + // if this is set to false, then the limit fields are meaningless and should be turned off + if (public_access == false) + { + childSetValue("limit_payment", false); + childSetValue("limit_age_verified", false); + } +} BOOL LLPanelEstateInfo::sendUpdate() { @@ -2157,10 +2182,11 @@ void LLPanelEstateInfo::setEstateFlags(U32 flags) "voice_chat_check", LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE)); childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); - childSetValue("deny_anonymous", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); - childSetValue("deny_identified", LLSD(flags & REGION_FLAGS_DENY_IDENTIFIED ? TRUE : FALSE) ); - childSetValue("deny_transacted", LLSD(flags & REGION_FLAGS_DENY_TRANSACTED ? TRUE : FALSE) ); + childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); + childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); childSetVisible("abuse_email_text", flags & REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER); + + refresh(); } U32 LLPanelEstateInfo::computeEstateFlags() @@ -2187,20 +2213,16 @@ U32 LLPanelEstateInfo::computeEstateFlags() flags |= REGION_FLAGS_SUN_FIXED; } - if (childGetValue("deny_anonymous").asBoolean()) + if (childGetValue("limit_payment").asBoolean()) { flags |= REGION_FLAGS_DENY_ANONYMOUS; } - if (childGetValue("deny_identified").asBoolean()) + if (childGetValue("limit_age_verified").asBoolean()) { - flags |= REGION_FLAGS_DENY_IDENTIFIED; + flags |= REGION_FLAGS_DENY_AGEUNVERIFIED; } - if (childGetValue("deny_transacted").asBoolean()) - { - flags |= REGION_FLAGS_DENY_TRANSACTED; - } return flags; } diff --git a/linden/indra/newview/llfloaterregioninfo.h b/linden/indra/newview/llfloaterregioninfo.h index 656583b..abf4789 100644 --- a/linden/indra/newview/llfloaterregioninfo.h +++ b/linden/indra/newview/llfloaterregioninfo.h @@ -79,6 +79,9 @@ public: static LLPanelEstateInfo* getPanelEstate(); static LLPanelEstateCovenant* getPanelCovenant(); + // from LLPanel + virtual void refresh(); + protected: LLFloaterRegionInfo(const LLRect& rect); void refreshFromRegion(LLViewerRegion* region); @@ -294,6 +297,7 @@ public: // LLPanel virtual BOOL postBuild(); virtual void updateChild(LLUICtrl* child_ctrl); + virtual void refresh(); U32 computeEstateFlags(); void setEstateFlags(U32 flags); diff --git a/linden/indra/newview/llfloaterreleasemsg.cpp b/linden/indra/newview/llfloaterreleasemsg.cpp index 87ff436..bb5bbd5 100644 --- a/linden/indra/newview/llfloaterreleasemsg.cpp +++ b/linden/indra/newview/llfloaterreleasemsg.cpp @@ -37,9 +37,10 @@ #include "llfloaterreleasemsg.h" #include "llagent.h" #include "llviewerregion.h" +#include "llappviewer.h" extern LLAgent gAgent; -extern LLString gLastVersionChannel; + LLFloaterReleaseMsg* LLFloaterReleaseMsg::sInstance = 0; diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp index a7cd211..bd5438e 100644 --- a/linden/indra/newview/llfloaterreporter.cpp +++ b/linden/indra/newview/llfloaterreporter.cpp @@ -81,7 +81,7 @@ #include "llselectmgr.h" #include "llviewerbuild.h" #include "llvieweruictrlfactory.h" -#include "viewer.h" +#include "llappviewer.h" #include "llassetuploadresponders.h" diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index 3bc172c..71e94cc 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp @@ -51,7 +51,6 @@ #include "llsliderctrl.h" #include "llspinctrl.h" #include "llviewercontrol.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" #include "llviewerstats.h" #include "llviewercamera.h" diff --git a/linden/indra/newview/llfloatertest.cpp b/linden/indra/newview/llfloatertest.cpp index 5af34a8..2716306 100644 --- a/linden/indra/newview/llfloatertest.cpp +++ b/linden/indra/newview/llfloatertest.cpp @@ -147,7 +147,7 @@ LLFloaterTestImpl::LLFloaterTestImpl() "monospaced, non-opaque text with tooltip, non-opaque non-opaque", LLFontGL::sMonospace, FALSE); // mouse_opaque - text->setToolTip("I'm a tooltip"); + text->setToolTip(LLString("I'm a tooltip")); addChild(text); y -= VPAD + LINE; @@ -178,7 +178,7 @@ LLFloaterTestImpl::LLFloaterTestImpl() LLString("File"), LLFontGL::sSansSerif, TRUE); // mouse_opaque - text->setToolTip("This should be Unicode text"); + text->setToolTip(LLString("This should be Unicode text")); panel->addChild(text); y -= VPAD + LINE; diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 4f8ed08..22581c6 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -76,7 +76,6 @@ #include "llviewerparcelmgr.h" #include "llviewerwindow.h" #include "llviewercontrol.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" @@ -752,7 +751,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) BOOL LLFloaterTools::canClose() { // don't close when quitting, so camera will stay put - return !gQuit; + return !LLApp::isExiting(); } // virtual diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp index 9e86c92..20f9e1e 100644 --- a/linden/indra/newview/llfloatertos.cpp +++ b/linden/indra/newview/llfloatertos.cpp @@ -38,7 +38,7 @@ #include "llvfile.h" #include "lltextbox.h" #include "llviewertexteditor.h" -#include "viewer.h" +#include "llappviewer.h" #include "llstartup.h" #include "message.h" #include "llagent.h" diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp index b411bb2..53b43ef 100644 --- a/linden/indra/newview/llfloaterworldmap.cpp +++ b/linden/indra/newview/llfloaterworldmap.cpp @@ -84,7 +84,7 @@ #include "llworldmapview.h" #include "llurl.h" #include "llvieweruictrlfactory.h" -#include "viewer.h" +#include "llappviewer.h" #include "llmapimagetype.h" #include "llweb.h" diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index c6a2710..eb9addc 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp @@ -66,7 +66,7 @@ // We need these because some of the code below relies on things like // gAgent root folder. Remove them once the abstraction leak is fixed. #include "llagent.h" -#include "viewer.h" +#include "llappviewer.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/linden/indra/newview/llframestatview.cpp b/linden/indra/newview/llframestatview.cpp index aa6c609..1111e18 100644 --- a/linden/indra/newview/llframestatview.cpp +++ b/linden/indra/newview/llframestatview.cpp @@ -40,7 +40,6 @@ #include "llmath.h" #include "llfontgl.h" -#include "viewer.h" #include "llui.h" #include "llviewercontrol.h" #include "llstat.h" diff --git a/linden/indra/newview/llgesturemgr.cpp b/linden/indra/newview/llgesturemgr.cpp index 3e17ecf..537cadf 100644 --- a/linden/indra/newview/llgesturemgr.cpp +++ b/linden/indra/newview/llgesturemgr.cpp @@ -55,7 +55,6 @@ #include "llviewermessage.h" #include "llvoavatar.h" #include "llviewerstats.h" -#include "viewer.h" LLGestureManager gGestureManager; diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index da3f7aa..ba56d70 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp @@ -56,7 +56,6 @@ #include "llviewerobjectlist.h" #include "lltoolselectrect.h" #include "llviewerwindow.h" -#include "viewer.h" #include "llcompass.h" #include "llsurface.h" #include "llwind.h" diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp index d1116b6..c213d26 100644 --- a/linden/indra/newview/llgroupmgr.cpp +++ b/linden/indra/newview/llgroupmgr.cpp @@ -47,7 +47,6 @@ #include "roles_constants.h" #include "lltransactiontypes.h" #include "llstatusbar.h" -#include "viewer.h" #include "lleconomy.h" #include "llviewerwindow.h" #include "llfloaterdirectory.h" @@ -806,8 +805,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group properties reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group properties reply for another agent!" << llendl; return; } @@ -895,8 +893,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group properties reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group properties reply for another agent!" << llendl; return; } @@ -963,8 +960,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group properties reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group properties reply for another agent!" << llendl; return; } @@ -1031,8 +1027,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group properties reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group properties reply for another agent!" << llendl; return; } @@ -1142,8 +1137,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group properties reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group properties reply for another agent!" << llendl; return; } diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp index 8a88165..6947aae 100644 --- a/linden/indra/newview/llgroupnotify.cpp +++ b/linden/indra/newview/llgroupnotify.cpp @@ -285,7 +285,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, onClickNext, this, LLFontGL::sSansSerif); - btn->setToolTip("Next"); + btn->setToolTip(LLString("Next")); // *TODO: Translate addChild(btn); mNextBtn = btn; @@ -312,7 +312,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, BTN_HEIGHT); btn = new LLButton("Group Notices", btn_rect, "", onClickGroupInfo, this); - btn->setToolTip("View past notices or opt-out of receiving these messages here."); + btn->setToolTip(LLString("View past notices or opt-out of receiving these messages here.")); // TODO: Translate addChild(btn, -1); if (mHasInventory && mInventoryOffer) diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp index 1ebe813..1d68441 100644 --- a/linden/indra/newview/llhudtext.cpp +++ b/linden/indra/newview/llhudtext.cpp @@ -48,7 +48,6 @@ #include "llviewerobject.h" #include "llvovolume.h" #include "llviewerwindow.h" -#include "viewer.h" #include "llstatusbar.h" #include "llmenugl.h" #include "pipeline.h" diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index b259b80..810d3a2 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -61,7 +61,7 @@ #include "llviewertexteditor.h" #include "llviewermessage.h" #include "llviewerstats.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llvieweruictrlfactory.h" #include "lllogchat.h" #include "llfloaterhtml.h" diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index a6e2a13..9c37f1f 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp @@ -55,7 +55,7 @@ #include "llimpanel.h" #include "llresizebar.h" #include "lltabcontainer.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llfloater.h" #include "llmutelist.h" #include "llresizehandle.h" diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index fba3ace..9adb3b9 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp @@ -78,7 +78,6 @@ #include "llviewerwindow.h" #include "llwearable.h" #include "llwearablelist.h" -#include "viewer.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "lltabcontainer.h" diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index f777e09..12617ef 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -78,7 +78,6 @@ #include "llviewerwindow.h" #include "llwearable.h" #include "llwearablelist.h" -#include "viewer.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "lltabcontainer.h" diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index 8c2eb2b..c61fa7f 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h @@ -383,6 +383,7 @@ class LLLandmarkBridge : public LLItemBridge { friend class LLInvFVBridge; public: + static const LLString& prefix() { return sPrefix; } virtual const LLString& getPrefix() { return sPrefix; } virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 4e54e78..ca65b87 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp @@ -47,7 +47,7 @@ #include "llviewerinventory.h" #include "llviewermessage.h" #include "llviewerwindow.h" -#include "viewer.h" +#include "llappviewer.h" #include "lldbstrings.h" #include "llviewerstats.h" #include "llmutelist.h" diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 2ac46ab..96d947f 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -75,7 +75,7 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llwearablelist.h" -#include "viewer.h" +#include "llappviewer.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "lltabcontainer.h" diff --git a/linden/indra/newview/lllcd.cpp b/linden/indra/newview/lllcd.cpp index f6fec7d..f980ee4 100644 --- a/linden/indra/newview/lllcd.cpp +++ b/linden/indra/newview/lllcd.cpp @@ -31,11 +31,14 @@ #include "llviewerprecompiledheaders.h" +#include "lllcd.h" + #include "llcontrol.h" #include "llstatusbar.h" #include "llviewerregion.h" #include "llviewerstats.h" #include "llvieweruictrlfactory.h" +#include "llviewercontrol.h" #if LL_LCD_COMPILE @@ -47,7 +50,8 @@ extern LLControlGroup gSavedSettings; // for Logitech LCD keyboards / speakers #include "EZ_LCD.h" #include "lllogitechlcd.h" -#include "lllcd.h" + +llLCD *gLcdScreen = NULL; // Singleton-ish? // not happy about this, but there's no local class to put it in. LLPanel *bogus = NULL; diff --git a/linden/indra/newview/lllcd.h b/linden/indra/newview/lllcd.h index e6583c7..ae21da3 100644 --- a/linden/indra/newview/lllcd.h +++ b/linden/indra/newview/lllcd.h @@ -105,6 +105,9 @@ public: }; class llLCD; + +// The following symbols are exported from lllcd.cpp extern llLCD *gLcdScreen; +extern void CreateLCDDebugWindows(); //#endif diff --git a/linden/indra/newview/lllogchat.cpp b/linden/indra/newview/lllogchat.cpp index 8620446..d89ec79 100644 --- a/linden/indra/newview/lllogchat.cpp +++ b/linden/indra/newview/lllogchat.cpp @@ -32,7 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "lllogchat.h" -#include "viewer.h" +#include "llappviewer.h" const S32 LOG_RECALL_SIZE = 2048; diff --git a/linden/indra/newview/llmanip.cpp b/linden/indra/newview/llmanip.cpp index 953befc..44b919a 100644 --- a/linden/indra/newview/llmanip.cpp +++ b/linden/indra/newview/llmanip.cpp @@ -55,7 +55,6 @@ #include "llvoavatar.h" #include "llworld.h" // for gWorldPointer #include "llresmgr.h" -#include "viewer.h" // for gFPS #include "pipeline.h" #include "llglheaders.h" diff --git a/linden/indra/newview/llmaniprotate.cpp b/linden/indra/newview/llmaniprotate.cpp index fb3de3a..2e4f66c 100644 --- a/linden/indra/newview/llmaniprotate.cpp +++ b/linden/indra/newview/llmaniprotate.cpp @@ -60,7 +60,6 @@ #include "llviewerwindow.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" #include "lldrawable.h" #include "llglheaders.h" @@ -513,8 +512,6 @@ LLVector3 LLManipRotate::projectToSphere( F32 x, F32 y, BOOL* on_sphere ) return LLVector3( x, y, z ); } -extern U32 gFrameCount; - // Freeform rotation void LLManipRotate::drag( S32 x, S32 y ) { diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index 1963b1a..36e3f9a 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp @@ -61,7 +61,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llworld.h" -#include "viewer.h" #include "llui.h" #include "pipeline.h" diff --git a/linden/indra/newview/llmemoryview.cpp b/linden/indra/newview/llmemoryview.cpp index 53582ac..a698c53 100644 --- a/linden/indra/newview/llmemoryview.cpp +++ b/linden/indra/newview/llmemoryview.cpp @@ -41,7 +41,6 @@ #include "llfontgl.h" #include "llmemtype.h" -#include "viewer.h" #include "llui.h" #include "llviewercontrol.h" #include "llstat.h" diff --git a/linden/indra/newview/llmenucommands.cpp b/linden/indra/newview/llmenucommands.cpp index 92c7832..68bbe53 100644 --- a/linden/indra/newview/llmenucommands.cpp +++ b/linden/indra/newview/llmenucommands.cpp @@ -67,7 +67,6 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llworldmap.h" -#include "viewer.h" #include "llfocusmgr.h" void handle_track_avatar(const LLUUID& agent_id, const std::string& name) diff --git a/linden/indra/newview/llmorphview.cpp b/linden/indra/newview/llmorphview.cpp index d69968d..81e6774 100644 --- a/linden/indra/newview/llmorphview.cpp +++ b/linden/indra/newview/llmorphview.cpp @@ -49,7 +49,6 @@ #include "llvoavatar.h" #include "llviewerwindow.h" #include "pipeline.h" -#include "viewer.h" LLMorphView *gMorphView = NULL; diff --git a/linden/indra/newview/llmoveview.cpp b/linden/indra/newview/llmoveview.cpp index e115f10..4f1d7bb 100644 --- a/linden/indra/newview/llmoveview.cpp +++ b/linden/indra/newview/llmoveview.cpp @@ -39,7 +39,7 @@ // Viewer includes #include "llagent.h" #include "llcallbacklist.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llfontgl.h" #include "llbutton.h" #include "llviewerwindow.h" diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index 118fd42..f36e282 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp @@ -61,7 +61,6 @@ #include "llfloatermute.h" #include "llviewergenericmessage.h" // for gGenericDispatcher #include "llviewerwindow.h" -#include "viewer.h" #include "llworld.h" //for particle system banning LLMuteList* gMuteListp = NULL; diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index edf2567..c312865 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -65,7 +65,7 @@ #include "llvoavatar.h" #include "llworld.h" #include "llworldmapview.h" // shared draw code -#include "viewer.h" // Only for constants! +#include "llappviewer.h" // Only for constants! #include "llglheaders.h" diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index cd22343..0c259c0 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp @@ -152,7 +152,7 @@ LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer noti if(notify_template->mUnique) { LLString message = notify_template->mMessage; - LLAlertDialog::format(message, args); + format(message, args); unique_map_t::iterator found_it = sOpenUniqueNotifyBoxes.find(notify_template->mLabel + message); if (found_it != sOpenUniqueNotifyBoxes.end()) { @@ -162,6 +162,7 @@ LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer noti return NULL; } +//static void LLNotifyBox::cleanup() { sDefaultTemplate = NULL; @@ -196,7 +197,7 @@ LLNotifyBox::LLNotifyBox(LLPointer xml_template, const LLSt // setup paramaters mMessage = xml_template->mMessage; - LLAlertDialog::format(mMessage, args); + format(mMessage, args); // use name + formatted text as unique key if (mUnique) @@ -339,7 +340,7 @@ LLNotifyBox::LLNotifyBox(LLPointer xml_template, const LLSt onClickNext, this, sFont); - btn->setToolTip("Next"); + btn->setToolTip(LLString("Next")); // *TODO: Translate addChild(btn); mNextBtn = btn; @@ -440,7 +441,7 @@ BOOL LLNotifyBox::handleRightMouseDown(S32 x, S32 y, MASK mask) { if (!mIsTip && getVisible() && getEnabled() && pointInView(x,y)) { - moveToBack(); + moveToBack(true); return TRUE; } @@ -554,6 +555,15 @@ void LLNotifyBox::close() } } +void LLNotifyBox::format(LLString& msg, const LLString::format_map_t& args) +{ + // XUI:translate! + LLString::format_map_t targs = args; + targs["[SECOND_LIFE]"] = "Second Life"; + LLString::format(msg, targs); +} + + /*virtual*/ BOOL LLNotifyBox::tick() { @@ -575,7 +585,7 @@ void LLNotifyBox::setVisible(BOOL visible) LLPanel::setVisible(visible); } -void LLNotifyBox::moveToBack() +void LLNotifyBox::moveToBack(bool getfocus) { // Move this dialog to the back. gNotifyBoxView->sendChildToBack(this); @@ -590,10 +600,13 @@ void LLNotifyBox::moveToBack() if (front) { gNotifyBoxView->showOnly(front); - // assuming that moveToBack is only called by clicking the next button, - // we give focus to the next next button - front->mNextBtn->setFocus(TRUE); - gFocusMgr.triggerFocusFlash(); // TODO: it's ugly to call this here + if (getfocus) + { + // if are called from a user interaction + // we give focus to the next next button + front->mNextBtn->setFocus(TRUE); + gFocusMgr.triggerFocusFlash(); // TODO: it's ugly to call this here + } } } } @@ -755,7 +768,7 @@ void LLNotifyBox::onClickButton(void* data) void LLNotifyBox::onClickNext(void* data) { LLNotifyBox* self = static_cast(data); - self->moveToBack(); + self->moveToBack(true); } // static @@ -795,7 +808,7 @@ const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc, const L if (iter != sNotifyTemplates.end()) { LLString message = iter->second->mMessage; - LLAlertDialog::format(message, args); + format(message, args); return message; } else diff --git a/linden/indra/newview/llnotify.h b/linden/indra/newview/llnotify.h index 3d7bf6d..d717883 100644 --- a/linden/indra/newview/llnotify.h +++ b/linden/indra/newview/llnotify.h @@ -74,6 +74,7 @@ public: void close(); static void cleanup(); + static void format(LLString& msg, const LLString::format_map_t& args); protected: LLNotifyBox(LLPointer notify_template, const LLString::format_map_t& args, @@ -91,7 +92,7 @@ protected: /*virtual*/ void draw(); /*virtual*/ BOOL tick(); - void moveToBack(); + void moveToBack(bool getfocus = false); // Returns the rect, relative to gNotifyView, where this // notify box should be placed. diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index bcdb6c6..15c993e 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -57,7 +57,6 @@ #include "llvoavatar.h" #include "llvoiceremotectrl.h" #include "llwebbrowserctrl.h" -#include "viewer.h" // // Globals diff --git a/linden/indra/newview/llpanelLCD.cpp b/linden/indra/newview/llpanelLCD.cpp index 960a321..63a1d6b 100644 --- a/linden/indra/newview/llpanelLCD.cpp +++ b/linden/indra/newview/llpanelLCD.cpp @@ -47,7 +47,7 @@ #include "llresmgr.h" #include "lltextbox.h" #include "llui.h" -#include "viewer.h" +#include "llviewercontrol.h" //Ventrella #include "llagent.h" diff --git a/linden/indra/newview/llpanelaudioprefs.cpp b/linden/indra/newview/llpanelaudioprefs.cpp index a4591dc..7edccc2 100644 --- a/linden/indra/newview/llpanelaudioprefs.cpp +++ b/linden/indra/newview/llpanelaudioprefs.cpp @@ -60,7 +60,7 @@ #include "llviewerparcelmgr.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" -#include "viewer.h" // do_disconnect +#include "llviewercontrol.h" // // Static functions diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index dc2f14f..5b43497 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp @@ -69,6 +69,7 @@ #include "lltooldraganddrop.h" #include "lluiconstants.h" #include "llvoavatar.h" +#include "llviewercontrol.h" #include "llviewermenu.h" // *FIX: for is_agent_friend() #include "llviewergenericmessage.h" // send_generic_message #include "llviewerobjectlist.h" @@ -76,7 +77,6 @@ #include "llviewborder.h" #include "llweb.h" #include "llinventorymodel.h" -#include "viewer.h" // for gUserServer #include "roles_constants.h" #define kArraySize( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) @@ -1788,6 +1788,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) //BOOL mature = FALSE; BOOL identified = FALSE; BOOL transacted = FALSE; + BOOL age_verified = FALSE; BOOL online = FALSE; char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; /*Flawfinder: ignore*/ @@ -1825,6 +1826,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) identified = (flags & AVATAR_IDENTIFIED); transacted = (flags & AVATAR_TRANSACTED); + age_verified = (flags & AVATAR_AGEVERIFIED); allow_publish = (flags & AVATAR_ALLOW_PUBLISH); online = (flags & AVATAR_ONLINE); @@ -1874,6 +1876,12 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) payment_text = "NoPaymentInfoOnFile"; } args["[PAYMENTINFO]"] = self->mPanelSecondLife->childGetValue(payment_text).asString(); + LLString age_text = "NotAgeVerified"; + if(age_verified) + { + age_text = "AgeVerified"; + } + args["[PAYMENTINFO]"] += self->mPanelSecondLife->childGetValue(age_text).asString(); } else { diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index e0f750f..04fb54b 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp @@ -66,7 +66,7 @@ #include "llviewergenericmessage.h" // send_generic_message #include "llviewerregion.h" #include "llviewerwindow.h" // for window width, height -#include "viewer.h" // app_abort_quit() +#include "llappviewer.h" // abortQuit() const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ @@ -322,7 +322,7 @@ void LLPanelClassified::saveCallback(S32 option, void* data) case 2: // Cancel default: - app_abort_quit(); + LLAppViewer::instance()->abortQuit(); break; } } diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp index 50ff7bd..fa7cdfb 100644 --- a/linden/indra/newview/llpanelcontents.cpp +++ b/linden/indra/newview/llpanelcontents.cpp @@ -65,7 +65,6 @@ #include "lltoolmgr.h" #include "lltoolcomp.h" #include "llpanelinventory.h" -#include "viewer.h" // // Imported globals diff --git a/linden/indra/newview/llpaneldirbrowser.cpp b/linden/indra/newview/llpaneldirbrowser.cpp index 27fb3ac..65b1e59 100644 --- a/linden/indra/newview/llpaneldirbrowser.cpp +++ b/linden/indra/newview/llpaneldirbrowser.cpp @@ -1184,6 +1184,7 @@ void LLPanelDirBrowser::setupNewSearch() // static +// called from calssifieds, events, groups, land, people, and places void LLPanelDirBrowser::onClickSearchCore(void* userdata) { LLPanelDirBrowser* self = (LLPanelDirBrowser*)userdata; @@ -1191,6 +1192,8 @@ void LLPanelDirBrowser::onClickSearchCore(void* userdata) self->resetSearchStart(); self->performQuery(); + + LLFloaterDirectory::sOldSearchCount++; } diff --git a/linden/indra/newview/llpaneldirevents.cpp b/linden/indra/newview/llpaneldirevents.cpp index d8a4652..1dc4286 100644 --- a/linden/indra/newview/llpaneldirevents.cpp +++ b/linden/indra/newview/llpaneldirevents.cpp @@ -48,7 +48,7 @@ #include "llresmgr.h" #include "lluiconstants.h" #include "llpanelevent.h" -#include "viewer.h" +#include "llappviewer.h" BOOL gDisplayEventHack = FALSE; diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp index 3dd419f..640cbef 100644 --- a/linden/indra/newview/llpaneldirfind.cpp +++ b/linden/indra/newview/llpaneldirfind.cpp @@ -276,7 +276,7 @@ std::string LLPanelDirFindAll::getSearchURLSuffix(bool mature_in) mature = false; } - std::string url = gSavedSettings.getString("SearchURLSuffix"); + std::string url = gSavedSettings.getString("SearchURLSuffix2"); // if the mature checkbox is unchecked, modify query to remove // terms with given phrase from the result set @@ -314,6 +314,11 @@ std::string LLPanelDirFindAll::getSearchURLSuffix(bool mature_in) substring = "[Z]"; url.replace(url.find(substring), substring.length(), z); + LLUUID session_id = gAgent.getSessionID(); + std::string session_string = session_id.getString(); + substring = "[SESSION]"; + url.replace(url.find(substring), substring.length(), session_string); + return url; } @@ -366,6 +371,8 @@ void LLPanelDirFindAll::onClickSearch(void* data) LLPanelDirFindAll* self = ( LLPanelDirFindAll* )data; LLString search_text = self->childGetText("search_editor"); self->search(search_text); + + LLFloaterDirectory::sNewSearchCount++; } void LLPanelDirFindAll::onNavigateBegin( const EventType& eventIn ) diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index 3b2edcc..0d0fc80 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -74,7 +74,7 @@ //RN temporary includes for resolution switching #include "llglheaders.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llsky.h" const F32 MAX_USER_FAR_CLIP = 512.f; diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index 9cdf919..007e2ff 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp @@ -46,6 +46,7 @@ #include "llcolorswatch.h" #include "llcombobox.h" #include "llconsole.h" +#include "lllineeditor.h" #include "llpanellogin.h" #include "llnetmap.h" #include "llresmgr.h" @@ -54,8 +55,9 @@ #include "llui.h" #include "llurlsimstring.h" #include "llviewercontrol.h" -#include "viewer.h" // gCrashBehavior - +#include "llappviewer.h" +#include "llurlsimstring.h" +#include "llappviewer.h" // // Imported globals // @@ -63,6 +65,7 @@ void set_crash_behavior(LLUICtrl* ctrl, void* data); void set_start_location(LLUICtrl* ctrl, void* data); + // // Globals // @@ -72,8 +75,7 @@ void set_start_location(LLUICtrl* ctrl, void* data); // void set_crash_behavior(LLUICtrl* ctrl, void* data) { - gCrashBehavior = ((LLComboBox*) ctrl)->getCurrentIndex(); - gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); + LLAppViewer::instance()->setCrashBehavior(((LLComboBox*) ctrl)->getCurrentIndex()); } void set_language(LLUICtrl* ctrl, void* data) @@ -86,6 +88,11 @@ void LLPanelGeneral::set_start_location(LLUICtrl* ctrl, void* data) LLURLSimString::setString(ctrl->getValue().asString()); } +void LLPanelGeneral::set_specific_start_location(LLLineEditor* line_editor, void* data) +{ + LLURLSimString::setString(line_editor->getValue().asString()); +} + LLPanelGeneral::LLPanelGeneral() { gUICtrlFactory->buildPanel(this, "panel_preferences_general.xml"); @@ -137,6 +144,7 @@ BOOL LLPanelGeneral::postBuild() combo->setCurrentByIndex( login_last ? 1 : 0 ); } combo->setCommitCallback( &set_start_location ); + combo->setTextEntryCallback( &set_specific_start_location ); } // Show location on login screen @@ -145,7 +153,7 @@ BOOL LLPanelGeneral::postBuild() combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); if (combo) { - combo->setCurrentByIndex( gCrashBehavior ); + combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); combo->setCommitCallback( &set_crash_behavior ); } @@ -181,11 +189,11 @@ void LLPanelGeneral::refresh() mLoginLocation = combo->getValue().asString(); } - mCrashBehavior = gCrashBehavior; + mCrashBehavior = LLAppViewer::instance()->getCrashBehavior(); combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); if (combo) { - combo->setCurrentByIndex( gCrashBehavior ); + combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); } mRenderName = gSavedSettings.getS32("RenderName"); @@ -222,8 +230,7 @@ void LLPanelGeneral::cancel() LLURLSimString::setString(mLoginLocation); - gCrashBehavior = mCrashBehavior; - gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); + LLAppViewer::instance()->setCrashBehavior(mCrashBehavior); // make listener //gAFKTimeout = away_timeout; @@ -231,5 +238,5 @@ void LLPanelGeneral::cancel() void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data) { - LLPanelLogin::refreshLocation( false ); // in case LLPanelLogin is visible + LLPanelLogin::loadLoginPage(); } diff --git a/linden/indra/newview/llpanelgeneral.h b/linden/indra/newview/llpanelgeneral.h index 7c89d78..f3f29c5 100644 --- a/linden/indra/newview/llpanelgeneral.h +++ b/linden/indra/newview/llpanelgeneral.h @@ -55,6 +55,7 @@ public: static void clickShowStartLocation(LLUICtrl*, void* user_data); static void set_start_location(LLUICtrl* ctrl, void* data); + static void set_specific_start_location(LLLineEditor* line_editor, void* data); protected: S32 mRenderName; diff --git a/linden/indra/newview/llpanelgroup.cpp b/linden/indra/newview/llpanelgroup.cpp index 99744c9..76fbada 100644 --- a/linden/indra/newview/llpanelgroup.cpp +++ b/linden/indra/newview/llpanelgroup.cpp @@ -44,7 +44,7 @@ #include "llviewermessage.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" -#include "viewer.h" +#include "llappviewer.h" // static void* LLPanelGroupTab::createTab(void* data) @@ -530,7 +530,7 @@ void LLPanelGroup::handleNotifyCallback(S32 option) default: // Do nothing. The user is canceling the action. // If we were quitting, we didn't really mean it. - app_abort_quit(); + LLAppViewer::instance()->abortQuit(); break; } } diff --git a/linden/indra/newview/llpanelgrouplandmoney.cpp b/linden/indra/newview/llpanelgrouplandmoney.cpp index 4c12aa2..0152990 100644 --- a/linden/indra/newview/llpanelgrouplandmoney.cpp +++ b/linden/indra/newview/llpanelgrouplandmoney.cpp @@ -1115,8 +1115,7 @@ void LLPanelGroupLandMoney::processGroupAccountDetailsReply(LLMessageSystem* msg msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group L$ history reply for another agent!" << llendl; return; } @@ -1292,8 +1291,7 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group L$ history reply for another agent!" << llendl; return; } @@ -1463,8 +1461,7 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group L$ history reply for another agent!" << llendl; return; } diff --git a/linden/indra/newview/llpanelgroupvoting.cpp b/linden/indra/newview/llpanelgroupvoting.cpp index b74bf9c..6007c88 100644 --- a/linden/indra/newview/llpanelgroupvoting.cpp +++ b/linden/indra/newview/llpanelgroupvoting.cpp @@ -752,8 +752,7 @@ void LLPanelGroupVoting::impl::processGroupActiveProposalItemReply(LLMessageSyst msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got active group proposals reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got active group proposals reply for another agent!" << llendl; return; } @@ -913,8 +912,7 @@ void LLPanelGroupVoting::impl::processGroupVoteHistoryItemReply(LLMessageSystem msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group voting history reply for another agent!" - << " Probably a userserver bug!" << llendl; + llwarns << "Got group voting history reply for another agent!" << llendl; return; } diff --git a/linden/indra/newview/llpanelinput.cpp b/linden/indra/newview/llpanelinput.cpp index d3a140c..4e0e182 100644 --- a/linden/indra/newview/llpanelinput.cpp +++ b/linden/indra/newview/llpanelinput.cpp @@ -50,7 +50,8 @@ #include "llsliderctrl.h" #include "lltextbox.h" #include "llui.h" -#include "viewer.h" +#include "llappviewer.h" +#include "llviewercontrol.h" //Ventrella #include "llagent.h" @@ -61,9 +62,6 @@ // Imported globals // -extern F32 gMouseSensitivity; -extern BOOL gInvertMouse; - // // Globals // diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 292f5c3..3e64bba 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -44,13 +44,16 @@ #include "llbutton.h" #include "llcheckboxctrl.h" +#include "llcommandhandler.h" #include "llcombobox.h" +#include "llcurl.h" #include "llviewercontrol.h" #include "llfloaterabout.h" #include "llfloatertest.h" #include "llfloaterpreference.h" #include "llfocusmgr.h" #include "lllineeditor.h" +#include "llstartup.h" #include "lltextbox.h" #include "llui.h" #include "lluiconstants.h" @@ -61,7 +64,8 @@ #include "llviewernetwork.h" #include "llviewerwindow.h" // to link into child list #include "llnotify.h" -#include "viewer.h" // for gHideLinks +#include "llappviewer.h" // for gHideLinks +#include "llurlsimstring.h" #include "llvieweruictrlfactory.h" #include "llhttpclient.h" #include "llweb.h" @@ -72,11 +76,146 @@ #include "llglheaders.h" + +LLString load_password_from_disk(void); +void save_password_to_disk(const char* hashed_password); + const S32 BLACK_BORDER_HEIGHT = 160; const S32 MAX_PASSWORD = 16; LLPanelLogin *LLPanelLogin::sInstance = NULL; -BOOL LLPanelLogin::sCapslockDidNotification = FALSE; + + +//parses the input url and returns true if afterwards +//a web-login-key, firstname and lastname is set +bool LLLoginHandler::parseDirectLogin(std::string url) +{ + LLURI uri(url); + parse(uri.queryMap()); + + if (mWebLoginKey.isNull() || + mFirstName.empty() || + mLastName.empty()) + { + return false; + } + else + { + return true; + } +} + + +void LLLoginHandler::parse(const LLSD& queryMap) +{ + mWebLoginKey = queryMap["web_login_key"].asUUID(); + mFirstName = queryMap["first_name"].asString(); + mLastName = queryMap["last_name"].asString(); + + if (queryMap["grid"].asString() == "aditi") + { + gGridChoice = GRID_INFO_ADITI; + } + else if (queryMap["grid"].asString() == "agni") + { + gGridChoice = GRID_INFO_AGNI; + } + else if (queryMap["grid"].asString() == "siva") + { + gGridChoice = GRID_INFO_SIVA; + } + else if (queryMap["grid"].asString() == "durga") + { + gGridChoice = GRID_INFO_DURGA; + } + else if (queryMap["grid"].asString() == "shakti") + { + gGridChoice = GRID_INFO_SHAKTI; + } + else if (queryMap["grid"].asString() == "soma") + { + gGridChoice = GRID_INFO_SOMA; + } + else if (queryMap["grid"].asString() == "ganga") + { + gGridChoice = GRID_INFO_GANGA; + } + else if (queryMap["grid"].asString() == "vaak") + { + gGridChoice = GRID_INFO_VAAK; + } + else if (queryMap["grid"].asString() == "uma") + { + gGridChoice = GRID_INFO_UMA; + } + + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */ + LLAppViewer::instance()->resetURIs(); + + LLString startLocation = queryMap["location"].asString(); + + if (startLocation == "specify") + { + LLURLSimString::setString(queryMap["region"].asString()); + } + else if (startLocation == "home") + { + gSavedSettings.setBOOL("LoginLastLocation", FALSE); + LLURLSimString::setString(""); + } + else if (startLocation == "last") + { + gSavedSettings.setBOOL("LoginLastLocation", TRUE); + LLURLSimString::setString(""); + } +} + +bool LLLoginHandler::handle(const LLSD& tokens, + const LLSD& queryMap) +{ + parse(queryMap); + + //if we haven't initialized stuff yet, this is + //coming in from the GURL handler, just parse + if (STATE_FIRST == LLStartUp::getStartupState()) + { + return true; + } + + LLString password = queryMap["password"].asString(); + + if (!password.empty()) + { + gSavedSettings.setBOOL("RememberPassword", TRUE); + + if (password.substr(0,3) != "$1$") + { + LLMD5 pass((unsigned char*)password.c_str()); + char md5pass[33]; /* Flawfinder: ignore */ + pass.hex_digest(md5pass); + password = md5pass; + save_password_to_disk(password.c_str()); + } + } + else + { + save_password_to_disk(NULL); + gSavedSettings.setBOOL("RememberPassword", FALSE); + } + + + if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) //on splash page + { + if (mWebLoginKey.isNull()) { + LLPanelLogin::loadLoginPage(); + } else { + LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); + } + } + return true; +} + +LLLoginHandler gLoginHandler; // helper class that trys to download a URL from a web site and calls a method // on parent class indicating if the web server is working or not @@ -155,112 +294,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mLogoImage = gImageList.getImage("startup_logo.tga", LLUUID::null, MIPMAP_FALSE, TRUE); gUICtrlFactory->buildPanel(this, "panel_login.xml"); - setRect(rect); + + //leave room for the login menu bar + setRect(LLRect(0, rect.getHeight()-18, rect.getWidth(), 0)); reshape(rect.getWidth(), rect.getHeight()); - - childSetPrevalidate("first_name_edit", LLLineEditor::prevalidatePrintableNoSpace); - childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace); - - childSetCommitCallback("password_edit", mungePassword); - childSetKeystrokeCallback("password_edit", onPassKey, this); - childSetUserData("password_edit", this); - - LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "password_edit"); - if (edit) edit->setDrawAsterixes(TRUE); - - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "start_location_combo"); - if (combo) - { - combo->setAllowTextEntry(TRUE, 128, FALSE); - - // The XML file loads the combo with the following labels: - // 0 - "My Home" - // 1 - "My Last Location" - // 2 - "" - - BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); - LLString sim_string = LLURLSimString::sInstance.mSimString; - if (!sim_string.empty()) - { - // Replace "" with this region name - combo->remove(2); - combo->add( sim_string ); - combo->setTextEntry(sim_string); - combo->setCurrentByIndex( 2 ); - } - else if (login_last) - { - combo->setCurrentByIndex( 1 ); - } - else - { - combo->setCurrentByIndex( 0 ); - } - - combo->setCommitCallback( &LLPanelGeneral::set_start_location ); - } - // Specific servers added later. - childSetVisible("server_combo", show_server); - - childSetAction("new_account_btn", onClickNewAccount, this); - childSetVisible("new_account_btn", !gHideLinks); - - childSetAction("connect_btn", onClickConnect, this); - - setDefaultBtn("connect_btn"); - - childSetAction("preferences_btn", LLFloaterPreference::show, this); - - childSetAction("quit_btn", onClickQuit, this); - - LLTextBox* text = LLUICtrlFactory::getTextBoxByName(this, "version_text"); - if (text) - { - LLString version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VIEWER_BUILD ); - text->setText(version); - text->setClickedCallback(onClickVersion); - text->setCallbackUserData(this); - - // HACK to move to the lower-right of the window - // replace/remove this logic when we have dynamic layouts - S32 right = getRect().mRight; - LLRect r = text->getRect(); - const S32 PAD = 2; - r.setOriginAndSize( right - r.getWidth() - PAD, PAD, - r.getWidth(), r.getHeight() ); - text->setRect(r); - } - - LLTextBox* channel_text = LLUICtrlFactory::getTextBoxByName(this, "channel_text"); - if (channel_text) - { - channel_text->setText(gChannelName); - channel_text->setClickedCallback(onClickVersion); - channel_text->setCallbackUserData(this); - - // HACK to move to the right of the window, above the version string, - // replace/remove this logic when we have dynamic layouts - S32 right = getRect().mRight; - LLRect r = channel_text->getRect(); - const S32 PAD = 2; - S32 version_string_top = r.mTop; - if(text) - { - version_string_top = text->getRect().mTop; - } - r.setOriginAndSize( - right - r.getWidth() - PAD, - version_string_top, - r.getWidth(), - r.getHeight()); - channel_text->setRect(r); - } - // get the web browser control #if LL_LIBXUL_ENABLED LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "login_html"); @@ -284,11 +322,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through) LLRect htmlRect = mRect; - htmlRect.setCenterAndSize( mRect.getCenterX() - 2, mRect.getCenterY() + 40, mRect.getWidth() + 6, mRect.getHeight() - 78 ); + htmlRect.setCenterAndSize( mRect.getCenterX() - 2, mRect.getCenterY(), mRect.getWidth() + 6, mRect.getHeight()); web_browser->setRect( htmlRect ); web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); - reshape( mRect.getWidth(), mRect.getHeight(), 1 ); - + reshape( mRect.getWidth(), mRect.getHeight(), 1 ); + // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build( this ); LLHTTPClient::get( childGetValue( "real_url" ).asString(), gResponsePtr ); @@ -298,7 +336,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, #endif // Initialize visibility (and don't force visibility - use prefs) - refreshLocation( false ); } void LLPanelLogin::setSiteIsAlive( bool alive ) @@ -310,9 +347,8 @@ void LLPanelLogin::setSiteIsAlive( bool alive ) { if ( web_browser ) { - // navigate to the "real" page - web_browser->navigateTo( childGetValue( "real_url" ).asString() ); - + loadLoginPage(); + // mark as available mHtmlAvailable = TRUE; }; @@ -334,21 +370,6 @@ void LLPanelLogin::setSiteIsAlive( bool alive ) #endif } -void LLPanelLogin::mungePassword(LLUICtrl* caller, void* user_data) -{ - LLPanelLogin* self = (LLPanelLogin*)user_data; - LLLineEditor* editor = (LLLineEditor*)caller; - std::string password = editor->getText(); - - // Re-md5 if we've changed at all - if (password != self->mIncomingPassword) - { - LLMD5 pass((unsigned char *)password.c_str()); - char munged_password[MD5HEX_STR_SIZE]; - pass.hex_digest(munged_password); - self->mMungedPassword = munged_password; - } -} LLPanelLogin::~LLPanelLogin() { @@ -384,13 +405,6 @@ void LLPanelLogin::draw() glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * mRect.getWidth(), 0.f, 0.f); glScalef(image_aspect / view_aspect, 1.f, 1.f); } - // Don't maintain aspect ratio if screen wider than image. This results in the - // hand being partially cut off. JC - //else - //{ - // glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * (F32)BLACK_BORDER_HEIGHT, 0.f); - // glScalef(1.f, view_aspect / image_aspect, 1.f); - //} S32 width = mRect.getWidth(); S32 height = mRect.getHeight(); @@ -399,9 +413,6 @@ void LLPanelLogin::draw() { // draw a background box in black gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); - - // draw the bottom part of the background image - just the blue background to the native client UI - gl_draw_scaled_image(0, -264, width + 8, mLogoImage->getHeight(), mLogoImage); } else { @@ -469,54 +480,14 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) return LLPanel::handleKeyHere(key, mask, called_from_parent); } - -// virtual -void LLPanelLogin::setFocus(BOOL b) -{ - if(b != hasFocus()) - { - if(b) - { - LLPanelLogin::giveFocus(); - } - else - { - LLPanel::setFocus(b); - } - } -} + // static void LLPanelLogin::giveFocus() { - if( sInstance ) - { - // Grab focus and move cursor to first blank input field - std::string first = sInstance->childGetText("first_name_edit"); - std::string pass = sInstance->childGetText("password_edit"); - - BOOL have_first = !first.empty(); - BOOL have_pass = !pass.empty(); - - LLLineEditor* edit = NULL; - if (have_first && !have_pass) - { - // User saved his name but not his password. Move - // focus to password field. - edit = LLUICtrlFactory::getLineEditorByName(sInstance, "password_edit"); - } - else - { - // User doesn't have a name, so start there. - edit = LLUICtrlFactory::getLineEditorByName(sInstance, "first_name_edit"); - } - if (edit) - { - edit->setFocus(TRUE); - edit->selectAll(); - } - } + if (sInstance) + sInstance->setFocus(TRUE); } @@ -528,266 +499,167 @@ void LLPanelLogin::show(const LLRect &rect, { new LLPanelLogin(rect, show_server, callback, callback_data); + LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(sInstance, "login_html"); + + if (!web_browser) return; + if( !gFocusMgr.getKeyboardFocus() ) { // Grab focus and move cursor to first enabled control - sInstance->setFocus(TRUE); + web_browser->setFocus(TRUE); } // Make sure that focus always goes here (and use the latest sInstance that was just created) - gFocusMgr.setDefaultKeyboardFocus(sInstance); + gFocusMgr.setDefaultKeyboardFocus(web_browser); } + // static -void LLPanelLogin::setFields(const std::string& firstname, const std::string& lastname, const std::string& password, - BOOL remember) +void LLPanelLogin::close() { - if (!sInstance) + if (sInstance) { - llwarns << "Attempted fillFields with no login view shown" << llendl; - return; - } - - sInstance->childSetText("first_name_edit", firstname); - sInstance->childSetText("last_name_edit", lastname); + gViewerWindow->getRootView()->removeChild( LLPanelLogin::sInstance ); + + gFocusMgr.setDefaultKeyboardFocus(NULL); - // Max "actual" password length is 16 characters. - // Hex digests are always 32 characters. - if (password.length() == 32) - { - // This is a MD5 hex digest of a password. - // We don't actually use the password input field, - // fill it with MAX_PASSWORD characters so we get a - // nice row of asterixes. - const std::string filler("123456789!123456"); - sInstance->childSetText("password_edit", filler); - sInstance->mIncomingPassword = filler; - sInstance->mMungedPassword = password; - } - else - { - // this is a normal text password - sInstance->childSetText("password_edit", password); - sInstance->mIncomingPassword = password; - LLMD5 pass((unsigned char *)password.c_str()); - char munged_password[MD5HEX_STR_SIZE]; - pass.hex_digest(munged_password); - sInstance->mMungedPassword = munged_password; + delete sInstance; + sInstance = NULL; } - - sInstance->childSetValue("remember_check", remember); } - // static -void LLPanelLogin::addServer(const char *server, S32 domain_name) +void LLPanelLogin::setAlwaysRefresh(bool refresh) { - if (!sInstance) - { - llwarns << "Attempted addServer with no login view shown" << llendl; - return; - } + if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return; - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) + LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(sInstance, "login_html"); + + if (web_browser) { - combo->add(server, LLSD(domain_name) ); - combo->setCurrentByIndex(0); + web_browser->setAlwaysRefresh(refresh); } } -// static -void LLPanelLogin::getFields(LLString &firstname, LLString &lastname, LLString &password, - BOOL &remember) -{ - if (!sInstance) - { - llwarns << "Attempted getFields with no login view shown" << llendl; - return; - } - firstname = sInstance->childGetText("first_name_edit"); - LLString::trim(firstname); - lastname = sInstance->childGetText("last_name_edit"); - LLString::trim(lastname); +void LLPanelLogin::loadLoginPage() +{ + if (!sInstance) return; - password = sInstance->mMungedPassword; - remember = sInstance->childGetValue("remember_check"); -} + LLURLSimString::sInstance.parse(); + LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(sInstance, "login_html"); -// static. Return TRUE if user made a choice from the popup -BOOL LLPanelLogin::getServer(LLString &server, S32 &domain_name) -{ - BOOL user_picked = FALSE; - if (!sInstance) - { - llwarns << "Attempted getServer with no login view shown" << llendl; + std::ostringstream oStr; + + LLString location; + LLString region; + LLString password; + + if (LLURLSimString::parse()) + { + std::ostringstream oRegionStr; + location = "specify"; + oRegionStr << LLURLSimString::sInstance.mSimName << "/" << LLURLSimString::sInstance.mX << "/" + << LLURLSimString::sInstance.mY << "/" + << LLURLSimString::sInstance.mZ; + region = oRegionStr.str(); } else { - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) + if (gSavedSettings.getBOOL("LoginLastLocation")) { - LLSD combo_val = combo->getValue(); - if (LLSD::TypeInteger == combo_val.type()) - { - domain_name = combo->getValue().asInteger(); - - if ((S32)USERSERVER_OTHER == domain_name) - { - server = gUserServerName; - } - } - else - { - // no valid selection, return other - domain_name = (S32)USERSERVER_OTHER; - server = combo_val.asString(); - } - user_picked = combo->isDirty(); + location = "last"; + } + else + { + location = "home"; } } - - return user_picked; -} - -// static -void LLPanelLogin::getLocation(LLString &location) -{ - if (!sInstance) + + LLString firstname, lastname; + + if (gCmdLineFirstName.empty()) { - llwarns << "Attempted getLocation with no login view shown" << llendl; - return; + firstname = gSavedSettings.getString("FirstName"); } - - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "start_location_combo"); - if (combo) + else { - location = combo->getValue().asString(); + firstname = gCmdLineFirstName; } -} - -// static -void LLPanelLogin::refreshLocation( bool force_visible ) -{ - if (!sInstance) return; - - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "start_location_combo"); - if (!combo) return; - - LLString sim_string = LLURLSimString::sInstance.mSimString; - if (!sim_string.empty()) + + if (gCmdLineLastName.empty()) { - combo->setCurrentByIndex( 3 ); // BUG? Maybe 2? - combo->setTextEntry(sim_string); + lastname = gSavedSettings.getString("LastName"); } else { - BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); - combo->setCurrentByIndex( login_last ? 1 : 0 ); + lastname = gCmdLineLastName; } + + LLString version = llformat("%d.%d.%d (%d)", + LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); - BOOL show_start = TRUE; + char* curl_region = curl_escape(region.c_str(), 0); + char* curl_channel = curl_escape(gChannelName.c_str(), 0); + char* curl_version = curl_escape(version.c_str(), 0); - if ( ! force_visible ) - show_start = gSavedSettings.getBOOL("ShowStartLocation"); + + oStr << sInstance->childGetValue( "real_url" ).asString() << "&firstname=" << firstname << + "&lastname=" << lastname << "&location=" << location << "®ion=" << curl_region << + "&grid=" << gGridInfo[gGridChoice].mLabel << "&channel=" << curl_channel << + "&version=" << curl_version; - sInstance->childSetVisible("start_location_combo", show_start); - sInstance->childSetVisible("start_location_text", show_start); -} + + curl_free(curl_region); + curl_free(curl_channel); + curl_free(curl_version); -// static -void LLPanelLogin::close() -{ - if (sInstance) + LLString language(gSavedSettings.getString("Language")); + if(language == "default") { - gViewerWindow->getRootView()->removeChild( LLPanelLogin::sInstance ); - - gFocusMgr.setDefaultKeyboardFocus(NULL); - - delete sInstance; - sInstance = NULL; + language = gSavedSettings.getString("SystemLanguage"); } -} - -//--------------------------------------------------------------------------- -// Protected methods -//--------------------------------------------------------------------------- + oStr << "&lang=" << language; -// static -void LLPanelLogin::onClickConnect(void *) -{ - if (sInstance && sInstance->mCallback) + if (!gCmdLinePassword.empty()) { - // tell the responder we're not here anymore - if ( gResponsePtr ) - gResponsePtr->setParent( 0 ); - - // JC - Make sure the fields all get committed. - sInstance->setFocus(FALSE); - - LLString first = sInstance->childGetText("first_name_edit"); - LLString last = sInstance->childGetText("last_name_edit"); - if (!first.empty() && !last.empty()) - { - // has both first and last name typed - - // store off custom server entry, if currently selected - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) - { - S32 selected_server = combo->getValue(); - if (selected_server == USERSERVER_NONE) - { - LLString custom_server = combo->getValue().asString(); - gSavedSettings.setString("CustomServer", custom_server); - } - } - sInstance->mCallback(0, sInstance->mCallbackData); - } - else - { - // empty first or last name - // same as clicking new account - onClickNewAccount(NULL); - } + oStr << "&password=" << gCmdLinePassword; } -} - - -// static -void LLPanelLogin::newAccountAlertCallback(S32 option, void*) -{ - if (0 == option) + else if (!(password = load_password_from_disk()).empty()) { - llinfos << "Going to account creation URL" << llendl; - LLWeb::loadURL( CREATE_ACCOUNT_URL ); + oStr << "&password=$1$" << password; } - else + if (gAutoLogin) { - sInstance->setFocus(TRUE); + oStr << "&auto_login=TRUE"; } -} - - -// static -void LLPanelLogin::onClickNewAccount(void*) -{ - if (gHideLinks) + if (gSavedSettings.getBOOL("ShowStartLocation")) { - gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks"); - } - else + oStr << "&show_start_location=TRUE"; + } + if (gSavedSettings.getBOOL("RememberPassword")) { - gViewerWindow->alertXml("MustHaveAccountToLogIn", - LLPanelLogin::newAccountAlertCallback); - } + oStr << "&remember_password=TRUE"; + } +#ifndef LL_RELEASE_FOR_DOWNLOAD + oStr << "&show_grid=TRUE"; +#else + if (gSavedSettings.getBOOL("ForceShowGrid")) + oStr << "&show_grid=TRUE"; +#endif + + // navigate to the "real" page + web_browser->navigateTo( oStr.str() ); } +//--------------------------------------------------------------------------- +// Protected methods +//--------------------------------------------------------------------------- + // static void LLPanelLogin::onClickQuit(void*) { @@ -807,13 +679,3 @@ void LLPanelLogin::onClickVersion(void*) { LLFloaterAbout::show(NULL); } - -// static -void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) -{ - if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE) - { - LLNotifyBox::showXml("CapsKeyOn"); - sCapslockDidNotification = TRUE; - } -} diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h index 94e746e..191e88c 100644 --- a/linden/indra/newview/llpanellogin.h +++ b/linden/indra/newview/llpanellogin.h @@ -33,7 +33,7 @@ #define LL_LLPANELLOGIN_H #include "llpanel.h" - +#include "llcommandhandler.h" #include "lldbstrings.h" #include "llmemory.h" #include "llviewerimage.h" @@ -46,6 +46,22 @@ class LLCheckBoxCtrl; class LLButton; class LLComboBox; + +class LLLoginHandler : public LLCommandHandler +{ + public: + LLLoginHandler() : LLCommandHandler("login") { } + bool handle(const LLSD& tokens, const LLSD& queryMap); + bool parseDirectLogin(std::string url); + void parse(const LLSD& queryMap); + + LLUUID mWebLoginKey; + LLString mFirstName; + LLString mLastName; +}; + +extern LLLoginHandler gLoginHandler; + class LLPanelLogin : public LLPanel { @@ -57,50 +73,30 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); virtual void draw(); - virtual void setFocus( BOOL b ); static void show(const LLRect &rect, BOOL show_server, void (*callback)(S32 option, void* user_data), void* callback_data); - static void setFields(const std::string& firstname, const std::string& lastname, - const std::string& password, BOOL remember); - - static void addServer(const char *server, S32 domain_name); - static void refreshLocation( bool force_visible ); - - static void getFields(LLString &firstname, LLString &lastname, - LLString &password, BOOL &remember); - - static BOOL getServer(LLString &server, S32& domain_name); - static void getLocation(LLString &location); - static void close(); void setSiteIsAlive( bool alive ); - static void giveFocus(); - static void mungePassword(LLUICtrl* caller, void* user_data); - + static void loadLoginPage(); + static void giveFocus(); + static void setAlwaysRefresh(bool refresh); + private: - static void onClickConnect(void*); - static void onClickNewAccount(void*); - static void newAccountAlertCallback(S32 option, void*); static void onClickQuit(void*); static void onClickVersion(void*); - static void onPassKey(LLLineEditor* caller, void* user_data); - + private: LLPointer mLogoImage; void (*mCallback)(S32 option, void *userdata); void* mCallbackData; - std::string mIncomingPassword; - std::string mMungedPassword; - static LLPanelLogin* sInstance; - static BOOL sCapslockDidNotification; BOOL mHtmlAvailable; }; diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index cf50709..c3d949d 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp @@ -68,7 +68,7 @@ #include "llvovolume.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llvieweruictrlfactory.h" #include "llfirstuse.h" diff --git a/linden/indra/newview/llpanelvolume.cpp b/linden/indra/newview/llpanelvolume.cpp index 69e0fde..c288c6a 100644 --- a/linden/indra/newview/llpanelvolume.cpp +++ b/linden/indra/newview/llpanelvolume.cpp @@ -72,7 +72,6 @@ #include "llvovolume.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" #include "lldrawpool.h" #include "llvieweruictrlfactory.h" diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp index 59619d6..9ad7149 100644 --- a/linden/indra/newview/llprefsvoice.cpp +++ b/linden/indra/newview/llprefsvoice.cpp @@ -45,7 +45,7 @@ #include "llfocusmgr.h" #include "llfloatervoicewizard.h" -#include "viewer.h" +#include "llappviewer.h" #include "llvoiceclient.h" diff --git a/linden/indra/newview/llpreviewgesture.cpp b/linden/indra/newview/llpreviewgesture.cpp index 720963c..051e328 100644 --- a/linden/indra/newview/llpreviewgesture.cpp +++ b/linden/indra/newview/llpreviewgesture.cpp @@ -65,7 +65,7 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" // busycount -#include "viewer.h" // gVFS +#include "llappviewer.h" // gVFS #include "llresmgr.h" @@ -342,7 +342,7 @@ void LLPreviewGesture::handleSaveChangesDialog(S32 option, void* data) case 2: // "Cancel" default: // If we were quitting, we didn't really mean it. - app_abort_quit(); + LLAppViewer::instance()->abortQuit(); break; } } diff --git a/linden/indra/newview/llpreviewlandmark.cpp b/linden/indra/newview/llpreviewlandmark.cpp index 2d20fd5..461f7d4 100644 --- a/linden/indra/newview/llpreviewlandmark.cpp +++ b/linden/indra/newview/llpreviewlandmark.cpp @@ -56,7 +56,6 @@ #include "llviewercontrol.h" #include "llviewerregion.h" #include "llviewerstats.h" -#include "viewer.h" #include "llvieweruictrlfactory.h" diff --git a/linden/indra/newview/llpreviewnotecard.cpp b/linden/indra/newview/llpreviewnotecard.cpp index 620be8f..dc56494 100644 --- a/linden/indra/newview/llpreviewnotecard.cpp +++ b/linden/indra/newview/llpreviewnotecard.cpp @@ -55,7 +55,8 @@ #include "lldir.h" //#include "llfloaterchat.h" #include "llviewerstats.h" -#include "viewer.h" // app_abort_quit() +#include "llviewercontrol.h" // gSavedSettings +#include "llappviewer.h" // app_abort_quit() #include "lllineeditor.h" #include "llvieweruictrlfactory.h" @@ -636,7 +637,7 @@ void LLPreviewNotecard::handleSaveChangesDialog(S32 option, void* userdata) case 2: // "Cancel" default: // If we were quitting, we didn't really mean it. - app_abort_quit(); + LLAppViewer::instance()->abortQuit(); break; } } diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index 7eac589..6c37700 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp @@ -72,7 +72,6 @@ #include "llscrolllistctrl.h" #include "lltextbox.h" #include "llslider.h" -#include "viewer.h" #include "lldir.h" #include "llcombobox.h" //#include "llfloaterchat.h" @@ -83,7 +82,8 @@ #include "llwebbrowserctrl.h" #include "lluictrlfactory.h" -#include "viewer.h" +#include "llviewercontrol.h" +#include "llappviewer.h" #include "llpanelinventory.h" @@ -629,7 +629,7 @@ void LLScriptEdCore::handleSaveChangesDialog( S32 option, void* userdata ) case 2: // "Cancel" default: // If we were quitting, we didn't really mean it. - app_abort_quit(); + LLAppViewer::instance()->abortQuit(); break; } } diff --git a/linden/indra/newview/llprogressview.cpp b/linden/indra/newview/llprogressview.cpp index d855f75..cc9c3fa 100644 --- a/linden/indra/newview/llprogressview.cpp +++ b/linden/indra/newview/llprogressview.cpp @@ -49,7 +49,7 @@ #include "llviewercontrol.h" #include "llviewerimagelist.h" #include "llviewerwindow.h" -#include "viewer.h" +#include "llappviewer.h" LLProgressView* LLProgressView::sInstance = NULL; @@ -127,7 +127,7 @@ BOOL LLProgressView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) // Suck up all keystokes except CTRL-Q. if( ('Q' == key) && (MASK_CONTROL == mask) ) { - app_user_quit(); + LLAppViewer::instance()->userQuit(); } return TRUE; } @@ -228,7 +228,7 @@ void LLProgressView::draw() F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); // background_color.mV[3] = background_color.mV[3]*alpha; - LLString top_line = gSecondLife; + LLString top_line = LLAppViewer::instance()->getSecondLifeTitle(); font->renderUTF8(top_line, 0, line_x, line_one_y, @@ -338,7 +338,7 @@ void LLProgressView::onCancelButtonClicked(void*) { if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) { - app_request_quit(); + LLAppViewer::instance()->requestQuit(); } else { diff --git a/linden/indra/newview/llsky.cpp b/linden/indra/newview/llsky.cpp index eadac8a..ee3890e 100644 --- a/linden/indra/newview/llsky.cpp +++ b/linden/indra/newview/llsky.cpp @@ -64,6 +64,7 @@ extern LLPipeline gPipeline; F32 azimuth_from_vector(const LLVector3 &v); F32 elevation_from_vector(const LLVector3 &v); +LLSky gSky; // ---------------- LLSky ---------------- ////////////////////////////////////////////////////////////////////// diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp index 6cd1ace..abb8d97 100644 --- a/linden/indra/newview/llspatialpartition.cpp +++ b/linden/indra/newview/llspatialpartition.cpp @@ -38,7 +38,7 @@ #include "llvovolume.h" #include "llviewercamera.h" #include "llface.h" -#include "viewer.h" +#include "llviewercontrol.h" #include "llagent.h" #include "llviewerregion.h" #include "llcamera.h" diff --git a/linden/indra/newview/llsprite.cpp b/linden/indra/newview/llsprite.cpp index 332a5aa..827493d 100644 --- a/linden/indra/newview/llsprite.cpp +++ b/linden/indra/newview/llsprite.cpp @@ -48,7 +48,6 @@ #include "llface.h" #include "llviewercamera.h" #include "llviewerimagelist.h" -#include "viewer.h" LLVector3 LLSprite::sCameraUp(0.0f,0.0f,1.0f); LLVector3 LLSprite::sCameraRight(1.0f,0.0f,0.0f); diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index dad8046..6c37341 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -134,6 +134,7 @@ #include "llurlsimstring.h" #include "llurlwhitelist.h" #include "lluserauth.h" +#include "llvieweraudio.h" #include "llviewerassetstorage.h" #include "llviewercamera.h" #include "llviewerdisplay.h" @@ -155,12 +156,16 @@ #include "llworldmap.h" #include "llxfermanager.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" #include "llmediaengine.h" #include "llfasttimerview.h" #include "llfloatermap.h" #include "llweb.h" #include "llvoiceclient.h" +#include "llnamelistctrl.h" +#include "llnamebox.h" +#include "llnameeditor.h" +#include "llurlsimstring.h" #if LL_LIBXUL_ENABLED #include "llmozlib.h" @@ -186,13 +191,7 @@ // // exported globals // - -// HACK: Allow server to change sun and moon IDs. -// I can't figure out how to pass the appropriate -// information into the LLVOSky constructor. JC -LLUUID gSunTextureID = IMG_SUN; -LLUUID gMoonTextureID = IMG_MOON; -LLUUID gCloudTextureID = IMG_CLOUD_POOF; +BOOL gAgentMovementCompleted = FALSE; const char* SCREEN_HOME_FILENAME = "screen_home.bmp"; const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; @@ -202,7 +201,6 @@ const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; // extern S32 gStartImageWidth; extern S32 gStartImageHeight; -extern std::string gSerialNumber; // // local globals @@ -250,6 +248,17 @@ void init_start_screen(S32 location_id); void release_start_screen(); void reset_login(); +void callback_cache_name(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group, void* data) +{ + LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); + LLNameBox::refreshAll(id, firstname, lastname, is_group); + LLNameEditor::refreshAll(id, firstname, lastname, is_group); + + // TODO: Actually be intelligent about the refresh. + // For now, just brute force refresh the dialogs. + dialog_refresh_all(); +} + // // exported functionality // @@ -288,9 +297,9 @@ public: void update_texture_fetch() { - gTextureCache->update(1); // unpauses the texture cache thread - gImageDecodeThread->update(1); // unpauses the image thread - gTextureFetch->update(1); // unpauses the texture fetch thread + LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread + LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread + LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread gImageList.updateImages(0.10f); } @@ -320,6 +329,7 @@ BOOL idle_startup() static std::string auth_message; static LLString firstname; static LLString lastname; + static LLUUID web_login_key; static LLString password; static std::vector requested_options; @@ -339,7 +349,6 @@ BOOL idle_startup() static S32 location_which = START_LOCATION_ID_LAST; static BOOL show_connect_box = TRUE; - static BOOL remember_password = TRUE; static BOOL stipend_since_login = FALSE; @@ -372,7 +381,7 @@ BOOL idle_startup() ///////////////////////////////////////////////// // - // Initialize stuff that doesn't need data from userserver/simulators + // Initialize stuff that doesn't need data from simulators // if (gFeatureManagerp->isSafe()) @@ -412,7 +421,7 @@ BOOL idle_startup() // *TODO:translate (maybe - very unlikely error message) // Note: alerts.xml may be invalid - if this gets translated it will need to be in the code LLString bad_xui_msg = "An error occured while updating Second Life. Please download the latest version from www.secondlife.com."; - app_early_exit(bad_xui_msg); + LLAppViewer::instance()->earlyExit(bad_xui_msg); } // // Statistics stuff @@ -465,13 +474,13 @@ BOOL idle_startup() std::string())) { std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); - app_early_exit(msg); + LLAppViewer::instance()->earlyExit(msg); } LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); } else { - app_early_exit("Unable to initialize communications."); + LLAppViewer::instance()->earlyExit("Unable to initialize communications."); } if(gMessageSystem && gMessageSystem->isOK()) @@ -625,37 +634,42 @@ BOOL idle_startup() // // Log on to system // - if( !gCmdLineFirstName.empty() + if ((!gLoginHandler.mFirstName.empty() && + !gLoginHandler.mLastName.empty() && + !gLoginHandler.mWebLoginKey.isNull()) + || gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand) ) + { + firstname = gLoginHandler.mFirstName; + lastname = gLoginHandler.mLastName; + web_login_key = gLoginHandler.mWebLoginKey; + + show_connect_box = FALSE; + } + else if( !gCmdLineFirstName.empty() && !gCmdLineLastName.empty() && !gCmdLinePassword.empty()) { firstname = gCmdLineFirstName; lastname = gCmdLineLastName; - LLMD5 pass((unsigned char*)gCmdLinePassword.c_str()); - char md5pass[33]; /* Flawfinder: ignore */ - pass.hex_digest(md5pass); - password = md5pass; - - remember_password = gSavedSettings.getBOOL("RememberPassword"); - show_connect_box = FALSE; + show_connect_box = TRUE; + gAutoLogin = TRUE; } else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin")) { firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); password = load_password_from_disk(); - remember_password = TRUE; - show_connect_box = FALSE; + gSavedSettings.setBOOL("RememberPassword", TRUE); + show_connect_box = TRUE; } else { // if not automatically logging in, display login dialog - // until a valid userserver is selected + // a valid grid is selected firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); password = load_password_from_disk(); - remember_password = gSavedSettings.getBOOL("RememberPassword"); show_connect_box = TRUE; } @@ -665,7 +679,8 @@ BOOL idle_startup() } if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) - { + { + llinfos << "Initializing Window" << llendl; gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); @@ -686,8 +701,6 @@ BOOL idle_startup() // Show the login dialog login_show(); - // connect dialog is already shown, so fill in the names - LLPanelLogin::setFields( firstname, lastname, password, remember_password ); LLPanelLogin::giveFocus(); gSavedSettings.setBOOL("FirstRunThisInstall", FALSE); @@ -699,6 +712,32 @@ BOOL idle_startup() // skip directly to message template verification LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } + + // Create selection manager + // Must be done before menus created, because many enabled callbacks + // require its existance. + gSelectMgr = new LLSelectMgr(); + gParcelMgr = new LLViewerParcelMgr(); + gHUDManager = new LLHUDManager(); + gMuteListp = new LLMuteList(); + + // Initialize UI + if (!gNoRender) + { + // Initialize all our tools. Must be done after saved settings loaded. + if ( gToolMgr == NULL ) + { + gToolMgr = new LLToolMgr(); + gToolMgr->initTools(); + } + + // Quickly get something onscreen to look at. + gViewerWindow->initWorldUI(); + } + + gViewerWindow->setNormalControlsVisible( FALSE ); + gLoginMenuBarView->setVisible( TRUE ); + gLoginMenuBarView->setEnabled( TRUE ); timeout.reset(); return do_normal_idle; @@ -716,11 +755,16 @@ BOOL idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + //reset the values that could have come in from a slurl + if (!gLoginHandler.mWebLoginKey.isNull()) + { + firstname = gLoginHandler.mFirstName; + lastname = gLoginHandler.mLastName; + web_login_key = gLoginHandler.mWebLoginKey; + } + if (show_connect_box) { - // Load all the name information out of the login view - LLPanelLogin::getFields(firstname, lastname, password, remember_password); - // HACK: Try to make not jump on login gKeyboard->resetKeys(); } @@ -730,12 +774,11 @@ BOOL idle_startup() gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); + + + llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; - write_debug("Attempting login as: "); - write_debug(firstname); - write_debug(" "); - write_debug(lastname); - write_debug("\n"); + gDebugInfo["LoginName"] = firstname + " " + lastname; } // create necessary directories @@ -780,28 +823,10 @@ BOOL idle_startup() if (show_connect_box) { - LLString server_label; - S32 domain_name_index; - BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index ); - gUserServerChoice = (EUserServerDomain) domain_name_index; - gSavedSettings.setS32("ServerChoice", gUserServerChoice); - if (gUserServerChoice == USERSERVER_OTHER) - { - snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ - } - - if ( user_picked_server ) - { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gUserServerChoice - sAuthUris.clear(); - resetURIs(); - } - - LLString location; - LLPanelLogin::getLocation( location ); - LLURLSimString::setString( location ); LLPanelLogin::close(); } + //For HTML parsing in text boxes. LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); LLTextEditor::setURLCallbacks ( &LLWeb::loadURL, &LLURLDispatcher::dispatch, &LLURLDispatcher::dispatch ); @@ -871,6 +896,8 @@ BOOL idle_startup() if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState()) { //#define LL_MINIMIAL_REQUESTED_OPTIONS + gDebugInfo["GridUtilHost"] = gGridInfo[gGridChoice].mName; + lldebugs << "STATE_LOGIN_AUTH_INIT" << llendl; if (!gUserAuthp) { @@ -906,14 +933,13 @@ BOOL idle_startup() gSavedSettings.setBOOL("UseDebugMenus", TRUE); requested_options.push_back("god-connect"); } - if (sAuthUris.empty()) - { - sAuthUris = getLoginURIs(); - } + LLAppViewer::instance()->getLoginURIs(); + sAuthUris = LLAppViewer::instance()->getLoginURIs(); + sAuthUriNum = 0; auth_method = "login_to_simulator"; auth_desc = "Logging in. "; - auth_desc += gSecondLife; + auth_desc += LLAppViewer::instance()->getSecondLifeTitle(); auth_desc += " may appear frozen. Please wait."; LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); } @@ -931,11 +957,12 @@ BOOL idle_startup() // a startup URL was specified std::stringstream unescaped_start; unescaped_start << "uri:" - << LLURLSimString::sInstance.mSimName << "&" - << LLURLSimString::sInstance.mX << "&" - << LLURLSimString::sInstance.mY << "&" - << LLURLSimString::sInstance.mZ; + << LLURLSimString::sInstance.mSimName << "&" + << LLURLSimString::sInstance.mX << "&" + << LLURLSimString::sInstance.mY << "&" + << LLURLSimString::sInstance.mZ; start << xml_escape_string(unescaped_start.str().c_str()); + } else if (gSavedSettings.getBOOL("LoginLastLocation")) { @@ -951,13 +978,13 @@ BOOL idle_startup() hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); hashed_mac.finalize(); hashed_mac.hex_digest(hashed_mac_string); - + gUserAuthp->authenticate( sAuthUris[sAuthUriNum].c_str(), auth_method.c_str(), firstname.c_str(), lastname.c_str(), - password.c_str(), + web_login_key, start.str().c_str(), gSkipOptionalUpdate, gAcceptTOS, @@ -966,7 +993,8 @@ BOOL idle_startup() gLastExecFroze, requested_options, hashed_mac_string, - gSerialNumber); + LLAppViewer::instance()->getSerialNumber()); + // reset globals gAcceptTOS = FALSE; gAcceptCriticalMessage = FALSE; @@ -977,6 +1005,10 @@ BOOL idle_startup() if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState()) { //lldebugs << "STATE_LOGIN_NO_DATA_YET" << llendl; + // If we get here we have gotten past the potential stall + // in curl, so take "may appear frozen" out of progress bar. JC + auth_desc = "Logging in..."; + set_startup_status(progress, auth_desc.c_str(), auth_message.c_str()); if (!gUserAuthp) { llerrs << "No userauth in STATE_LOGIN_NO_DATA_YET!" << llendl; @@ -1167,7 +1199,7 @@ BOOL idle_startup() default: if (sAuthUriNum >= (int) sAuthUris.size() - 1) { - emsg << "Unable to connect to " << gSecondLife << ".\n"; + emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n"; emsg << gUserAuthp->errorMessage(); } else { sAuthUriNum++; @@ -1187,7 +1219,7 @@ BOOL idle_startup() { delete gUserAuthp; gUserAuthp = NULL; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return FALSE; } @@ -1202,15 +1234,11 @@ BOOL idle_startup() const char* text; text = gUserAuthp->getResponse("agent_id"); if(text) gAgentID.set(text); - write_debug("AgentID: "); - write_debug(text); - write_debug("\n"); + gDebugInfo["AgentID"] = text; text = gUserAuthp->getResponse("session_id"); if(text) gAgentSessionID.set(text); - write_debug("SessionID: "); - write_debug(text); - write_debug("\n"); + gDebugInfo["SessionID"] = text; text = gUserAuthp->getResponse("secure_session_id"); if(text) gAgent.mSecureSessionID.set(text); @@ -1228,17 +1256,8 @@ BOOL idle_startup() if(text) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); - if (remember_password) - { - save_password_to_disk(password.c_str()); - } - else - { - save_password_to_disk(NULL); - } - gSavedSettings.setBOOL("RememberPassword", remember_password); + gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); - gSavedSettings.setBOOL("LoggedIn", TRUE); text = gUserAuthp->getResponse("agent_access"); if(text && (text[0] == 'M')) @@ -1463,14 +1482,6 @@ BOOL idle_startup() // type the name/password again if we crash. gSavedSettings.saveToFile(gSettingsFileName, TRUE); - // Create selection manager - // Must be done before menus created, because many enabled callbacks - // require its existance. - gSelectMgr = new LLSelectMgr(); - gParcelMgr = new LLViewerParcelMgr(); - gHUDManager = new LLHUDManager(); - gMuteListp = new LLMuteList(); - // // Initialize classes w/graphics stuff. // @@ -1539,21 +1550,14 @@ BOOL idle_startup() if ( gViewerWindow != NULL && gToolMgr != NULL ) { // This isn't the first logon attempt, so show the UI gViewerWindow->setNormalControlsVisible( TRUE ); - } + } + gLoginMenuBarView->setVisible( FALSE ); + gLoginMenuBarView->setEnabled( FALSE ); + + gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); - // Initialize UI if (!gNoRender) { - // Initialize all our tools. Must be done after saved settings loaded. - if ( gToolMgr == NULL ) - { - gToolMgr = new LLToolMgr(); - gToolMgr->initTools(); - } - - // Quickly get something onscreen to look at. - gViewerWindow->initWorldUI(); - // Move the progress view in front of the UI gViewerWindow->moveProgressViewToFront(); @@ -1587,7 +1591,7 @@ BOOL idle_startup() gCacheName->addObserver(callback_cache_name); // Load stored cache if possible - load_name_cache(); + LLAppViewer::instance()->loadNameCache(); } // Data storage for map of world. @@ -1985,22 +1989,8 @@ BOOL idle_startup() gAgent.sendReliableMessage(); // request all group information - // *FIX: This will not do the right thing if the message - // gets there before the requestuserserverconnection - // circuit is completed. gAgent.sendAgentDataUpdateRequest(); - - // NOTE: removed as part of user-privacy - // enhancements. this information should be available from - // login. 2006-10-16 Phoenix. - // get the users that have been granted modify powers - //msg->newMessageFast(_PREHASH_RequestGrantedProxies); - //msg->nextBlockFast(_PREHASH_AgentData); - //msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - //msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - //gAgent.sendReliableMessage(); - BOOL shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); // Create the inventory views @@ -2136,7 +2126,6 @@ BOOL idle_startup() //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); llinfos << "Initialization complete" << llendl; - gInitializationComplete = TRUE; gRenderStartTime.reset(); gForegroundTime.reset(); @@ -2169,17 +2158,17 @@ BOOL idle_startup() if (url_ok) { args["[TYPE]"] = "desired"; - args["[HELP]"] = " "; + args["[HELP]"] = ""; } else if (gSavedSettings.getBOOL("LoginLastLocation")) { args["[TYPE]"] = "last"; - args["[HELP]"] = " \n "; + args["[HELP]"] = ""; } else { args["[TYPE]"] = "home"; - args["[HELP]"] = " \nYou may want to set a new home location.\n "; + args["[HELP]"] = "\nYou may want to set a new home location."; } gViewerWindow->alertXml("AvatarMoved", args); } @@ -2351,68 +2340,12 @@ void login_show() // UI textures have been previously loaded in doPreloadImages() llinfos << "Setting Servers" << llendl; - - if( USERSERVER_OTHER == gUserServerChoice ) - { - LLPanelLogin::addServer( gUserServerName, USERSERVER_OTHER ); - } - else - { - LLPanelLogin::addServer( gUserServerDomainName[gUserServerChoice].mLabel, gUserServerChoice ); - } - - // Arg! We hate loops! - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DMZ].mLabel, USERSERVER_DMZ ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_LOCAL].mLabel, USERSERVER_LOCAL ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_AGNI].mLabel, USERSERVER_AGNI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_ADITI].mLabel, USERSERVER_ADITI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SIVA].mLabel, USERSERVER_SIVA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DURGA].mLabel, USERSERVER_DURGA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SHAKTI].mLabel, USERSERVER_SHAKTI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_GANGA].mLabel, USERSERVER_GANGA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_UMA].mLabel, USERSERVER_UMA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SOMA].mLabel, USERSERVER_SOMA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_VAAK].mLabel, USERSERVER_VAAK ); } // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. void login_callback(S32 option, void *userdata) { - const S32 CONNECT_OPTION = 0; - const S32 QUIT_OPTION = 1; - - if (CONNECT_OPTION == option) - { - LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); - return; - } - else if (QUIT_OPTION == option) - { - // Make sure we don't save the password if the user is trying to clear it. - LLString first, last, password; - BOOL remember = TRUE; - LLPanelLogin::getFields(first, last, password, remember); - if (!remember) - { - // turn off the setting and write out to disk - gSavedSettings.setBOOL("RememberPassword", FALSE); - gSavedSettings.saveToFile(gSettingsFileName, TRUE); - - // stomp the saved password on disk - save_password_to_disk(NULL); - } - LLPanelLogin::close(); - - // Next iteration through main loop should shut down the app cleanly. - gQuit = TRUE; - - return; - } - else - { - llwarns << "Unknown login button clicked" << llendl; - } } LLString load_password_from_disk() @@ -2660,7 +2593,7 @@ void update_dialog_callback(S32 option, void *userdata) // ...user doesn't want to do it if (mandatory) { - app_force_quit(); + LLAppViewer::instance()->forceQuit(); // Bump them back to the login screen. //reset_login(); } @@ -2680,7 +2613,9 @@ void update_dialog_callback(S32 option, void *userdata) #elif LL_LINUX query_map["os"] = "lnx"; #endif - query_map["userserver"] = gUserServerName; + // *TODO change userserver to be grid on both viewer and sim, since + // userserver no longer exists. + query_map["userserver"] = gGridName; query_map["channel"] = gChannelName; // *TODO constantize this guy LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); @@ -2691,7 +2626,7 @@ void update_dialog_callback(S32 option, void *userdata) { // We're hosed, bail llwarns << "LLDir::getTempFilename() failed" << llendl; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return; } @@ -2709,7 +2644,7 @@ void update_dialog_callback(S32 option, void *userdata) if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) { llinfos << "Unable to copy the updater!" << llendl; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return; } @@ -2742,13 +2677,14 @@ void update_dialog_callback(S32 option, void *userdata) program_name = "SecondLife"; } - params << " -silent -name \"" << gSecondLife << "\""; + params << " -silent -name \"" << LLAppViewer::instance()->getSecondLifeTitle() << "\""; params << " -program \"" << program_name << "\""; } llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; - remove_marker_file(); // In case updater fails + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); // In case updater fails // Use spawn() to run asynchronously int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); @@ -2767,13 +2703,14 @@ void update_dialog_callback(S32 option, void *userdata) update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \""; update_exe_path += update_url.asString(); update_exe_path += "\" -name \""; - update_exe_path += gSecondLife; + update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); update_exe_path += "\" &"; llinfos << "Calling updater: " << update_exe_path << llendl; - - remove_marker_file(); // In case updater fails + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); // In case updater fails + // Run the auto-updater. system(update_exe_path.c_str()); /* Flawfinder: ignore */ @@ -2781,16 +2718,18 @@ void update_dialog_callback(S32 option, void *userdata) OSMessageBox("Automatic updating is not yet implemented for Linux.\n" "Please download the latest version from www.secondlife.com.", NULL, OSMB_OK); - remove_marker_file(); + + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); #endif - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); } void use_circuit_callback(void**, S32 result) { // bail if we're quitting. - if(gQuit) return; + if(LLApp::isExiting()) return; if( !gUseCircuitCallbackCalled ) { gUseCircuitCallbackCalled = true; @@ -3646,6 +3585,8 @@ void reset_login() if ( gViewerWindow ) { // Hide menus and normal buttons gViewerWindow->setNormalControlsVisible( FALSE ); + gLoginMenuBarView->setVisible( TRUE ); + gLoginMenuBarView->setEnabled( TRUE ); } // Hide any other stuff @@ -3689,3 +3630,8 @@ bool LLStartUp::dispatchURL() } return false; } + +void login_alert_done(S32 option, void* user_data) +{ + LLPanelLogin::giveFocus(); +} diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h index ad27b28..08f2f60 100644 --- a/linden/indra/newview/llstartup.h +++ b/linden/indra/newview/llstartup.h @@ -36,9 +36,9 @@ // functions BOOL idle_startup(); -void cleanup_app(); LLString load_password_from_disk(); void release_start_screen(); +void login_alert_done(S32 option, void* user_data); // constants, variables, & enumerations extern const char* SCREEN_HOME_FILENAME; diff --git a/linden/indra/newview/llstatgraph.cpp b/linden/indra/newview/llstatgraph.cpp index bd31077..25ff11c 100644 --- a/linden/indra/newview/llstatgraph.cpp +++ b/linden/indra/newview/llstatgraph.cpp @@ -95,10 +95,10 @@ void LLStatGraph::draw() if (mUpdateTimer.getElapsedTimeF32() > 0.5f) { - char format_str[256]; /* Flawfinder: ignore */ - char tmp_str[256]; /* Flawfinder: ignore */ - snprintf(format_str, sizeof(format_str), "%%s%%.%df%%s", mPrecision); /* Flawfinder: ignore */ - snprintf(tmp_str, sizeof(tmp_str), format_str, mLabel.c_str(), mValue, mUnits.c_str()); /* Flawfinder: ignore */ + std::string format_str; + std::string tmp_str; + format_str = llformat("%%s%%.%df%%s", mPrecision); + tmp_str = llformat(format_str.c_str(), mLabel.c_str(), mValue, mUnits.c_str()); setToolTip(tmp_str); mUpdateTimer.reset(); diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index 8c50eca..856943d 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp @@ -78,7 +78,7 @@ #include "lltoolmgr.h" #include "llfocusmgr.h" -#include "viewer.h" +#include "llappviewer.h" //#include "llfirstuse.h" @@ -256,7 +256,7 @@ void LLStatusBar::refresh() << std::setfill('0') << std::setw(2) << internal_time->tm_mday << " " << sMonths[internal_time->tm_mon] << " " << internal_time->tm_year + 1900; - mTextTime->setToolTip(date.str().c_str()); + mTextTime->setToolTip(date.str()); LLRect r; const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp index e9643eb..e9aa9b0 100644 --- a/linden/indra/newview/llsurface.cpp +++ b/linden/indra/newview/llsurface.cpp @@ -41,7 +41,7 @@ #include "llviewerobjectlist.h" #include "llregionhandle.h" #include "llagent.h" -#include "viewer.h" +#include "llappviewer.h" #include "llworld.h" #include "llviewercontrol.h" #include "llviewerimage.h" @@ -67,8 +67,6 @@ S32 LLSurface::sTexelsUpdated = 0; F32 LLSurface::sTextureUpdateTime = 0.f; LLStat LLSurface::sTexelsUpdatedPerSecStat; -extern void bad_network_handler(); - // ---------------- LLSurface:: Public Members --------------- LLSurface::LLSurface(U32 type, LLViewerRegion *regionp) : @@ -776,7 +774,7 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL << " quant_wbits " << (S32)ph.quant_wbits << " patchids " << (S32)ph.patchids << llendl; - bad_network_handler(); + LLAppViewer::instance()->badNetworkHandler(); return; } diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp index 097682f..5330e8d 100644 --- a/linden/indra/newview/lltexlayer.cpp +++ b/linden/indra/newview/lltexlayer.cpp @@ -52,7 +52,6 @@ #include "llxmltree.h" #include "pipeline.h" #include "v4coloru.h" -#include "viewer.h" //#include "../tools/imdebug/imdebug.h" diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp index b961053..706587a 100644 --- a/linden/indra/newview/lltexturectrl.cpp +++ b/linden/indra/newview/lltexturectrl.cpp @@ -1037,19 +1037,21 @@ void LLTextureCtrl::setVisible( BOOL visible ) void LLTextureCtrl::setEnabled( BOOL enabled ) { + LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)LLFloater::getFloaterByHandle(mFloaterHandle); if( enabled ) { - setToolTip( "Click to choose a picture" ); + LLString tooltip; + if (floaterp) tooltip = floaterp->getUIString("choose_picture"); + setToolTip( tooltip ); } else { - setToolTip( "" ); + setToolTip( LLString() ); // *TODO: would be better to keep floater open and show // disabled state. closeFloater(); } - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)LLFloater::getFloaterByHandle(mFloaterHandle); if( floaterp ) { floaterp->setActive(enabled); diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index 7d5e6ab..9464146 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -46,7 +46,6 @@ #include "llviewerimagelist.h" #include "llviewerimage.h" #include "llviewerregion.h" -#include "viewer.h" ////////////////////////////////////////////////////////////////////////////// @@ -1295,11 +1294,21 @@ bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 pri return false; } } - // If the requester knows the dimentions of the image, - // this will calculate how much data we need without having to parse the header + S32 desired_size; - if (w*h*c > 0) + if ((discard == 0) && worker && worker->mFileSize) + { + // if we want the entire image, and we know its size, then get it all + // (calcDataSizeJ2C() below makes assumptions about how the image + // was compressed - this code ensures that when we request the entire image, + // we really do get it.) + desired_size = worker->mFileSize; + } + else if (w*h*c > 0) { + // If the requester knows the dimentions of the image, + // this will calculate how much data we need without having to parse the header + desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, discard); } else diff --git a/linden/indra/newview/lltextureview.cpp b/linden/indra/newview/lltextureview.cpp index 4df5444..06a4ea0 100644 --- a/linden/indra/newview/lltextureview.cpp +++ b/linden/indra/newview/lltextureview.cpp @@ -49,7 +49,7 @@ #include "llviewerobject.h" #include "llviewerimage.h" #include "llviewerimagelist.h" -#include "viewer.h" +#include "llappviewer.h" extern F32 texmem_lower_bound_scale; @@ -145,7 +145,7 @@ void LLTextureBar::draw() } LLColor4 color; - if (mImagep->getID() == gTextureFetch->mDebugID) + if (mImagep->getID() == LLAppViewer::getTextureFetch()->mDebugID) { color = LLColor4::cyan2; } @@ -347,7 +347,7 @@ BOOL LLTextureBar::handleMouseDown(S32 x, S32 y, MASK mask) { if ((mask & (MASK_CONTROL|MASK_SHIFT|MASK_ALT)) == MASK_ALT) { - gTextureFetch->mDebugID = mImagep->getID(); + LLAppViewer::getTextureFetch()->mDebugID = mImagep->getID(); return TRUE; } return LLView::handleMouseDown(x,y,mask); @@ -469,9 +469,9 @@ void LLGLTexMemBar::draw() text = llformat("Textures: Count: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d(%d) RAW:%d", gImageList.getNumImages(), - gTextureFetch->getNumRequests(), gTextureFetch->getNumDeletes(), - gTextureFetch->mPacketCount, gTextureFetch->mBadPacketCount, - gTextureCache->getNumReads(), gTextureCache->getNumWrites(), + LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(), + LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount, + LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(), LLLFSThread::sLocal->getPending(), LLImageWorker::sCount, LLImageWorker::getWorkerThread()->getNumDeletes(), LLImageRaw::sRawImageCount); @@ -480,7 +480,7 @@ void LLGLTexMemBar::draw() text_color, LLFontGL::LEFT, LLFontGL::TOP); S32 dx1 = 0; - if (gTextureFetch->mDebugPause) + if (LLAppViewer::getTextureFetch()->mDebugPause) { LLFontGL::sMonospace->renderUTF8("!", 0, title_x1, line_height, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -781,7 +781,7 @@ BOOL LLTextureView::handleMouseDown(S32 x, S32 y, MASK mask) } if ((mask & (MASK_CONTROL|MASK_SHIFT|MASK_ALT)) == (MASK_CONTROL|MASK_SHIFT)) { - gTextureFetch->mDebugPause = !gTextureFetch->mDebugPause; + LLAppViewer::getTextureFetch()->mDebugPause = !LLAppViewer::getTextureFetch()->mDebugPause; return TRUE; } if (mask & MASK_SHIFT) diff --git a/linden/indra/newview/lltoolbar.cpp b/linden/indra/newview/lltoolbar.cpp index 71e8aec..e7a5445 100644 --- a/linden/indra/newview/lltoolbar.cpp +++ b/linden/indra/newview/lltoolbar.cpp @@ -59,7 +59,6 @@ #include "llviewerparcelmgr.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" -#include "viewer.h" #include "lltoolgrab.h" #if LL_DARWIN diff --git a/linden/indra/newview/lltoolbrush.cpp b/linden/indra/newview/lltoolbrush.cpp index a56bf42..189996e 100644 --- a/linden/indra/newview/lltoolbrush.cpp +++ b/linden/indra/newview/lltoolbrush.cpp @@ -53,7 +53,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llworld.h" -#include "viewer.h" +#include "llappviewer.h" #include "llparcel.h" #include "llglheaders.h" diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index 1f607de..e6eca31 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp @@ -63,7 +63,6 @@ #include "llvolume.h" #include "llworld.h" #include "object_flags.h" -#include "viewer.h" LLToolDragAndDrop *gToolDragAndDrop = NULL; diff --git a/linden/indra/newview/lltoolfocus.cpp b/linden/indra/newview/lltoolfocus.cpp index 2ac2b33..43c8e1a 100644 --- a/linden/indra/newview/lltoolfocus.cpp +++ b/linden/indra/newview/lltoolfocus.cpp @@ -55,7 +55,6 @@ #include "llviewercamera.h" #include "llviewerobject.h" #include "llviewerwindow.h" -#include "viewer.h" #include "llvoavatar.h" #include "llmorphview.h" diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp index 13977ee..3f19ed4 100644 --- a/linden/indra/newview/lltoolgrab.cpp +++ b/linden/indra/newview/lltoolgrab.cpp @@ -62,7 +62,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llworld.h" -#include "viewer.h" const S32 SLOP_DIST_SQ = 4; diff --git a/linden/indra/newview/lltoolgun.cpp b/linden/indra/newview/lltoolgun.cpp index c7e598e..ebe22fc 100644 --- a/linden/indra/newview/lltoolgun.cpp +++ b/linden/indra/newview/lltoolgun.cpp @@ -37,7 +37,6 @@ #include "llagent.h" #include "llviewercontrol.h" #include "llsky.h" -#include "viewer.h" #include "llresmgr.h" #include "llfontgl.h" #include "llui.h" diff --git a/linden/indra/newview/lltoolmgr.cpp b/linden/indra/newview/lltoolmgr.cpp index ae74eba..0e46ece 100644 --- a/linden/indra/newview/lltoolmgr.cpp +++ b/linden/indra/newview/lltoolmgr.cpp @@ -428,6 +428,11 @@ void LLToolMgr::onAppFocusGained() updateToolStatus(); } +void LLToolMgr::clearSavedTool() +{ + mSavedTool = NULL; +} + ///////////////////////////////////////////////////// // LLToolset diff --git a/linden/indra/newview/lltoolmgr.h b/linden/indra/newview/lltoolmgr.h index e0f554d..557208b 100644 --- a/linden/indra/newview/lltoolmgr.h +++ b/linden/indra/newview/lltoolmgr.h @@ -70,6 +70,8 @@ public: void onAppFocusGained(); void onAppFocusLost(); + void clearSavedTool(); + protected: friend class LLToolset; // to allow access to setCurrentTool(); void setCurrentTool(LLTool* tool); diff --git a/linden/indra/newview/lltoolmorph.cpp b/linden/indra/newview/lltoolmorph.cpp index d3cd997..3a56a9f 100644 --- a/linden/indra/newview/lltoolmorph.cpp +++ b/linden/indra/newview/lltoolmorph.cpp @@ -62,7 +62,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "pipeline.h" -#include "viewer.h" //LLToolMorph *gToolMorph = NULL; diff --git a/linden/indra/newview/lltoolobjpicker.cpp b/linden/indra/newview/lltoolobjpicker.cpp index 8e8abfe..a8876da 100644 --- a/linden/indra/newview/lltoolobjpicker.cpp +++ b/linden/indra/newview/lltoolobjpicker.cpp @@ -38,7 +38,6 @@ #include "llagent.h" #include "llselectmgr.h" #include "llworld.h" -#include "viewer.h" // for gFPSClamped, pie menus #include "llviewercontrol.h" #include "llmenugl.h" #include "lltoolmgr.h" diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index 166209d..fa8213d 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp @@ -85,6 +85,8 @@ LLToolPie::LLToolPie() BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { + if (!gCamera) return FALSE; + //left mouse down always picks transparent gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback, TRUE, TRUE); diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp index ee5d08f..d26bdab 100644 --- a/linden/indra/newview/lltoolplacer.cpp +++ b/linden/indra/newview/lltoolplacer.cpp @@ -50,9 +50,22 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llworld.h" -#include "viewer.h" #include "llui.h" +//Headers added for functions moved from viewer.cpp +#include "llvograss.h" +#include "llvotree.h" +#include "llvolumemessage.h" +#include "llhudmanager.h" +#include "llagent.h" +#include "audioengine.h" +#include "llhudeffecttrail.h" +#include "llviewerobjectlist.h" +#include "llviewercamera.h" +#include "llviewerstats.h" + +const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f); + //static LLPCode LLToolPlacer::sObjectType = LL_PCODE_CUBE; @@ -61,9 +74,366 @@ LLToolPlacer::LLToolPlacer() { } +BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, + BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ) +{ + F32 max_dist_from_camera = gSavedSettings.getF32( "MaxSelectDistance" ) - 1.f; + + // Viewer-side pick to find the right sim to create the object on. + // First find the surface the object will be created on. + gViewerWindow->hitObjectOrLandGlobalImmediate(x, y, NULL, FALSE); + + // Note: use the frontmost non-flora version because (a) plants usually have lots of alpha and (b) pants' Havok + // representations (if any) are NOT the same as their viewer representation. + *hit_obj = gObjectList.findObject( gLastHitNonFloraObjectID ); + *hit_face = gLastHitNonFloraObjectFace; + *b_hit_land = !(*hit_obj) && !gLastHitNonFloraPosGlobal.isExactlyZero(); + LLVector3d land_pos_global = gLastHitNonFloraPosGlobal; + + // Make sure there's a surface to place the new object on. + BOOL bypass_sim_raycast = FALSE; + LLVector3d surface_pos_global; + if (*b_hit_land) + { + surface_pos_global = land_pos_global; + bypass_sim_raycast = TRUE; + } + else + if (*hit_obj) + { + surface_pos_global = (*hit_obj)->getPositionGlobal(); + } + else + { + return FALSE; + } + + // Make sure the surface isn't too far away. + LLVector3d ray_start_global = gAgent.getCameraPositionGlobal(); + F32 dist_to_surface_sq = (F32)((surface_pos_global - ray_start_global).magVecSquared()); + if( dist_to_surface_sq > (max_dist_from_camera * max_dist_from_camera) ) + { + return FALSE; + } + + // Find the sim where the surface lives. + LLViewerRegion *regionp = gWorldp->getRegionFromPosGlobal(surface_pos_global); + if (!regionp) + { + llwarns << "Trying to add object outside of all known regions!" << llendl; + return FALSE; + } + + // Find the simulator-side ray that will be used to place the object accurately + LLVector3d mouse_direction; + mouse_direction.setVec( gViewerWindow->mouseDirectionGlobal( x, y ) ); + + *region = regionp; + *ray_start_region = regionp->getPosRegionFromGlobal( ray_start_global ); + F32 near_clip = gCamera->getNear() + 0.01f; // Include an epsilon to avoid rounding issues. + *ray_start_region += gCamera->getAtAxis() * near_clip; + + if( bypass_sim_raycast ) + { + // Hack to work around Havok's inability to ray cast onto height fields + *ray_end_region = regionp->getPosRegionFromGlobal( surface_pos_global ); // ray end is the viewer's intersection point + } + else + { + LLVector3d ray_end_global = ray_start_global + (1.f + max_dist_from_camera) * mouse_direction; // add an epsilon to the sim version of the ray to avoid rounding problems. + *ray_end_region = regionp->getPosRegionFromGlobal( ray_end_global ); + } + + return TRUE; +} + + +BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) +{ + LLVector3 ray_start_region; + LLVector3 ray_end_region; + LLViewerRegion* regionp = NULL; + BOOL b_hit_land = FALSE; + S32 hit_face = -1; + LLViewerObject* hit_obj = NULL; + U8 state = 0; + BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); + if( !success ) + { + return FALSE; + } + + if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) ) + { + // Can't create objects on avatars or attachments + return FALSE; + } + + if (NULL == regionp) + { + llwarns << "regionp was NULL; aborting function." << llendl; + return FALSE; + } + + if (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX) + { + LLFirstUse::useSandbox(); + } + + // Set params for new object based on its PCode. + LLQuaternion rotation; + LLVector3 scale = DEFAULT_OBJECT_SCALE; + U8 material = LL_MCODE_WOOD; + BOOL create_selected = FALSE; + LLVolumeParams volume_params; + + switch (pcode) + { + case LL_PCODE_LEGACY_GRASS: + // Randomize size of grass patch + scale.setVec(10.f + ll_frand(20.f), 10.f + ll_frand(20.f), 1.f + ll_frand(2.f)); + state = rand() % LLVOGrass::sMaxGrassSpecies; + break; + + + case LL_PCODE_LEGACY_TREE: + case LL_PCODE_TREE_NEW: + state = rand() % LLVOTree::sMaxTreeSpecies; + break; + + case LL_PCODE_SPHERE: + case LL_PCODE_CONE: + case LL_PCODE_CUBE: + case LL_PCODE_CYLINDER: + case LL_PCODE_TORUS: + case LLViewerObject::LL_VO_SQUARE_TORUS: + case LLViewerObject::LL_VO_TRIANGLE_TORUS: + default: + create_selected = TRUE; + break; + } + + // Play creation sound + if (gAudiop) + { + F32 volume = gSavedSettings.getF32("AudioLevelUI"); + gAudiop->triggerSound( LLUUID(gSavedSettings.getString("UISndObjectCreate")), gAgent.getID(), volume); + } + + gMessageSystem->newMessageFast(_PREHASH_ObjectAdd); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addU8Fast(_PREHASH_Material, material); + + U32 flags = 0; // not selected + if (use_physics) + { + flags |= FLAGS_USE_PHYSICS; + } + if (create_selected) + { + flags |= FLAGS_CREATE_SELECTED; + } + gMessageSystem->addU32Fast(_PREHASH_AddFlags, flags ); + + LLPCode volume_pcode; // ...PCODE_VOLUME, or the original on error + switch (pcode) + { + case LL_PCODE_SPHERE: + rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + + volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1, 1 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_TORUS: + rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_CIRCLE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1.f, 0.25f ); // "top size" + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LLViewerObject::LL_VO_SQUARE_TORUS: + rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + + volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_CIRCLE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1.f, 0.25f ); // "top size" + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LLViewerObject::LL_VO_TRIANGLE_TORUS: + rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + + volume_params.setType( LL_PCODE_PROFILE_EQUALTRI, LL_PCODE_PATH_CIRCLE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1.f, 0.25f ); // "top size" + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_SPHERE_HEMI: + volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE ); + //volume_params.setBeginAndEndS( 0.5f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 0.5f ); + volume_params.setRatio ( 1, 1 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_CUBE: + volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1, 1 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_PRISM: + volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 0, 1 ); + volume_params.setShear ( -0.5f, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_PYRAMID: + volume_params.setType( LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 0, 0 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_TETRAHEDRON: + volume_params.setType( LL_PCODE_PROFILE_EQUALTRI, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 0, 0 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_CYLINDER: + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1, 1 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_CYLINDER_HEMI: + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.25f, 0.75f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 1, 1 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_CONE: + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.f, 1.f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 0, 0 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + case LL_PCODE_CONE_HEMI: + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_LINE ); + volume_params.setBeginAndEndS( 0.25f, 0.75f ); + volume_params.setBeginAndEndT( 0.f, 1.f ); + volume_params.setRatio ( 0, 0 ); + volume_params.setShear ( 0, 0 ); + LLVolumeMessage::packVolumeParams(&volume_params, gMessageSystem); + volume_pcode = LL_PCODE_VOLUME; + break; + + default: + LLVolumeMessage::packVolumeParams(0, gMessageSystem); + volume_pcode = pcode; + break; + } + gMessageSystem->addU8Fast(_PREHASH_PCode, volume_pcode); + + gMessageSystem->addVector3Fast(_PREHASH_Scale, scale ); + gMessageSystem->addQuatFast(_PREHASH_Rotation, rotation ); + gMessageSystem->addVector3Fast(_PREHASH_RayStart, ray_start_region ); + gMessageSystem->addVector3Fast(_PREHASH_RayEnd, ray_end_region ); + gMessageSystem->addU8Fast(_PREHASH_BypassRaycast, (U8)b_hit_land ); + gMessageSystem->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE ); + gMessageSystem->addU8Fast(_PREHASH_State, state); + + // Limit raycast to a single object. + // Speeds up server raycast + avoid problems with server ray hitting objects + // that were clipped by the near plane or culled on the viewer. + LLUUID ray_target_id; + if( hit_obj ) + { + ray_target_id = hit_obj->getID(); + } + else + { + ray_target_id.setNull(); + } + gMessageSystem->addUUIDFast(_PREHASH_RayTargetID, ray_target_id ); + + // Pack in name value pairs + gMessageSystem->sendReliable(regionp->getHost()); + + // Spawns a message, so must be after above send + if (create_selected) + { + gSelectMgr->deselectAll(); + gViewerWindow->getWindow()->incBusyCount(); + } + + // VEFFECT: AddObject + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + effectp->setSourceObject((LLViewerObject*)gAgent.getAvatarObject()); + effectp->setPositionGlobal(regionp->getPosGlobalFromRegion(ray_end_region)); + effectp->setDuration(LL_HUD_DUR_SHORT); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + + gViewerStats->incStat(LLViewerStats::ST_CREATE_COUNT); + + return TRUE; +} + // Used by the placer tool to add copies of the current selection. // Inspired by add_object(). JC -BOOL add_duplicate(S32 x, S32 y) +BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) { LLVector3 ray_start_region; LLVector3 ray_end_region; @@ -71,7 +441,7 @@ BOOL add_duplicate(S32 x, S32 y) BOOL b_hit_land = FALSE; S32 hit_face = -1; LLViewerObject* hit_obj = NULL; - BOOL success = raycast_for_new_obj_pos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); + BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); if( !success ) { make_ui_sound("UISndInvalidOp"); @@ -123,11 +493,11 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) if (gSavedSettings.getBOOL("CreateToolCopySelection")) { - added = add_duplicate(x, y); + added = addDuplicate(x, y); } else { - added = add_object( sObjectType, x, y, NO_PHYSICS ); + added = addObject( sObjectType, x, y, FALSE ); } // ...and go back to the default tool diff --git a/linden/indra/newview/lltoolplacer.h b/linden/indra/newview/lltoolplacer.h index d6d21cb..b016470 100644 --- a/linden/indra/newview/lltoolplacer.h +++ b/linden/indra/newview/lltoolplacer.h @@ -37,6 +37,7 @@ #include "lltool.h" class LLButton; +class LLViewerRegion; //////////////////////////////////////////////////// // LLToolPlacer @@ -57,6 +58,12 @@ public: protected: static LLPCode sObjectType; + +private: + BOOL addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ); + BOOL raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, + BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ); + BOOL addDuplicate(S32 x, S32 y); }; //////////////////////////////////////////////////// diff --git a/linden/indra/newview/lltoolselect.cpp b/linden/indra/newview/lltoolselect.cpp index f77202f..37c8b00 100644 --- a/linden/indra/newview/lltoolselect.cpp +++ b/linden/indra/newview/lltoolselect.cpp @@ -49,7 +49,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llworld.h" -#include "viewer.h" // for gFPSClamped, pie menus // Globals LLToolSelect *gToolSelect = NULL; diff --git a/linden/indra/newview/lltoolselectland.cpp b/linden/indra/newview/lltoolselectland.cpp index dae8288..bbbda58 100644 --- a/linden/indra/newview/lltoolselectland.cpp +++ b/linden/indra/newview/lltoolselectland.cpp @@ -45,7 +45,6 @@ #include "lltoolview.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" -#include "viewer.h" // Globals LLToolSelectLand *gToolParcel = NULL; diff --git a/linden/indra/newview/lltoolselectrect.cpp b/linden/indra/newview/lltoolselectrect.cpp index 505039d..dd1a01f 100644 --- a/linden/indra/newview/lltoolselectrect.cpp +++ b/linden/indra/newview/lltoolselectrect.cpp @@ -48,7 +48,6 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llviewercamera.h" -#include "viewer.h" #include "llglheaders.h" diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp index a35d7b5..4bab922 100644 --- a/linden/indra/newview/lltracker.cpp +++ b/linden/indra/newview/lltracker.cpp @@ -45,7 +45,7 @@ #include "v4color.h" // viewer includes -#include "viewer.h" +#include "llappviewer.h" #include "lltracker.h" #include "llagent.h" #include "llcallingcard.h" @@ -62,6 +62,7 @@ #include "llviewerinventory.h" #include "llworld.h" #include "llworldmapview.h" +#include "llviewercontrol.h" const F32 DESTINATION_REACHED_RADIUS = 3.0f; const F32 DESTINATION_VISITED_RADIUS = 6.0f; diff --git a/linden/indra/newview/llurldispatcher.cpp b/linden/indra/newview/llurldispatcher.cpp index ad2ef62..51b9505 100644 --- a/linden/indra/newview/llurldispatcher.cpp +++ b/linden/indra/newview/llurldispatcher.cpp @@ -48,9 +48,6 @@ // library includes #include "llsd.h" -// system includes -#include - const std::string SLURL_SL_HELP_PREFIX = "secondlife://app."; const std::string SLURL_SL_PREFIX = "sl://"; const std::string SLURL_SECONDLIFE_PREFIX = "secondlife://"; @@ -111,7 +108,7 @@ bool LLURLDispatcherImpl::isSLURL(const std::string& url) // static bool LLURLDispatcherImpl::isSLURLCommand(const std::string& url) -{ +{ if (matchPrefix(url, SLURL_SL_PREFIX + SLURL_APP_TOKEN) || matchPrefix(url, SLURL_SECONDLIFE_PREFIX + "/" + SLURL_APP_TOKEN) || matchPrefix(url, SLURL_SLURL_PREFIX + SLURL_APP_TOKEN) ) @@ -128,6 +125,14 @@ bool LLURLDispatcherImpl::dispatchCore(const std::string& url, bool right_mouse) if (dispatchHelp(url, right_mouse)) return true; if (dispatchApp(url, right_mouse)) return true; if (dispatchRegion(url, right_mouse)) return true; + + /* + // Inform the user we can't handle this + std::map args; + args["[SLURL]"] = url; + gViewerWindow->alertXml("BadURL", args); + */ + return false; } @@ -164,41 +169,14 @@ bool LLURLDispatcherImpl::dispatchApp(const std::string& url, BOOL right_mouse) { return false; } - std::string s = stripProtocol(url); - - // At this point, "secondlife://app/foo/bar/baz/" should be left - // as: "app/foo/bar/baz/" - typedef boost::tokenizer > tokenizer; - boost::char_separator sep("/", "", boost::drop_empty_tokens); - tokenizer tokens(s, sep); - tokenizer::iterator it = tokens.begin(); - tokenizer::iterator end = tokens.end(); - - // Build parameter list suitable for LLDispatcher dispatch - if (it == end) return false; - if (*it != "app") return false; - ++it; - - if (it == end) return false; - std::string cmd = *it; - ++it; - - std::vector params; - for ( ; it != end; ++it) - { - params.push_back(*it); - } - bool handled = LLCommandDispatcher::dispatch(cmd, params); - if (handled) return true; - - // Inform the user we can't handle this - std::map args; - args["[SLURL]"] = url; - gViewerWindow->alertXml("BadURL", args); - // This was a SLURL with a /app prefix, and we "handled" it by displaying an error dialog, - // so return true. It doesn't need to be parsed any further. - return true; + LLURI uri(url); + LLSD pathArray = uri.pathArray(); + pathArray.erase(0); // erase "app" + std::string cmd = pathArray.get(0); + pathArray.erase(0); // erase "cmd" + bool handled = LLCommandDispatcher::dispatch(cmd, pathArray, uri.queryMap()); + return handled; } // static @@ -211,14 +189,14 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, BOOL right_mous // Before we're logged in, need to update the startup screen // to tell the user where they are going. - if (LLStartUp::getStartupState() < STATE_CLEANUP) + if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) { // Parse it and stash in globals, it will be dispatched in // STATE_CLEANUP. LLURLSimString::setString(url); // We're at the login screen, so make sure user can see // the login location box to know where they are going. - LLPanelLogin::refreshLocation( true ); + LLPanelLogin::loadLoginPage(); return true; } @@ -314,7 +292,7 @@ class LLTeleportHandler : public LLCommandHandler { public: LLTeleportHandler() : LLCommandHandler("teleport") { } - bool handle(const std::vector& tokens) + bool handle(const LLSD& tokens, const LLSD& queryMap) { // construct a "normal" SLURL, resolve the region to // a global position, and teleport to it @@ -325,9 +303,9 @@ public: // build secondlife://De%20Haro/123/45/67 for use in callback std::string url = SLURL_SECONDLIFE_PREFIX; - for (size_t i = 0; i < tokens.size(); ++i) + for (int i = 0; i < tokens.size(); ++i) { - url += tokens[i] + "/"; + url += tokens[i].asString() + "/"; } gWorldMap->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionHandleCallback, diff --git a/linden/indra/newview/llurlsimstring.cpp b/linden/indra/newview/llurlsimstring.cpp index efa3c5a..147589c 100644 --- a/linden/indra/newview/llurlsimstring.cpp +++ b/linden/indra/newview/llurlsimstring.cpp @@ -69,7 +69,6 @@ void LLURLSimString::setString(const LLString& sim_string) idx = (idx == LLString::npos) ? 0 : idx+2; sInstance.mSimString = tstring.substr(idx); } - LLPanelLogin::refreshLocation( false ); // in case LLPanelLogin is visible } // "/100" -> 100 diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp index 0f4c108..4534e88 100644 --- a/linden/indra/newview/lluserauth.cpp +++ b/linden/indra/newview/lluserauth.cpp @@ -38,7 +38,7 @@ #include "lldir.h" #include "llversionviewer.h" -#include "viewer.h" +#include "llappviewer.h" #include "llviewerbuild.h" #include "llviewercontrol.h" #include "llxmlrpctransaction.h" @@ -82,13 +82,13 @@ LLUserAuth::~LLUserAuth() mTransaction = NULL; } -// passwd is already MD5 hashed by the time we get to it. + void LLUserAuth::authenticate( const char* auth_uri, const char* method, const char* firstname, const char* lastname, - const char* passwd, + LLUUID web_login_key, const char* start, BOOL skip_optional, BOOL accept_tos, @@ -99,8 +99,6 @@ void LLUserAuth::authenticate( const std::string& hashed_mac, const std::string& hashed_volume_serial) { - std::string dpasswd("$1$"); - dpasswd.append(passwd); llinfos << "Authenticating: " << firstname << " " << lastname << ", " << /*dpasswd.c_str() <<*/ llendl; std::ostringstream option_str; @@ -122,7 +120,7 @@ void LLUserAuth::authenticate( XMLRPC_VALUE params = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); XMLRPC_VectorAppendString(params, "first", firstname, 0); XMLRPC_VectorAppendString(params, "last", lastname, 0); - XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); + XMLRPC_VectorAppendString(params, "web_login_key", web_login_key.getString().c_str(), 0); XMLRPC_VectorAppendString(params, "start", start, 0); XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name XMLRPC_VectorAppendString(params, "channel", gChannelName.c_str(), 0); diff --git a/linden/indra/newview/lluserauth.h b/linden/indra/newview/lluserauth.h index d6ee1da..4169a7e 100644 --- a/linden/indra/newview/lluserauth.h +++ b/linden/indra/newview/lluserauth.h @@ -35,6 +35,8 @@ #include #include #include +typedef struct _xmlrpc_value* XMLRPC_VALUE; +// forward ecl of types from xlrpc.h class LLXMLRPCTransaction; @@ -96,7 +98,7 @@ public: const char* auth_method, const char* firstname, const char* lastname, - const char* passwd, + LLUUID web_login_key, const char* start, BOOL skip_optional_update, BOOL accept_tos, diff --git a/linden/indra/newview/llvectorperfoptions.cpp b/linden/indra/newview/llvectorperfoptions.cpp new file mode 100644 index 0000000..f8b8dd5 --- /dev/null +++ b/linden/indra/newview/llvectorperfoptions.cpp @@ -0,0 +1,121 @@ +/** + * @file llvectorperfoptions.cpp + * @brief Control of vector perfomance options. + * + * $LicenseInfo:firstyear=2001&license=internal$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") previously entered between you and Linden + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llvectorperfoptions.h" +#include "llviewerjointmesh.h" +#include "llviewercontrol.h" + +// Initially, we test the performance of the vectorization code, then +// turn it off if it ends up being slower. JC +BOOL gVectorizePerfTest = TRUE; +BOOL gVectorizeEnable = FALSE; +U32 gVectorizeProcessor = 0; +BOOL gVectorizeSkin = FALSE; + +void update_vector_performances(void) +{ + char *vp; + + switch(gVectorizeProcessor) + { + case 2: vp = "SSE2"; break; // *TODO: replace the magic #s + case 1: vp = "SSE"; break; + default: vp = "COMPILER DEFAULT"; break; + } + llinfos << "Vectorization : " << ( gVectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ; + llinfos << "Vector Processor : " << vp << llendl ; + llinfos << "Vectorized Skinning : " << ( gVectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ; + + if(gVectorizeEnable && gVectorizeSkin) + { + switch(gVectorizeProcessor) + { + case 2: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE2; + break; + case 1: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE; + break; + default: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryVectorized; + break; + } + } + else + { + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryOriginal; + } +} + + +class LLVectorizationEnableListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeEnable = event->getValue().asBoolean(); + update_vector_performances(); + return true; + } +}; +static LLVectorizationEnableListener vectorization_enable_listener; + +class LLVectorizeSkinListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeSkin = event->getValue().asBoolean(); + update_vector_performances(); + return true; + } +}; +static LLVectorizeSkinListener vectorize_skin_listener; + +class LLVectorProcessorListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeProcessor = event->getValue().asInteger(); + update_vector_performances(); + return true; + } +}; +static LLVectorProcessorListener vector_processor_listener; + +void LLVectorPerformanceOptions::initClass() +{ + gVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); + gVectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); + gVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); + gVectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); + update_vector_performances(); + + // these are currently static in this file, so they can't move to settings_setup_listeners + gSavedSettings.getControl("VectorizeEnable")->addListener(&vectorization_enable_listener); + gSavedSettings.getControl("VectorizeProcessor")->addListener(&vector_processor_listener); + gSavedSettings.getControl("VectorizeSkin")->addListener(&vectorize_skin_listener); +} + +void LLVectorPerformanceOptions::cleanupClass() +{ +} + diff --git a/linden/indra/newview/llvectorperfoptions.h b/linden/indra/newview/llvectorperfoptions.h new file mode 100644 index 0000000..2d9135c --- /dev/null +++ b/linden/indra/newview/llvectorperfoptions.h @@ -0,0 +1,31 @@ +/** + * @file llvectorperfoptions.h + * @brief Control of vector performance options + * + * $LicenseInfo:firstyear=2001&license=internal$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") previously entered between you and Linden + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_VECTORPERFOPTIONS_H +#define LL_VECTORPERFOPTIONS_H + +namespace LLVectorPerformanceOptions +{ + void initClass(); // Run after configuration files are read. + void cleanupClass(); +}; + +#endif diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp new file mode 100644 index 0000000..fc11915 --- /dev/null +++ b/linden/indra/newview/llvieweraudio.cpp @@ -0,0 +1,228 @@ +/** + * @file llvieweraudio.cpp + * @brief Audio functions moved from viewer.cpp + * + * $LicenseInfo:firstyear=2000&license=internal$ + * + * Copyright (c) 2000-2007, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") previously entered between you and Linden + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llvieweraudio.h" +#include "audioengine.h" +#include "llviewercontrol.h" +#include "llmediaengine.h" +#include "llagent.h" +#include "llappviewer.h" +#include "llvoiceclient.h" +#include "llviewerwindow.h" +#include "llviewercamera.h" + +///////////////////////////////////////////////////////// + +void init_audio() +{ + if (!gAudiop) + { + llwarns << "Failed to create an appropriate Audio Engine" << llendl; + return; + } + LLVector3d lpos_global = gAgent.getCameraPositionGlobal(); + LLVector3 lpos_global_f; + + lpos_global_f.setVec(lpos_global); + + gAudiop->setListener(lpos_global_f, + LLVector3::zero, // gCamera->getVelocity(), // !!! BUG need to replace this with smoothed velocity! + gCamera->getUpAxis(), + gCamera->getAtAxis()); + +// load up our initial set of sounds we'll want so they're in memory and ready to be played + + BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + + if (!mute_audio && gPreloadSounds) + { + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndChatFromObject"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClick"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndClickRelease"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionF"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndHealthReductionM"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingChat"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndIncomingIM"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvApplyToObject"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInvalidOp"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndInventoryCopyToInv"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeDown"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndMoneyChangeUp"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCopyToInv"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectCreate"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectDelete"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezIn"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndObjectRezOut"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuAppear"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuHide"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight0"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight1"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight2"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight3"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight4"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight5"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight6"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndPieMenuSliceHighlight7"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndSnapshot"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartAutopilot"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartFollowpilot"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStartIM"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndStopAutopilot"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTeleportOut"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureApplyToObject"))); + //gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTextureCopyToInv"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTyping"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowClose"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowOpen"))); + } + + audio_update_volume(true); +} + +void audio_update_volume(bool force_update) +{ + F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); + BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + { + mute_audio = TRUE; + } + F32 mute_volume = mute_audio ? 0.0f : 1.0f; + + // Sound Effects + if (gAudiop) + { + gAudiop->setMasterGain ( master_volume ); + + gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); + gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance")); + gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); +#ifdef kAUDIO_ENABLE_WIND + gAudiop->enableWind(!mute_audio); +#endif + + gAudiop->setMuted(mute_audio); + + if (force_update) + { + audio_update_wind(true); + } + } + + // Streaming Music + if (gAudiop) + { + F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); + music_volume = mute_volume * master_volume * (music_volume*music_volume); + gAudiop->setInternetStreamGain ( music_volume ); + } + + // Streaming Media + if(LLMediaEngine::getInstance()) + { + F32 media_volume = gSavedSettings.getF32("AudioLevelMedia"); + media_volume = mute_volume * master_volume * (media_volume*media_volume); + LLMediaEngine::getInstance()->setVolume(media_volume); + } + + // Voice + if (gVoiceClient) + { + F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice"); + voice_volume = mute_volume * master_volume * voice_volume; + gVoiceClient->setVoiceVolume(voice_volume); + gVoiceClient->setMicGain(gSavedSettings.getF32("AudioLevelMic")); + + if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + { + gVoiceClient->setMuteMic(true); + } + else + { + gVoiceClient->setMuteMic(false); + } + } +} + +void audio_update_listener() +{ + if (gAudiop) + { + // update listener position because agent has moved + LLVector3d lpos_global = gAgent.getCameraPositionGlobal(); + LLVector3 lpos_global_f; + lpos_global_f.setVec(lpos_global); + + gAudiop->setListener(lpos_global_f, + // gCameraVelocitySmoothed, + // LLVector3::zero, + gAgent.getVelocity(), // !!! *TODO: need to replace this with smoothed velocity! + gCamera->getUpAxis(), + gCamera->getAtAxis()); + } +} + +void audio_update_wind(bool force_update) +{ +#ifdef kAUDIO_ENABLE_WIND + // + // Extract height above water to modulate filter by whether above/below water + // + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + static F32 last_camera_water_height = -1000.f; + LLVector3 camera_pos = gAgent.getCameraPositionAgent(); + F32 camera_water_height = camera_pos.mV[VZ] - region->getWaterHeight(); + + // + // Don't update rolloff factor unless water surface has been crossed + // + if (force_update || (last_camera_water_height * camera_water_height) < 0.f) + { + if (camera_water_height < 0.f) + { + gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff") * LL_ROLLOFF_MULTIPLIER_UNDER_WATER); + } + else + { + gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); + } + } + // this line rotates the wind vector to be listener (agent) relative + // unfortunately we have to pre-translate to undo the translation that + // occurs in the transform call + gRelativeWindVec = gAgent.getFrameAgent().rotateToLocal(gWindVec - gAgent.getVelocity()); + + // don't use the setter setMaxWindGain() because we don't + // want to screw up the fade-in on startup by setting actual source gain + // outside the fade-in. + gAudiop->mMaxWindGain = gSavedSettings.getF32("AudioLevelAmbient"); + + last_camera_water_height = camera_water_height; + gAudiop->updateWind(gRelativeWindVec, camera_water_height); + } +#endif +} diff --git a/linden/indra/newview/llvieweraudio.h b/linden/indra/newview/llvieweraudio.h new file mode 100644 index 0000000..c01da0e --- /dev/null +++ b/linden/indra/newview/llvieweraudio.h @@ -0,0 +1,30 @@ +/** + * @file llvieweraudio.h + * @brief Audio functions originally in viewer.cpp + * + * $LicenseInfo:firstyear=2000&license=internal$ + * + * Copyright (c) 2000-2007, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") previously entered between you and Linden + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_VIEWERAUDIO_H +#define LL_VIEWERAUDIO_H + +void init_audio(); +void audio_update_volume(bool force_update = true); +void audio_update_listener(); +void audio_update_wind(bool force_update = true); + +#endif //LL_VIEWER_H diff --git a/linden/indra/newview/llviewercamera.h b/linden/indra/newview/llviewercamera.h index a5b7b6f..5a655cb 100644 --- a/linden/indra/newview/llviewercamera.h +++ b/linden/indra/newview/llviewercamera.h @@ -47,6 +47,9 @@ const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X 0.f, 1.f, 0.f, 0.f, // Y becomes Z 0.f, 0.f, 0.f, 1.f }; +const BOOL FOR_SELECTION = TRUE; +const BOOL NOT_FOR_SELECTION = FALSE; + class LLViewerCamera : public LLCamera { public: diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 79ec70f..250b250 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp @@ -50,6 +50,10 @@ #include "llspinctrl.h" #include "llcolorswatch.h" +#ifdef TOGGLE_HACKED_GODLIKE_VIEWER +BOOL gHackGodmode = FALSE; +#endif + LLFloaterSettingsDebug* LLFloaterSettingsDebug::sInstance = NULL; LLControlGroup gSavedSettings; // saved at end of session diff --git a/linden/indra/newview/llviewercontrol.h b/linden/indra/newview/llviewercontrol.h index 3151261..8a3191d 100644 --- a/linden/indra/newview/llviewercontrol.h +++ b/linden/indra/newview/llviewercontrol.h @@ -36,6 +36,13 @@ #include "llfloater.h" #include "lltexteditor.h" +// Enabled this definition to compile a 'hacked' viewer that +// allows a hacked godmode to be toggled on and off. +#define TOGGLE_HACKED_GODLIKE_VIEWER +#ifdef TOGGLE_HACKED_GODLIKE_VIEWER +extern BOOL gHackGodmode; +#endif + class LLFloaterSettingsDebug : public LLFloater { public: diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 24b8105..6018431 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -62,7 +62,7 @@ #include "llvograss.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" #include "llstartup.h" #include "llfasttimer.h" #include "llfloatertools.h" @@ -72,14 +72,11 @@ #include "llviewerregion.h" #include "lldrawpoolwater.h" -extern U32 gFrameCount; extern LLPointer gStartImageGL; -extern LLPointer gDisconnectedImagep; -extern BOOL gLogoutRequestSent; -extern LLTimer gLogoutTimer; -extern BOOL gHaveSavedSnapshot; extern BOOL gDisplaySwapBuffers; +LLPointer gDisconnectedImagep = NULL; + // used to toggle renderer back on after teleport const F32 TELEPORT_RENDER_DELAY = 20.f; // Max time a teleport is allowed to take before we raise the curtain const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived. @@ -99,7 +96,7 @@ void render_ui_3d(); void render_ui_2d(); void render_disconnected_background(); -void process_keystrokes_async(); // in viewer.cpp +void process_keystrokes_async(); void display_startup() { @@ -331,7 +328,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) break; } } - else if(gLogoutRequestSent) + else if(LLAppViewer::instance()->logoutRequestSent()) { F32 percent_done = gLogoutTimer.getElapsedTimeF32() * 100.f / gLogoutMaxTime; if (percent_done > 100.f) @@ -339,7 +336,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) percent_done = 100.f; } - if( gQuit ) + if( LLApp::isExiting() ) { percent_done = 100.f; } @@ -358,7 +355,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) else { - if( gQuit ) + if( LLApp::isExiting() ) { percent_done = 100.f; } @@ -554,7 +551,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) // glPopMatrix(); //} - if (!(gLogoutRequestSent && gHaveSavedSnapshot) + if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot()) && !gRestoreGL && !gDisconnected) { @@ -745,6 +742,74 @@ void render_ui_and_swap() } } +void renderCoordinateAxes() +{ + LLGLSNoTexture gls_no_texture; + glBegin(GL_LINES); + glColor3f(1.0f, 0.0f, 0.0f); // i direction = X-Axis = red + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(2.0f, 0.0f, 0.0f); + glVertex3f(3.0f, 0.0f, 0.0f); + glVertex3f(5.0f, 0.0f, 0.0f); + glVertex3f(6.0f, 0.0f, 0.0f); + glVertex3f(8.0f, 0.0f, 0.0f); + // Make an X + glVertex3f(11.0f, 1.0f, 1.0f); + glVertex3f(11.0f, -1.0f, -1.0f); + glVertex3f(11.0f, 1.0f, -1.0f); + glVertex3f(11.0f, -1.0f, 1.0f); + + glColor3f(0.0f, 1.0f, 0.0f); // j direction = Y-Axis = green + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(0.0f, 2.0f, 0.0f); + glVertex3f(0.0f, 3.0f, 0.0f); + glVertex3f(0.0f, 5.0f, 0.0f); + glVertex3f(0.0f, 6.0f, 0.0f); + glVertex3f(0.0f, 8.0f, 0.0f); + // Make a Y + glVertex3f(1.0f, 11.0f, 1.0f); + glVertex3f(0.0f, 11.0f, 0.0f); + glVertex3f(-1.0f, 11.0f, 1.0f); + glVertex3f(0.0f, 11.0f, 0.0f); + glVertex3f(0.0f, 11.0f, 0.0f); + glVertex3f(0.0f, 11.0f, -1.0f); + + glColor3f(0.0f, 0.0f, 1.0f); // Z-Axis = blue + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(0.0f, 0.0f, 2.0f); + glVertex3f(0.0f, 0.0f, 3.0f); + glVertex3f(0.0f, 0.0f, 5.0f); + glVertex3f(0.0f, 0.0f, 6.0f); + glVertex3f(0.0f, 0.0f, 8.0f); + // Make a Z + glVertex3f(-1.0f, 1.0f, 11.0f); + glVertex3f(1.0f, 1.0f, 11.0f); + glVertex3f(1.0f, 1.0f, 11.0f); + glVertex3f(-1.0f, -1.0f, 11.0f); + glVertex3f(-1.0f, -1.0f, 11.0f); + glVertex3f(1.0f, -1.0f, 11.0f); + glEnd(); +} + + +void draw_axes() +{ + LLGLSUIDefault gls_ui; + LLGLSNoTexture gls_no_texture; + // A vertical white line at origin + LLVector3 v = gAgent.getPositionAgent(); + glBegin(GL_LINES); + glColor3f(1.0f, 1.0f, 1.0f); + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(0.0f, 0.0f, 40.0f); + glEnd(); + // Some coordinate axes + glPushMatrix(); + glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] ); + renderCoordinateAxes(); + glPopMatrix(); +} + void render_ui_3d() { LLGLSPipeline gls_pipeline; @@ -841,73 +906,6 @@ void render_ui_2d() LLFontGL::sCurOrigin.set(0, 0); } -void renderCoordinateAxes() -{ - LLGLSNoTexture gls_no_texture; - glBegin(GL_LINES); - glColor3f(1.0f, 0.0f, 0.0f); // i direction = X-Axis = red - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(2.0f, 0.0f, 0.0f); - glVertex3f(3.0f, 0.0f, 0.0f); - glVertex3f(5.0f, 0.0f, 0.0f); - glVertex3f(6.0f, 0.0f, 0.0f); - glVertex3f(8.0f, 0.0f, 0.0f); - // Make an X - glVertex3f(11.0f, 1.0f, 1.0f); - glVertex3f(11.0f, -1.0f, -1.0f); - glVertex3f(11.0f, 1.0f, -1.0f); - glVertex3f(11.0f, -1.0f, 1.0f); - - glColor3f(0.0f, 1.0f, 0.0f); // j direction = Y-Axis = green - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(0.0f, 2.0f, 0.0f); - glVertex3f(0.0f, 3.0f, 0.0f); - glVertex3f(0.0f, 5.0f, 0.0f); - glVertex3f(0.0f, 6.0f, 0.0f); - glVertex3f(0.0f, 8.0f, 0.0f); - // Make a Y - glVertex3f(1.0f, 11.0f, 1.0f); - glVertex3f(0.0f, 11.0f, 0.0f); - glVertex3f(-1.0f, 11.0f, 1.0f); - glVertex3f(0.0f, 11.0f, 0.0f); - glVertex3f(0.0f, 11.0f, 0.0f); - glVertex3f(0.0f, 11.0f, -1.0f); - - glColor3f(0.0f, 0.0f, 1.0f); // Z-Axis = blue - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(0.0f, 0.0f, 2.0f); - glVertex3f(0.0f, 0.0f, 3.0f); - glVertex3f(0.0f, 0.0f, 5.0f); - glVertex3f(0.0f, 0.0f, 6.0f); - glVertex3f(0.0f, 0.0f, 8.0f); - // Make a Z - glVertex3f(-1.0f, 1.0f, 11.0f); - glVertex3f(1.0f, 1.0f, 11.0f); - glVertex3f(1.0f, 1.0f, 11.0f); - glVertex3f(-1.0f, -1.0f, 11.0f); - glVertex3f(-1.0f, -1.0f, 11.0f); - glVertex3f(1.0f, -1.0f, 11.0f); - glEnd(); -} - -void draw_axes() -{ - LLGLSUIDefault gls_ui; - LLGLSNoTexture gls_no_texture; - // A vertical white line at origin - LLVector3 v = gAgent.getPositionAgent(); - glBegin(GL_LINES); - glColor3f(1.0f, 1.0f, 1.0f); - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(0.0f, 0.0f, 40.0f); - glEnd(); - // Some coordinate axes - glPushMatrix(); - glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] ); - renderCoordinateAxes(); - glPopMatrix(); -} - void render_disconnected_background() { @@ -984,3 +982,48 @@ void render_disconnected_background() glPopMatrix(); } } + +void display_cleanup() +{ + gDisconnectedImagep = NULL; +} + +void process_keystrokes_async() +{ +#if LL_WINDOWS + MSG msg; + // look through all input messages, leaving them in the event queue + while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_NOYIELD)) + { + // on first mouse message, break out + if (msg.message >= WM_MOUSEFIRST && + msg.message <= WM_MOUSELAST || + msg.message == WM_QUIT) + { + break; + } + + // this is a message we want to handle now, so remove it from the event queue + PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE | PM_NOYIELD); + // if (msg.message == WM_KEYDOWN) + // { + // llinfos << "Process async key down " << (U32)msg.wParam << llendl; + // } + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + // Scan keyboard for movement keys. Command keys and typing + // are handled by windows callbacks. Don't do this until we're + // done initializing. JC + if (gViewerWindow->mWindow->getVisible() + && gViewerWindow->getActive() + && !gViewerWindow->mWindow->getMinimized() + && LLStartUp::getStartupState() == STATE_STARTED + && !gViewerWindow->getShowProgress() + && !gFocusMgr.focusLocked()) + { + gKeyboard->scanKeyboard(); + } +#endif +} diff --git a/linden/indra/newview/llviewerdisplay.h b/linden/indra/newview/llviewerdisplay.h index b42c6e9..2bf784c 100644 --- a/linden/indra/newview/llviewerdisplay.h +++ b/linden/indra/newview/llviewerdisplay.h @@ -33,8 +33,13 @@ #define LL_LLVIEWERDISPLAY_H void display_startup(); +void display_cleanup(); -extern BOOL gDisplaySwapBuffers; +void display(BOOL rebuild = TRUE, F32 zoom_factor = 1.f, int subfield = 0); +extern BOOL gDisplaySwapBuffers; +extern BOOL gTeleportDisplay; +extern LLFrameTimer gTeleportDisplayTimer; +extern BOOL gForceRenderLandFence; #endif // LL_LLVIEWERDISPLAY_H diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp index 240ffa5..d67bec1 100644 --- a/linden/indra/newview/llviewerimage.cpp +++ b/linden/indra/newview/llviewerimage.cpp @@ -57,8 +57,7 @@ #include "llviewerimagelist.h" #include "llviewercontrol.h" #include "pipeline.h" -#include "viewer.h" - +#include "llappviewer.h" /////////////////////////////////////////////////////////////////////////////// // statics @@ -294,7 +293,7 @@ LLViewerImage::~LLViewerImage() { if (mHasFetcher) { - gTextureFetch->deleteRequest(getID(), true); + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); } // Explicitly call LLViewerImage::cleanup since we're in a destructor and cleanup is virtual LLViewerImage::cleanup(); @@ -557,9 +556,9 @@ void LLViewerImage::processTextureStats() F32 LLViewerImage::calcDecodePriority() { #ifndef LL_RELEASE_FOR_DOWNLOAD - if (mID == gTextureFetch->mDebugID) + if (mID == LLAppViewer::getTextureFetch()->mDebugID) { - gTextureFetch->mDebugCount++; // for setting breakpoints + LLAppViewer::getTextureFetch()->mDebugCount++; // for setting breakpoints } #endif @@ -695,9 +694,9 @@ bool LLViewerImage::updateFetch() mRequestDeltaTime = 999999.f; #ifndef LL_RELEASE_FOR_DOWNLOAD - if (mID == gTextureFetch->mDebugID) + if (mID == LLAppViewer::getTextureFetch()->mDebugID) { - gTextureFetch->mDebugCount++; // for setting breakpoints + LLAppViewer::getTextureFetch()->mDebugCount++; // for setting breakpoints } #endif @@ -735,14 +734,14 @@ bool LLViewerImage::updateFetch() { // Sets mRawDiscardLevel, mRawImage, mAuxRawImage S32 fetch_discard = current_discard; - bool finished = gTextureFetch->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage); + bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage); if (finished) { mIsFetching = FALSE; } else { - mFetchState = gTextureFetch->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority, + mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority, mFetchPriority, mFetchDeltaTime, mRequestDeltaTime); } @@ -803,7 +802,7 @@ bool LLViewerImage::updateFetch() } else if (mDecodePriority >= 0.f) { - gTextureFetch->updateRequestPriority(mID, mDecodePriority); + LLAppViewer::getTextureFetch()->updateRequestPriority(mID, mDecodePriority); } } @@ -859,14 +858,14 @@ bool LLViewerImage::updateFetch() desired_discard = llmax(desired_discard, current_discard-2); } } - if (gTextureFetch->createRequest(getID(),getTargetHost(), decode_priority, + if (LLAppViewer::getTextureFetch()->createRequest(getID(),getTargetHost(), decode_priority, w, h, c, desired_discard, needsAux())) { mHasFetcher = TRUE; mIsFetching = TRUE; mRequestedDiscardLevel = desired_discard; - mFetchState = gTextureFetch->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority, + mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority, mFetchPriority, mFetchDeltaTime, mRequestDeltaTime); } // if createRequest() failed, we're finishing up a request for this UUID, @@ -879,7 +878,7 @@ bool LLViewerImage::updateFetch() if (mLastPacketTimer.getElapsedTimeF32() > FETCH_IDLE_TIME) { // llinfos << "Deleting request: " << getID() << " Discard: " << current_discard << " <= min:" << mMinDiscardLevel << " or priority == 0: " << decode_priority << llendl; - gTextureFetch->deleteRequest(getID(), true); + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); mHasFetcher = FALSE; } } @@ -893,7 +892,7 @@ void LLViewerImage::setIsMissingAsset() { if (mHasFetcher) { - gTextureFetch->deleteRequest(getID(), true); + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); mHasFetcher = FALSE; mIsFetching = FALSE; mFetchState = 0; diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index a31ed86..43ac967 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp @@ -58,7 +58,7 @@ #include "llviewerimage.h" #include "llviewerregion.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" //////////////////////////////////////////////////////////////////////////// @@ -327,7 +327,7 @@ static std::string get_texture_list_name() void LLViewerImageList::doPrefetchImages() { - if (gPurgeCache) + if (LLAppViewer::instance()->getPurgeCache()) { // cache was purged, no point return; @@ -1028,9 +1028,9 @@ void LLViewerImageList::decodeAllImages(F32 max_time) S32 fetch_pending = 0; while (1) { - gTextureCache->update(1); // unpauses the texture cache thread - gImageDecodeThread->update(1); // unpauses the image thread - fetch_pending = gTextureFetch->update(1); // unpauses the texture fetch thread + LLAppViewer::instance()->getTextureCache()->update(1); // unpauses the texture cache thread + LLAppViewer::instance()->getImageDecodeThread()->update(1); // unpauses the image thread + fetch_pending = LLAppViewer::instance()->getTextureFetch()->update(1); // unpauses the texture fetch thread if (fetch_pending == 0 || timer.getElapsedTimeF32() > max_time) { break; @@ -1324,7 +1324,7 @@ void LLViewerImageList::receiveImageHeader(LLMessageSystem *msg, void **user_dat return; } image->mLastPacketTimer.reset(); - bool res = gTextureFetch->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data); + bool res = LLAppViewer::getTextureFetch()->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data); if (!res) { delete[] data; @@ -1388,7 +1388,7 @@ void LLViewerImageList::receiveImagePacket(LLMessageSystem *msg, void **user_dat return; } image->mLastPacketTimer.reset(); - bool res = gTextureFetch->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data); + bool res = LLAppViewer::getTextureFetch()->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data); if (!res) { delete[] data; diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp index b436465..43e8589 100644 --- a/linden/indra/newview/llviewerinventory.cpp +++ b/linden/indra/newview/llviewerinventory.cpp @@ -41,7 +41,6 @@ #include "llinventorymodel.h" #include "llnotify.h" #include "llimview.h" -#include "viewer.h" #include "llgesturemgr.h" #include "llinventoryview.h" diff --git a/linden/indra/newview/llviewerjoystick.cpp b/linden/indra/newview/llviewerjoystick.cpp index c3c504f..27e71c2 100644 --- a/linden/indra/newview/llviewerjoystick.cpp +++ b/linden/indra/newview/llviewerjoystick.cpp @@ -34,7 +34,7 @@ #include "llviewerwindow.h" #include "llviewercamera.h" #include "llviewerjoystick.h" -#include "viewer.h" +#include "llappviewer.h" #include "llkeyboard.h" static LLQuaternion sFlycamRotation; diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 8faa72c..a6fb7fa 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -191,7 +191,7 @@ #include "llworldmap.h" #include "object_flags.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" #include "roles_constants.h" #include "llviewerjoystick.h" @@ -218,8 +218,6 @@ LLVOAvatar* find_avatar_from_object( const LLUUID& object_id ); void handle_test_load_url(void*); -extern void disconnect_viewer(void *); - // // Evil hackish imported globals // @@ -227,8 +225,6 @@ extern BOOL gRenderLightGlows; extern BOOL gRenderAvatar; extern BOOL gHideSelectedObjects; extern BOOL gShowOverlayTitle; -extern BOOL gRandomizeFramerate; -extern BOOL gPeriodicSlowFrame; extern BOOL gOcclusionCull; extern BOOL gAllowSelectAvatar; @@ -239,6 +235,7 @@ extern BOOL gAllowSelectAvatar; LLMenuBarGL *gMenuBarView = NULL; LLViewerMenuHolderGL *gMenuHolder = NULL; LLMenuGL *gPopupMenuView = NULL; +LLMenuBarGL *gLoginMenuBarView = NULL; // Pie menus LLPieMenu *gPieSelf = NULL; @@ -408,11 +405,16 @@ void handle_claim_public_land(void*); void handle_god_request_havok(void *); void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new avatar geometry void reload_personal_settings_overrides(void *); -void force_breakpoint(void *); void reload_vertex_shader(void *); void slow_mo_animations(void *); void handle_disconnect_viewer(void *); +void force_error_breakpoint(void *); +void force_error_llerror(void *); +void force_error_bad_memory_access(void *); +void force_error_infinite_loop(void *); +void force_error_software_exception(void *); + void handle_stopall(void*); //void handle_hinge(void*); //void handle_ptop(void*); @@ -422,6 +424,7 @@ void handle_stopall(void*); BOOL enable_dehinge(void*); void handle_force_delete(void*); void print_object_info(void*); +void print_agent_nvpairs(void*); void show_debug_menus(); void toggle_debug_menus(void*); void toggle_map( void* user_data ); @@ -446,7 +449,6 @@ void handle_force_unlock(void*); void handle_selected_texture_info(void*); void handle_dump_image_list(void*); -void handle_fullscreen_debug(void*); void handle_crash(void*); void handle_dump_followcam(void*); void handle_toggle_flycam(void*); @@ -749,6 +751,15 @@ void init_menus() // Debug menu visiblity // show_debug_menus(); + + gLoginMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_login.xml", gMenuHolder); + LLRect menuBarRect = gLoginMenuBarView->getRect(); + gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom)); + + gLoginMenuBarView->setBackgroundColor( color ); + + gMenuHolder->addChild(gLoginMenuBarView); + } void init_landmark_menu(LLMenuGL* menu) @@ -1061,16 +1072,18 @@ void init_client_menu(LLMenuGL* menu) &menu_check_control, (void*)"ShowConsoleWindow")); -#ifndef LL_RELEASE_FOR_DOWNLOAD + if(gQAMode && !gInProductionGrid) { LLMenuGL* sub = NULL; sub = new LLMenuGL("Debugging"); - sub->append(new LLMenuItemCallGL("Force Breakpoint", &force_breakpoint, NULL, NULL, 'B', MASK_CONTROL | MASK_ALT)); - sub->append(new LLMenuItemCallGL("LLError And Crash", &handle_crash)); + sub->append(new LLMenuItemCallGL("Force Breakpoint", &force_error_breakpoint, NULL, NULL, 'B', MASK_CONTROL | MASK_ALT)); + sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror)); + sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access)); + sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop)); + // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception)); sub->createJumpKeys(); menu->appendMenu(sub); } -#endif // TomY Temporary menu item so we can test this floater menu->append(new LLMenuItemCheckGL("Clothing...", @@ -2372,7 +2385,6 @@ void callback_leave_group(S32 option, void *userdata) msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_GroupData); msg->addUUIDFast(_PREHASH_GroupID, gAgent.mGroupID ); - //msg->sendReliable( gUserServer ); gAgent.sendReliableMessage(); } } @@ -4689,6 +4701,24 @@ void print_object_info(void*) gSelectMgr->selectionDump(); } +void print_agent_nvpairs(void*) +{ + LLViewerObject *objectp; + + llinfos << "Agent Name Value Pairs" << llendl; + + objectp = gObjectList.findObject(gAgentID); + if (objectp) + { + objectp->printNameValuePairs(); + } + else + { + llinfos << "Can't find agent object" << llendl; + } + + llinfos << "Camera at " << gAgent.getCameraPositionGlobal() << llendl; +} void show_debug_menus() { @@ -5174,18 +5204,6 @@ void handle_force_unlock(void*) gSelectMgr->getSelection()->applyToObjects(&func); } -// Fullscreen debug stuff -void handle_fullscreen_debug(void*) -{ - llinfos << "Width " << gViewerWindow->getWindowWidth() << " Height " << gViewerWindow->getWindowHeight() << llendl; - llinfos << "mouse_x_from_center(100) " << mouse_x_from_center(100) << " y " << mouse_y_from_center(100) << llendl; -} - -void handle_crash(void*) -{ - llerrs << "This is an llerror" << llendl; -} - class LLWorldForceSun : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -6811,13 +6829,6 @@ void reload_personal_settings_overrides(void *) gSavedSettings.loadFromFile(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,"overrides.xml")); } -void force_breakpoint(void *) -{ -#if LL_WINDOWS // Forcing a breakpoint - DebugBreak(); -#endif -} - void reload_vertex_shader(void *) { //THIS WOULD BE AN AWESOME PLACE TO RELOAD SHADERS... just a thought - DaveP @@ -6994,9 +7005,33 @@ void handle_disconnect_viewer(void *) snprintf(message, sizeof(message), "Testing viewer disconnect"); /* Flawfinder: ignore */ - do_disconnect(message); + LLAppViewer::instance()->forceDisconnect(message); } +void force_error_breakpoint(void *) +{ + LLAppViewer::instance()->forceErrorBreakpoint(); +} + +void force_error_llerror(void *) +{ + LLAppViewer::instance()->forceErrorLLError(); +} + +void force_error_bad_memory_access(void *) +{ + LLAppViewer::instance()->forceErrorBadMemoryAccess(); +} + +void force_error_infinite_loop(void *) +{ + LLAppViewer::instance()->forceErrorInifiniteLoop(); +} + +void force_error_software_exception(void *) +{ + LLAppViewer::instance()->forceErrorSoftwareException(); +} class LLToolsUseSelectionForGrid : public view_listener_t { diff --git a/linden/indra/newview/llviewermenu.h b/linden/indra/newview/llviewermenu.h index 55fab86..6814c31 100644 --- a/linden/indra/newview/llviewermenu.h +++ b/linden/indra/newview/llviewermenu.h @@ -141,6 +141,7 @@ extern LLMenuBarGL* gMenuBarView; //extern LLView* gMenuBarHolder; extern LLMenuGL* gPopupMenuView; extern LLViewerMenuHolderGL* gMenuHolder; +extern LLMenuBarGL* gLoginMenuBarView; // Pie menus extern LLPieMenu *gPieSelf; diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp index 97b11fd..13ff55c 100644 --- a/linden/indra/newview/llviewermenufile.cpp +++ b/linden/indra/newview/llviewermenufile.cpp @@ -52,7 +52,8 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" -#include "viewer.h" // app_request_quit() +#include "llappviewer.h" + // linden libraries #include "llassetuploadresponders.h" @@ -347,6 +348,16 @@ class LLFileCloseWindow : public view_listener_t } }; +class LLFileEnableCloseAllWindows : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + bool open_children = gFloaterView->allChildrenClosed(); + gMenuHolder->findControl(userdata["control"].asString())->setValue(!open_children); + return true; + } +}; + class LLFileCloseAllWindows : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -439,7 +450,7 @@ class LLFileQuit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - app_user_quit(); + LLAppViewer::instance()->userQuit(); return true; } }; @@ -1035,6 +1046,7 @@ void init_menu_file() (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); (new LLFileCloseAllWindows())->registerListener(gMenuHolder, "File.CloseAllWindows"); (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); + (new LLFileEnableCloseAllWindows())->registerListener(gMenuHolder, "File.EnableCloseAllWindows"); (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index c337044..2011275 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -129,8 +129,9 @@ #include "llweb.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" #include "llfloaterworldmap.h" +#include "llviewerdisplay.h" #include "llkeythrottle.h" #include @@ -153,8 +154,6 @@ static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL = 10.0f; // seconds extern BOOL gDebugClicks; -extern void bad_network_handler(); - // function prototypes void open_offer(const std::vector& items, const std::string& from_name); void friendship_offer_callback(S32 option, void* user_data); @@ -209,8 +208,8 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoneyTransferRequest); msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, agent_get_id()); - msg->addUUIDFast(_PREHASH_SessionID, agent_get_session_id()); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_MoneyData); msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_DestID, uuid); @@ -248,7 +247,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) msg->getUUID("AgentData", "AgentID", agent_id); LLUUID session_id; msg->getUUID("AgentData", "SessionID", session_id); - if((agent_id != agent_get_id()) || (session_id != agent_get_session_id())) + if((agent_id != gAgent.getID()) || (session_id != gAgent.getSessionID())) { llwarns << "Bogus Logout Reply" << llendl; } @@ -285,7 +284,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) gInventory.accountForUpdate(parents); gInventory.notifyObservers(); } - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); } void process_layer_data(LLMessageSystem *mesgsys, void **user_data) @@ -789,7 +788,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) // Use the name of the last item giver, who is probably the person // spamming you. JC std::ostringstream message; - message << gSecondLife; + message << LLAppViewer::instance()->getSecondLifeTitle(); if (!from_name.empty()) { message << ": Items coming in too fast from " << from_name; @@ -2715,7 +2714,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) << x << ":" << y << " current pos " << gAgent.getPositionGlobal() << llendl; - do_disconnect("You were sent to an invalid region."); + LLAppViewer::instance()->forceDisconnect("You were sent to an invalid region."); return; } @@ -2895,7 +2894,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) } // We have already requested to log out. Don't send agent updates. - if(gLogoutRequestSent) + if(LLAppViewer::instance()->logoutRequestSent()) { return; } @@ -3242,10 +3241,13 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) F32 phase; U64 space_time_usec; + U32 seconds_per_day; + U32 seconds_per_year; + // "SimulatorViewerTimeMessage" mesgsys->getU64Fast(_PREHASH_TimeInfo, _PREHASH_UsecSinceStart, space_time_usec); - mesgsys->getU32Fast(_PREHASH_TimeInfo, _PREHASH_SecPerDay, gSecondsPerDay); - mesgsys->getU32Fast(_PREHASH_TimeInfo, _PREHASH_SecPerYear, gSecondsPerYear); + mesgsys->getU32Fast(_PREHASH_TimeInfo, _PREHASH_SecPerDay, seconds_per_day); + mesgsys->getU32Fast(_PREHASH_TimeInfo, _PREHASH_SecPerYear, seconds_per_year); // This should eventually be moved to an "UpdateHeavenlyBodies" message mesgsys->getF32Fast(_PREHASH_TimeInfo, _PREHASH_SunPhase, phase); @@ -3930,7 +3932,7 @@ void process_kick_user(LLMessageSystem *msg, void** /*user_data*/) msg->getStringFast(_PREHASH_UserInfo, _PREHASH_Reason, 2048, message); - do_disconnect(message); + LLAppViewer::instance()->forceDisconnect(message); } @@ -4069,18 +4071,18 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) process_alert_core(buffer, modal); } -void process_alert_core(const char* buffer, BOOL modal) +void process_alert_core(const std::string& message, BOOL modal) { // make sure the cursor is back to the usual default since the // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); - // HACK -- handle callbacks for specific alerts - if( !strcmp( buffer, "You died and have been teleported to your home location" ) ) + // HACK -- handle callbacks for specific alerts + if ( message == "You died and have been teleported to your home location") { gViewerStats->incStat(LLViewerStats::ST_KILLED_COUNT); } - else if( !strcmp( buffer, "Home position set." ) ) + else if( message == "Home position set." ) { // save the home location image to disk LLString snap_filename = gDirUtilp->getLindenUserDir(); @@ -4089,19 +4091,26 @@ void process_alert_core(const char* buffer, BOOL modal) gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE); } - const char ALERT_PREFIX[] = "ALERT: "; - const size_t ALERT_PREFIX_LEN = sizeof(ALERT_PREFIX) - 1; - if (!strncmp(buffer, ALERT_PREFIX, ALERT_PREFIX_LEN)) + const std::string ALERT_PREFIX("ALERT: "); + const std::string NOTIFY_PREFIX("NOTIFY: "); + if (message.find(ALERT_PREFIX) == 0) { // Allow the server to spawn a named alert so that server alerts can be - // translated out of English. JC - std::string alert_name(buffer + ALERT_PREFIX_LEN); + // translated out of English. + std::string alert_name(message.substr(ALERT_PREFIX.length())); LLAlertDialog::showXml(alert_name); } - else if (buffer[0] == '/') + else if (message.find(NOTIFY_PREFIX) == 0) + { + // Allow the server to spawn a named notification so that server notifications can be + // translated out of English. + std::string notify_name(message.substr(NOTIFY_PREFIX.length())); + LLNotifyBox::showXml(notify_name); + } + else if (message[0] == '/') { // System message is important, show in upper-right box not tip - LLString text(buffer+1); + LLString text(message.substr(1)); LLString::format_map_t args; if (text.substr(0,17) == "RESTART_X_MINUTES") { @@ -4128,14 +4137,14 @@ void process_alert_core(const char* buffer, BOOL modal) { // *TODO:translate LLString::format_map_t args; - args["[ERROR_MESSAGE]"] = buffer; + args["[ERROR_MESSAGE]"] = message; gViewerWindow->alertXml("ErrorMessage", args); } else { // *TODO:translate LLString::format_map_t args; - args["[MESSAGE]"] = buffer; + args["[MESSAGE]"] = message; LLNotifyBox::showXml("SystemMessageTip", args); } } @@ -5365,7 +5374,7 @@ void invalid_message_callback(LLMessageSystem* msg, void*, EMessageException exception) { - bad_network_handler(); + LLAppViewer::instance()->badNetworkHandler(); } // Please do not add more message handlers here. This file is huge. diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h index 2cbd163..2c5005c 100644 --- a/linden/indra/newview/llviewermessage.h +++ b/linden/indra/newview/llviewermessage.h @@ -110,7 +110,7 @@ void process_adjust_balance(LLMessageSystem* msg_system, void**); void process_alert_message(LLMessageSystem* msg, void**); void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data); -void process_alert_core(const char* buffer, BOOL modal); +void process_alert_core(const std::string& message, BOOL modal); // "Mean" or player-vs-player abuse void handle_show_mean_events(void *); diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp index 046f1f6..caa61d6 100644 --- a/linden/indra/newview/llviewernetwork.cpp +++ b/linden/indra/newview/llviewernetwork.cpp @@ -34,47 +34,47 @@ #include "llviewernetwork.h" -LLUserServerData gUserServerDomainName[USERSERVER_COUNT] = +LLGridData gGridInfo[GRID_INFO_COUNT] = { { "None", "", "", ""}, { "Aditi", - "userserver.aditi.lindenlab.com", + "util.aditi.lindenlab.com", "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", "http://aditi-secondlife.webdev.lindenlab.com/helpers/" }, { "Agni", - "userserver.agni.lindenlab.com", + "util.agni.lindenlab.com", "https://login.agni.lindenlab.com/cgi-bin/login.cgi", "https://secondlife.com/helpers/" }, { "DMZ", - "userserver.dmz.lindenlab.com", + "util.dmz.lindenlab.com", "https://login.dmz.lindenlab.com/cgi-bin/login.cgi", "http://dmz-secondlife.webdev.lindenlab.com/helpers/" }, { "Siva", - "userserver.siva.lindenlab.com", + "util.siva.lindenlab.com", "https://login.siva.lindenlab.com/cgi-bin/login.cgi", "http://siva-secondlife.webdev.lindenlab.com/helpers/" }, { "Durga", - "userserver.durga.lindenlab.com", + "util.durga.lindenlab.com", "https://login.durga.lindenlab.com/cgi-bin/login.cgi", "http://durga-secondlife.webdev.lindenlab.com/helpers/" }, { "Shakti", - "userserver.shakti.lindenlab.com", + "util.shakti.lindenlab.com", "https://login.shakti.lindenlab.com/cgi-bin/login.cgi", "http://shakti-secondlife.webdev.lindenlab.com/helpers/" }, { "Soma", - "userserver.soma.lindenlab.com", + "util.soma.lindenlab.com", "https://login.soma.lindenlab.com/cgi-bin/login.cgi", "http://soma-secondlife.webdev.lindenlab.com/helpers/" }, { "Ganga", - "userserver.ganga.lindenlab.com", + "util.ganga.lindenlab.com", "https://login.ganga.lindenlab.com/cgi-bin/login.cgi", "http://ganga-secondlife.webdev.lindenlab.com/helpers/" }, { "Vaak", - "userserver.vaak.lindenlab.com", + "util.vaak.lindenlab.com", "https://login.vaak.lindenlab.com/cgi-bin/login.cgi", "http://vaak-secondlife.webdev.lindenlab.com/helpers/" }, { "Uma", - "userserver.uma.lindenlab.com", + "util.uma.lindenlab.com", "https://login.uma.lindenlab.com/cgi-bin/login.cgi", "http://uma-secondlife.webdev.lindenlab.com/helpers/" }, { "Local", @@ -89,10 +89,8 @@ LLUserServerData gUserServerDomainName[USERSERVER_COUNT] = // Use this to figure out which domain name and login URI to use. -EUserServerDomain gUserServerChoice = USERSERVER_NONE; -char gUserServerName[MAX_STRING]; /* Flawfinder: ignore */ - -LLHost gUserServer; +EGridInfo gGridChoice = GRID_INFO_NONE; +char gGridName[MAX_STRING]; /* Flawfinder: ignore */ F32 gPacketDropPercentage = 0.f; F32 gInBandwidth = 0.f; diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h index 1f73fe2..118897a 100644 --- a/linden/indra/newview/llviewernetwork.h +++ b/linden/indra/newview/llviewernetwork.h @@ -35,26 +35,26 @@ class LLHost; -enum EUserServerDomain +enum EGridInfo { - USERSERVER_NONE, - USERSERVER_ADITI, - USERSERVER_AGNI, - USERSERVER_DMZ, - USERSERVER_SIVA, - USERSERVER_DURGA, - USERSERVER_SHAKTI, - USERSERVER_SOMA, - USERSERVER_GANGA, - USERSERVER_VAAK, - USERSERVER_UMA, - USERSERVER_LOCAL, - USERSERVER_OTHER, // IP address set via -user or other command line option - USERSERVER_COUNT + GRID_INFO_NONE, + GRID_INFO_ADITI, + GRID_INFO_AGNI, + GRID_INFO_DMZ, + GRID_INFO_SIVA, + GRID_INFO_DURGA, + GRID_INFO_SHAKTI, + GRID_INFO_SOMA, + GRID_INFO_GANGA, + GRID_INFO_VAAK, + GRID_INFO_UMA, + GRID_INFO_LOCAL, + GRID_INFO_OTHER, // IP address set via -user or other command line option + GRID_INFO_COUNT }; -struct LLUserServerData +struct LLGridData { const char* mLabel; const char* mName; @@ -65,9 +65,9 @@ struct LLUserServerData extern F32 gPacketDropPercentage; extern F32 gInBandwidth; extern F32 gOutBandwidth; -extern EUserServerDomain gUserServerChoice; -extern LLUserServerData gUserServerDomainName[]; -extern char gUserServerName[MAX_STRING]; /* Flawfinder: ignore */ +extern EGridInfo gGridChoice; +extern LLGridData gGridInfo[]; +extern char gGridName[MAX_STRING]; /* Flawfinder: ignore */ const S32 MAC_ADDRESS_BYTES = 6; extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 0c9ca01..4c6f279 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp @@ -95,13 +95,12 @@ #include "llworld.h" #include "llui.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" //#define DEBUG_UPDATE_TYPE -extern BOOL gVelocityInterpolate; -extern BOOL gPingInterpolate; -extern U32 gFrameCount; +BOOL gVelocityInterpolate = TRUE; +BOOL gPingInterpolate = TRUE; U32 LLViewerObject::sNumZombieObjects = 0; S32 LLViewerObject::sNumObjects = 0; diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h index 9ce417d..b30bf7e 100644 --- a/linden/indra/newview/llviewerobject.h +++ b/linden/indra/newview/llviewerobject.h @@ -692,4 +692,7 @@ public: virtual void updateDrawable(BOOL force_damped); }; +extern BOOL gVelocityInterpolate; +extern BOOL gPingInterpolate; + #endif diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 967f018..38efb5d 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -42,7 +42,6 @@ #include "llvoavatar.h" #include "llviewerobject.h" #include "llviewerwindow.h" -#include "viewer.h" #include "llnetmap.h" #include "llagent.h" #include "pipeline.h" @@ -71,11 +70,9 @@ #endif #include "object_flags.h" -extern BOOL gVelocityInterpolate; -extern BOOL gPingInterpolate; +#include "llappviewer.h" + extern F32 gMinObjectDistance; -extern U32 gFrameCount; -extern LLTimer gRenderStartTime; extern BOOL gAnimateTextures; void dialog_refresh_all(); diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index d5fc9fa..f0d6fd1 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -1398,8 +1398,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use F32 parcel_prim_bonus = 1.f; BOOL region_push_override = false; BOOL region_deny_anonymous_override = false; - BOOL region_deny_identified_override = false; - BOOL region_deny_transacted_override = false; + BOOL region_deny_identified_override = false; // Deprecated + BOOL region_deny_transacted_override = false; // Deprecated + BOOL region_deny_age_unverified_override = false; S32 other_clean_time = 0; @@ -1474,8 +1475,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use msg->getF32Fast(_PREHASH_ParcelData, _PREHASH_ParcelPrimBonus, parcel_prim_bonus ); msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionPushOverride, region_push_override ); msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyAnonymous, region_deny_anonymous_override ); - msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyIdentified, region_deny_identified_override ); - msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyTransacted, region_deny_transacted_override ); + msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyIdentified, region_deny_identified_override ); // Deprecated + msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_RegionDenyTransacted, region_deny_transacted_override ); // Deprecated + msg->getBOOLFast(_PREHASH_AgeVerificationBlock, _PREHASH_RegionDenyAgeUnverified, region_deny_age_unverified_override ); msg->getS32("ParcelData", "OtherCleanTime", other_clean_time ); @@ -1505,8 +1507,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel->setCleanOtherTime(other_clean_time); parcel->setRegionPushOverride(region_push_override); parcel->setRegionDenyAnonymousOverride(region_deny_anonymous_override); - parcel->setRegionDenyIdentifiedOverride(region_deny_identified_override); - parcel->setRegionDenyTransactedOverride(region_deny_transacted_override); + parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override); parcel->unpackMessage(msg); if (parcel == gParcelMgr->mAgentParcel) diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp index 643df1e..0022212 100644 --- a/linden/indra/newview/llviewerregion.cpp +++ b/linden/indra/newview/llviewerregion.cpp @@ -63,7 +63,6 @@ #include "llvocache.h" #include "llvoclouds.h" #include "llworld.h" -#include "viewer.h" // Viewer object cache version, change if object update // format changes. JC @@ -969,28 +968,16 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) } } -LLString LLViewerRegion::getInfoString() +void LLViewerRegion::getInfo(LLSD& info) { - char tmp_buf[256]; /* Flawfinder: ignore */ - LLString info; - - info = "Region: "; - getHost().getString(tmp_buf, 256); - info += tmp_buf; - info += ":"; - info += getName(); - info += "\n"; - + info["Region"]["Host"] = getHost().getIPandPort(); + info["Region"]["Name"] = getName(); U32 x, y; from_region_handle(getHandle(), &x, &y); - snprintf(tmp_buf, sizeof(tmp_buf), "%d:%d", x, y); /* Flawfinder: ignore */ - info += "Handle:"; - info += tmp_buf; - info += "\n"; - return info; + info["Region"]["Handle"]["x"] = (LLSD::Integer)x; + info["Region"]["Handle"]["y"] = (LLSD::Integer)y; } - void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp) { U32 local_id = objectp->getLocalID(); diff --git a/linden/indra/newview/llviewerregion.h b/linden/indra/newview/llviewerregion.h index 013a96f..a0953e5 100644 --- a/linden/indra/newview/llviewerregion.h +++ b/linden/indra/newview/llviewerregion.h @@ -223,7 +223,7 @@ public: F32 getLandHeightRegion(const LLVector3& region_pos); - LLString getInfoString(); + void getInfo(LLSD& info); // handle a full update message void cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp index 96f52a1..2b278c7 100644 --- a/linden/indra/newview/llviewerstats.cpp +++ b/linden/indra/newview/llviewerstats.cpp @@ -37,10 +37,29 @@ #include "message.h" #include "lltimer.h" -LLViewerStats *gViewerStats = NULL; +#include "llappviewer.h" + +#include "pipeline.h" +#include "llviewerobjectlist.h" +#include "llviewerimagelist.h" +#include "lltexlayer.h" +#include "llsurface.h" +#include "llvlmanager.h" +#include "llagent.h" +#include "llviewercontrol.h" +#include "llfloaterdirectory.h" +#include "llfloatertools.h" +#include "lldebugview.h" +#include "llfasttimerview.h" +#include "llviewerregion.h" +#include "llfloaterhtmlhelp.h" +#include "llworld.h" +#include "llfeaturemanager.h" +#if LL_WINDOWS && LL_LCD_COMPILE + #include "lllcd.h" +#endif -extern U32 gFrameCount; -extern LLTimer gRenderStartTime; +LLViewerStats *gViewerStats = NULL; class StatAttributes { @@ -323,3 +342,427 @@ const char *LLViewerStats::statTypeToText(EStatType type) return "Unknown statistic"; } } + +// *NOTE:Mani The following methods used to exist in viewer.cpp +// Moving them here, but not merging them into LLViewerStats yet. +void reset_statistics() +{ + gPipeline.resetFrameStats(); // Reset per-frame statistics. + if (LLSurface::sTextureUpdateTime) + { + LLSurface::sTexelsUpdatedPerSecStat.addValue(0.001f*(LLSurface::sTexelsUpdated / LLSurface::sTextureUpdateTime)); + LLSurface::sTexelsUpdated = 0; + LLSurface::sTextureUpdateTime = 0.f; + } +} + + +void output_statistics(void*) +{ + llinfos << "Number of orphans: " << gObjectList.getOrphanCount() << llendl; + llinfos << "Number of dead objects: " << gObjectList.mNumDeadObjects << llendl; + llinfos << "Num images: " << gImageList.getNumImages() << llendl; + llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemory << llendl; + llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemory << llendl; + llinfos << "Raw usage: " << LLImageRaw::sGlobalRawMemory << llendl; + llinfos << "Formatted usage: " << LLImageFormatted::sGlobalFormattedMemory << llendl; + llinfos << "Zombie Viewer Objects: " << LLViewerObject::getNumZombieObjects() << llendl; + llinfos << "Number of lights: " << gPipeline.getLightCount() << llendl; + + llinfos << "Memory Usage:" << llendl; + llinfos << "--------------------------------" << llendl; + llinfos << "Pipeline:" << llendl; + llinfos << llendl; + +#if LL_SMARTHEAP + llinfos << "--------------------------------" << llendl; + { + llinfos << "sizeof(LLVOVolume) = " << sizeof(LLVOVolume) << llendl; + + U32 total_pool_size = 0; + U32 total_used_size = 0; + MEM_POOL_INFO pool_info; + MEM_POOL_STATUS pool_status; + U32 pool_num = 0; + for(pool_status = MemPoolFirst( &pool_info, 1 ); + pool_status != MEM_POOL_END; + pool_status = MemPoolNext( &pool_info, 1 ) ) + { + llinfos << "Pool #" << pool_num << llendl; + if( MEM_POOL_OK != pool_status ) + { + llwarns << "Pool not ok" << llendl; + continue; + } + + llinfos << "Pool blockSizeFS " << pool_info.blockSizeFS + << " pageSize " << pool_info.pageSize + << llendl; + + U32 pool_count = MemPoolCount(pool_info.pool); + llinfos << "Blocks " << pool_count << llendl; + + U32 pool_size = MemPoolSize( pool_info.pool ); + if( pool_size == MEM_ERROR_RET ) + { + llinfos << "MemPoolSize() failed (" << pool_num << ")" << llendl; + } + else + { + llinfos << "MemPool Size " << pool_size / 1024 << "K" << llendl; + } + + total_pool_size += pool_size; + + if( !MemPoolLock( pool_info.pool ) ) + { + llinfos << "MemPoolLock failed (" << pool_num << ") " << llendl; + continue; + } + + U32 used_size = 0; + MEM_POOL_ENTRY entry; + entry.entry = NULL; + while( MemPoolWalk( pool_info.pool, &entry ) == MEM_POOL_OK ) + { + if( entry.isInUse ) + { + used_size += entry.size; + } + } + + MemPoolUnlock( pool_info.pool ); + + llinfos << "MemPool Used " << used_size/1024 << "K" << llendl; + total_used_size += used_size; + pool_num++; + } + + llinfos << "Total Pool Size " << total_pool_size/1024 << "K" << llendl; + llinfos << "Total Used Size " << total_used_size/1024 << "K" << llendl; + + } +#endif + + llinfos << "--------------------------------" << llendl; + llinfos << "Avatar Memory (partly overlaps with above stats):" << llendl; + gTexStaticImageList.dumpByteCount(); + LLVOAvatar::dumpScratchTextureByteCount(); + LLTexLayerSetBuffer::dumpTotalByteCount(); + LLVOAvatar::dumpTotalLocalTextureByteCount(); + LLTexLayerParamAlpha::dumpCacheByteCount(); + LLVOAvatar::dumpBakedStatus(); + + llinfos << llendl; + + llinfos << "Object counts:" << llendl; + S32 i; + S32 obj_counts[256]; +// S32 app_angles[256]; + for (i = 0; i < 256; i++) + { + obj_counts[i] = 0; + } + for (i = 0; i < gObjectList.getNumObjects(); i++) + { + LLViewerObject *objectp = gObjectList.getObject(i); + if (objectp) + { + obj_counts[objectp->getPCode()]++; + } + } + for (i = 0; i < 256; i++) + { + if (obj_counts[i]) + { + llinfos << LLPrimitive::pCodeToString(i) << ":" << obj_counts[i] << llendl; + } + } +} + + +U32 gTotalLandIn = 0, gTotalLandOut = 0; +U32 gTotalWaterIn = 0, gTotalWaterOut = 0; + +F32 gAveLandCompression = 0.f, gAveWaterCompression = 0.f; +F32 gBestLandCompression = 1.f, gBestWaterCompression = 1.f; +F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; + + + +U32 gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0; +U32 gObjectBits = 0; +F32 gAvgSimPing = 0.f; + + +extern U32 gVisCompared; +extern U32 gVisTested; + +std::map gDebugTimers; + +void update_statistics(U32 frame_count) +{ + gTotalWorldBytes += gVLManager.getTotalBytes(); + gTotalObjectBytes += gObjectBits / 8; + gTotalTextureBytes += LLViewerImageList::sTextureBits / 8; + + // make sure we have a valid time delta for this frame + if (gFrameIntervalSeconds > 0.f) + { + if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) + { + gViewerStats->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); + } + else if (gAgent.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) + { + gViewerStats->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); + } + else if (gFloaterTools && gFloaterTools->getVisible()) + { + gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); + } + } + gViewerStats->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); + gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); + gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); + gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); +#if 0 // 1.9.2 + gViewerStats->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); + gViewerStats->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); + gViewerStats->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment")); +#endif + gViewerStats->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME)); + F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE); + F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK); + gViewerStats->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); + gViewerStats->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); + gViewerStats->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE)); + gViewerStats->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_REBUILD)); + gViewerStats->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY)); + + LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); + if (cdp) + { + gViewerStats->mSimPingStat.addValue(cdp->getPingDelay()); + gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); + gSimPingCount++; + } + else + { + gViewerStats->mSimPingStat.addValue(10000); + } + + gViewerStats->mFPSStat.addValue(1); + F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); + gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f); + gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f); + gViewerStats->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f); + gViewerStats->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); + gViewerStats->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + gTransferManager.resetTransferBitsIn(LLTCT_ASSET); + + static S32 tex_bits_idle_count = 0; + if (LLViewerImageList::sTextureBits == 0) + { + if (++tex_bits_idle_count >= 30) + gDebugTimers[0].pause(); + } + else + { + tex_bits_idle_count = 0; + gDebugTimers[0].unpause(); + } + + gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); + + // log when the LibXUL (aka Mozilla) widget is used and opened so we can monitor framerate changes + #if LL_LIBXUL_ENABLED + { + BOOL result = gViewerHtmlHelp.getFloaterOpened(); + gViewerStats->setStat(LLViewerStats::ST_LIBXUL_WIDGET_USED, (F64)result); + } + #endif + + { + static F32 visible_avatar_frames = 0.f; + static F32 avg_visible_avatars = 0; + F32 visible_avatars = (F32)LLVOAvatar::sNumVisibleAvatars; + if (visible_avatars > 0.f) + { + visible_avatar_frames = 1.f; + avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; + } + gViewerStats->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); + } + gWorldp->updateNetStats(); + gWorldp->requestCacheMisses(); + + // Reset all of these values. + gVLManager.resetBitCounts(); + gObjectBits = 0; +// gDecodedBits = 0; + + LLViewerImageList::sTextureBits = 0; + LLViewerImageList::sTexturePackets = 0; + +#if LL_WINDOWS && LL_LCD_COMPILE + bool LCDenabled = gLcdScreen->Enabled(); + gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled); +#else + gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, false); +#endif +} + +class ViewerStatsResponder : public LLHTTPClient::Responder +{ +public: + ViewerStatsResponder() { } + + void error(U32 statusNum, const std::string& reason) + { + llinfos << "ViewerStatsResponder::error " << statusNum << " " + << reason << llendl; + } + + void result(const LLSD& content) + { + llinfos << "ViewerStatsResponder::result" << llendl; + } +}; + +/* + * The sim-side LLSD is in newsim/llagentinfo.cpp:forwardViewerStats. + * + * There's also a compatibility shim for the old fixed-format sim + * stats in newsim/llagentinfo.cpp:processViewerStats. + * + * If you move stats around here, make the corresponding changes in + * those locations, too. + */ +void send_stats() +{ + // IW 9/23/02 I elected not to move this into LLViewerStats + // because it depends on too many viewer.cpp globals. + // Someday we may want to merge all our stats into a central place + // but that day is not today. + + // Only send stats if the agent is connected to a region. + if (!gAgent.getRegion() || gNoRender) + { + return; + } + + LLSD body; + std::string url = gAgent.getRegion()->getCapability("ViewerStats"); + + if (url.empty()) { + llwarns << "Could not get ViewerStats capability" << llendl; + return; + } + + body["session_id"] = gAgentSessionID; + + LLSD &agent = body["agent"]; + + time_t ltime; + time(<ime); + F32 run_time = F32(LLFrameTimer::getElapsedSeconds()); + + agent["start_time"] = ltime - run_time; + + // The first stat set must have a 0 run time if it doesn't actually + // contain useful data in terms of FPS, etc. We use half the + // SEND_STATS_PERIOD seconds as the point at which these statistics become + // valid. Data warehouse uses a 0 value here to easily discard these + // records with non-useful FPS values etc. + if (run_time < (SEND_STATS_PERIOD / 2)) + { + agent["run_time"] = 0.0f; + } + else + { + agent["run_time"] = run_time; + } + + // send fps only for time app spends in foreground + agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32(); + agent["version"] = gCurrentVersion; + LLString language(gSavedSettings.getString("Language")); + if(language == "default") language = gSavedSettings.getString("SystemLanguage"); + agent["language"] = language; + + agent["sim_fps"] = ((F32) gFrameCount - gSimFrames) / + (F32) (gRenderStartTime.getElapsedTimeF32() - gSimLastTime); + + gSimLastTime = gRenderStartTime.getElapsedTimeF32(); + gSimFrames = (F32) gFrameCount; + + agent["agents_in_view"] = LLVOAvatar::sNumVisibleAvatars; + agent["ping"] = gAvgSimPing; + agent["meters_traveled"] = gAgent.getDistanceTraveled(); + agent["regions_visited"] = gAgent.getRegionsVisited(); + agent["mem_use"] = getCurrentRSS() / 1024.0; + + LLSD &system = body["system"]; + + system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB(); + system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + system["cpu"] = gSysCPU.getCPUString(); + + std::string gpu_desc = llformat( + "%-6s Class %d ", + gGLManager.mGLVendorShort.substr(0,6).c_str(), + gFeatureManagerp->getGPUClass()) + + gFeatureManagerp->getGPUString(); + + system["gpu"] = gpu_desc; + system["gpu_class"] = gFeatureManagerp->getGPUClass(); + system["gpu_vendor"] = gGLManager.mGLVendorShort; + system["gpu_version"] = gGLManager.mDriverVersionVendorString; + + LLSD &download = body["downloads"]; + + download["world_kbytes"] = gTotalWorldBytes / 1024.0; + download["object_kbytes"] = gTotalObjectBytes / 1024.0; + download["texture_kbytes"] = gTotalTextureBytes / 1024.0; + + LLSD &in = body["stats"]["net"]["in"]; + + in["kbytes"] = gMessageSystem->mTotalBytesIn / 1024.0; + in["packets"] = (S32) gMessageSystem->mPacketsIn; + in["compressed_packets"] = (S32) gMessageSystem->mCompressedPacketsIn; + in["savings"] = (gMessageSystem->mUncompressedBytesIn - + gMessageSystem->mCompressedBytesIn) / 1024.0; + + LLSD &out = body["stats"]["net"]["out"]; + + out["kbytes"] = gMessageSystem->mTotalBytesOut / 1024.0; + out["packets"] = (S32) gMessageSystem->mPacketsOut; + out["compressed_packets"] = (S32) gMessageSystem->mCompressedPacketsOut; + out["savings"] = (gMessageSystem->mUncompressedBytesOut - + gMessageSystem->mCompressedBytesOut) / 1024.0; + + LLSD &fail = body["stats"]["failures"]; + + fail["send_packet"] = (S32) gMessageSystem->mSendPacketFailureCount; + fail["dropped"] = (S32) gMessageSystem->mDroppedPackets; + fail["resent"] = (S32) gMessageSystem->mResentPackets; + fail["failed_resends"] = (S32) gMessageSystem->mFailedResendPackets; + fail["off_circuit"] = (S32) gMessageSystem->mOffCircuitPackets; + fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets; + + // Misc stats, two strings and two ints + // These are not expecticed to persist across multiple releases + // Comment any changes with your name and the expected release revision + // If the current revision is recent, ping the previous author before overriding + LLSD &misc = body["stats"]["misc"]; + + // misc["string_1"] = + // misc["string_2"] = + misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6 + misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6 + + gViewerStats->addToMessage(body); + + LLHTTPClient::post(url, body, new ViewerStatsResponder()); +} diff --git a/linden/indra/newview/llviewerstats.h b/linden/indra/newview/llviewerstats.h index 3c959a5..0ce4e79 100644 --- a/linden/indra/newview/llviewerstats.h +++ b/linden/indra/newview/llviewerstats.h @@ -94,7 +94,6 @@ public: LLStat mSimPingStat; - LLStat mUserserverPingStat; void resetStats(); public: @@ -188,4 +187,13 @@ private: extern LLViewerStats *gViewerStats; +static const F32 SEND_STATS_PERIOD = 300.0f; + +// The following are from (older?) statistics code found in appviewer. +void reset_statistics(); +void output_statistics(void*); +void update_statistics(U32 frame_count); +void send_stats(); + +extern std::map gDebugTimers; #endif // LL_LLVIEWERSTATS_H diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 1e75e42..e89f3f9 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp @@ -37,6 +37,7 @@ #include "llinventory.h" #include "llinventorymodel.h" #include "llinventoryview.h" +#include "llinventorybridge.h" // for landmark prefix string #include "llviewertexteditor.h" @@ -58,7 +59,7 @@ #include "llmemorystream.h" #include "llmenugl.h" -extern BOOL gPacificDaylightTime; +#include "llappviewer.h" // for gPacificDaylightTime ///---------------------------------------------------------------------------- /// Class LLEmbeddedNotecardOpener @@ -1399,7 +1400,9 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item ) void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item ) { - open_landmark((LLViewerInventoryItem*)item, " preview landmark", FALSE, item->getUUID(), TRUE); + LLString title = + LLString(" ") + LLLandmarkBridge::prefix() + item->getName(); + open_landmark((LLViewerInventoryItem*)item, title, FALSE, item->getUUID(), TRUE); } void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, BOOL saved ) diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 7aaf9c0..d8f182c 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -31,6 +31,7 @@ #include "llviewerprecompiledheaders.h" +#include "llpanellogin.h" #include "llviewerwindow.h" // system library includes @@ -105,6 +106,7 @@ #include "llfloatermap.h" #include "llfloatermute.h" #include "llfloaternamedesc.h" +#include "llfloaterpreference.h" #include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" @@ -161,6 +163,7 @@ #include "llvieweruictrlfactory.h" #include "lluploaddialog.h" #include "llurldispatcher.h" // SLURL from other app instance +#include "llvieweraudio.h" #include "llviewercamera.h" #include "llviewergesture.h" #include "llviewerimagelist.h" @@ -178,7 +181,9 @@ #include "llworldmapview.h" #include "moviemaker.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" +#include "llurlsimstring.h" +#include "llviewerdisplay.h" #if LL_WINDOWS #include "llwindebug.h" @@ -240,6 +245,12 @@ BOOL gbCapturing = FALSE; MovieMaker gMovieMaker; #endif +// HUD display lines in lower right +BOOL gDisplayWindInfo = FALSE; +BOOL gDisplayCameraPos = FALSE; +BOOL gDisplayNearestWater = FALSE; +BOOL gDisplayFOV = FALSE; + S32 CHAT_BAR_HEIGHT = 28; S32 OVERLAY_BAR_HEIGHT = 20; @@ -1192,14 +1203,14 @@ BOOL LLViewerWindow::handleCloseRequest(LLWindow *window) { // User has indicated they want to close, but we may need to ask // about modified documents. - app_user_quit(); + LLAppViewer::instance()->userQuit(); // Don't quit immediately return FALSE; } void LLViewerWindow::handleQuit(LLWindow *window) { - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); } void LLViewerWindow::handleResize(LLWindow *window, S32 width, S32 height) @@ -1212,6 +1223,8 @@ void LLViewerWindow::handleFocus(LLWindow *window) { gFocusMgr.setAppHasFocus(TRUE); LLModalDialog::onAppFocusGained(); + + gAgent.onAppFocusGained(); if (gToolMgr) { gToolMgr->onAppFocusGained(); @@ -1315,7 +1328,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) gAgent.clearAFK(); if (mWindow->getFullscreen() && !mIgnoreActivate) { - if (!gQuit) + if (!LLApp::isExiting() ) { if (LLStartUp::getStartupState() >= STATE_STARTED) { @@ -1505,7 +1518,7 @@ LLViewerWindow::LLViewerWindow( llwarns << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings" << llendl; #endif - app_force_exit(1); + LLAppViewer::instance()->forceExit(1); } // Get the real window rect the window was created with (since there are various OS-dependent reasons why @@ -1892,7 +1905,6 @@ void LLViewerWindow::initWorldUI() // TODO: Move instance management into class gFloaterMap = new LLFloaterMap("Map"); gFloaterMap->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); - gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); // keep onscreen gFloaterView->adjustToFitScreen(gFloaterMap, FALSE); @@ -2107,7 +2119,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) // reshape messages. We don't care about these, and we // don't want to send messages because the message system // may have been destructed. - if (!gQuit) + if (!LLApp::isExiting()) { if (gNoRender) { @@ -2193,13 +2205,22 @@ void LLViewerWindow::reshape(S32 width, S32 height) void LLViewerWindow::setNormalControlsVisible( BOOL visible ) { if ( gBottomPanel ) + { gBottomPanel->setVisible( visible ); + gBottomPanel->setEnabled( visible ); + } if ( gMenuBarView ) + { gMenuBarView->setVisible( visible ); - + gMenuBarView->setEnabled( visible ); + } + if ( gStatusBar ) - gStatusBar->setVisible( visible ); + { + gStatusBar->setVisible( visible ); + gStatusBar->setEnabled( visible ); + } } @@ -2408,6 +2429,18 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) toggle_debug_menus(NULL); } + // Explicit hack for debug menu. + if ((mask == (MASK_SHIFT | MASK_CONTROL)) && + ('G' == key || 'g' == key)) + { + if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) //on splash page + { + BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid"); + gSavedSettings.setBOOL("ForceShowGrid", visible); + LLPanelLogin::loadLoginPage(); + } + } + // Example "bug" for bug reporter web page if ((MASK_SHIFT & mask) && (MASK_ALT & mask) @@ -2439,6 +2472,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { return TRUE; } + // let menus handle navigation keys + if (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE)) + { + return TRUE; + } // Traverses up the hierarchy LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); @@ -2544,6 +2582,12 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { return TRUE; } + + // give menus a chance to handle keys + if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)) + { + return TRUE; + } // don't pass keys on to world when something in ui has focus return gFocusMgr.childHasKeyboardFocus(mRootView) @@ -2831,7 +2875,7 @@ BOOL LLViewerWindow::handlePerFrameHover() // *NOTE: sometimes tools handle the mouse as a captor, so this // logic is a little confusing LLTool *tool = NULL; - if (gToolMgr && gHoverView) + if (gToolMgr && gHoverView && gCamera) { tool = gToolMgr->getCurrentTool(); @@ -2904,8 +2948,8 @@ BOOL LLViewerWindow::handlePerFrameHover() mToolTip->setVisible( TRUE ); } } - - if (tool != gToolNull && tool != gToolInspect && tool != gToolDragAndDrop && !gSavedSettings.getBOOL("FreezeTime")) + + if (tool && tool != gToolNull && tool != gToolInspect && tool != gToolDragAndDrop && !gSavedSettings.getBOOL("FreezeTime")) { LLMouseHandler *captor = gFocusMgr.getMouseCapture(); // With the null, inspect, or drag and drop tool, don't muck @@ -4715,9 +4759,9 @@ void LLViewerWindow::stopGL(BOOL save_state) llinfos << "Shutting down GL..." << llendl; // Pause texture decode threads (will get unpaused during main loop) - gTextureCache->pause(); - gImageDecodeThread->pause(); - gTextureFetch->pause(); + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + LLAppViewer::getTextureFetch()->pause(); gSky.destroyGL(); stop_glerror(); diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h index fcd1597..faab518 100644 --- a/linden/indra/newview/llviewerwindow.h +++ b/linden/indra/newview/llviewerwindow.h @@ -416,4 +416,10 @@ extern BOOL gPickTransparent; extern BOOL gDebugFastUIRender; extern S32 CHAT_BAR_HEIGHT; + +extern BOOL gDisplayCameraPos; +extern BOOL gDisplayWindInfo; +extern BOOL gDisplayNearestWater; +extern BOOL gDisplayFOV; + #endif diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 4905ff8..7a225c8 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -114,7 +114,7 @@ #include "llworld.h" #include "pipeline.h" #include "llglslshader.h" -#include "viewer.h" +#include "llappviewer.h" #include "lscript_byteformat.h" //#include "vtune/vtuneapi.h" @@ -1622,7 +1622,6 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info) // LLVOAvatar::buildCharacter() // Deferred initialization and rebuild of the avatar. //----------------------------------------------------------------------------- -extern BOOL gPrintMessagesThisFrame; void LLVOAvatar::buildCharacter() { LLMemType mt(LLMemType::MTYPE_AVATAR); @@ -7439,7 +7438,7 @@ void LLVOAvatar::onCustomizeEnd() avatar->updateMeshTextures(); - if( !gQuit ) + if( !LLApp::isExiting()) { avatar->requestLayerSetUploads(); } diff --git a/linden/indra/newview/llvoclouds.cpp b/linden/indra/newview/llvoclouds.cpp index 07cfcea..7a2ba60 100644 --- a/linden/indra/newview/llvoclouds.cpp +++ b/linden/indra/newview/llvoclouds.cpp @@ -49,7 +49,9 @@ #include "llvosky.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" + +LLUUID gCloudTextureID = IMG_CLOUD_POOF; + LLVOClouds::LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLAlphaObject(id, LL_VO_CLOUDS, regionp) diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp index f6f7ce7..cf6b13e 100644 --- a/linden/indra/newview/llvoiceclient.cpp +++ b/linden/indra/newview/llvoiceclient.cpp @@ -42,12 +42,12 @@ #include "expat/expat.h" #include "llcallbacklist.h" #include "llviewerregion.h" -#include "llviewernetwork.h" // for gUserServerChoice +#include "llviewernetwork.h" // for gGridChoice #include "llfloateractivespeakers.h" // for LLSpeakerMgr #include "llbase64.h" #include "llviewercontrol.h" #include "llkeyboard.h" -#include "viewer.h" // for gDisconnected, gDisableVoice +#include "llappviewer.h" // for gDisconnected, gDisableVoice #include "llmutelist.h" // to check for muted avatars #include "llagent.h" #include "llcachename.h" @@ -1052,10 +1052,10 @@ void LLVoiceClient::userAuthorized(const std::string& firstName, const std::stri llinfos << "name \"" << mAccountDisplayName << "\" , ID " << agentID << llendl; - std::string userserver = gUserServerName; - LLString::toLower(userserver); - if((gUserServerChoice == USERSERVER_AGNI) || - ((gUserServerChoice == USERSERVER_OTHER) && (userserver.find("agni") != std::string::npos))) + std::string gridname = gGridName; + LLString::toLower(gridname); + if((gGridChoice == GRID_INFO_AGNI) || + ((gGridChoice == GRID_INFO_OTHER) && (gridname.find("agni") != std::string::npos))) { sConnectingToAgni = true; } diff --git a/linden/indra/newview/llvosky.cpp b/linden/indra/newview/llvosky.cpp index d3c24a6..b8d994d 100644 --- a/linden/indra/newview/llvosky.cpp +++ b/linden/indra/newview/llvosky.cpp @@ -53,7 +53,6 @@ #include "llviewerregion.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" // for gSunTextureID const S32 NUM_TILES_X = 8; const S32 NUM_TILES_Y = 4; @@ -72,6 +71,10 @@ const LLVector2 TEX01 = LLVector2(0.f, 1.f); const LLVector2 TEX10 = LLVector2(1.f, 0.f); const LLVector2 TEX11 = LLVector2(1.f, 1.f); +// Exported globals +LLUUID gSunTextureID = IMG_SUN; +LLUUID gMoonTextureID = IMG_MOON; + //static LLColor3 LLHaze::sAirScaSeaLevel; diff --git a/linden/indra/newview/llvosky.h b/linden/indra/newview/llvosky.h index 4020114..f3bceb0 100644 --- a/linden/indra/newview/llvosky.h +++ b/linden/indra/newview/llvosky.h @@ -69,6 +69,12 @@ const F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma); const F64 Ndens = 2.55e25; const F64 Ndens2 = Ndens*Ndens; +// HACK: Allow server to change sun and moon IDs. +// I can't figure out how to pass the appropriate +// information into the LLVOSky constructor. JC +extern LLUUID gSunTextureID; +extern LLUUID gMoonTextureID; + LL_FORCE_INLINE LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2) { diff --git a/linden/indra/newview/llwearable.cpp b/linden/indra/newview/llwearable.cpp index 4222e84..b4e7910 100644 --- a/linden/indra/newview/llwearable.cpp +++ b/linden/indra/newview/llwearable.cpp @@ -48,9 +48,6 @@ #include "llvoavatar.h" #include "llwearable.h" -//#include "viewer.h" -//#include "llvfs.h" - // static S32 LLWearable::sCurrentDefinitionVersion = 1; diff --git a/linden/indra/newview/llweb.cpp b/linden/indra/newview/llweb.cpp index 7ee4869..eac24ce 100644 --- a/linden/indra/newview/llweb.cpp +++ b/linden/indra/newview/llweb.cpp @@ -40,14 +40,20 @@ #include "llviewercontrol.h" // static -void LLWeb::loadURL(std::string url) +void LLWeb::initClass() +{ + LLAlertDialog::setURLLoader(&sAlertURLLoader); +} + +// static +void LLWeb::loadURL(const std::string& url) { loadURLExternal(url); } // static -void LLWeb::loadURLExternal(std::string url) +void LLWeb::loadURLExternal(const std::string& url) { std::string escaped_url = escapeURL(url); #if LL_LIBXUL_ENABLED @@ -57,7 +63,7 @@ void LLWeb::loadURLExternal(std::string url) // static -std::string LLWeb::escapeURL(std::string url) +std::string LLWeb::escapeURL(const std::string& url) { // The CURL curl_escape() function escapes colons, slashes, // and all characters but A-Z and 0-9. Do a cheesy mini-escape. @@ -81,3 +87,12 @@ std::string LLWeb::escapeURL(std::string url) } return escaped_url; } + +// virtual +void LLWeb::URLLoader::load(const std::string& url) +{ + loadURL(url); +} + +// static +LLWeb::URLLoader LLWeb::sAlertURLLoader; diff --git a/linden/indra/newview/llweb.h b/linden/indra/newview/llweb.h index b339f2d..318410b 100644 --- a/linden/indra/newview/llweb.h +++ b/linden/indra/newview/llweb.h @@ -34,21 +34,31 @@ #define LL_LLWEB_H #include +#include "llalertdialog.h" class LLWeb { public: + static void initClass(); + // Loads unescaped url in either internal web browser or external // browser, depending on user settings. - static void loadURL(std::string url); + static void loadURL(const std::string& url); static void loadURL(const char* url) { loadURL( std::string(url) ); } // Loads unescaped url in external browser. - static void loadURLExternal(std::string url); + static void loadURLExternal(const std::string& url); // Returns escaped (eg, " " to "%20") url - static std::string escapeURL(std::string url); + static std::string escapeURL(const std::string& url); + + class URLLoader : public LLAlertDialog::URLLoader + { + virtual void load(const std::string& url); + }; + + static URLLoader sAlertURLLoader; }; #endif diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index 7fedc4c..afd27bf 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -42,7 +42,7 @@ #include "llviewerwindow.h" #include "llfloaterhtml.h" #include "llweb.h" -#include "viewer.h" +#include "llurlsimstring.h" // linden library includes #include "llfocusmgr.h" @@ -544,6 +544,15 @@ void LLWebBrowserCtrl::onStatusTextChange( const EventType& eventIn ) // virtual void LLWebBrowserCtrl::onLocationChange( const EventType& eventIn ) { + const LLURI url(eventIn.getStringValue()); + LLSD queryMap(url.queryMap()); + std::string redirect_http_hack = queryMap["redirect-http-hack"].asString(); + if (!redirect_http_hack.empty()) + { + LLURLDispatcher::dispatch(redirect_http_hack); + return; + } + // chain this event on to observers of an instance of LLWebBrowserCtrl LLWebBrowserCtrlEvent event( eventIn.getStringValue() ); mEventEmitter.update( &LLWebBrowserCtrlObserver::onLocationChange, event ); @@ -554,7 +563,6 @@ void LLWebBrowserCtrl::onLocationChange( const EventType& eventIn ) void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn ) { const std::string protocol( "http://" ); - if( mOpenLinksInExternalBrowser ) { if ( eventIn.getStringValue().length() ) diff --git a/linden/indra/newview/llwind.cpp b/linden/indra/newview/llwind.cpp index b04299b..96a985f 100644 --- a/linden/indra/newview/llwind.cpp +++ b/linden/indra/newview/llwind.cpp @@ -48,7 +48,6 @@ // viewer #include "noise.h" #include "v4color.h" -#include "viewer.h" #include "llagent.h" #include "llworld.h" diff --git a/linden/indra/newview/llwindebug.cpp b/linden/indra/newview/llwindebug.cpp index b65262c..d0129c8 100644 --- a/linden/indra/newview/llwindebug.cpp +++ b/linden/indra/newview/llwindebug.cpp @@ -33,16 +33,69 @@ #ifdef LL_WINDOWS +#include +#include +#include "llappviewer.h" #include "llwindebug.h" #include "llviewercontrol.h" #include "lldir.h" +#include "llsd.h" +#include "llsdserialize.h" + +#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union +#pragma warning(disable: 4100) //unreferenced formal parameter + +/* +LLSD Block for Windows Dump Information + + + Platform + + Process + + Module + + DateModified + + ExceptionCode + + ExceptionRead/WriteAddress + + Instruction + + Registers + + + EIP + ... + + + Call Stack + + + + ModuleName + + ModuleBaseAddress + + ModuleOffsetAddress + + Parameters + + + + + + + + + +*/ // From viewer.h extern BOOL gInProductionGrid; extern void (*gCrashCallback)(void); -extern void write_debug(const char *str); -extern void write_debug(const std::string &str); // based on dbghelp.h typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, @@ -53,6 +106,248 @@ typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hF MINIDUMPWRITEDUMP f_mdwp = NULL; +#undef UNICODE + +HMODULE hDbgHelp; + +// Tool Help functions. +typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID); +typedef BOOL (WINAPI * MODULE32_FIRST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); +typedef BOOL (WINAPI * MODULE32_NEST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); + +CREATE_TOOL_HELP32_SNAPSHOT CreateToolhelp32Snapshot_; +MODULE32_FIRST Module32First_; +MODULE32_NEST Module32Next_; + +#define DUMP_SIZE_MAX 8000 //max size of our dump +#define CALL_TRACE_MAX ((DUMP_SIZE_MAX - 2000) / (MAX_PATH + 40)) //max number of traced calls +#define NL L"\r\n" //new line + +//Windows Call Stack Construction idea from +//http://www.codeproject.com/tools/minidump.asp + +//**************************************************************************************** +BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr) +//**************************************************************************************** +// Find module by Ret_Addr (address in the module). +// Return Module_Name (full path) and Module_Addr (start address). +// Return TRUE if found. +{ + MODULEENTRY32 M = {sizeof(M)}; + HANDLE hSnapshot; + + bool found = false; + + if (CreateToolhelp32Snapshot_) + { + hSnapshot = CreateToolhelp32Snapshot_(TH32CS_SNAPMODULE, 0); + + if ((hSnapshot != INVALID_HANDLE_VALUE) && + Module32First_(hSnapshot, &M)) + { + do + { + if (DWORD(Ret_Addr - M.modBaseAddr) < M.modBaseSize) + { + lstrcpyn(Module_Name, M.szExePath, MAX_PATH); + Module_Addr = M.modBaseAddr; + found = true; + break; + } + } while (Module32Next_(hSnapshot, &M)); + } + + CloseHandle(hSnapshot); + } + + return found; +} //Get_Module_By_Ret_Addr + +//****************************************************************** +void WINAPI Get_Call_Stack(PEXCEPTION_POINTERS pException, LLSD& info) +//****************************************************************** +// Fill Str with call stack info. +// pException can be either GetExceptionInformation() or NULL. +// If pException = NULL - get current call stack. +{ + LPWSTR Module_Name = new WCHAR[MAX_PATH]; + PBYTE Module_Addr = 0; + + typedef struct STACK + { + STACK * Ebp; + PBYTE Ret_Addr; + DWORD Param[0]; + } STACK, * PSTACK; + + STACK Stack = {0, 0}; + PSTACK Ebp; + + if (pException) //fake frame for exception address + { + Stack.Ebp = (PSTACK)pException->ContextRecord->Ebp; + Stack.Ret_Addr = (PBYTE)pException->ExceptionRecord->ExceptionAddress; + Ebp = &Stack; + } + else + { + Ebp = (PSTACK)&pException - 1; //frame addr of Get_Call_Stack() + + // Skip frame of Get_Call_Stack(). + if (!IsBadReadPtr(Ebp, sizeof(PSTACK))) + Ebp = Ebp->Ebp; //caller ebp + } + + // Trace CALL_TRACE_MAX calls maximum - not to exceed DUMP_SIZE_MAX. + // Break trace on wrong stack frame. + for (int Ret_Addr_I = 0, i = 0; + (Ret_Addr_I < CALL_TRACE_MAX) && !IsBadReadPtr(Ebp, sizeof(PSTACK)) && !IsBadCodePtr(FARPROC(Ebp->Ret_Addr)); + Ret_Addr_I++, Ebp = Ebp->Ebp, ++i) + { + // If module with Ebp->Ret_Addr found. + + if (Get_Module_By_Ret_Addr(Ebp->Ret_Addr, Module_Name, Module_Addr)) + { + // Save module's address and full path. + info["CallStack"][i]["ModuleName"] = ll_convert_wide_to_string(Module_Name); + info["CallStack"][i]["ModuleAddress"] = (int)Module_Addr; + info["CallStack"][i]["CallOffset"] = (int)(Ebp->Ret_Addr - Module_Addr); + + LLSD params; + // Save 5 params of the call. We don't know the real number of params. + if (pException && !Ret_Addr_I) //fake frame for exception address + params[0] = "Exception Offset"; + else if (!IsBadReadPtr(Ebp, sizeof(PSTACK) + 5 * sizeof(DWORD))) + { + for(int j = 0; j < 5; ++j) + { + params[j] = (int)Ebp->Param[j]; + } + } + info["CallStack"][i]["Parameters"] = params; + } + info["CallStack"][i]["ReturnAddress"] = (int)Ebp->Ret_Addr; + } +} //Get_Call_Stack + +//*********************************** +void WINAPI Get_Version_Str(LLSD& info) +//*********************************** +// Fill Str with Windows version. +{ + OSVERSIONINFOEX V = {sizeof(OSVERSIONINFOEX)}; //EX for NT 5.0 and later + + if (!GetVersionEx((POSVERSIONINFO)&V)) + { + ZeroMemory(&V, sizeof(V)); + V.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx((POSVERSIONINFO)&V); + } + + if (V.dwPlatformId != VER_PLATFORM_WIN32_NT) + V.dwBuildNumber = LOWORD(V.dwBuildNumber); //for 9x HIWORD(dwBuildNumber) = 0x04xx + + info["Platform"] = llformat("Windows: %d.%d.%d, SP %d.%d, Product Type %d", //SP - service pack, Product Type - VER_NT_WORKSTATION,... + V.dwMajorVersion, V.dwMinorVersion, V.dwBuildNumber, V.wServicePackMajor, V.wServicePackMinor, V.wProductType); +} //Get_Version_Str + +//************************************************************* +LLSD WINAPI Get_Exception_Info(PEXCEPTION_POINTERS pException) +//************************************************************* +// Allocate Str[DUMP_SIZE_MAX] and return Str with dump, if !pException - just return call stack in Str. +{ + LLSD info; + LPWSTR Str; + int Str_Len; + int i; + LPWSTR Module_Name = new WCHAR[MAX_PATH]; + PBYTE Module_Addr; + HANDLE hFile; + FILETIME Last_Write_Time; + FILETIME Local_File_Time; + SYSTEMTIME T; + + Str = new WCHAR[DUMP_SIZE_MAX]; + Str_Len = 0; + if (!Str) + return NULL; + + Get_Version_Str(info); + + GetModuleFileName(NULL, Str, MAX_PATH); + info["Process"] = ll_convert_wide_to_string(Str); + + // If exception occurred. + if (pException) + { + EXCEPTION_RECORD & E = *pException->ExceptionRecord; + CONTEXT & C = *pException->ContextRecord; + + // If module with E.ExceptionAddress found - save its path and date. + if (Get_Module_By_Ret_Addr((PBYTE)E.ExceptionAddress, Module_Name, Module_Addr)) + { + info["Module"] = ll_convert_wide_to_string(Module_Name); + + if ((hFile = CreateFile(Module_Name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) + { + if (GetFileTime(hFile, NULL, NULL, &Last_Write_Time)) + { + FileTimeToLocalFileTime(&Last_Write_Time, &Local_File_Time); + FileTimeToSystemTime(&Local_File_Time, &T); + + info["DateModified"] = llformat("%02d/%02d/%d", T.wMonth, T.wDay, T.wYear); + } + CloseHandle(hFile); + } + } + else + { + info["ExceptionAddr"] = (int)E.ExceptionAddress; + } + + info["ExceptionCode"] = (int)E.ExceptionCode; + + /* + //TODO: Fix this + if (E.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) + { + // Access violation type - Write/Read. + LLSD exception_info; + exception_info["Type"] = E.ExceptionInformation[0] ? "Write" : "Read"; + exception_info["Address"] = llformat("%08x", E.ExceptionInformation[1]); + info["Exception Information"] = exception_info; + } + */ + + + // Save instruction that caused exception. + LLString str; + for (i = 0; i < 16; i++) + str += llformat(" %02X", PBYTE(E.ExceptionAddress)[i]); + info["Instruction"] = str; + + LLSD registers; + registers["EAX"] = (int)C.Eax; + registers["EBX"] = (int)C.Ebx; + registers["ECX"] = (int)C.Ecx; + registers["EDX"] = (int)C.Edx; + registers["ESI"] = (int)C.Esi; + registers["EDI"] = (int)C.Edi; + registers["ESP"] = (int)C.Esp; + registers["EBP"] = (int)C.Ebp; + registers["EIP"] = (int)C.Eip; + registers["EFlags"] = (int)C.EFlags; + info["Registers"] = registers; + } //if (pException) + + // Save call stack info. + Get_Call_Stack(pException, info); + + return info; +} //Get_Exception_Info + +#define UNICODE class LLMemoryReserve { @@ -96,7 +391,6 @@ static LLMemoryReserve gEmergencyMemoryReserve; // static BOOL LLWinDebug::setupExceptionHandler() { -#ifdef LL_RELEASE_FOR_DOWNLOAD static BOOL s_first_run = TRUE; // Load the dbghelp dll now, instead of waiting for the crash. @@ -123,7 +417,7 @@ BOOL LLWinDebug::setupExceptionHandler() msg += local_dll_name; msg += "!\n"; - write_debug(msg.c_str()); + //write_debug(msg.c_str()); ok = FALSE; } @@ -133,7 +427,7 @@ BOOL LLWinDebug::setupExceptionHandler() if (!f_mdwp) { - write_debug("No MiniDumpWriteDump!\n"); + //write_debug("No MiniDumpWriteDump!\n"); FreeLibrary(hDll); hDll = NULL; ok = FALSE; @@ -146,6 +440,13 @@ BOOL LLWinDebug::setupExceptionHandler() LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; prev_filter = SetUnhandledExceptionFilter(LLWinDebug::handleException); + // Try to get Tool Help library functions. + HMODULE hKernel32; + hKernel32 = GetModuleHandle(_T("KERNEL32")); + CreateToolhelp32Snapshot_ = (CREATE_TOOL_HELP32_SNAPSHOT)GetProcAddress(hKernel32, "CreateToolhelp32Snapshot"); + Module32First_ = (MODULE32_FIRST)GetProcAddress(hKernel32, "Module32FirstW"); + Module32Next_ = (MODULE32_NEST)GetProcAddress(hKernel32, "Module32NextW"); + if (s_first_run) { // We're fine, this is the first run. @@ -162,56 +463,16 @@ BOOL LLWinDebug::setupExceptionHandler() llwarns << "Our exception handler (" << (void *)LLWinDebug::handleException << ") replaced with " << prev_filter << "!" << llendl; ok = FALSE; } + return ok; -#else // Internal builds don't mess with exception handling. - return TRUE; -#endif -} - -void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const char *filename) -{ - if(f_mdwp == NULL) - { - write_debug("No way to generate a minidump, no MiniDumpWriteDump function!\n"); - } - else if(gDirUtilp == NULL) - { - write_debug("No way to generate a minidump, no gDirUtilp!\n"); - } - else - { - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - filename); - - HANDLE hFile = CreateFileA(dump_path.c_str(), - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) - { - // Write the dump, ignoring the return value - f_mdwp(GetCurrentProcess(), - GetCurrentProcessId(), - hFile, - type, - ExInfop, - NULL, - NULL); - - CloseHandle(hFile); - } - - } + //return TRUE; } - // static LONG LLWinDebug::handleException(struct _EXCEPTION_POINTERS *exception_infop) { + // *NOTE:Mani - This method is no longer the initial exception handler. + // It is called from viewer_windows_exception_handler() and other places. // // Let go of a bunch of reserved memory to give library calls etc @@ -220,50 +481,34 @@ LONG LLWinDebug::handleException(struct _EXCEPTION_POINTERS *exception_infop) // gEmergencyMemoryReserve.release(); - BOOL userWantsMaxiDump = - (stricmp(gSavedSettings.getString("LastName").c_str(), "linden") == 0) - || (stricmp(gSavedSettings.getString("LastName").c_str(), "tester") == 0); - - BOOL alsoSaveMaxiDump = userWantsMaxiDump && !gInProductionGrid; - - /* Calculate alsoSaveMaxiDump here */ - if (exception_infop) { - _MINIDUMP_EXCEPTION_INFORMATION ExInfo; - ExInfo.ThreadId = ::GetCurrentThreadId(); - ExInfo.ExceptionPointers = exception_infop; - ExInfo.ClientPointers = NULL; + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SecondLifeException"); - writeDumpToFile(MiniDumpNormal, &ExInfo, "SecondLife.dmp"); + std::string log_path = dump_path + ".log"; - if(alsoSaveMaxiDump) - writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLifePlus.dmp"); + LLSD info; + info = Get_Exception_Info(exception_infop); + if (info) + { + std::ofstream out_file(log_path.c_str()); + LLSDSerialize::toPrettyXML(info, out_file); + out_file.close(); + } } else { - writeDumpToFile(MiniDumpNormal, NULL, "SecondLife.dmp"); - - if(alsoSaveMaxiDump) - writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), NULL, "SecondLifePlus.dmp"); - } - - if (!exception_infop) - { // We're calling this due to a network error, not due to an actual exception. // It doesn't realy matter what we return. return EXCEPTION_CONTINUE_SEARCH; } - // - // Call the newview crash callback, which will spawn the crash - // reporter. It may or may not spawn a dialog. - // - if (gCrashCallback) - { - gCrashCallback(); - } + //handle viewer crash must be called here since + //we don't return handling of the application + //back to the process. + LLAppViewer::handleViewerCrash(); // // At this point, we always want to exit the app. There's no graceful @@ -276,4 +521,3 @@ LONG LLWinDebug::handleException(struct _EXCEPTION_POINTERS *exception_infop) } #endif - diff --git a/linden/indra/newview/llwindebug.h b/linden/indra/newview/llwindebug.h index bb1f11d..e420138 100644 --- a/linden/indra/newview/llwindebug.h +++ b/linden/indra/newview/llwindebug.h @@ -41,7 +41,7 @@ public: static BOOL setupExceptionHandler(); static LONG WINAPI handleException(struct _EXCEPTION_POINTERS *pExceptionInfo); - static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const char *filename); + //static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const char *filename); }; #endif // LL_LLWINDEBUG_H diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp index dd3223c..e761235 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp @@ -56,7 +56,7 @@ #include "llvowater.h" #include "message.h" #include "pipeline.h" -#include "viewer.h" // for do_disconnect() +#include "llappviewer.h" // for do_disconnect() // // Globals @@ -248,7 +248,7 @@ void LLWorld::removeRegion(const LLHost &host) llwarns << "gFrameTimeSeconds " << gFrameTimeSeconds << llendl; llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl; - do_disconnect("You have been disconnected from the region you were in."); + LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in."); return; } @@ -972,16 +972,16 @@ void LLWorld::requestCacheMisses() } } -LLString LLWorld::getInfoString() +void LLWorld::getInfo(LLSD& info) { - LLString info_string("World Info:\n"); + LLSD region_info; for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) - { + { LLViewerRegion* regionp = *iter; - info_string += regionp->getInfoString(); + regionp->getInfo(region_info); + info["World"].append(region_info); } - return info_string; } void LLWorld::disconnectRegions() diff --git a/linden/indra/newview/llworld.h b/linden/indra/newview/llworld.h index 91685cd..e634459 100644 --- a/linden/indra/newview/llworld.h +++ b/linden/indra/newview/llworld.h @@ -142,7 +142,7 @@ public: void setSpaceTimeUSec(const U64 space_time_usec); U64 getSpaceTimeUSec() const; - LLString getInfoString(); + void getInfo(LLSD& info); public: typedef std::list region_list_t; diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index 6ba10ea..50c9cee 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp @@ -36,7 +36,7 @@ #include "llregionhandle.h" #include "message.h" -#include "viewer.h" // for gPacificDaylightTime +#include "llappviewer.h" // for gPacificDaylightTime #include "llagent.h" #include "llmapresponders.h" #include "llviewercontrol.h" diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index dc68910..dac6938 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp @@ -61,7 +61,7 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llworldmap.h" -#include "viewer.h" // Only for constants! +#include "llappviewer.h" // Only for constants! #include "llglheaders.h" diff --git a/linden/indra/newview/llxmlrpctransaction.cpp b/linden/indra/newview/llxmlrpctransaction.cpp index 905e35c..3df2073 100644 --- a/linden/indra/newview/llxmlrpctransaction.cpp +++ b/linden/indra/newview/llxmlrpctransaction.cpp @@ -39,7 +39,7 @@ #include #include -#include "viewer.h" +#include "llappviewer.h" LLXMLRPCValue LLXMLRPCValue::operator[](const char* id) const { diff --git a/linden/indra/newview/macutil_Prefix.h b/linden/indra/newview/macutil_Prefix.h index f8050c8..145a01c 100644 --- a/linden/indra/newview/macutil_Prefix.h +++ b/linden/indra/newview/macutil_Prefix.h @@ -39,3 +39,6 @@ #include +#undef check +#undef verify +#undef require diff --git a/linden/indra/newview/macview.xcodeproj/default.pbxuser b/linden/indra/newview/macview.xcodeproj/default.pbxuser new file mode 100644 index 0000000..62e730f --- /dev/null +++ b/linden/indra/newview/macview.xcodeproj/default.pbxuser @@ -0,0 +1,183 @@ +// !$*UTF8*$! +{ + 20286C28FDCF999611CA2CEA /* Project object */ = { + activeBuildConfigurationName = Development; + activeExecutable = E3C7DAB60CFF871100AD076D /* newview */; + activeTarget = 5503B89E05446B1F003D051F /* newview */; + breakpointsGroup = E3C7DAE10CFF885000AD076D /* XCBreakpointsBucket */; + codeSenseManager = E3C7DAC70CFF874400AD076D /* Code sense */; + executables = ( + E3C7DAB40CFF871100AD076D /* AutoUpdater */, + E3C7DAB50CFF871100AD076D /* crashreporter */, + E3C7DAB60CFF871100AD076D /* newview */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 243, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 200, + 131, + 20, + 48.1626, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 218073202; + PBXWorkspaceStateSaveDate = 218073202; + }; + sourceControlManager = E3C7DAC60CFF874400AD076D /* Source Control */; + userBuildSettings = { + }; + }; + 5503B89E05446B1F003D051F /* newview */ = { + activeExec = 0; + executables = ( + E3C7DAB60CFF871100AD076D /* newview */, + ); + }; + 9932ED1E056C1F0900554101 /* crashreporter */ = { + activeExec = 0; + executables = ( + E3C7DAB50CFF871100AD076D /* crashreporter */, + ); + }; + 9967E9080B37533F0087BD1B /* fmodwrapper */ = { + activeExec = 0; + }; + 99CDED4905E70BAB0000F8AA /* llcommon */ = { + activeExec = 0; + }; + 99D5703205BDEFD7004DE704 /* AutoUpdater */ = { + activeExec = 0; + executables = ( + E3C7DAB40CFF871100AD076D /* AutoUpdater */, + ); + }; + D64593550B3B4D7D00FAB68F /* llkdu */ = { + activeExec = 0; + }; + E3C7DAB40CFF871100AD076D /* AutoUpdater */ = { + isa = PBXExecutable; + activeArgIndex = 2147483647; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + configStateDict = { + }; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = AutoUpdater; + sourceDirectories = ( + ); + }; + E3C7DAB50CFF871100AD076D /* crashreporter */ = { + isa = PBXExecutable; + activeArgIndex = 2147483647; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + configStateDict = { + }; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = crashreporter; + sourceDirectories = ( + ); + }; + E3C7DAB60CFF871100AD076D /* newview */ = { + isa = PBXExecutable; + activeArgIndex = 2147483647; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + configStateDict = { + }; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = newview; + sourceDirectories = ( + ); + }; + E3C7DAC60CFF874400AD076D /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + }; + scmType = ""; + }; + E3C7DAC70CFF874400AD076D /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + E3C7DAE10CFF885000AD076D /* XCBreakpointsBucket */ = { + isa = XCBreakpointsBucket; + name = "Project Breakpoints"; + objects = ( + ); + }; + FD53B40509BDF9F600BFE3BC /* third party libs */ = { + activeExec = 0; + }; +} diff --git a/linden/indra/newview/macview.xcodeproj/project.pbxproj b/linden/indra/newview/macview.xcodeproj/project.pbxproj index c3a4b0a..2d54757 100644 --- a/linden/indra/newview/macview.xcodeproj/project.pbxproj +++ b/linden/indra/newview/macview.xcodeproj/project.pbxproj @@ -37,7 +37,6 @@ 1A47B8E00860FDF100F73746 /* llpanelweb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A47B8DE0860FDF100F73746 /* llpanelweb.cpp */; }; 1A5104450ABF5B5A00520F6D /* llnotecard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5104440ABF5B5A00520F6D /* llnotecard.cpp */; }; 1A5104570ABF60A800520F6D /* llviewerassetstorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5104560ABF60A800520F6D /* llviewerassetstorage.cpp */; }; - 1A57CD2C0C9EFE9900B6EB24 /* llfloaterlagmeter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57CD2B0C9EFE9900B6EB24 /* llfloaterlagmeter.cpp */; }; 1A5B3B550A70147000A90391 /* llfloaterbump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5B3B540A70147000A90391 /* llfloaterbump.cpp */; }; 1A61A7F00A5ED446009FE3D2 /* llfloateravatarpicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A61A7EF0A5ED446009FE3D2 /* llfloateravatarpicker.cpp */; }; 1A758C920A436FCA00589675 /* llagentdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A758C910A436FCA00589675 /* llagentdata.cpp */; }; @@ -292,7 +291,6 @@ 5503BC4E05446B20003D051F /* llmenucommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AD8051F61DF00A80050 /* llmenucommands.cpp */; }; 5503BC4F05446B20003D051F /* llhudeffectpointat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52ADA051F61DF00A80050 /* llhudeffectpointat.cpp */; }; 5503BC5005446B20003D051F /* llhudeffectlookat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52ADB051F61DF00A80050 /* llhudeffectlookat.cpp */; }; - 5503BCDA05446B20003D051F /* viewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E79A760520BEC400A80050 /* viewer.cpp */; }; 5503BCDC05446B20003D051F /* llnameeditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2617306405221AB700A80050 /* llnameeditor.cpp */; }; 5503BCDD05446B20003D051F /* llnamebox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2617306805221DF400A80050 /* llnamebox.cpp */; }; 5503BCEB05446B20003D051F /* llfeaturemanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E02FE05239C9A00A80050 /* llfeaturemanager.cpp */; }; @@ -589,10 +587,124 @@ AAEAAF270A8104D8005F0707 /* llscrollingpanellist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */; }; AAF5FFD20B13F71900D28A84 /* lltexturecache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF5FFD00B13F71900D28A84 /* lltexturecache.cpp */; }; C16C08500B4AE6C7009AD67F /* llfloaterinspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */; }; + C1E4A5760CC020FC005FB0A6 /* llcrashloggermac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C1E4A5750CC020FC005FB0A6 /* llcrashloggermac.cpp */; }; + C1E4A5790CC0210F005FB0A6 /* llcrashlogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C1E4A5770CC0210F005FB0A6 /* llcrashlogger.cpp */; }; + C1E4A57B0CC02160005FB0A6 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558220A06BB5F00DE9AE5 /* lldate.cpp */; }; + C1E4A57C0CC02160005FB0A6 /* llthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9159DDD607662E7900F15AA1 /* llthread.cpp */; }; + C1E4A57D0CC02160005FB0A6 /* u64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 616C4A8F0752C3D1006C2C65 /* u64.cpp */; }; + C1E4A57E0CC02160005FB0A6 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192212F074A9B57005E1F34 /* llerror.cpp */; }; + C1E4A57F0CC02160005FB0A6 /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D309E3421500712406 /* llstreamtools.cpp */; }; + C1E4A5800CC02160005FB0A6 /* llapp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91E3336D0ABB5379004351DE /* llapp.cpp */; }; + C1E4A5810CC02160005FB0A6 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922135074A9B57005E1F34 /* llfasttimer.cpp */; }; + C1E4A5820CC02160005FB0A6 /* llfixedbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922137074A9B57005E1F34 /* llfixedbuffer.cpp */; }; + C1E4A5830CC02160005FB0A6 /* llstat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192214B074A9B57005E1F34 /* llstat.cpp */; }; + C1E4A5840CC02160005FB0A6 /* llmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192213E074A9B57005E1F34 /* llmemory.cpp */; }; + C1E4A5850CC02160005FB0A6 /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 918B123A07B19605008CD6CD /* llsd.cpp */; }; + C1E4A5860CC02160005FB0A6 /* llcommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99E43519092D6535003AE728 /* llcommon.cpp */; }; + C1E4A5870CC02160005FB0A6 /* llares.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8849626B0C7B3E8A00A777FB /* llares.cpp */; }; + C1E4A5880CC02160005FB0A6 /* llbase32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9897E80B98E2F4005C45D7 /* llbase32.cpp */; }; + C1E4A5890CC02160005FB0A6 /* llbase64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02016D0B7A85DE00D5C589 /* llbase64.cpp */; }; + C1E4A58A0CC02160005FB0A6 /* llmortician.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99E4350B092D644F003AE728 /* llmortician.cpp */; }; + C1E4A58B0CC02160005FB0A6 /* llprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922143074A9B57005E1F34 /* llprocessor.cpp */; }; + C1E4A58C0CC02160005FB0A6 /* llformat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA9C40DF0B54B4BA00DD6F44 /* llformat.cpp */; }; + C1E4A58D0CC02160005FB0A6 /* llsecondlifeurls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AE41CB08F4842F00141675 /* llsecondlifeurls.cpp */; }; + C1E4A58E0CC02160005FB0A6 /* llstringtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922151074A9B58005E1F34 /* llstringtable.cpp */; }; + C1E4A58F0CC02160005FB0A6 /* llsdutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 913ADF0D0A250C750055AB21 /* llsdutil.cpp */; }; + C1E4A5900CC02160005FB0A6 /* llstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192214F074A9B58005E1F34 /* llstring.cpp */; }; + C1E4A5910CC02160005FB0A6 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558280A06BB5F00DE9AE5 /* lluri.cpp */; }; + C1E4A5920CC02160005FB0A6 /* llevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3AF6BC80A544C71005B5E2C /* llevent.cpp */; }; + C1E4A5930CC02160005FB0A6 /* llapr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 915862D8075D2CE400F6A924 /* llapr.cpp */; }; + C1E4A5940CC02160005FB0A6 /* llworkerthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99321B12081DD26000678159 /* llworkerthread.cpp */; }; + C1E4A5960CC02160005FB0A6 /* llerrorthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B2863B00ABF637200A05D7C /* llerrorthread.cpp */; }; + C1E4A5970CC02160005FB0A6 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558260A06BB5F00DE9AE5 /* llsdserialize.cpp */; }; + C1E4A5980CC02160005FB0A6 /* llrun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91E333730ABB79AC004351DE /* llrun.cpp */; }; + C1E4A59A0CC02160005FB0A6 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922139074A9B57005E1F34 /* llframetimer.cpp */; }; + C1E4A59B0CC02160005FB0A6 /* llmemorystream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A3E09C75B3A00AA1849 /* llmemorystream.cpp */; }; + C1E4A59C0CC02160005FB0A6 /* metaproperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6E0A37203E006E8A2D /* metaproperty.cpp */; }; + C1E4A59D0CC02160005FB0A6 /* llfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0633E5D009E341F500712406 /* llfile.cpp */; }; + C1E4A59E0CC02160005FB0A6 /* llcriticaldamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922127074A9B57005E1F34 /* llcriticaldamp.cpp */; }; + C1E4A59F0CC02160005FB0A6 /* llsdserialize_xml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558240A06BB5F00DE9AE5 /* llsdserialize_xml.cpp */; }; + C1E4A5A00CC02160005FB0A6 /* metaclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C6B0A37203E006E8A2D /* metaclass.cpp */; }; + C1E4A5A10CC02160005FB0A6 /* reflective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDA39C710A37203E006E8A2D /* reflective.cpp */; }; + C1E4A5A20CC02160005FB0A6 /* llsys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922153074A9B58005E1F34 /* llsys.cpp */; }; + C1E4A5A30CC02160005FB0A6 /* llassettype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99E4326B092D5996003AE728 /* llassettype.cpp */; }; + C1E4A5A40CC02160005FB0A6 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 616C4A8E0752C3D1006C2C65 /* lltimer.cpp */; }; + C1E4A5A50CC02160005FB0A6 /* timing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922161074A9B58005E1F34 /* timing.cpp */; }; + C1E4A5A60CC02160005FB0A6 /* llliveappconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A97C4540B8BCF9C00331A24 /* llliveappconfig.cpp */; }; + C1E4A5A70CC0216F005FB0A6 /* llnullcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221DF074A9B59005E1F34 /* llnullcipher.cpp */; }; + C1E4A5A80CC0216F005FB0A6 /* llurlrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B39350F0AD6F9F400F57245 /* llurlrequest.cpp */; }; + C1E4A5AA0CC0216F005FB0A6 /* lltransfersourceasset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221F0074A9B59005E1F34 /* lltransfersourceasset.cpp */; }; + C1E4A5AB0CC0216F005FB0A6 /* llhost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221D3074A9B59005E1F34 /* llhost.cpp */; }; + C1E4A5AC0CC0216F005FB0A6 /* llmessageconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9C659A850BAB0B6E00D2EB60 /* llmessageconfig.cpp */; }; + C1E4A5AD0CC0216F005FB0A6 /* partsyspacket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922211074A9B59005E1F34 /* partsyspacket.cpp */; }; + C1E4A5AE0CC0216F005FB0A6 /* lltemplatemessagebuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D0FA690B4BF897003323BA /* lltemplatemessagebuilder.cpp */; }; + C1E4A5AF0CC0216F005FB0A6 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922208074A9B59005E1F34 /* message.cpp */; }; + C1E4A5B00CC0216F005FB0A6 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A3A09C75B0500AA1849 /* llbufferstream.cpp */; }; + C1E4A5B10CC0216F005FB0A6 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB54F40AFBC5060033B433 /* llhttpnode.cpp */; }; + C1E4A5B20CC0216F005FB0A6 /* lltransfersourcefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221F2074A9B59005E1F34 /* lltransfersourcefile.cpp */; }; + C1E4A5B30CC0216F005FB0A6 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD835B800AD1CB6700038B74 /* llchainio.cpp */; }; + C1E4A5B40CC0216F005FB0A6 /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B39350B0AD6F96900F57245 /* llhttpclient.cpp */; }; + C1E4A5B50CC0216F005FB0A6 /* llxfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221FB074A9B59005E1F34 /* llxfer.cpp */; }; + C1E4A5B60CC0216F005FB0A6 /* network.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192220F074A9B59005E1F34 /* network.cpp */; }; + C1E4A5B70CC0216F005FB0A6 /* llpacketring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221E3074A9B59005E1F34 /* llpacketring.cpp */; }; + C1E4A5B80CC0216F005FB0A6 /* llxfer_vfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922201074A9B59005E1F34 /* llxfer_vfile.cpp */; }; + C1E4A5B90CC0216F005FB0A6 /* llsdmessagereader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA4B14190B978815003F64DE /* llsdmessagereader.cpp */; }; + C1E4A5BA0CC0216F005FB0A6 /* llxfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922203074A9B59005E1F34 /* llxfermanager.cpp */; }; + C1E4A5BB0CC0216F005FB0A6 /* llmessagethrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8E07B3E383001A39E3 /* llmessagethrottle.cpp */; }; + C1E4A5BC0CC0216F005FB0A6 /* llsdmessagebuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA4B14170B978815003F64DE /* llsdmessagebuilder.cpp */; }; + C1E4A5BD0CC0216F005FB0A6 /* message_string_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192220C074A9B59005E1F34 /* message_string_table.cpp */; }; + C1E4A5BE0CC0216F005FB0A6 /* message_prehash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192220A074A9B59005E1F34 /* message_prehash.cpp */; }; + C1E4A5BF0CC0216F005FB0A6 /* llmessagetemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D0FA6A0B4BF898003323BA /* llmessagetemplate.cpp */; }; + C1E4A5C00CC0216F005FB0A6 /* llxfer_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221FD074A9B59005E1F34 /* llxfer_file.cpp */; }; + C1E4A5C10CC0216F005FB0A6 /* llmime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E790B4486C10009E8F9 /* llmime.cpp */; }; + C1E4A5C20CC0216F005FB0A6 /* llmessagereader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3834D6010B73ABC1002B61C8 /* llmessagereader.cpp */; }; + C1E4A5C30CC0216F005FB0A6 /* patch_idct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922217074A9B59005E1F34 /* patch_idct.cpp */; }; + C1E4A5C40CC0216F005FB0A6 /* lliosocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99374E460B5C603E008DB4BE /* lliosocket.cpp */; }; + C1E4A5C50CC0216F005FB0A6 /* llcachename.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221BB074A9B59005E1F34 /* llcachename.cpp */; }; + C1E4A5C60CC0216F005FB0A6 /* llblowfishcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02017E0B7A861200D5C589 /* llblowfishcipher.cpp */; }; + C1E4A5C70CC0216F005FB0A6 /* llpacketbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221E1074A9B59005E1F34 /* llpacketbuffer.cpp */; }; + C1E4A5C80CC0216F005FB0A6 /* llmessagetemplateparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9CC280FE0BE79737006D8BDC /* llmessagetemplateparser.cpp */; }; + C1E4A5C90CC0216F005FB0A6 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A3809C75B0500AA1849 /* llbuffer.cpp */; }; + C1E4A5CA0CC0216F005FB0A6 /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA348DF80B0EAB31002C3015 /* llcurl.cpp */; }; + C1E4A5CB0CC0216F005FB0A6 /* llxorcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922205074A9B59005E1F34 /* llxorcipher.cpp */; }; + C1E4A5CC0CC0216F005FB0A6 /* llnamevalue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221DD074A9B59005E1F34 /* llnamevalue.cpp */; }; + C1E4A5CD0CC0216F005FB0A6 /* lliobuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9190430E08327117002396D4 /* lliobuffer.cpp */; }; + C1E4A5CE0CC0216F005FB0A6 /* llpartdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221E5074A9B59005E1F34 /* llpartdata.cpp */; }; + C1E4A5CF0CC0216F005FB0A6 /* llfiltersd2xmlrpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9190430C08327117002396D4 /* llfiltersd2xmlrpc.cpp */; }; + C1E4A5D00CC0216F005FB0A6 /* net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192220D074A9B59005E1F34 /* net.cpp */; }; + C1E4A5D10CC0216F005FB0A6 /* llxfer_mem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221FF074A9B59005E1F34 /* llxfer_mem.cpp */; }; + C1E4A5D20CC0216F005FB0A6 /* llthrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221EC074A9B59005E1F34 /* llthrottle.cpp */; }; + C1E4A5D30CC0216F005FB0A6 /* lllogtextmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A241CB8C07B3E383001A39E3 /* lllogtextmessage.cpp */; }; + C1E4A5D40CC0216F005FB0A6 /* llinstantmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AE41CF08F4845400141675 /* llinstantmessage.cpp */; }; + C1E4A5D50CC0216F005FB0A6 /* llmessagebuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D0FA6B0B4BF898003323BA /* llmessagebuilder.cpp */; }; + C1E4A5D60CC0216F005FB0A6 /* lldatapacker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221C5074A9B59005E1F34 /* lldatapacker.cpp */; }; + C1E4A5D70CC0216F005FB0A6 /* patch_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922213074A9B59005E1F34 /* patch_code.cpp */; }; + C1E4A5D80CC0216F005FB0A6 /* llservice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9190431408327117002396D4 /* llservice.cpp */; }; + C1E4A5D90CC0216F005FB0A6 /* llclassifiedflags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99FBB071087365E90048A5CC /* llclassifiedflags.cpp */; }; + C1E4A5DA0CC0216F005FB0A6 /* patch_dct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922215074A9B59005E1F34 /* patch_dct.cpp */; }; + C1E4A5DB0CC0216F005FB0A6 /* lltransfertargetvfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221F6074A9B59005E1F34 /* lltransfertargetvfile.cpp */; }; + C1E4A5DC0CC0216F005FB0A6 /* lltemplatemessagereader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3834D6030B73ABC1002B61C8 /* lltemplatemessagereader.cpp */; }; + C1E4A5DD0CC0216F005FB0A6 /* llassetstorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221B9074A9B59005E1F34 /* llassetstorage.cpp */; }; + C1E4A5DE0CC0216F005FB0A6 /* lldispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221D0074A9B59005E1F34 /* lldispatcher.cpp */; }; + C1E4A5DF0CC0216F005FB0A6 /* llpacketack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9117EAA10BF24A6100845BD2 /* llpacketack.cpp */; }; + C1E4A5E00CC0216F005FB0A6 /* llcircuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221BE074A9B59005E1F34 /* llcircuit.cpp */; }; + C1E4A5E10CC0216F005FB0A6 /* llhttpsender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA4B14140B978815003F64DE /* llhttpsender.cpp */; }; + C1E4A5E20CC0216F005FB0A6 /* llpumpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9190431208327117002396D4 /* llpumpio.cpp */; }; + C1E4A5E30CC0216F005FB0A6 /* lltransfertargetfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221F4074A9B59005E1F34 /* lltransfertargetfile.cpp */; }; + C1E4A5E40CC0216F005FB0A6 /* lluseroperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221F8074A9B59005E1F34 /* lluseroperation.cpp */; }; + C1E4A5E50CC0216F005FB0A6 /* lliopipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9190431008327117002396D4 /* lliopipe.cpp */; }; + C1E4A5E60CC0216F005FB0A6 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD6C9A4609C75BCD00AA1849 /* llioutil.cpp */; }; + C1E4A5E70CC0216F005FB0A6 /* lltransfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 619221EE074A9B59005E1F34 /* lltransfermanager.cpp */; }; + C1E4A5F70CC0226A005FB0A6 /* llxmltree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6192227B074A9B5A005E1F34 /* llxmltree.cpp */; }; + C1E4A5F80CC0226A005FB0A6 /* llxmlnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBAAFE160858EBA400B9269A /* llxmlnode.cpp */; }; + C1E4A5F90CC0226A005FB0A6 /* llcontrol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0E2A5F0A2FDAEE0066250A /* llcontrol.cpp */; }; + C1E4A5FA0CC0226A005FB0A6 /* llxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61922279074A9B5A005E1F34 /* llxmlparser.cpp */; }; + C1E4A5FE0CC02365005FB0A6 /* libxmlrpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8765809BEA39700AF6316 /* libxmlrpc.a */; }; C1F5D0A50B138AEB00827F1D /* lluserrelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */; }; C64F673F0AFBED80009732B5 /* lllogchat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F673D0AFBED80009732B5 /* lllogchat.cpp */; }; C64F67420AFBED91009732B5 /* lldirpicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64F67400AFBED91009732B5 /* lldirpicker.cpp */; }; D23289B50C453A3600304FEF /* llfloaterreleasemsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D23289B30C453A3600304FEF /* llfloaterreleasemsg.cpp */; }; + D2768CE50CEA38940000BD66 /* llfloaterlagmeter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D2768CE30CEA38940000BD66 /* llfloaterlagmeter.cpp */; }; D62830DB0B4DC76300F8830F /* llimagej2coj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D62830D80B4DC76300F8830F /* llimagej2coj.cpp */; }; D645940C0B3B6D9000FAB68F /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDE8764E09BEA39600AF6316 /* libapr-1.a */; }; D645940D0B3B6D9A00FAB68F /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD6C9A5209C773A000AA1849 /* libaprutil-1.a */; }; @@ -715,6 +827,10 @@ FE51387B0CD80BAE00F32EE3 /* llfloaterclassified.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5138730CD80BAE00F32EE3 /* llfloaterclassified.cpp */; }; FE51387C0CD80BAE00F32EE3 /* llfloaterevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5138750CD80BAE00F32EE3 /* llfloaterevent.cpp */; }; FE51387D0CD80BAE00F32EE3 /* llfloaterparcel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5138770CD80BAE00F32EE3 /* llfloaterparcel.cpp */; }; + FE679A3D0CDFF5AC00959041 /* llappviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE679A350CDFF5AC00959041 /* llappviewer.cpp */; }; + FE679A3E0CDFF5AC00959041 /* llappviewermacosx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE679A370CDFF5AC00959041 /* llappviewermacosx.cpp */; }; + FE679A3F0CDFF5AC00959041 /* llvectorperfoptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE679A390CDFF5AC00959041 /* llvectorperfoptions.cpp */; }; + FE679A400CDFF5AC00959041 /* llvieweraudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE679A3B0CDFF5AC00959041 /* llvieweraudio.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ @@ -874,8 +990,6 @@ 1A5104580ABF60BF00520F6D /* llviewerassetstorage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llviewerassetstorage.h; sourceTree = ""; }; 1A57B92C09F8303A004D8B1A /* lllslconstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lllslconstants.h; sourceTree = ""; }; 1A57B92D09F8303A004D8B1A /* llagentconstants.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagentconstants.h; sourceTree = ""; }; - 1A57CD2B0C9EFE9900B6EB24 /* llfloaterlagmeter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterlagmeter.cpp; sourceTree = ""; }; - 1A57CD2D0C9EFEA400B6EB24 /* llfloaterlagmeter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterlagmeter.h; sourceTree = ""; }; 1A5B3B530A70146900A90391 /* llfloaterbump.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterbump.h; sourceTree = ""; }; 1A5B3B540A70147000A90391 /* llfloaterbump.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterbump.cpp; sourceTree = ""; }; 1A61A7EF0A5ED446009FE3D2 /* llfloateravatarpicker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloateravatarpicker.cpp; sourceTree = ""; }; @@ -909,7 +1023,6 @@ 1A9897E80B98E2F4005C45D7 /* llbase32.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbase32.cpp; sourceTree = ""; }; 1A9EC236083EA0100023D510 /* llfloatereditui.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatereditui.cpp; sourceTree = ""; }; 1A9EC23A083EA01F0023D510 /* llfloatereditui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloatereditui.h; sourceTree = ""; }; - 1AB0DADC0A52E8A0001CACEB /* message_template.msg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = message_template.msg; path = ../../scripts/messages/message_template.msg; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.simpleColoring; }; 1AA2EE9C0CBBE2790017E185 /* llfloaterlandmark.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterlandmark.h; sourceTree = ""; }; 1AA2EE9D0CBBE2790017E185 /* llfloaterlandmark.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterlandmark.cpp; sourceTree = ""; }; 1AA2EE9F0CBBE28C0017E185 /* llclassifiedstatsresponder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llclassifiedstatsresponder.h; sourceTree = ""; }; @@ -918,6 +1031,7 @@ 1AA2EEA30CBBE2BF0017E185 /* llfloaterurldisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterurldisplay.cpp; sourceTree = ""; }; 1AA2EEA50CBBE2D40017E185 /* llremoteparcelrequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llremoteparcelrequest.h; sourceTree = ""; }; 1AA2EEA60CBBE2D40017E185 /* llremoteparcelrequest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llremoteparcelrequest.cpp; sourceTree = ""; }; + 1AB0DADC0A52E8A0001CACEB /* message_template.msg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = message_template.msg; path = ../../scripts/messages/message_template.msg; sourceTree = SOURCE_ROOT; }; 1AD3940C0CAB0003004BA76A /* llurlsimstring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurlsimstring.h; sourceTree = ""; }; 1AD3940D0CAB0003004BA76A /* llurldispatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurldispatcher.h; sourceTree = ""; }; 1AD3940E0CAB000F004BA76A /* llurlsimstring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurlsimstring.cpp; sourceTree = ""; }; @@ -949,7 +1063,6 @@ 26C5F3E605DB1E3C00994065 /* llfloaterpostcard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterpostcard.cpp; sourceTree = ""; }; 26E79A3D0520B56600A80050 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 26E79A630520BC6D00A80050 /* libSystem.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libSystem.dylib; path = /usr/lib/libSystem.B.dylib; sourceTree = ""; }; - 26E79A760520BEC400A80050 /* viewer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = viewer.cpp; sourceTree = SOURCE_ROOT; }; 26E79A7A0520ED1200A80050 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 26F529A1051F61DF00A80050 /* llgenepool.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llgenepool.cpp; sourceTree = SOURCE_ROOT; }; 26F529A2051F61DF00A80050 /* llviewercamera.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewercamera.cpp; sourceTree = SOURCE_ROOT; }; @@ -1665,7 +1778,6 @@ 996209680B864D0E00392531 /* SLVoiceAgent.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = SLVoiceAgent.app; path = "vivox-runtime/universal-darwin/SLVoiceAgent.app"; sourceTree = SOURCE_ROOT; }; 9967E9090B37533F0087BD1B /* libfmodwrapper.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libfmodwrapper.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 9967E9520B37564D0087BD1B /* fmodwrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fmodwrapper.cpp; sourceTree = ""; }; - 997B4BD006015820001B0407 /* viewer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = viewer.h; sourceTree = SOURCE_ROOT; }; 997B4BD106015820001B0407 /* VertexCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VertexCache.h; sourceTree = SOURCE_ROOT; }; 997B4BD406015820001B0407 /* randgauss.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = randgauss.h; sourceTree = SOURCE_ROOT; }; 997B4BD506015820001B0407 /* pipeline.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pipeline.h; sourceTree = SOURCE_ROOT; }; @@ -1898,12 +2010,10 @@ 997B4D1306015823001B0407 /* llcallbacklist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcallbacklist.h; sourceTree = SOURCE_ROOT; }; 997B4D1606015823001B0407 /* llbox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbox.h; sourceTree = SOURCE_ROOT; }; 997B4D1806015823001B0407 /* llbbox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbbox.h; sourceTree = SOURCE_ROOT; }; - 997B4D1C06015823001B0407 /* llaudiostatus.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llaudiostatus.h; sourceTree = SOURCE_ROOT; }; 997B4D1E06015823001B0407 /* llappearance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llappearance.h; sourceTree = SOURCE_ROOT; }; 997B4D2206015823001B0407 /* llagentpilot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagentpilot.h; sourceTree = SOURCE_ROOT; }; 997B4D2306015823001B0407 /* llagent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llagent.h; sourceTree = SOURCE_ROOT; }; 997B4D2406015823001B0407 /* head.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = head.h; sourceTree = SOURCE_ROOT; }; - 997B4D2506015823001B0407 /* llasynchostbyname.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llasynchostbyname.h; sourceTree = SOURCE_ROOT; }; 9985A08E0AC1FE3600579AFB /* llwindowmacosx-objc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "llwindowmacosx-objc.h"; sourceTree = ""; }; 9985A08F0AC1FE3600579AFB /* llwindowmacosx-objc.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = "llwindowmacosx-objc.mm"; sourceTree = ""; }; 9985A1270AC1FE4E00579AFB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../../../../../System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; @@ -2032,6 +2142,10 @@ ABD8702D0B3C68630007C63B /* llvoavatar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvoavatar.h; sourceTree = ""; }; C16C084E0B4AE6C7009AD67F /* llfloaterinspect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterinspect.cpp; sourceTree = ""; }; C16C084F0B4AE6C7009AD67F /* llfloaterinspect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterinspect.h; sourceTree = ""; }; + C1B2AF890CD679EB004CD4EF /* llcrashloggermac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcrashloggermac.h; sourceTree = ""; }; + C1E4A5750CC020FC005FB0A6 /* llcrashloggermac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcrashloggermac.cpp; sourceTree = ""; }; + C1E4A5770CC0210F005FB0A6 /* llcrashlogger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = llcrashlogger.cpp; path = ../llcrashlogger/llcrashlogger.cpp; sourceTree = SOURCE_ROOT; }; + C1E4A5780CC0210F005FB0A6 /* llcrashlogger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = llcrashlogger.h; path = ../llcrashlogger/llcrashlogger.h; sourceTree = SOURCE_ROOT; }; C1F5D0A30B138AEB00827F1D /* lluserrelations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluserrelations.cpp; sourceTree = ""; }; C1F5D0A40B138AEB00827F1D /* lluserrelations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluserrelations.h; sourceTree = ""; }; C64F673D0AFBED80009732B5 /* lllogchat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lllogchat.cpp; sourceTree = ""; }; @@ -2041,6 +2155,8 @@ CB162DB40C6CCCFE00BF83BB /* llextendedstatus.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llextendedstatus.h; sourceTree = ""; }; D23289B30C453A3600304FEF /* llfloaterreleasemsg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterreleasemsg.cpp; sourceTree = ""; }; D23289B40C453A3600304FEF /* llfloaterreleasemsg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterreleasemsg.h; sourceTree = ""; }; + D2768CE30CEA38940000BD66 /* llfloaterlagmeter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterlagmeter.cpp; sourceTree = ""; }; + D2768CE40CEA38940000BD66 /* llfloaterlagmeter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llfloaterlagmeter.h; sourceTree = ""; }; D62830D80B4DC76300F8830F /* llimagej2coj.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llimagej2coj.cpp; sourceTree = ""; }; D62830D90B4DC76300F8830F /* llimagej2coj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llimagej2coj.h; sourceTree = ""; }; D628315B0B4F3FA100F8830F /* llfont.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfont.cpp; sourceTree = ""; }; @@ -2234,6 +2350,14 @@ FE5138760CD80BAE00F32EE3 /* llfloaterevent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterevent.h; sourceTree = ""; }; FE5138770CD80BAE00F32EE3 /* llfloaterparcel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterparcel.cpp; sourceTree = ""; }; FE5138780CD80BAE00F32EE3 /* llfloaterparcel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterparcel.h; sourceTree = ""; }; + FE679A350CDFF5AC00959041 /* llappviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llappviewer.cpp; sourceTree = ""; }; + FE679A360CDFF5AC00959041 /* llappviewer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llappviewer.h; sourceTree = ""; }; + FE679A370CDFF5AC00959041 /* llappviewermacosx.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llappviewermacosx.cpp; sourceTree = ""; }; + FE679A380CDFF5AC00959041 /* llappviewermacosx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llappviewermacosx.h; sourceTree = ""; }; + FE679A390CDFF5AC00959041 /* llvectorperfoptions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvectorperfoptions.cpp; sourceTree = ""; }; + FE679A3A0CDFF5AC00959041 /* llvectorperfoptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvectorperfoptions.h; sourceTree = ""; }; + FE679A3B0CDFF5AC00959041 /* llvieweraudio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvieweraudio.cpp; sourceTree = ""; }; + FE679A3C0CDFF5AC00959041 /* llvieweraudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvieweraudio.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2278,6 +2402,7 @@ buildActionMask = 2147483647; files = ( 61923C89074ACA70005E1F34 /* libllcommon.a in Frameworks */, + C1E4A5FE0CC02365005FB0A6 /* libxmlrpc.a in Frameworks */, FDE8765A09BEA3BC00AF6316 /* libapr-1.a in Frameworks */, FDAA36AA09B916BD00FBF1CA /* Carbon.framework in Frameworks */, FDAA36B909B919AD00FBF1CA /* libssl.dylib in Frameworks */, @@ -2419,6 +2544,16 @@ 26F529A0051F61CD00A80050 /* newview */ = { isa = PBXGroup; children = ( + D2768CE30CEA38940000BD66 /* llfloaterlagmeter.cpp */, + D2768CE40CEA38940000BD66 /* llfloaterlagmeter.h */, + FE679A350CDFF5AC00959041 /* llappviewer.cpp */, + FE679A360CDFF5AC00959041 /* llappviewer.h */, + FE679A370CDFF5AC00959041 /* llappviewermacosx.cpp */, + FE679A380CDFF5AC00959041 /* llappviewermacosx.h */, + FE679A390CDFF5AC00959041 /* llvectorperfoptions.cpp */, + FE679A3A0CDFF5AC00959041 /* llvectorperfoptions.h */, + FE679A3B0CDFF5AC00959041 /* llvieweraudio.cpp */, + FE679A3C0CDFF5AC00959041 /* llvieweraudio.h */, FE51386F0CD80BAE00F32EE3 /* llclassifiedinfo.h */, FE5138700CD80BAE00F32EE3 /* lldebugmessagebox.cpp */, FE5138710CD80BAE00F32EE3 /* lldebugmessagebox.h */, @@ -2439,7 +2574,6 @@ 1AD394120CAB001B004BA76A /* llcommandhandler.cpp */, 1AD3940E0CAB000F004BA76A /* llurlsimstring.cpp */, 1AD3940F0CAB000F004BA76A /* llurldispatcher.cpp */, - 1A57CD2B0C9EFE9900B6EB24 /* llfloaterlagmeter.cpp */, 79256EA10C57D6A4000AAFA4 /* llfloatervoicewizard.cpp */, 79256EA20C57D6A4000AAFA4 /* llfloatervoicewizard.h */, AA11834E0C1DF9C400FDE5BA /* llpanelaudiovolume.cpp */, @@ -2839,7 +2973,6 @@ 26F529BE051F61DF00A80050 /* moviemaker.cpp */, 26F529BD051F61DF00A80050 /* noise.cpp */, 26F529BA051F61DF00A80050 /* pipeline.cpp */, - 26E79A760520BEC400A80050 /* viewer.cpp */, D8CA570D0BAF74FC0093D6D4 /* llvoicevisualizer.h */, D8CA570E0BAF74FC0093D6D4 /* llvoicevisualizer.cpp */, ); @@ -3479,6 +3612,10 @@ 61923C96074AD8B7005E1F34 /* mac_crash_logger */ = { isa = PBXGroup; children = ( + C1B2AF890CD679EB004CD4EF /* llcrashloggermac.h */, + C1E4A5770CC0210F005FB0A6 /* llcrashlogger.cpp */, + C1E4A5780CC0210F005FB0A6 /* llcrashlogger.h */, + C1E4A5750CC020FC005FB0A6 /* llcrashloggermac.cpp */, 61923C97074AD8B7005E1F34 /* mac_crash_logger.cpp */, ); name = mac_crash_logger; @@ -3636,15 +3773,12 @@ 1AD394140CAB0023004BA76A /* llcommandhandler.h */, 1AD3940C0CAB0003004BA76A /* llurlsimstring.h */, 1AD3940D0CAB0003004BA76A /* llurldispatcher.h */, - 1A57CD2D0C9EFEA400B6EB24 /* llfloaterlagmeter.h */, 997B4CF006015822001B0407 /* audiosettings.h */, 997B4D2406015823001B0407 /* head.h */, 997B4D2306015823001B0407 /* llagent.h */, 1A758C990A43700400589675 /* llagentdata.h */, 997B4D2206015823001B0407 /* llagentpilot.h */, 997B4D1E06015823001B0407 /* llappearance.h */, - 997B4D2506015823001B0407 /* llasynchostbyname.h */, - 997B4D1C06015823001B0407 /* llaudiostatus.h */, 997B4D1806015823001B0407 /* llbbox.h */, 997B4D1606015823001B0407 /* llbox.h */, 997B4D1306015823001B0407 /* llcallbacklist.h */, @@ -3919,7 +4053,6 @@ 997B4BD506015820001B0407 /* pipeline.h */, 997B4BD406015820001B0407 /* randgauss.h */, 997B4BD106015820001B0407 /* VertexCache.h */, - 997B4BD006015820001B0407 /* viewer.h */, ); name = "newview headers"; sourceTree = ""; @@ -4129,6 +4262,7 @@ 20286C28FDCF999611CA2CEA /* Project object */ = { isa = PBXProject; buildConfigurationList = 999484580883114300EFC621 /* Build configuration list for PBXProject "macview" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; knownRegions = ( English, @@ -4139,6 +4273,7 @@ ); mainGroup = 20286C29FDCF999611CA2CEA /* ¬´PROJECTNAME» */; projectDirPath = ""; + projectRoot = ""; targets = ( FD53B40509BDF9F600BFE3BC /* third party libs */, 99CDED4905E70BAB0000F8AA /* llcommon */, @@ -4437,7 +4572,6 @@ 5503BC4E05446B20003D051F /* llmenucommands.cpp in Sources */, 5503BC4F05446B20003D051F /* llhudeffectpointat.cpp in Sources */, 5503BC5005446B20003D051F /* llhudeffectlookat.cpp in Sources */, - 5503BCDA05446B20003D051F /* viewer.cpp in Sources */, 5503BCDC05446B20003D051F /* llnameeditor.cpp in Sources */, 5503BCDD05446B20003D051F /* llnamebox.cpp in Sources */, 5503BCEB05446B20003D051F /* llfeaturemanager.cpp in Sources */, @@ -4684,7 +4818,6 @@ 79256EA30C57D6A5000AAFA4 /* llfloatervoicewizard.cpp in Sources */, D23289B50C453A3600304FEF /* llfloaterreleasemsg.cpp in Sources */, 8849626C0C7B3E8A00A777FB /* llares.cpp in Sources */, - 1A57CD2C0C9EFE9900B6EB24 /* llfloaterlagmeter.cpp in Sources */, 1AD394100CAB000F004BA76A /* llurlsimstring.cpp in Sources */, 1AD394110CAB000F004BA76A /* llurldispatcher.cpp in Sources */, 1AD394130CAB001B004BA76A /* llcommandhandler.cpp in Sources */, @@ -4696,6 +4829,11 @@ FE51387B0CD80BAE00F32EE3 /* llfloaterclassified.cpp in Sources */, FE51387C0CD80BAE00F32EE3 /* llfloaterevent.cpp in Sources */, FE51387D0CD80BAE00F32EE3 /* llfloaterparcel.cpp in Sources */, + FE679A3D0CDFF5AC00959041 /* llappviewer.cpp in Sources */, + FE679A3E0CDFF5AC00959041 /* llappviewermacosx.cpp in Sources */, + FE679A3F0CDFF5AC00959041 /* llvectorperfoptions.cpp in Sources */, + FE679A400CDFF5AC00959041 /* llvieweraudio.cpp in Sources */, + D2768CE50CEA38940000BD66 /* llfloaterlagmeter.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4703,7 +4841,119 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + C1E4A5F70CC0226A005FB0A6 /* llxmltree.cpp in Sources */, + C1E4A5F80CC0226A005FB0A6 /* llxmlnode.cpp in Sources */, + C1E4A5F90CC0226A005FB0A6 /* llcontrol.cpp in Sources */, + C1E4A5FA0CC0226A005FB0A6 /* llxmlparser.cpp in Sources */, + C1E4A57B0CC02160005FB0A6 /* lldate.cpp in Sources */, + C1E4A57C0CC02160005FB0A6 /* llthread.cpp in Sources */, + C1E4A57D0CC02160005FB0A6 /* u64.cpp in Sources */, + C1E4A57E0CC02160005FB0A6 /* llerror.cpp in Sources */, + C1E4A57F0CC02160005FB0A6 /* llstreamtools.cpp in Sources */, + C1E4A5800CC02160005FB0A6 /* llapp.cpp in Sources */, + C1E4A5810CC02160005FB0A6 /* llfasttimer.cpp in Sources */, + C1E4A5820CC02160005FB0A6 /* llfixedbuffer.cpp in Sources */, + C1E4A5830CC02160005FB0A6 /* llstat.cpp in Sources */, + C1E4A5840CC02160005FB0A6 /* llmemory.cpp in Sources */, + C1E4A5850CC02160005FB0A6 /* llsd.cpp in Sources */, + C1E4A5860CC02160005FB0A6 /* llcommon.cpp in Sources */, + C1E4A5870CC02160005FB0A6 /* llares.cpp in Sources */, + C1E4A5880CC02160005FB0A6 /* llbase32.cpp in Sources */, + C1E4A5890CC02160005FB0A6 /* llbase64.cpp in Sources */, + C1E4A58A0CC02160005FB0A6 /* llmortician.cpp in Sources */, + C1E4A58B0CC02160005FB0A6 /* llprocessor.cpp in Sources */, + C1E4A58C0CC02160005FB0A6 /* llformat.cpp in Sources */, + C1E4A58D0CC02160005FB0A6 /* llsecondlifeurls.cpp in Sources */, + C1E4A58E0CC02160005FB0A6 /* llstringtable.cpp in Sources */, + C1E4A58F0CC02160005FB0A6 /* llsdutil.cpp in Sources */, + C1E4A5900CC02160005FB0A6 /* llstring.cpp in Sources */, + C1E4A5910CC02160005FB0A6 /* lluri.cpp in Sources */, + C1E4A5930CC02160005FB0A6 /* llapr.cpp in Sources */, + C1E4A5940CC02160005FB0A6 /* llworkerthread.cpp in Sources */, + C1E4A5960CC02160005FB0A6 /* llerrorthread.cpp in Sources */, + C1E4A5970CC02160005FB0A6 /* llsdserialize.cpp in Sources */, + C1E4A5980CC02160005FB0A6 /* llrun.cpp in Sources */, + C1E4A59A0CC02160005FB0A6 /* llframetimer.cpp in Sources */, + C1E4A59B0CC02160005FB0A6 /* llmemorystream.cpp in Sources */, + C1E4A59C0CC02160005FB0A6 /* metaproperty.cpp in Sources */, + C1E4A59D0CC02160005FB0A6 /* llfile.cpp in Sources */, + C1E4A59E0CC02160005FB0A6 /* llcriticaldamp.cpp in Sources */, + C1E4A59F0CC02160005FB0A6 /* llsdserialize_xml.cpp in Sources */, + C1E4A5A00CC02160005FB0A6 /* metaclass.cpp in Sources */, + C1E4A5A10CC02160005FB0A6 /* reflective.cpp in Sources */, + C1E4A5A20CC02160005FB0A6 /* llsys.cpp in Sources */, + C1E4A5A30CC02160005FB0A6 /* llassettype.cpp in Sources */, + C1E4A5A40CC02160005FB0A6 /* lltimer.cpp in Sources */, + C1E4A5A50CC02160005FB0A6 /* timing.cpp in Sources */, + C1E4A5A60CC02160005FB0A6 /* llliveappconfig.cpp in Sources */, + C1E4A5A70CC0216F005FB0A6 /* llnullcipher.cpp in Sources */, + C1E4A5A80CC0216F005FB0A6 /* llurlrequest.cpp in Sources */, + C1E4A5AA0CC0216F005FB0A6 /* lltransfersourceasset.cpp in Sources */, + C1E4A5AB0CC0216F005FB0A6 /* llhost.cpp in Sources */, + C1E4A5AC0CC0216F005FB0A6 /* llmessageconfig.cpp in Sources */, + C1E4A5AD0CC0216F005FB0A6 /* partsyspacket.cpp in Sources */, + C1E4A5AE0CC0216F005FB0A6 /* lltemplatemessagebuilder.cpp in Sources */, + C1E4A5AF0CC0216F005FB0A6 /* message.cpp in Sources */, + C1E4A5B00CC0216F005FB0A6 /* llbufferstream.cpp in Sources */, + C1E4A5B10CC0216F005FB0A6 /* llhttpnode.cpp in Sources */, + C1E4A5B20CC0216F005FB0A6 /* lltransfersourcefile.cpp in Sources */, + C1E4A5B30CC0216F005FB0A6 /* llchainio.cpp in Sources */, + C1E4A5B40CC0216F005FB0A6 /* llhttpclient.cpp in Sources */, + C1E4A5B50CC0216F005FB0A6 /* llxfer.cpp in Sources */, + C1E4A5B60CC0216F005FB0A6 /* network.cpp in Sources */, + C1E4A5B70CC0216F005FB0A6 /* llpacketring.cpp in Sources */, + C1E4A5B80CC0216F005FB0A6 /* llxfer_vfile.cpp in Sources */, + C1E4A5B90CC0216F005FB0A6 /* llsdmessagereader.cpp in Sources */, + C1E4A5BA0CC0216F005FB0A6 /* llxfermanager.cpp in Sources */, + C1E4A5BB0CC0216F005FB0A6 /* llmessagethrottle.cpp in Sources */, + C1E4A5BC0CC0216F005FB0A6 /* llsdmessagebuilder.cpp in Sources */, + C1E4A5BD0CC0216F005FB0A6 /* message_string_table.cpp in Sources */, + C1E4A5BE0CC0216F005FB0A6 /* message_prehash.cpp in Sources */, + C1E4A5BF0CC0216F005FB0A6 /* llmessagetemplate.cpp in Sources */, + C1E4A5C00CC0216F005FB0A6 /* llxfer_file.cpp in Sources */, + C1E4A5C10CC0216F005FB0A6 /* llmime.cpp in Sources */, + C1E4A5C20CC0216F005FB0A6 /* llmessagereader.cpp in Sources */, + C1E4A5C30CC0216F005FB0A6 /* patch_idct.cpp in Sources */, + C1E4A5C40CC0216F005FB0A6 /* lliosocket.cpp in Sources */, + C1E4A5C50CC0216F005FB0A6 /* llcachename.cpp in Sources */, + C1E4A5C60CC0216F005FB0A6 /* llblowfishcipher.cpp in Sources */, + C1E4A5C70CC0216F005FB0A6 /* llpacketbuffer.cpp in Sources */, + C1E4A5C80CC0216F005FB0A6 /* llmessagetemplateparser.cpp in Sources */, + C1E4A5C90CC0216F005FB0A6 /* llbuffer.cpp in Sources */, + C1E4A5CA0CC0216F005FB0A6 /* llcurl.cpp in Sources */, + C1E4A5CB0CC0216F005FB0A6 /* llxorcipher.cpp in Sources */, + C1E4A5CC0CC0216F005FB0A6 /* llnamevalue.cpp in Sources */, + C1E4A5CD0CC0216F005FB0A6 /* lliobuffer.cpp in Sources */, + C1E4A5CE0CC0216F005FB0A6 /* llpartdata.cpp in Sources */, + C1E4A5CF0CC0216F005FB0A6 /* llfiltersd2xmlrpc.cpp in Sources */, + C1E4A5D00CC0216F005FB0A6 /* net.cpp in Sources */, + C1E4A5D10CC0216F005FB0A6 /* llxfer_mem.cpp in Sources */, + C1E4A5D20CC0216F005FB0A6 /* llthrottle.cpp in Sources */, + C1E4A5D30CC0216F005FB0A6 /* lllogtextmessage.cpp in Sources */, + C1E4A5920CC02160005FB0A6 /* llevent.cpp in Sources */, + C1E4A5D40CC0216F005FB0A6 /* llinstantmessage.cpp in Sources */, + C1E4A5D50CC0216F005FB0A6 /* llmessagebuilder.cpp in Sources */, + C1E4A5D60CC0216F005FB0A6 /* lldatapacker.cpp in Sources */, + C1E4A5D70CC0216F005FB0A6 /* patch_code.cpp in Sources */, + C1E4A5D80CC0216F005FB0A6 /* llservice.cpp in Sources */, + C1E4A5D90CC0216F005FB0A6 /* llclassifiedflags.cpp in Sources */, + C1E4A5DA0CC0216F005FB0A6 /* patch_dct.cpp in Sources */, + C1E4A5DB0CC0216F005FB0A6 /* lltransfertargetvfile.cpp in Sources */, + C1E4A5DC0CC0216F005FB0A6 /* lltemplatemessagereader.cpp in Sources */, + C1E4A5DD0CC0216F005FB0A6 /* llassetstorage.cpp in Sources */, + C1E4A5DE0CC0216F005FB0A6 /* lldispatcher.cpp in Sources */, + C1E4A5DF0CC0216F005FB0A6 /* llpacketack.cpp in Sources */, + C1E4A5E00CC0216F005FB0A6 /* llcircuit.cpp in Sources */, + C1E4A5E10CC0216F005FB0A6 /* llhttpsender.cpp in Sources */, + C1E4A5E20CC0216F005FB0A6 /* llpumpio.cpp in Sources */, + C1E4A5E30CC0216F005FB0A6 /* lltransfertargetfile.cpp in Sources */, + C1E4A5E40CC0216F005FB0A6 /* lluseroperation.cpp in Sources */, + C1E4A5E50CC0216F005FB0A6 /* lliopipe.cpp in Sources */, + C1E4A5E60CC0216F005FB0A6 /* llioutil.cpp in Sources */, + C1E4A5E70CC0216F005FB0A6 /* lltransfermanager.cpp in Sources */, 61923C9E074AD920005E1F34 /* mac_crash_logger.cpp in Sources */, + C1E4A5760CC020FC005FB0A6 /* llcrashloggermac.cpp in Sources */, + C1E4A5790CC0210F005FB0A6 /* llcrashlogger.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4994,12 +5244,10 @@ isa = XCBuildConfiguration; buildSettings = { GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = macutil_Prefix.h; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "AutoUpdater-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = AutoUpdater; }; name = Universal; @@ -5011,8 +5259,15 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = macutil_Prefix.h; GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "../../libraries/$(arch)-darwin/include", + ../../libraries/include, + ../llcommon, + ../llcrashlogger, + ); INFOPLIST_FILE = "crashreporter-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = crashreporter; }; name = Universal; @@ -5022,8 +5277,10 @@ buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; DEPLOYMENT_POSTPROCESSING = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = llviewerprecompiledheaders.h; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = "$(HEADER_SEARCH_PATHS)"; INFOPLIST_FILE = "Info-SecondLife.plist"; INSTALL_PATH = Applications; @@ -5032,11 +5289,13 @@ "$(SRCROOT)/../../libraries/universal-darwin/lib_release", "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", ); + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = "Second Life"; SEPARATE_STRIP = YES; SHARED_PRECOMPS_DIR = "$(BUILD_DIR)/Caches/com.apple.Xcode.$(UID)/SharedPrecompiledHeaders"; STRIP_STYLE = debugging; WRAPPER_EXTENSION = app; + ZERO_LINK = NO; }; name = Universal; }; @@ -5047,6 +5306,7 @@ i386, ppc, ); + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_ALTIVEC_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 3; @@ -5091,6 +5351,7 @@ "-Wno-reorder", ); PREBINDING = NO; + PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; USER_HEADER_SEARCH_PATHS = ""; WARNING_CFLAGS = ( @@ -5118,6 +5379,7 @@ INSTALL_PATH = "@executable_path/../Resources/"; KEEP_PRIVATE_EXTERNS = NO; LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PREBINDING = NO; PRELINK_LIBS = ""; PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO; @@ -5141,6 +5403,7 @@ INSTALL_PATH = "@executable_path/../Resources/"; KEEP_PRIVATE_EXTERNS = NO; LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PREBINDING = NO; PRELINK_LIBS = ""; PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO; @@ -5162,7 +5425,7 @@ INSTALL_PATH = "@executable_path/../Resources/"; KEEP_PRIVATE_EXTERNS = NO; LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PREBINDING = NO; PRELINK_LIBS = ""; PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO; @@ -5197,7 +5460,9 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "crashreporter-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = crashreporter; + ZERO_LINK = NO; }; name = Development; }; @@ -5210,6 +5475,7 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "crashreporter-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = crashreporter; }; name = Deployment; @@ -5218,12 +5484,10 @@ isa = XCBuildConfiguration; buildSettings = { GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = macutil_Prefix.h; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "AutoUpdater-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = AutoUpdater; }; name = Development; @@ -5232,12 +5496,10 @@ isa = XCBuildConfiguration; buildSettings = { GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = macutil_Prefix.h; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "AutoUpdater-Info.plist"; LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-Wl,-search_paths_first"; PRODUCT_NAME = AutoUpdater; }; name = Deployment; @@ -5246,9 +5508,11 @@ isa = XCBuildConfiguration; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = llviewerprecompiledheaders.h; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = "$(HEADER_SEARCH_PATHS)"; INFOPLIST_FILE = "Info-SecondLife.plist"; INSTALL_PATH = "$(HOME)/Applications"; @@ -5271,7 +5535,7 @@ "-Winvalid-pch", ); WRAPPER_EXTENSION = app; - ZERO_LINK = YES; + ZERO_LINK = NO; }; name = Development; }; @@ -5279,8 +5543,10 @@ isa = XCBuildConfiguration; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = llviewerprecompiledheaders.h; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = "$(HEADER_SEARCH_PATHS)"; INFOPLIST_FILE = "Info-SecondLife.plist"; INSTALL_PATH = "$(HOME)/Applications"; @@ -5305,6 +5571,7 @@ 999484590883114300EFC621 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_ALTIVEC_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -5341,6 +5608,8 @@ "-DLL_DEBUG=1", "-D_DEBUG", "-fconstant-cfstrings", + "-gfull", + "-mlong-branch", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -5348,6 +5617,7 @@ "-Wno-reorder", ); PREBINDING = NO; + PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; USER_HEADER_SEARCH_PATHS = ""; WARNING_CFLAGS = ( @@ -5355,13 +5625,14 @@ "-Wno-sign-compare", "-Wno-switch", ); - ZERO_LINK = YES; + ZERO_LINK = NO; }; name = Development; }; 9994845A0883114300EFC621 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; GCC_ALTIVEC_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 3; @@ -5406,6 +5677,7 @@ "-Wno-reorder", ); PREBINDING = NO; + PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; USER_HEADER_SEARCH_PATHS = ""; WARNING_CFLAGS = ( diff --git a/linden/indra/newview/macview_Prefix.h b/linden/indra/newview/macview_Prefix.h index c7dd351..4d982f1 100644 --- a/linden/indra/newview/macview_Prefix.h +++ b/linden/indra/newview/macview_Prefix.h @@ -107,7 +107,6 @@ #include "llvosky.h" #include "llworld.h" #include "pipeline.h" -#include "viewer.h" /////////////////// From llfloater.cpp #include "llbutton.h" diff --git a/linden/indra/newview/newview.vcproj b/linden/indra/newview/newview.vcproj index 075fdcb..941c6c0 100644 --- a/linden/indra/newview/newview.vcproj +++ b/linden/indra/newview/newview.vcproj @@ -104,11 +104,14 @@ Name="VCLinkerTool" AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib areslib.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib OpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib png12.lib psapi.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib dnsapi.lib EZ_LCD_Wrapper.lib lgLcd.lib" OutputFile="$(ConfigurationName)/newview.exe" - LinkIncremental="2" + LinkIncremental="1" AdditionalLibraryDirectories=""../lib_$(ConfigurationName)/i686-win32";"../../libraries/i686-win32/lib_release"" IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(TargetName).pdb" + GenerateMapFile="TRUE" + MapFileName="$(TargetName).map" + MapLines="TRUE" SubSystem="2" OptimizeReferences="1" EnableCOMDATFolding="1" @@ -166,11 +169,15 @@ Name="VCLinkerTool" AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib areslib.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib fmodvc.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib OpenJPEG.lib llaudio.lib llmedia.lib llcharacter.lib llcommon.lib llimage.lib llimagej2coj.lib llinventory.lib llmath.lib llmessage.lib llmozlib.lib llprimitive.lib llrender.lib llui.lib llvfs.lib llwindow.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ogg_static_mt.lib ole32.lib oleaut32.lib opengl32.lib png12.lib psapi.lib qtmlclient.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib vorbis_static_mt.lib vorbisenc_static_mt.lib vorbisfile_static_mt.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib dnsapi.lib EZ_LCD_Wrapper.lib lgLcd.lib" OutputFile="$(ConfigurationName)/SecondLife.exe" - LinkIncremental="0" + LinkIncremental="1" AdditionalLibraryDirectories=""../lib_release/i686-win32";"../../libraries/i686-win32/lib_release"" IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(TargetName).pdb" + GenerateMapFile="TRUE" + MapFileName="$(TargetName).map" + MapExports="FALSE" + MapLines="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -289,6 +296,12 @@ RelativePath=".\llanimalcontrols.cpp"> + + + + + + + + - - + + + + + + + + - - diff --git a/linden/indra/newview/newview_vc8.vcproj b/linden/indra/newview/newview_vc8.vcproj index 6b669d9..362462f 100644 --- a/linden/indra/newview/newview_vc8.vcproj +++ b/linden/indra/newview/newview_vc8.vcproj @@ -76,6 +76,8 @@ IgnoreDefaultLibraryNames="msvcrtd;libcd;libcmt" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetName).pdb" + GenerateMapFile="true" + MapFileName="newview.map" SubSystem="2" OptimizeReferences="1" EnableCOMDATFolding="1" @@ -169,6 +171,8 @@ IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetName).pdb" + GenerateMapFile="true" + MapFileName="newview.map" SubSystem="2" OptimizeReferences="1" EnableCOMDATFolding="1" @@ -330,6 +334,7 @@ ForceConformanceInForLoopScope="true" UsePrecompiledHeader="2" PrecompiledHeaderThrough="llviewerprecompiledheaders.h" + AssemblerOutput="0" WarningLevel="3" WarnAsError="true" Detect64BitPortabilityProblems="false" @@ -353,7 +358,7 @@ IgnoreDefaultLibraryNames="msvcrt.lib;libc.lib" GenerateDebugInformation="true" ProgramDatabaseFile="$(TargetName).pdb" - GenerateMapFile="false" + GenerateMapFile="true" MapFileName="newview.map" SubSystem="2" OptimizeReferences="1" @@ -417,6 +422,14 @@ > + + + + @@ -1505,6 +1518,10 @@ > + + @@ -1521,6 +1538,10 @@ > + + @@ -1872,10 +1893,6 @@ RelativePath=".\pipeline.cpp" > - - + + + + @@ -3027,6 +3052,10 @@ > + + @@ -3035,6 +3064,10 @@ > + + diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 758455d..e9faccb 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -91,11 +91,11 @@ #include "llvotree.h" #include "llvopartgroup.h" #include "llworld.h" -#include "viewer.h" #include "llcubemap.h" #include "lldebugmessagebox.h" #include "llglslshader.h" #include "llviewerjoystick.h" +#include "llviewerdisplay.h" #ifdef _DEBUG // Debug indices is disabled for now for debug performance - djs 4/24/02 @@ -135,6 +135,8 @@ S32 gTrivialAccepts = 0; BOOL gRenderForSelect = FALSE; +LLPipeline gPipeline; + //---------------------------------------- void stamp(F32 x, F32 y, F32 xs, F32 ys) @@ -383,22 +385,14 @@ void LLPipeline::releaseGLBuffers() if (mCubeFrameBuffer) { -#if !defined(__sparc) glDeleteFramebuffersEXT(1, &mCubeFrameBuffer); glDeleteRenderbuffersEXT(1, &mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif mCubeDepth = mCubeFrameBuffer = 0; } if (mFramebuffer[0]) { -#if !defined(__sparc) glDeleteFramebuffersEXT(2, mFramebuffer); -#else -#error Can we generalize this without a CPU architecture test? -#endif mFramebuffer[0] = mFramebuffer[1] = 0; } } @@ -3776,12 +3770,8 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, BOOL reattach = FALSE; if (mCubeFrameBuffer == 0) { -#if !defined(__sparc) glGenFramebuffersEXT(1, &mCubeFrameBuffer); glGenRenderbuffersEXT(1, &mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif reattach = TRUE; } @@ -3852,7 +3842,6 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, if (reattach) { -#if !defined(__sparc) glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth); GLint res_x, res_y; glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x); @@ -3864,22 +3853,15 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, } glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif } for (S32 i = 0; i < 6; i++) { -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, cube_face[i], cube_map->getGLName(), 0); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.f, 1.f, 0.1f, 1024.f); @@ -3899,11 +3881,7 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, gPipeline.renderGeom(cube_cam); } -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif cube_cam.setOrigin(origin); gPipeline.resetDrawOrders(); @@ -4112,14 +4090,10 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, LLGLDisable blend(GL_BLEND); LLGLDisable cull(GL_CULL_FACE); -#if !defined(__sparc) if (mFramebuffer[0] == 0) { glGenFramebuffersEXT(2, mFramebuffer); } -#else -#error Can we generalize this without a CPU architecture test? -#endif GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); @@ -4142,15 +4116,11 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, for (S32 i = 0; i < kernel; i++) { -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, i%2 == 0 ? buffer : dest, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif glBindTexture(GL_TEXTURE_2D, i == 0 ? source : i%2==0 ? dest : @@ -4177,11 +4147,7 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, } -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif gGlowProgram.unbind(); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index 72288b8..6c581c5 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt @@ -1,3 +1,32 @@ +Release Notes for Second Life 1.18.6(0) December 5, 2007 +===================================== +Changes: +* Age Verification: +** The user interface for parcel and estate access has been clarified and improved. +** Added the ability to restrict access to parcels and estates to age verified adults. See an upcoming blog post for more details +** Removed the ability to *ban* access to Residents who have provided payment info or who have used payment info. We continue to support the ability to *allow* access to only those who have provided payment info. +* Login/Authentication +** We changed the way viewers login to Second Life to support future anti-fraud efforts +** The changes are largely internal +** Apart from some minor cosmetic differences, the behavior of the login screen is unchanged +** For more information, read our public Wiki article found here: http://wiki.secondlife.com/wiki/Viewer_Authentication +* Crash Reporter +** The crash reporting mechanism has been improved. Following a crash, more useful information will be sent and reports should now take less than 10 seconds. + +Fixes: +* VWR-1627: Classified metrics are reset to 0 when the ad is updated +* VWR-1162: Land for sale includes L$1 parcels that are not actually for sale +* VWR-1125: Clicking Title Bar While Mouselook'd Repositions SL +* VWR-2483: the macviewer.xcodeprj file doesn't create stripped binaries on Deployment or Universal +* VWR-2404: lossless texture compression on small textures not lossless +* VWR-2046: Focus is sent to menu/money/notification window +* Land owners can no longer delete objects belonging to others (but can still return objects) +* Positioning fixes for Japanese IME for fields where only ASCII is allowed +* Ctrl-Shift-W now works even if no windows have focus +* Fixed issue where avatar is stuck falling in place after login +* HTML login screen now functional again on Linux +* Floater sizing behavior corrected when viewer window is made very small + Release Notes for Second Life 1.18.5(3) November 29, 2007 ===================================== New features: diff --git a/linden/indra/newview/res/newViewRes.rc b/linden/indra/newview/res/newViewRes.rc index a3dfa72..05081a9 100644 --- a/linden/indra/newview/res/newViewRes.rc +++ b/linden/indra/newview/res/newViewRes.rc @@ -228,8 +228,8 @@ TOOLPIPETTE CURSOR "toolpipette.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,18,5,3 - PRODUCTVERSION 1,18,5,3 + FILEVERSION 1,18,6,0 + PRODUCTVERSION 1,18,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -246,12 +246,12 @@ BEGIN BEGIN VALUE "CompanyName", "Linden Lab" VALUE "FileDescription", "Second Life" - VALUE "FileVersion", "1.18.5.3" + VALUE "FileVersion", "1.18.6.0" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright © 2001-2007, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" - VALUE "ProductVersion", "1.18.5.3" + VALUE "ProductVersion", "1.18.6.0" END END BLOCK "VarFileInfo" diff --git a/linden/indra/newview/skins/xui/de/LCD_text.xml b/linden/indra/newview/skins/xui/de/LCD_text.xml new file mode 100644 index 0000000..a20d9f4 --- /dev/null +++ b/linden/indra/newview/skins/xui/de/LCD_text.xml @@ -0,0 +1,75 @@ + + + + Debug-Info + + + FPS + + + SimFPS + + + P-Ein + + + P-Aus + + + P-Verlust + + + Ping + + + Kontodaten + + + L$-Stand + + + Zeit + + + Standortdetails 1 + + + Standortdetails 2 + + + Region + + + Parzelle + + + Pos + + + qm + + + Eigentümer + + + Typ + + + Ja + + + Nein + + + Zum Verkauf + + + Traffic + + + Letzte 3 Chat-Zeilen + + + Letzte 3 IM-Zeilen + + diff --git a/linden/indra/newview/skins/xui/de/floater_landmark_ctrl.xml b/linden/indra/newview/skins/xui/de/floater_landmark_ctrl.xml new file mode 100644 index 0000000..f983bde --- /dev/null +++ b/linden/indra/newview/skins/xui/de/floater_landmark_ctrl.xml @@ -0,0 +1,10 @@ + + + +