diff options
author | Jacek Antonelli | 2008-08-15 23:45:02 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:02 -0500 |
commit | d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd (patch) | |
tree | 7ed0c2c27d717801238a2e6b5749cd5bf88c3059 /linden/indra/newview/llstartup.cpp | |
parent | Second Life viewer sources 1.17.3.0 (diff) | |
download | meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.zip meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.gz meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.bz2 meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.xz |
Second Life viewer sources 1.18.0.6
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 343 |
1 files changed, 54 insertions, 289 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 0130edf..7dbb107 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "llerrorcontrol.h" | 50 | #include "llerrorcontrol.h" |
51 | #include "llfiltersd2xmlrpc.h" | 51 | #include "llfiltersd2xmlrpc.h" |
52 | #include "llfocusmgr.h" | 52 | #include "llfocusmgr.h" |
53 | #include "llhttpsender.h" | ||
53 | #include "imageids.h" | 54 | #include "imageids.h" |
54 | #include "lllandmark.h" | 55 | #include "lllandmark.h" |
55 | #include "llloginflags.h" | 56 | #include "llloginflags.h" |
@@ -223,7 +224,6 @@ BOOL is_hex_string(U8* str, S32 len); | |||
223 | void show_first_run_dialog(); | 224 | void show_first_run_dialog(); |
224 | void first_run_dialog_callback(S32 option, void* userdata); | 225 | void first_run_dialog_callback(S32 option, void* userdata); |
225 | void set_startup_status(const F32 frac, const char* string, const char* msg); | 226 | void set_startup_status(const F32 frac, const char* string, const char* msg); |
226 | void on_userserver_name_resolved( BOOL success, const LLString& host_name, U32 ip, void* userdata ); | ||
227 | void login_alert_status(S32 option, void* user_data); | 227 | void login_alert_status(S32 option, void* user_data); |
228 | void update_app(BOOL mandatory, const std::string& message); | 228 | void update_app(BOOL mandatory, const std::string& message); |
229 | void update_dialog_callback(S32 option, void *userdata); | 229 | void update_dialog_callback(S32 option, void *userdata); |
@@ -236,7 +236,6 @@ void dialog_choose_gender_first_start(); | |||
236 | void callback_choose_gender(S32 option, void* userdata); | 236 | void callback_choose_gender(S32 option, void* userdata); |
237 | void init_start_screen(S32 location_id); | 237 | void init_start_screen(S32 location_id); |
238 | void release_start_screen(); | 238 | void release_start_screen(); |
239 | void process_connect_to_userserver(LLMessageSystem* msg, void**); | ||
240 | void reset_login(); | 239 | void reset_login(); |
241 | 240 | ||
242 | // | 241 | // |
@@ -246,6 +245,21 @@ void reset_login(); | |||
246 | // | 245 | // |
247 | // local classes | 246 | // local classes |
248 | // | 247 | // |
248 | |||
249 | namespace | ||
250 | { | ||
251 | class LLNullHTTPSender : public LLHTTPSender | ||
252 | { | ||
253 | virtual void send(const LLHost& host, | ||
254 | const char* message, const LLSD& body, | ||
255 | LLHTTPClient::ResponderPtr response) const | ||
256 | { | ||
257 | llwarns << " attemped to send " << message << " to " << host | ||
258 | << " with null sender" << llendl; | ||
259 | } | ||
260 | }; | ||
261 | } | ||
262 | |||
249 | class LLGestureInventoryFetchObserver : public LLInventoryFetchObserver | 263 | class LLGestureInventoryFetchObserver : public LLInventoryFetchObserver |
250 | { | 264 | { |
251 | public: | 265 | public: |
@@ -422,7 +436,7 @@ BOOL idle_startup() | |||
422 | port = gSavedSettings.getU32("ConnectionPort"); | 436 | port = gSavedSettings.getU32("ConnectionPort"); |
423 | } | 437 | } |
424 | 438 | ||
425 | LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); | 439 | LLHTTPSender::setDefaultSender(new LLNullHTTPSender()); |
426 | if(!start_messaging_system( | 440 | if(!start_messaging_system( |
427 | message_template_path, | 441 | message_template_path, |
428 | port, | 442 | port, |
@@ -435,6 +449,7 @@ BOOL idle_startup() | |||
435 | std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); | 449 | std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); |
436 | app_early_exit(msg); | 450 | app_early_exit(msg); |
437 | } | 451 | } |
452 | LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); | ||
438 | } | 453 | } |
439 | else | 454 | else |
440 | { | 455 | { |
@@ -452,9 +467,13 @@ BOOL idle_startup() | |||
452 | msg->setExceptionFunc(MX_PACKET_TOO_SHORT, | 467 | msg->setExceptionFunc(MX_PACKET_TOO_SHORT, |
453 | invalid_message_callback, | 468 | invalid_message_callback, |
454 | NULL); | 469 | NULL); |
455 | msg->setExceptionFunc(MX_RAN_OFF_END_OF_PACKET, | 470 | |
471 | // running off end of a packet is now valid in the case | ||
472 | // when a reader has a newer message template than | ||
473 | // the sender | ||
474 | /*msg->setExceptionFunc(MX_RAN_OFF_END_OF_PACKET, | ||
456 | invalid_message_callback, | 475 | invalid_message_callback, |
457 | NULL); | 476 | NULL);*/ |
458 | msg->setExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE, | 477 | msg->setExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE, |
459 | invalid_message_callback, | 478 | invalid_message_callback, |
460 | NULL); | 479 | NULL); |
@@ -476,7 +495,7 @@ BOOL idle_startup() | |||
476 | gXferManager->setUseAckThrottling(TRUE); | 495 | gXferManager->setUseAckThrottling(TRUE); |
477 | gXferManager->setAckThrottleBPS(xfer_throttle_bps); | 496 | gXferManager->setAckThrottleBPS(xfer_throttle_bps); |
478 | } | 497 | } |
479 | gAssetStorage = new LLViewerAssetStorage(msg, gXferManager, gVFS, gUserServer); | 498 | gAssetStorage = new LLViewerAssetStorage(msg, gXferManager, gVFS); |
480 | 499 | ||
481 | msg->mPacketRing.setDropPercentage(gPacketDropPercentage); | 500 | msg->mPacketRing.setDropPercentage(gPacketDropPercentage); |
482 | if (gInBandwidth != 0.f) | 501 | if (gInBandwidth != 0.f) |
@@ -778,7 +797,6 @@ BOOL idle_startup() | |||
778 | gSavedSettings.setS32("ServerChoice", gUserServerChoice); | 797 | gSavedSettings.setS32("ServerChoice", gUserServerChoice); |
779 | if (gUserServerChoice == USERSERVER_OTHER) | 798 | if (gUserServerChoice == USERSERVER_OTHER) |
780 | { | 799 | { |
781 | gUserServer.setHostByName( server_label.c_str() ); | ||
782 | snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ | 800 | snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ |
783 | } | 801 | } |
784 | } | 802 | } |
@@ -845,231 +863,15 @@ BOOL idle_startup() | |||
845 | // color init must be after saved settings loaded | 863 | // color init must be after saved settings loaded |
846 | init_colors(); | 864 | init_colors(); |
847 | 865 | ||
848 | // Request userserver domain name | 866 | // skipping over STATE_UPDATE_CHECK because that just waits for input |
849 | set_startup_status(0.05f, "Finding Server Domain Name...", NULL); | 867 | gStartupState = STATE_LOGIN_AUTH_INIT; |
850 | |||
851 | // We're prematurely switching out of this state because the | ||
852 | // userserver name resolver can potentiallly occur before reaching the end of the | ||
853 | // switch statement. Also, if it's done at the bottom, sometimes we will | ||
854 | // skip the userserver resolved step (in the local cases) - djs 09/24/03 | ||
855 | gStartupState++; | ||
856 | timeout.reset(); | ||
857 | |||
858 | switch( gUserServerChoice ) | ||
859 | { | ||
860 | case USERSERVER_AGNI: | ||
861 | gInProductionGrid = TRUE; | ||
862 | case USERSERVER_DMZ: | ||
863 | case USERSERVER_ADITI: | ||
864 | case USERSERVER_SIVA: | ||
865 | case USERSERVER_SHAKTI: | ||
866 | case USERSERVER_DURGA: | ||
867 | case USERSERVER_SOMA: | ||
868 | case USERSERVER_VAAK: | ||
869 | case USERSERVER_GANGA: | ||
870 | case USERSERVER_UMA: | ||
871 | { | ||
872 | const char* host_name = gUserServerDomainName[gUserServerChoice].mName; | ||
873 | snprintf(gUserServerName, MAX_STRING, "%s", host_name); /* Flawfinder: ignore */ | ||
874 | llinfos << "Resolving " << | ||
875 | gUserServerDomainName[gUserServerChoice].mLabel << | ||
876 | " userserver domain name " << host_name << llendl; | ||
877 | |||
878 | BOOL requested_domain_name = gAsyncHostByName.startRequest( host_name, on_userserver_name_resolved, NULL ); | ||
879 | if( !requested_domain_name ) | ||
880 | //BOOL resolved_domain_name = gUserServer.setHostByName( host_name ); | ||
881 | //if( !resolved_domain_name ) | ||
882 | { | ||
883 | llwarns << "setHostByName failed" << llendl; | ||
884 | |||
885 | LLStringBase<char>::format_map_t args; | ||
886 | args["[HOST_NAME]"] = host_name; | ||
887 | |||
888 | gViewerWindow->alertXml("UnableToConnect", args, login_alert_done ); | ||
889 | reset_login(); | ||
890 | return FALSE; | ||
891 | } | ||
892 | break; | ||
893 | } | ||
894 | |||
895 | case USERSERVER_LOCAL: | ||
896 | llinfos << "Using local userserver" << llendl; | ||
897 | gUserServer.setAddress( LOOPBACK_ADDRESS_STRING ); | ||
898 | gStartupState = STATE_USERSERVER_RESOLVED; | ||
899 | break; | ||
900 | |||
901 | case USERSERVER_OTHER: | ||
902 | llinfos << "Userserver set explicitly" << llendl; | ||
903 | gStartupState = STATE_USERSERVER_RESOLVED; | ||
904 | break; | ||
905 | |||
906 | case USERSERVER_NONE: | ||
907 | default: | ||
908 | llerrs << "No userserver IP address specified" << llendl; | ||
909 | break; | ||
910 | } | ||
911 | return do_normal_idle; | ||
912 | } | ||
913 | |||
914 | if (STATE_RESOLVING_USERSERVER == gStartupState) | ||
915 | { | ||
916 | // Don't do anything. Wait for LL_WM_HOST_RESOLVED which is handled by LLAsyncHostByName, | ||
917 | // which calls on_userserver_name_resolved, which will push us to the next state. | ||
918 | if (timeout.getElapsedTimeF32() > TIMEOUT_SECONDS*3.f) | ||
919 | { | ||
920 | // Cancel the pending asynchostbyname request | ||
921 | |||
922 | gViewerWindow->alertXml("CanNotFindServer", | ||
923 | login_alert_status, NULL); | ||
924 | |||
925 | // Back up to login screen | ||
926 | reset_login(); | ||
927 | gViewerStats->incStat(LLViewerStats::ST_LOGIN_TIMEOUT_COUNT); | ||
928 | } | ||
929 | ms_sleep(1); | ||
930 | return do_normal_idle; | ||
931 | } | ||
932 | |||
933 | if (STATE_USERSERVER_RESOLVED == gStartupState) | ||
934 | { | ||
935 | if (!gUserServer.isOk()) | ||
936 | { | ||
937 | LLStringBase<char>::format_map_t args; | ||
938 | args["[IP_ADDRESS]"] = u32_to_ip_string( gUserServer.getAddress() ); | ||
939 | |||
940 | gViewerWindow->alertXml("PleaseSelectServer", args, login_alert_done ); | ||
941 | |||
942 | reset_login(); | ||
943 | return FALSE; | ||
944 | } | ||
945 | |||
946 | write_debug("Userserver: "); | ||
947 | char tmp_str[256]; /* Flawfinder: ignore */ | ||
948 | gUserServer.getIPString(tmp_str, 256); | ||
949 | write_debug(tmp_str); | ||
950 | write_debug("\n"); | ||
951 | |||
952 | gStartupState++; | ||
953 | } | ||
954 | |||
955 | if (STATE_MESSAGE_TEMPLATE_SEND == gStartupState) | ||
956 | { | ||
957 | set_startup_status(0.10f, "Verifying protocol version...", NULL); | ||
958 | |||
959 | LLHost mt_host; | ||
960 | if (!gRunLocal) | ||
961 | { | ||
962 | // open up user server circuit (trusted) | ||
963 | gMessageSystem->enableCircuit(gUserServer, TRUE); | ||
964 | mt_host = gUserServer; | ||
965 | } | ||
966 | else | ||
967 | { | ||
968 | mt_host = gAgentSimHost; | ||
969 | } | ||
970 | |||
971 | llinfos << "Verifying message template..." << llendl; | ||
972 | LLMessageSystem::sendSecureMessageTemplateChecksum(mt_host); | ||
973 | |||
974 | timeout.reset(); | ||
975 | gStartupState++; | ||
976 | return do_normal_idle; | ||
977 | } | ||
978 | |||
979 | if (STATE_MESSAGE_TEMPLATE_WAIT == gStartupState) | ||
980 | { | ||
981 | LLMessageSystem* msg = gMessageSystem; | ||
982 | while (msg->checkAllMessages(gFrameCount, gServicePump)) | ||
983 | { | ||
984 | if (msg->isTemplateConfirmed()) | ||
985 | { | ||
986 | BOOL update_available = FALSE; | ||
987 | BOOL mandatory = FALSE; | ||
988 | |||
989 | if (!LLMessageSystem::doesTemplateMatch()) | ||
990 | { | ||
991 | // Mandatory update -- message template checksum doesn't match | ||
992 | update_available = TRUE; | ||
993 | mandatory = TRUE; | ||
994 | } | ||
995 | |||
996 | BOOL quit = FALSE; | ||
997 | if (update_available) | ||
998 | { | ||
999 | if (show_connect_box) | ||
1000 | { | ||
1001 | update_app(mandatory, ""); | ||
1002 | gStartupState = STATE_UPDATE_CHECK; | ||
1003 | return FALSE; | ||
1004 | } | ||
1005 | else | ||
1006 | { | ||
1007 | quit = TRUE; | ||
1008 | } | ||
1009 | } | ||
1010 | |||
1011 | // Bail out and clean up circuit | ||
1012 | if (quit) | ||
1013 | { | ||
1014 | msg->newMessageFast(_PREHASH_CloseCircuit); | ||
1015 | msg->sendMessage( msg->getSender() ); | ||
1016 | app_force_quit(NULL); | ||
1017 | return FALSE; | ||
1018 | } | ||
1019 | |||
1020 | // If we get here, we've got a compatible message template | ||
1021 | if (!mandatory) | ||
1022 | { | ||
1023 | llinfos << "Message template is current!" << llendl; | ||
1024 | } | ||
1025 | gStartupState = STATE_LOGIN_AUTH_INIT; | ||
1026 | timeout.reset(); | ||
1027 | // unregister with the message system so it knows we're no longer expecting this message | ||
1028 | msg->setHandlerFuncFast(_PREHASH_TemplateChecksumReply, NULL, NULL); | ||
1029 | |||
1030 | msg->newMessageFast(_PREHASH_CloseCircuit); | ||
1031 | msg->sendMessage(gUserServer); | ||
1032 | msg->disableCircuit(gUserServer); | ||
1033 | if (gRunLocal) | ||
1034 | { | ||
1035 | msg->enableCircuit(gAgentSimHost, TRUE); | ||
1036 | |||
1037 | // Don't use a session token, and generate a random user id | ||
1038 | gAgentID.generate(); | ||
1039 | gAgentSessionID = LLUUID::null; | ||
1040 | |||
1041 | // Skip userserver queries. | ||
1042 | gStartupState = STATE_WORLD_INIT; | ||
1043 | } | ||
1044 | } | ||
1045 | } | ||
1046 | gMessageSystem->processAcks(); | ||
1047 | |||
1048 | if (timeout.getElapsedTimeF32() > TIMEOUT_SECONDS) | ||
1049 | { | ||
1050 | if (timeout_count > MAX_TIMEOUT_COUNT) | ||
1051 | { | ||
1052 | gViewerWindow->alertXml("SystemMayBeDown", | ||
1053 | login_alert_status, | ||
1054 | NULL); | ||
1055 | |||
1056 | // Back up to login screen | ||
1057 | reset_login(); | ||
1058 | gViewerStats->incStat(LLViewerStats::ST_LOGIN_TIMEOUT_COUNT); | ||
1059 | } | ||
1060 | else | ||
1061 | { | ||
1062 | llinfos << "Resending on timeout" << llendl; | ||
1063 | gStartupState--; | ||
1064 | timeout_count++; | ||
1065 | } | ||
1066 | } | ||
1067 | 868 | ||
1068 | return do_normal_idle; | 869 | return do_normal_idle; |
1069 | } | 870 | } |
1070 | 871 | ||
1071 | if (STATE_UPDATE_CHECK == gStartupState) | 872 | if (STATE_UPDATE_CHECK == gStartupState) |
1072 | { | 873 | { |
874 | // wait for user to give input via dialog box | ||
1073 | return do_normal_idle; | 875 | return do_normal_idle; |
1074 | } | 876 | } |
1075 | 877 | ||
@@ -1677,9 +1479,7 @@ BOOL idle_startup() | |||
1677 | // | 1479 | // |
1678 | // Initialize classes w/graphics stuff. | 1480 | // Initialize classes w/graphics stuff. |
1679 | // | 1481 | // |
1680 | gImageList.doPrefetchImages(); | 1482 | gImageList.doPrefetchImages(); |
1681 | update_texture_fetch(); | ||
1682 | |||
1683 | LLSurface::initClasses(); | 1483 | LLSurface::initClasses(); |
1684 | 1484 | ||
1685 | LLFace::initClass(); | 1485 | LLFace::initClass(); |
@@ -1710,6 +1510,7 @@ BOOL idle_startup() | |||
1710 | LLViewerRegion *regionp = gWorldp->getRegionFromHandle(first_sim_handle); | 1510 | LLViewerRegion *regionp = gWorldp->getRegionFromHandle(first_sim_handle); |
1711 | llinfos << "Adding initial simulator " << regionp->getOriginGlobal() << llendl; | 1511 | llinfos << "Adding initial simulator " << regionp->getOriginGlobal() << llendl; |
1712 | 1512 | ||
1513 | gStartupState = STATE_SEED_GRANTED_WAIT; | ||
1713 | regionp->setSeedCapability(first_sim_seed_cap); | 1514 | regionp->setSeedCapability(first_sim_seed_cap); |
1714 | 1515 | ||
1715 | // Set agent's initial region to be the one we just created. | 1516 | // Set agent's initial region to be the one we just created. |
@@ -1725,9 +1526,32 @@ BOOL idle_startup() | |||
1725 | // VEFFECT: Login | 1526 | // VEFFECT: Login |
1726 | gWorldp->addRegion(0, gAgentSimHost); | 1527 | gWorldp->addRegion(0, gAgentSimHost); |
1727 | gAgent.setRegion(gWorldp->getRegionFromHandle(0)); | 1528 | gAgent.setRegion(gWorldp->getRegionFromHandle(0)); |
1529 | |||
1530 | gStartupState = STATE_SEED_CAP_GRANTED; | ||
1728 | } | 1531 | } |
1729 | 1532 | ||
1730 | display_startup(); | 1533 | display_startup(); |
1534 | return do_normal_idle; | ||
1535 | } | ||
1536 | |||
1537 | |||
1538 | //--------------------------------------------------------------------- | ||
1539 | // Wait for Seed Cap Grant | ||
1540 | //--------------------------------------------------------------------- | ||
1541 | if(STATE_SEED_GRANTED_WAIT == gStartupState) | ||
1542 | { | ||
1543 | llinfos << "Waiting for seed grant ...." << llendl; | ||
1544 | return do_normal_idle; | ||
1545 | } | ||
1546 | |||
1547 | |||
1548 | //--------------------------------------------------------------------- | ||
1549 | // Seed Capability Granted | ||
1550 | // no newMessage calls should happen before this point | ||
1551 | //--------------------------------------------------------------------- | ||
1552 | if (STATE_SEED_CAP_GRANTED == gStartupState) | ||
1553 | { | ||
1554 | update_texture_fetch(); | ||
1731 | 1555 | ||
1732 | // Initialize UI | 1556 | // Initialize UI |
1733 | if (!gNoRender) | 1557 | if (!gNoRender) |
@@ -2195,21 +2019,6 @@ BOOL idle_startup() | |||
2195 | return do_normal_idle; | 2019 | return do_normal_idle; |
2196 | } | 2020 | } |
2197 | 2021 | ||
2198 | //--------------------------------------------------------------------- | ||
2199 | // Assert agent to userserver | ||
2200 | //--------------------------------------------------------------------- | ||
2201 | if (STATE_CONNECT_USERSERVER == gStartupState) | ||
2202 | { | ||
2203 | LLMessageSystem* msg = gMessageSystem; | ||
2204 | msg->enableCircuit(gUserServer, TRUE); | ||
2205 | msg->newMessage("ConnectAgentToUserserver"); | ||
2206 | msg->nextBlockFast(_PREHASH_AgentData); | ||
2207 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
2208 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
2209 | msg->sendReliable(gUserServer); | ||
2210 | gStartupState++; | ||
2211 | return do_normal_idle; | ||
2212 | } | ||
2213 | 2022 | ||
2214 | //--------------------------------------------------------------------- | 2023 | //--------------------------------------------------------------------- |
2215 | // Misc | 2024 | // Misc |
@@ -2334,9 +2143,6 @@ BOOL idle_startup() | |||
2334 | msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound); | 2143 | msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound); |
2335 | msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change); | 2144 | msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change); |
2336 | //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); | 2145 | //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); |
2337 | msg->setHandlerFunc( | ||
2338 | "ConnectToUserserver", | ||
2339 | process_connect_to_userserver); | ||
2340 | 2146 | ||
2341 | llinfos << "Initialization complete" << llendl; | 2147 | llinfos << "Initialization complete" << llendl; |
2342 | gInitializationComplete = TRUE; | 2148 | gInitializationComplete = TRUE; |
@@ -2776,31 +2582,6 @@ void set_startup_status(const F32 frac, const char *string, const char* msg) | |||
2776 | gViewerWindow->setProgressMessage(msg); | 2582 | gViewerWindow->setProgressMessage(msg); |
2777 | } | 2583 | } |
2778 | 2584 | ||
2779 | void on_userserver_name_resolved( BOOL success, const LLString& host_name, U32 ip, void* userdata ) | ||
2780 | { | ||
2781 | if( STATE_RESOLVING_USERSERVER != gStartupState ) | ||
2782 | { | ||
2783 | llwarns << "Userserver name callback returned during invalid state!" << llendl; | ||
2784 | return; | ||
2785 | } | ||
2786 | |||
2787 | if( success ) | ||
2788 | { | ||
2789 | gUserServer.setAddress( ip ); | ||
2790 | llinfos << "...Userserver resolved to " << gUserServer << llendl; | ||
2791 | gStartupState = STATE_USERSERVER_RESOLVED; | ||
2792 | } | ||
2793 | else | ||
2794 | { | ||
2795 | llwarns << "setHostByName failed" << llendl; | ||
2796 | |||
2797 | LLStringBase<char>::format_map_t args; | ||
2798 | args["[HOST_NAME]"] = host_name; | ||
2799 | gViewerWindow->alertXml("SetByHostFail", args, login_alert_done ); | ||
2800 | reset_login(); | ||
2801 | } | ||
2802 | } | ||
2803 | |||
2804 | void login_alert_status(S32 option, void* user_data) | 2585 | void login_alert_status(S32 option, void* user_data) |
2805 | { | 2586 | { |
2806 | if (0 == option) | 2587 | if (0 == option) |
@@ -2924,8 +2705,6 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2924 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2705 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2925 | 2706 | ||
2926 | #if LL_WINDOWS | 2707 | #if LL_WINDOWS |
2927 | char ip[MAX_STRING]; /* Flawfinder: ignore */ | ||
2928 | |||
2929 | update_exe_path = gDirUtilp->getTempFilename(); | 2708 | update_exe_path = gDirUtilp->getTempFilename(); |
2930 | if (update_exe_path.empty()) | 2709 | if (update_exe_path.empty()) |
2931 | { | 2710 | { |
@@ -2952,7 +2731,6 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2952 | app_force_quit(NULL); | 2731 | app_force_quit(NULL); |
2953 | return; | 2732 | return; |
2954 | } | 2733 | } |
2955 | u32_to_ip_string(gUserServer.getAddress(), ip); | ||
2956 | 2734 | ||
2957 | // if a sim name was passed in via command line parameter (typically through a SLURL) | 2735 | // if a sim name was passed in via command line parameter (typically through a SLURL) |
2958 | if ( LLURLSimString::sInstance.mSimString.length() ) | 2736 | if ( LLURLSimString::sInstance.mSimString.length() ) |
@@ -3080,7 +2858,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) | |||
3080 | msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, NULL); | 2858 | msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, NULL); |
3081 | msg->setHandlerFunc("ViewerFrozenMessage", process_frozen_message); | 2859 | msg->setHandlerFunc("ViewerFrozenMessage", process_frozen_message); |
3082 | 2860 | ||
3083 | msg->setHandlerFuncFast(_PREHASH_RequestAvatarInfo, process_avatar_info_request); | 2861 | //msg->setHandlerFuncFast(_PREHASH_RequestAvatarInfo, process_avatar_info_request); |
3084 | msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value); | 2862 | msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value); |
3085 | msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); | 2863 | msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); |
3086 | msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); | 2864 | msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); |
@@ -3944,19 +3722,6 @@ void release_start_screen() | |||
3944 | gStartImageGL = NULL; | 3722 | gStartImageGL = NULL; |
3945 | } | 3723 | } |
3946 | 3724 | ||
3947 | void process_connect_to_userserver(LLMessageSystem* msg, void**) | ||
3948 | { | ||
3949 | // Sent unreliably since if we've become disconnected, the | ||
3950 | // userserver will get back to us eventually. By sending reliable, | ||
3951 | // we also may accidently induce two separate validations under | ||
3952 | // conditions where the userserver is already lagged. | ||
3953 | msg->newMessage("ConnectAgentToUserserver"); | ||
3954 | msg->nextBlockFast(_PREHASH_AgentData); | ||
3955 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
3956 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
3957 | msg->sendMessage(gUserServer); | ||
3958 | } | ||
3959 | |||
3960 | bool LLStartUp::canGoFullscreen() | 3725 | bool LLStartUp::canGoFullscreen() |
3961 | { | 3726 | { |
3962 | return gStartupState >= STATE_WORLD_INIT; | 3727 | return gStartupState >= STATE_WORLD_INIT; |