home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 2003 November / CD1_JOY_153.iso / demos / NHL2004Demo.exe / fe / COMMON / js / Session.js < prev    next >
Text File  |  2003-08-20  |  19KB  |  585 lines

  1. function Session()
  2. {
  3.     var protect                = this.createProtection(JAX_Object);
  4.     protect.profile                = null;
  5.     protect.userLKey            = "";
  6.     protect.username            = "";
  7.     protect.password            = "";
  8.     protect.postGame            = new Object();
  9.     protect.postGame.screenID    = "";
  10.     protect.postGame.backText    = "";
  11.     protect.postGame.leagueType    = "";
  12.     protect.postGame.leagueID    = "";
  13.     protect.postGame.clubInfo        = new Object();
  14.     protect.postGame.clubInfo.id        = "";
  15.     protect.postGame.clubInfo.name    = "";
  16.     protect.postGame.clubInfo.gmID    = "";
  17.     protect.postGame.clubInfo.gmName    = "";
  18.     protect.postGame.clubInfo.desc    = "";
  19.     protect.postGame.clubInfo.estDate    = "";
  20.     protect.postGame.clubInfo.rating    = "";
  21.     protect.postGame.roomInfo            = new Object();
  22.     protect.postGame.roomInfo.roomName    = "";
  23.     protect.postGame.roomInfo.roomID        = "";
  24.     protect.postGame.roomInfo.roomLevel    = "";
  25.     protect.loginCookie            = new JAX_Cookie(top.document, "logindata", 240000);
  26.     protect.loginCookie.load();
  27. };
  28. Session.prototype            = new JAX_Object;
  29. Session.prototype._resetData    = function()
  30. {
  31.     var protect = this.getProtection(Session);
  32.     protect.profile                = null;
  33.     protect.userLKey            = "";
  34.     protect.username            = "";
  35.     protect.password            = "";
  36.     protect.postGame            = new Object();
  37.     protect.postGame.screenID    = "";
  38.     protect.postGame.leagueType    = "";
  39.     protect.postGame.leagueID    = "";
  40.     protect.postGame.clubInfo        = new Object();
  41.     protect.postGame.clubInfo.id        = "";
  42.     protect.postGame.clubInfo.name    = "";
  43.     protect.postGame.clubInfo.gmID    = "";
  44.     protect.postGame.clubInfo.gmName    = "";
  45.     protect.postGame.clubInfo.desc    = "";
  46.     protect.postGame.clubInfo.estDate    = "";
  47.     protect.postGame.clubInfo.rating    = "";
  48.     protect.postGame.roomInfo            = new Object();
  49.     protect.postGame.roomInfo.roomName    = "";
  50.     protect.postGame.roomInfo.roomID        = "";
  51.     protect.postGame.roomInfo.roomLevel    = "";
  52.     protect.loginCookie.destroy();
  53.     window.external.GameInterface.BrowserState    = "";
  54. };
  55. Session.prototype.getProfile    = function()
  56. {
  57.     var protect            = this.getProtection(Session);
  58.     return protect.profile;
  59. };
  60. Session.prototype.getUserName    = function()
  61. {
  62.     var protect            = this.getProtection(Session);
  63.     return protect.username;
  64. };
  65. Session.prototype.getPassword    = function()
  66. {
  67.     var protect            = this.getProtection(Session);
  68.     return protect.password;
  69. };
  70. Session.prototype.getUserLKey    = function()
  71. {
  72.     var protect            = this.getProtection(Session);
  73.     return protect.userLKey;
  74. };
  75. Session.prototype.getLoginCookie    = function()
  76. {
  77.     var protect            = this.getProtection(Session);
  78.     if ( (protect.loginCookie.userName) && (protect.loginCookie.passWord) ) {
  79.         return protect.loginCookie;
  80.     };
  81.     return null;
  82. };
  83. Session.prototype.getPostGameLeague    = function()
  84. {
  85.     var protect            = this.getProtection(Session);
  86.     if ( (protect.postGame.leagueID) && (protect.postGame.leagueType) ) {
  87.         var leagueObj                = new Object();
  88.               leagueObj.leagueID        = protect.postGame.leagueID;
  89.               leagueObj.leagueType        = protect.postGame.leagueType;
  90.         return leagueObj;
  91.     };
  92.     return null;
  93. };
  94. Session.prototype.setPostGameLeague    = function(leagueID, leagueType)
  95. {
  96.     var     protect                    = this.getProtection(Session);
  97.         protect.postGame.leagueID    = (leagueID)     ? leagueID    : 0;
  98.         protect.postGame.leagueType    = (leagueType)     ? leagueType : 0;
  99.     this.saveState();
  100. };
  101. Session.prototype.clearPostGameLeague    = function()
  102. {
  103.     var protect            = this.getProtection(Session);
  104.     protect.postGame.leagueID    = "";
  105.     protect.postGame.leagueType    = "";
  106. };
  107. Session.prototype.getPostGameNavigation    = function()
  108. {
  109.     var protect        = this.getProtection(Session);
  110.     if (protect.postGame.screenID) {
  111.         return protect.postGame.screenID;
  112.     };
  113.     return "";
  114. };
  115. Session.prototype.getPostGameBackText    = function()
  116. {
  117.     var     protect                    = this.getProtection(Session);
  118.     if (protect) {
  119.         if (protect.postGame && protect.postGame.backText) {
  120.                 return protect.postGame.backText;
  121.         };
  122.     };
  123.     return "";
  124. };
  125. Session.prototype.setPostGameNavigation    = function(screenID, backText)
  126. {
  127.     if  (screenID) {
  128.         var     protect                    = this.getProtection(Session);
  129.             protect.postGame.screenID    = screenID;
  130.             protect.postGame.backText    = (backText) ? backText : "";
  131.             this.saveState();
  132.     };
  133. };
  134. Session.prototype.clearPostGameNavigation = function()
  135. {
  136.     var protect                    = this.getProtection(Session);
  137.     protect.postGame.screenID        = "";
  138.     this.saveState();
  139. };
  140. Session.prototype.getPostGameClubInfo    = function()
  141. {
  142.     var protect        = this.getProtection(Session);
  143.     if (protect.postGame.clubInfo) {
  144.         return protect.postGame.clubInfo;
  145.     };
  146.     return null;
  147. };
  148. Session.prototype.setPostGameClubInfo    = function(cid, cname, gmID, gmName, cdesc, est, crating)
  149. {
  150.     var protect            = this.getProtection(Session);
  151.     protect.postGame.clubInfo.id        = cid;
  152.     protect.postGame.clubInfo.name    = cname;
  153.     protect.postGame.clubInfo.gmID    = gmID;
  154.     protect.postGame.clubInfo.gmName    = gmName;
  155.     protect.postGame.clubInfo.desc    = cdesc;
  156.     protect.postGame.clubInfo.estDate    = est;
  157.     protect.postGame.clubInfo.rating    = crating;
  158.     if (protect.profile) {
  159.         if (protect.profile.getClubID() == cid) {
  160.             this.saveState();
  161.         };
  162.     };
  163. };
  164. Session.prototype.setPostGameRoomInfo    = function(roomID, roomLevel, roomName)
  165. {
  166.     var protect            = this.getProtection(Session);
  167.     protect.postGame.roomInfo.roomID            = roomID;
  168.     protect.postGame.roomInfo.roomLevel        = roomLevel;
  169.     protect.postGame.roomInfo.roomName        = roomName;
  170.     this.saveState();
  171. };
  172. Session.prototype.getPostGameRoomInfo    = function()
  173. {
  174.     var protect            = this.getProtection(Session);
  175.     return protect.postGame.roomInfo;
  176. };
  177. Session.prototype.setProfile    = function(userProfile)
  178. {
  179.     if ((userProfile) && (userProfile instanceof User_Profile) ) {
  180.         var protect        = this.getProtection(Session);
  181.         protect.profile        = userProfile;
  182.         protect.username    = userProfile.getName();
  183.         this.saveState();
  184.     };
  185. };
  186. Session.prototype.isLoggedIn    = false;
  187. Session.prototype.onlogin        = function() {};
  188.  
  189. Session.prototype.login        = function(userName, passWord, savePass)
  190. {
  191.     var protect            = this.getProtection(Session);
  192.     var host                 = System.getHostURL();
  193.     var bSuccess            = true;
  194.  
  195.     userName += "";
  196.     passWord += "";
  197.  
  198.     if (userName.match(/\W/g) || passWord.match(/\W/g)) {
  199.         System.GUI.profile_viewer.setLoginInfo("", "");
  200.         System.handleError("::99::" + scMsg('SC_REGERROR_10'));
  201.         return;
  202.     };
  203.  
  204.     if ( EASOProps.get("login_url") ) {  host = EASOProps.get("login_url");};
  205.  
  206.     var gameFeatureID        = "2311";
  207.     var loginError;
  208.     var strParams = "methodCall=login";
  209.     strParams += "&screenname=" + userName;
  210.     strParams += "&password=" + passWord;
  211.     strParams = (EASOProps.get("login_dev") ) ? (strParams + "&game-feature-id=&") : (strParams + "&game-feature-id=" + gameFeatureID + "&");
  212.     //System.GUI.loadingDialog.setText(scMsg("SC_RETRIEVING_PROFILE"));
  213.     //System.GUI.loadingDialog.show();
  214.  
  215.     gblRRManager.onCancel = function()
  216.     {
  217.         System.Session._resetData();
  218.         return false;
  219.     };
  220.  
  221.     try {
  222.         var request                 = new Remote_Request( host + "subsxml/subsxml.jsp", strParams,true);
  223.         request.oncomplete        = function()
  224.         {
  225.             try {
  226.                 var responseNode    = request.getValue();
  227.                 var retStatus="";
  228.                 var retMessage="";
  229.                 if (request.isError()) {
  230.                     loginError                = new Error();
  231.                     loginError.description    = request.isError();
  232.                     loginError.requestFailed    = true;
  233.                     bSuccess                = false;
  234.                     System.Session.onlogin(false);
  235.                     System.Session.logout(true);
  236.                     System.GUI.profile_viewer.setLoginInfo("", "");
  237.                     System.handleError(loginError.description, loginError.number, "Session::login", true);
  238.                     return;
  239.                 };
  240.                 if (responseNode.xml) {
  241.                     retStatus =  responseNode.selectSingleNode("subs-interface-reply/status").text;
  242.                     retMessage = responseNode.selectSingleNode("subs-interface-reply/message").text;
  243.                 } else {
  244.                     loginError                = new Error();
  245.                     loginError.description    = "::500::Server Not Responding";
  246.                     bSuccess                = false;
  247.                     System.Session.onlogin(false);
  248.                     System.Session.logout(true);
  249.                     System.GUI.profile_viewer.setLoginInfo("", "");
  250.                     System.handleError(loginError.description, loginError.number, "Session::login", true);
  251.                     return;
  252.                 };
  253.                 if (retStatus && retMessage) {
  254.                     if(retStatus=="0") {
  255.                         protect.userLKey    = responseNode.selectSingleNode("//lkey").text;
  256.                         protect.username    = userName;
  257.                         protect.password    = passWord;
  258.                         if (savePass) {
  259.                             protect.loginCookie.addItem("userName", userName, true);
  260.                             protect.loginCookie.addItem("passWord", passWord, true);
  261.                         };
  262.                     } else {
  263.                         loginError                    = new Error();
  264.                             loginError.description        = "::" + retStatus + "::" + retMessage;
  265.                             bSuccess                    = false;
  266.                             System.Session.onlogin(false);
  267.                             System.Session.logout(true);
  268.                         System.GUI.profile_viewer.setLoginInfo("", "");
  269.                         System.handleError(loginError.description, loginError.number, "Session::login", true);
  270.                         return;
  271.                      };
  272.                 } else {
  273.                     loginError                = new Error();
  274.                     loginError.description    = "::500::Server Not Responding";
  275.                     bSuccess                = false;
  276.                     System.Session.onlogin(false);
  277.                     System.Session.logout(true);
  278.                     System.GUI.profile_viewer.setLoginInfo("", "");
  279.                     System.handleError(loginError.description, loginError.number, "Session::login", true);
  280.                     return;
  281.                 };
  282.                 OnLoginServerCallback();
  283.             } catch (e) {
  284.                 if ( !(e === loginError) ) {
  285.                     loginError = e;
  286.                 };
  287.                 System.Session.onlogin(false);
  288.                 System.Session.logout(true);
  289.                 System.GUI.profile_viewer.setLoginInfo("", "");
  290.                 System.handleError(loginError.description, loginError.number, "Session::login", true);
  291.                 return;
  292.             };
  293.         };
  294.         request.send();
  295.     } catch (e) {
  296.         if ( !(e === loginError) ) {
  297.             loginError = e;
  298.         };
  299.         System.Session.onlogin(false);
  300.         System.Session.logout(true);
  301.         System.GUI.profile_viewer.setLoginInfo("", "");
  302.         System.handleError(loginError.description, loginError.number, "Session::login::logining in send", true);
  303.         return;
  304.     };
  305.     function OnLoginServerCallback()
  306.     {
  307.         try {
  308.             if (!loginError) {
  309.                 System.GUI.loadingDialog.setText( scMsg("SC_UPDATING_TOKEN"));
  310.                 host = EASOProps.get("host_url");
  311.                 var request2                = new Remote_Request( host + "easo/nhl03/on_login.jsp", "", true);
  312.                 request2.oncomplete        = function()
  313.                 {
  314.                     LoadProfile();
  315.                 };
  316.                 request2.send();
  317.             } else {
  318.                 System.Session.onlogin(false);
  319.                 System.Session.logout(true);
  320.                 System.GUI.profile_viewer.setLoginInfo("", "");
  321.                 System.handleError(loginError.description, loginError.number, "Session::login::onlogin", true);
  322.                 return
  323.             };
  324.         } catch (e) {
  325.             if ( !(e === loginError) ) {
  326.                 loginError = e;
  327.             };
  328.             System.Session.onlogin(false);
  329.             System.Session.logout(true);
  330.             System.GUI.profile_viewer.setLoginInfo("", "");
  331.             System.handleError(loginError.description, loginError.number, "Session::login::onlogin", true);
  332.             return;
  333.         };
  334.     };
  335.     function LoadProfile()
  336.     {
  337.         try {
  338.             if (!loginError) {
  339.                 function onProfileLoaded()
  340.                 {
  341.                     try {
  342.                         System.GUI.profile_viewer.loadProfile(protect.profile);
  343.                         System.GUI.profile_viewer.hideLogin();
  344.                         if (System.Session.getProfile().getClubID()) {
  345.                             System.Session.setPostGameClubInfo(System.Session.getProfile().getClubID());
  346.                             System.GUI.commandBar.showMyClub();
  347.                         } else {
  348.                             System.GUI.commandBar.hideMyClub();
  349.                         };
  350.                         System.Session.saveState();
  351.                         ConnectBuddyList();
  352.                     } catch (e) {
  353.                         System.GUI.loadingDialog.hide();
  354.                         if ( !(e === loginError) ) {
  355.                             loginError = e;
  356.                         };
  357.                         System.GUI.profile_viewer.setLoginInfo("", "");
  358.                         System.Session.onlogin(false);
  359.                         System.Session.logout(true);
  360.                         System.handleError(loginError.description, loginError.number, "Session::login", true);
  361.                         return;
  362.                     };
  363.                 };
  364.                 protect.profile        = new User_Profile();
  365.                 protect.profile.load(userName, null, onProfileLoaded);
  366.             } else {
  367.                 System.Session.onlogin(false);
  368.                 System.Session.logout(true);
  369.                 System.GUI.profile_viewer.setLoginInfo("", "");
  370.                 System.handleError(loginError.description, loginError.number, "Session::login", true);
  371.                 return;
  372.             };
  373.         } catch (e) {
  374.             if ( !(e === loginError) ) { loginError = e; };
  375.             System.Session.onlogin(false);
  376.             System.Session.logout(true);
  377.             System.GUI.profile_viewer.setLoginInfo("", "");
  378.             System.handleError(loginError.description, loginError.number, "Session::login", true);
  379.             return;
  380.         };
  381.     };
  382.     function ConnectBuddyList()
  383.     {
  384.         try {
  385.             if (!loginError) {
  386.                 bl_connect();
  387.                 System.GUI.showBuddyList();
  388.             } else {
  389.                 System.Session.onlogin(false);
  390.                 System.Session.logout(true);
  391.                 System.GUI.profile_viewer.setLoginInfo("", "");
  392.                 System.handleError(loginError.description, loginError.number, "Session::login", true);
  393.                 return;
  394.             };
  395.         } catch (e) {
  396.             System.Session.onlogin(false);
  397.             System.Session.logout(true);
  398.             System.GUI.profile_viewer.setLoginInfo("", "");
  399.             System.handleError(loginError.description, loginError.number, "Session::login", true);
  400.             return;
  401.         };
  402.         if (top.document.frames['Editorial_Frame'].showLoginInfo) {
  403.             top.document.frames['Editorial_Frame'].showLoginInfo();
  404.         };
  405.         System.isOnline    = true;
  406.         top.document.all.btn_logout.style.visibility    = "visible";
  407.         System.GUI.playSFX(25);
  408.         System.GUI.loadingDialog.hide();
  409.         if (System.Session.onlogin && typeof(System.Session.onlogin == "function")) { System.Session.onlogin(true); };
  410.     };
  411. };
  412. Session.prototype.logout        = function(bDontNav)
  413. {
  414.     var protect            = this.getProtection(Session);
  415.     var bNavigate            = true;
  416.     if (!bDontNav) {
  417.         if (System.GUI.currentScreenObj && parseInt(System.GUI.currentScreenObj.getScreenID()) != 1) {
  418.             bNavigate    = System.GUI.navigate("1");
  419.         } else {
  420.             bNavigate    = true;
  421.         };
  422.     };
  423.     if (bNavigate) {
  424.         this.isLoggedIn                            = false;
  425.         this._resetData();
  426.         //System.GUI.profile_viewer.showLogin();
  427.         top.document.all.btn_logout.style.visibility    = "hidden";
  428.         //bl_disconnect();
  429.         System.GUI.showChyron();
  430.         //Elite_UnloadData();
  431.         var prop;
  432.         for (prop in System.ScratchPad)
  433.         {
  434.             System.ScratchPad[prop] = null;
  435.             delete System.ScratchPad[prop];
  436.         };
  437.  
  438.         System.ScratchPad.EliteCache = new EliteCacheObject;
  439.  
  440.         if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
  441.             top.document.frames['Editorial_Frame'].hideLoginInfo();
  442.         };
  443.         System.GUI.commandBar.hideMyClub();
  444.         window.external.PumpMessages();
  445.     };
  446. };
  447. Session.prototype.relogin = function(sUserName, sPass)
  448. {
  449.    this._resetData();
  450.    this.login(sUserName, sPass);
  451. };
  452. Session.prototype.quit        = function()
  453. {
  454.     //EASO CHECK
  455.     if (window.external.GameInterface.LeagueServerInterface.LeagueType == 2)
  456.     {    
  457.         oGameFace.CommInterface.ReportNoStart();
  458.         oGameFace.CommInterface.PurgeGameReporter();
  459.     }
  460.  
  461.     //function ReallyQuit()
  462.     //{
  463.         window.external.GameInterface.RestoreGameState();
  464.         window.external.GameInterface.Quit();
  465.     //};
  466. /*
  467.     var bNavigate    = false;
  468.     if (System.GUI.currentScreenObj && parseInt(System.GUI.currentScreenObj.getScreenID()) != 1) {
  469.         bNavigate    = System.GUI.navigate("1");
  470.     } else {
  471.         bNavigate    = true;
  472.     };
  473.  
  474.     if (bNavigate) {
  475.         if (System.GUI.dialog) {
  476.             System.GUI.dialog.innerHTML = nhlMsg("ARE_YOU_SURE_YOU_WANT_TO_QUIT");
  477.             System.GUI.dialog.addButton("quitBtn", scMsg("SC_YES"), ReallyQuit, true);
  478.             System.GUI.dialog.addButton("cancelBtn", scMsg("SC_NO"), null);
  479.             System.GUI.dialog.setSize(390, 97);
  480.             System.GUI.dialog.allowResize();
  481.             System.GUI.dialog.align    = "center";
  482.             System.GUI.playSFX("alert");
  483.             System.GUI.dialog.show();
  484.         };
  485.     };
  486. */
  487.     bNavigate = null;
  488. };
  489. Session.prototype.saveState    = function()
  490. {
  491.     var protect            = this.getProtection(Session);
  492.     var stateObj            = new JAX_Object();
  493.     stateObj.userLKey                = protect.userLKey;
  494.     stateObj.username                = protect.username;
  495.     stateObj.password                = protect.password;
  496.     var postGameProp;
  497.     stateObj.postGame                = new Object();
  498.     for (postGameProp in protect.postGame)
  499.     {
  500.         if (typeof protect.postGame[postGameProp] == 'object')  { continue; };
  501.         stateObj.postGame[postGameProp]    = protect.postGame[postGameProp];
  502.     };
  503.     if (protect.profile) {
  504.         if (protect.postGame.clubInfo.id && protect.profile.getClubID()) {
  505.             if (protect.postGame.clubInfo.id != protect.profile.getClubID()) {
  506.                 protect.postGame.clubInfo.id        = protect.profile.getClubID();
  507.                 protect.postGame.clubInfo.name    = protect.profile.getClubName();
  508.                 if (protect.profile.isClubGM()) {
  509.                     protect.postGame.clubInfo.gmID    = protect.profile.getUserID();
  510.                     protect.postGame.clubInfo.gmName    = protect.profile.getName();
  511.                 };
  512.                 protect.postGame.clubInfo.rating    = protect.profile.getBaseStats().getRating();
  513.             };
  514.         };
  515.     };
  516.     var clubProp;
  517.     stateObj.postGame.clubInfo        = new Object();
  518.     for (clubProp in protect.postGame.clubInfo)
  519.     {
  520.         if (typeof protect.postGame.clubInfo[clubProp] == 'object') {continue; };
  521.         if (!protect.postGame.clubInfo[clubProp]) {
  522.             stateObj.postGame.clubInfo[clubProp]    = "";
  523.         } else {
  524.             stateObj.postGame.clubInfo[clubProp]    = protect.postGame.clubInfo[clubProp];
  525.         };
  526.     };
  527.     var roomProp;
  528.     stateObj.postGame.roomInfo        = new Object();
  529.     for (roomProp in protect.postGame.roomInfo)
  530.     {
  531.         if (typeof protect.postGame.roomInfo[roomProp] == 'object') { continue; };
  532.         if (!protect.postGame.roomInfo[roomProp]) {
  533.             stateObj.postGame.roomInfo[roomProp]    = "";
  534.         } else {
  535.             stateObj.postGame.roomInfo[roomProp]    = protect.postGame.roomInfo[roomProp];
  536.         };
  537.     };
  538.     window.external.GameInterface.BrowserState    = stateObj.toXMLString(true);
  539. };
  540. Session.prototype.loadState    = function()
  541. {
  542.     var protect            = this.getProtection(Session);
  543.     var xmlDom            = new ActiveXObject("MSXML.DOMDocument");
  544.           xmlDom.async        = false;
  545.     if (window.external.GameInterface.BrowserState) {
  546.          var bLoaded            = xmlDom.loadXML(window.external.GameInterface.BrowserState);
  547.          if (bLoaded) {
  548.              var arProps        = xmlDom.selectNodes("OBJECT/PROPERTY");
  549.              var idx            = 0;
  550.              var end            = (arProps) ? arProps.length : 0;
  551.              while (idx < end)
  552.              {
  553.                  protect[arProps[idx].getAttribute("name")]    = arProps[idx].text;
  554.                  idx++;
  555.              };
  556.             var arPostGameProps    = xmlDom.selectNodes("OBJECT/OBJECT/PROPERTY");
  557.             idx = 0;
  558.             end = (arPostGameProps) ? arPostGameProps.length : 0;
  559.             while (idx < end) {
  560.                 protect.postGame[arPostGameProps[idx].getAttribute("name")]    = arPostGameProps[idx].text;
  561.                 idx++;
  562.             };
  563.             var arClubInfoProps    = xmlDom.selectNodes("/OBJECT/OBJECT/OBJECT[0]/PROPERTY");
  564.             idx     = 0;
  565.             end    = (arClubInfoProps) ? arClubInfoProps.length : 0;
  566.             while (idx < end) {
  567.                 protect.postGame.clubInfo[arClubInfoProps[idx].getAttribute("name")] = arClubInfoProps[idx].text;
  568.                 idx++;
  569.             };
  570.             var arRoomInfoProps    = xmlDom.selectNodes("OBJECT/OBJECT/OBJECT[1]/PROPERTY");
  571.             idx = 0;
  572.             end = (arRoomInfoProps) ? arRoomInfoProps.length : 0;
  573.             while (idx < end) {
  574.                 protect.postGame.roomInfo[arRoomInfoProps[idx].getAttribute("name")] = arRoomInfoProps[idx].text;
  575.                 idx++;
  576.             };
  577.             if ( (protect.username) && (protect.userLKey) && (protect.password) ) {
  578.                  return true;
  579.              } else if ( !isNaN(parseInt(protect.postGame.screenID)) ) {
  580.                  return true;
  581.              };
  582.          };
  583.      };
  584.      return false;
  585. };