Advertisement
Breach

xat chat610 network.as

Dec 30th, 2014
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.     import com.adobe.serialization.json.*;
  4.     import flash.display.*;
  5.     import flash.events.*;
  6.     import flash.net.*;
  7.     import flash.system.*;
  8.     import flash.utils.*;
  9.     import flash.xml.*;
  10.  
  11.     public class network extends Object
  12.     {
  13.         public static var iprules:* = new Object();
  14.         public static var xNumAttempts:* = 5;
  15.         public static var xFlag:* = 0;
  16.         public static var attempt:* = 0;
  17.         public static var prevrpool:* = -1;
  18.         public static var NetworkState:*;
  19.         public static var NetworkTimeout:*;
  20.         public static var MessageCount:*;
  21.         public static var LurkerLimit:*;
  22.         public static var LurkerTimeout:*;
  23.         public static var socket:*;
  24.         public static var UnfairFile:String = "";
  25.         public static var UnfairMessage:String = "";
  26.         public static var UnfairGroupName:String = "";
  27.         public static var GotDone:Boolean = false;
  28.         public static var GotFirstDone:Boolean = false;
  29.         public static var w_redirectdom:* = undefined;
  30.         public static var w_redirectport:* = undefined;
  31.         public static var QK:* = false;
  32.         public static var YI:* = undefined;
  33.         public static var YC:int = undefined;
  34.         public static var YC2:int = undefined;
  35.         public static var WV:* = false;
  36.         public static var WC:*;
  37.         public static var FI:* = undefined;
  38.         public static var LastLocate:* = 0;
  39.         public static var fs:* = 0;
  40.         public static var sjt:* = 0;
  41.         public static var jt1:* = 0;
  42.         public static var jt2:* = 0;
  43.         public static var UngagTimeout:* = undefined;
  44.         public static var Bootp:* = undefined;
  45.         public static var UserId:*;
  46.         public static var k1:*;
  47.         public static var k2:*;
  48.         public static var J2_Order:*;
  49.         public static var ipLoaded:* = false;
  50.         public static var p_w:* = 100;
  51.         public static var p_h:* = 100;
  52.         public static var p_octaves:* = 6;
  53.         public static var p_seed:* = 12345;
  54.         public static var p_x:* = 50;
  55.         public static var p_y:* = 50;
  56.         public static var codeLoad:*;
  57.         public static var mcCode:MovieClip = null;
  58.  
  59.         final public static function PickIP(param1:*)
  60.         {
  61.             var _loc_5:* = undefined;
  62.             var _loc_6:* = undefined;
  63.             var _loc_7:* = undefined;
  64.             var _loc_8:* = undefined;
  65.             var _loc_9:* = undefined;
  66.             var _loc_10:* = undefined;
  67.             var _loc_11:* = undefined;
  68.             if(attempt >= iprules["order"].length)
  69.             {
  70.                 return new Array("0", 0, 0);
  71.             }
  72.             var _loc_2:* = iprules["order"][attempt][0];
  73.             var _loc_3:* = iprules[_loc_2];
  74.             var _loc_4:* = iprules["order"][attempt][1];
  75.             if((_loc_3[0] & 1) == 1)
  76.             {
  77.                 _loc_5 = 0;
  78.                 if(prevrpool == -1)
  79.                 {
  80.                     _loc_5 = (Math.floor(Math.random() * (_loc_3.length - 1))) + 1;
  81.                 }
  82.                 else
  83.                 {
  84.                     _loc_5 = (_loc_5 % (_loc_3.length - 1)) + 1;
  85.                 }
  86.                 _loc_6 = Math.floor(Math.random() * _loc_3[_loc_5].length);
  87.                 _loc_7 = _loc_3[_loc_5][_loc_6].split(":");
  88.                 if(_loc_7[1] == undefined)
  89.                 {
  90.                     _loc_7[1] = 10000;
  91.                 }
  92.                 if(_loc_7[2] == undefined)
  93.                 {
  94.                     _loc_7[2] = 39;
  95.                 }
  96.                 _loc_8 = xatlib.xInt(_loc_7[1]) + (Math.floor(Math.random() * xatlib.xInt(_loc_7[2])));
  97.                 prevrpool = _loc_5;
  98.                 return new Array(_loc_7[0], _loc_8, _loc_4);
  99.             }
  100.             else
  101.             {
  102.                 _loc_9 = network.GetDom(param1);
  103.                 _loc_10 = network.GetPort(param1);
  104.                 _loc_11 = _loc_3[1][(4 * _loc_9) + (Math.floor(Math.random() * 4))];
  105.             }
  106.             return new Array(_loc_11, _loc_10, _loc_4);
  107.         }
  108.  
  109.         final public static function GetDom(param1:*) : Number
  110.         {
  111.             if(xFlag & 8)
  112.             {
  113.                 return Math.floor(Math.random() * 4);
  114.             }
  115.             if(xatlib.xInt(param1) == 8)
  116.             {
  117.                 return 0;
  118.             }
  119.             return xatlib.xInt(param1) < 8 ? 3 : (xatlib.xInt(param1) & 96) >> 5;
  120.         }
  121.  
  122.         final public static function GetPort(param1:*) : Number
  123.         {
  124.             if(xFlag & 8)
  125.             {
  126.                 return (10000 + 7) + (Math.floor(Math.random() * 32));
  127.             }
  128.             if(xatlib.xInt(param1) == 8)
  129.             {
  130.                 return 10000;
  131.             }
  132.             return xatlib.xInt(param1) < 8 ? (10000 - 1) + xatlib.xInt(param1) : (10000 + 7) + (xatlib.xInt(param1) % 32);
  133.         }
  134.  
  135.         final public static function NetworkInit()
  136.         {
  137.             NetworkState = 0;
  138.             NetworkTimeout = -1;
  139.             MessageCount = 0;
  140.             LurkerLimit = (12 * 60) * 5;
  141.             LurkerTimeout = -1;
  142.         }
  143.  
  144.         final public static function NetworkStartChat()
  145.         {
  146.             ipLoaded = false;
  147.             var _loc_1:URLRequest = new URLRequest();
  148.             var _loc_2:Date = new Date();
  149.             _loc_1.url = (todo.chatdomain + "ip2.htm?init") + (xatlib.xInt((_loc_2.getTime() + 30000) / 60000));
  150.             _loc_1.method = URLRequestMethod.GET;
  151.             var _loc_3:URLLoader = new URLLoader();
  152.             _loc_3.load(_loc_1);
  153.             _loc_3.addEventListener(Event.COMPLETE, ipcompleteHandler);
  154.             _loc_3.addEventListener(IOErrorEvent.IO_ERROR, ipcompleteError);
  155.             network.SetNetworkState(14, 60);
  156.         }
  157.  
  158.         final public static function NetworkStartChat2()
  159.         {
  160.             var _loc_1:* = undefined;
  161.             var _loc_3:* = undefined;
  162.             var _loc_4:URLRequest = null;
  163.             var _loc_5:URLLoader = null;
  164.             xmessage.ClearLists(true);
  165.             UngagTimeout = undefined;
  166.             var _loc_2:* = iprules["k1n"];
  167.             _loc_2;
  168.             todo.w_userno;
  169.             todo.w_k1;
  170.             if(_loc_2 && todo.w_userno && todo.w_userno < _loc_2 && todo.w_k1 && iprules["time"])
  171.             {
  172.                 _loc_3 = 14;
  173.                 if(iprules["k1d"])
  174.                 {
  175.                     _loc_3 = iprules["k1d"];
  176.                 }
  177.                 _loc_1 = todo.w_k1.substr(10, 8);
  178.                 if(!_loc_1 || (_loc_1 + (_loc_3 * 24) * 3600) < iprules["time"])
  179.                 {
  180.                     todo.w_k1 = undefined;
  181.                     _loc_1 = 1;
  182.                 }
  183.                 else
  184.                 {
  185.                     _loc_1 = 0;
  186.                 }
  187.             }
  188.             if(!(todo.w_userrev == undefined) || _loc_1 && !todo.w_k1 || todo.w_k2 == 0)
  189.             {
  190.                 UserId = undefined;
  191.                 _loc_4 = new URLRequest();
  192.                 _loc_4.url = (todo.chatdomain + "auser3.php?") + "u=" + xatlib.xInt(todo.w_userno) + "&k2=" + todo.w_k2 + "&t=" + Math.random();
  193.                 _loc_4.method = URLRequestMethod.GET;
  194.                 _loc_5 = new URLLoader();
  195.                 _loc_5.load(_loc_4);
  196.                 _loc_5.addEventListener(Event.COMPLETE, ausercompleteHandler);
  197.             }
  198.             else
  199.             {
  200.                 if(todo.w_userrev == undefined)
  201.                 {
  202.                     UserId = 2;
  203.                 }
  204.                 else
  205.                 {
  206.                     UserId = todo.w_userno;
  207.                     k1 = todo.w_k1;
  208.                     k2 = todo.w_k2;
  209.                 }
  210.             }
  211.             network.SetNetworkState(1, 120);
  212.             todo.DoBuildUserListScrollUp = true;
  213.         }
  214.  
  215.         final public static function NetworkClose()
  216.         {
  217.             network.SetNetworkState(0, -1);
  218.             if(socket)
  219.             {
  220.                 if(socket.connected)
  221.                 {
  222.                     socket.close();
  223.                 }
  224.             }
  225.             if(todo.messageecho == "s")
  226.             {
  227.                 if(chat.sending_lc)
  228.                 {
  229.                     chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "o");
  230.                 }
  231.             }
  232.         }
  233.  
  234.         final public static function SetNetworkState(param1:*, param2:*)
  235.         {
  236.             var _loc_3:String = null;
  237.             NetworkState = param1;
  238.             NetworkTimeout = param2;
  239.             if(main.ButtonLoginMc != undefined)
  240.             {
  241.                 if(NetworkState == 0)
  242.                 {
  243.                     _loc_3 = xconst.ST(19);
  244.                 }
  245.                 else
  246.                 {
  247.                     if(NetworkState == 4)
  248.                     {
  249.                         _loc_3 = xconst.ST(31);
  250.                     }
  251.                     else
  252.                     {
  253.                         _loc_3 = xconst.ST(32);
  254.                     }
  255.                 }
  256.                 main.ButtonLoginMc.SetText(_loc_3);
  257.             }
  258.         }
  259.  
  260.         final public static function NetworkTick()
  261.         {
  262.             var _loc_2:* = undefined;
  263.             var _loc_3:* = undefined;
  264.             var _loc_4:int = NaN;
  265.             var _loc_5:* = undefined;
  266.             var _loc_6:* = undefined;
  267.             var _loc_7:int = 0;
  268.             if(NetworkTimeout != -1)
  269.             {
  270.                 NetworkTimeout = NetworkTimeout - 1;
  271.                 if(NetworkTimeout < 0)
  272.                 {
  273.                     NetworkTimeout = 0;
  274.                 }
  275.             }
  276.             if(NetworkState == 1)
  277.             {
  278.                 network.auserLoaded();
  279.                 if(NetworkTimeout == 0)
  280.                 {
  281.                     network.SetNetworkState(0, -1);
  282.                     if(xFlag & 2)
  283.                     {
  284.                         xatlib.xLog("AT_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  285.                     }
  286.                     xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (AT)");
  287.                 }
  288.             }
  289.             else
  290.             {
  291.                 if(NetworkState == 3)
  292.                 {
  293.                     if(NetworkTimeout == 0)
  294.                     {
  295.                         if(attempt < xNumAttempts)
  296.                         {
  297.                             var _loc_8:network = network;
  298.                             var _loc_9:* = _loc_8.attempt + 1;
  299.                             _loc_8.attempt = _loc_9;
  300.                             _loc_8.SetNetworkState(0, -1);
  301.                             todo.lb = "n";
  302.                             todo.DoUpdate = true;
  303.                             _loc_8.NetworkClose();
  304.                             _loc_8.NetworkStartChat();
  305.                         }
  306.                         else
  307.                         {
  308.                             _loc_8.SetNetworkState(0, -1);
  309.                             if(xFlag & 2)
  310.                             {
  311.                                 xatlib.xLog("CT_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  312.                             }
  313.                             xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (CT)");
  314.                         }
  315.                     }
  316.                 }
  317.                 else
  318.                 {
  319.                     if(NetworkState == 4)
  320.                     {
  321.                         if(LurkerTimeout != -1)
  322.                         {
  323.                             if(todo.w_userno <= (2000000000 - 100000))
  324.                             {
  325.                                 if(LurkerTimeout <= 0)
  326.                                 {
  327.                                     _loc_8.NetworkSendMsg(todo.w_userno, "/KEEPALIVE", 0, 0, 1);
  328.                                 }
  329.                                 else
  330.                                 {
  331.                                     LurkerTimeout = LurkerTimeout - 1;
  332.                                 }
  333.                             }
  334.                         }
  335.                     }
  336.                     else
  337.                     {
  338.                         if(NetworkState == 5)
  339.                         {
  340.                             if(NetworkTimeout != -1)
  341.                             {
  342.                                 if(NetworkTimeout == 0)
  343.                                 {
  344.                                     _loc_8.NetworkStartChat();
  345.                                 }
  346.                             }
  347.                             else
  348.                             {
  349.                                 _loc_8.NetworkStartChat();
  350.                             }
  351.                         }
  352.                         else
  353.                         {
  354.                             if(NetworkState == 6)
  355.                             {
  356.                                 if(YI != undefined)
  357.                                 {
  358.                                     if(todo.w_password != undefined)
  359.                                     {
  360.                                         _loc_8.NetworkLogin(todo.w_email, todo.w_password);
  361.                                         WV = true;
  362.                                     }
  363.                                     _loc_8.SetNetworkState(7, 120);
  364.                                 }
  365.                                 if(NetworkTimeout == 0)
  366.                                 {
  367.                                     _loc_8.SetNetworkState(0, -1);
  368.                                     if(xFlag & 2)
  369.                                     {
  370.                                         xatlib.xLog("Y_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  371.                                     }
  372.                                     xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (Y)");
  373.                                 }
  374.                             }
  375.                             else
  376.                             {
  377.                                 if(NetworkState == 7)
  378.                                 {
  379.                                     if(WC !== 1)
  380.                                     {
  381.                                         if(mcCode && mcCode.code)
  382.                                         {
  383.                                             WC = mcCode.code;
  384.                                             mcCode.code = 0;
  385.                                         }
  386.                                         else
  387.                                         {
  388.                                         }
  389.                                     }
  390.                                     if(WV == false && WC > 0)
  391.                                     {
  392.                                         _loc_8.myOnJoin();
  393.                                     }
  394.                                 }
  395.                                 else
  396.                                 {
  397.                                     if(NetworkState == 8)
  398.                                     {
  399.                                     }
  400.                                     else
  401.                                     {
  402.                                         if(NetworkState == 9)
  403.                                         {
  404.                                         }
  405.                                         else
  406.                                         {
  407.                                             if(NetworkState == 11)
  408.                                             {
  409.                                             }
  410.                                             else
  411.                                             {
  412.                                                 if(NetworkState == 12)
  413.                                                 {
  414.                                                 }
  415.                                                 else
  416.                                                 {
  417.                                                     if(NetworkState == 13)
  418.                                                     {
  419.                                                     }
  420.                                                     else
  421.                                                     {
  422.                                                         if(NetworkState == 14)
  423.                                                         {
  424.                                                             if(ipLoaded || NetworkTimeout == 0)
  425.                                                             {
  426.                                                                 ipLoaded = true;
  427.                                                                 _loc_8.NetworkStartChat2();
  428.                                                             }
  429.                                                         }
  430.                                                     }
  431.                                                 }
  432.                                             }
  433.                                         }
  434.                                     }
  435.                                 }
  436.                             }
  437.                         }
  438.                     }
  439.                 }
  440.             }
  441.             MessageCount = MessageCount - 1;
  442.             if(MessageCount < 0)
  443.             {
  444.                 MessageCount = 0;
  445.             }
  446.             if((todo.MessageToProcess == "") && todo.lb == "n" && GotDone)
  447.             {
  448.                 main.ProcessMessage();
  449.             }
  450.             if((todo.MessageToSend == "") && MessageCount <= 0 && todo.lb == "n" && GotDone)
  451.             {
  452.                 todo.w_k1;
  453.                 if(!(todo.w_k1 && todo.MessageToSend.indexOf(todo.w_k1.toString()) == -1))
  454.                 {
  455.                     todo.MessageToSend = xatlib.Replace(todo.MessageToSend, todo.w_k1.toString(), (Math.floor(Math.random() * 2147483648.00)).toString());
  456.                 }
  457.                 todo.w_k3;
  458.                 if(!(todo.w_k3 && todo.MessageToSend.indexOf(todo.w_k3.toString()) == -1))
  459.                 {
  460.                     todo.MessageToSend = xatlib.Replace(todo.MessageToSend, todo.w_k3.toString(), (Math.floor(Math.random() * 2147483648.00)).toString());
  461.                 }
  462.                 _loc_2 = xatlib.CountLinks(todo.MessageToSend);
  463.                 if(_loc_2 <= 2)
  464.                 {
  465.                     _loc_8.NetworkSendMsg(todo.w_userno, todo.MessageToSend, todo.PrivateChat, todo.PrivateMessage, 0);
  466.                     var _loc_8:int = 0;
  467.                     todo.PrivateMessage = _loc_8;
  468.                     todo.PrivateChat = _loc_8;
  469.                     main.lockmc._visible = false;
  470.                     if(todo.messageecho == "l" && _loc_2 > 0)
  471.                     {
  472.                         if(chat.sending_lc)
  473.                         {
  474.                             chat.sending_lc.send(chat.fromxat, "onMsg", 4, todo.w_userno, todo.MessageToSend);
  475.                         }
  476.                     }
  477.                 }
  478.                 MessageCount = 25;
  479.                 todo.LastMessageToSend = todo.MessageToSend;
  480.                 todo.MessageToSend = "";
  481.             }
  482.             if(!(todo.w_registered == undefined) && FI && (todo.tick % 12) == 6 && todo.lb == "t" && GotDone && w_redirectport == undefined || w_redirectport == 80)
  483.             {
  484.                 _loc_3 = todo.w_friendlist.length;
  485.                 if(fs > 0)
  486.                 {
  487.                     xatlib.MainSolWrite("w_friendlist2", todo.w_friendlist2);
  488.                 }
  489.                 fs = 0;
  490.                 _loc_4 = 0;
  491.                 while(_loc_4 < _loc_3)
  492.                 {
  493.                     _loc_5 = todo.w_friendlist[_loc_4].u;
  494.                     if(_loc_5 > 6 && todo.w_friendlist2[_loc_5] == undefined)
  495.                     {
  496.                         _loc_6 = "";
  497.                         if(todo.w_friendlist[_loc_4].u != todo.w_userno)
  498.                         {
  499.                             _loc_6 = "/b " + todo.w_friendlist[_loc_4].u + "," + "1" + "," + "" + "," + (todo.w_friendlist[_loc_4].n.substr(0, 20));
  500.                         }
  501.                         else
  502.                         {
  503.                             if(todo.w_Mask == undefined)
  504.                             {
  505.                                 todo.w_Mask = todo.NO_POWERS.slice();
  506.                             }
  507.                             _loc_6 = "/b " + todo.w_friendlist[_loc_4].u + "," + "1" + "," + "" + "," + (todo.w_friendlist[_loc_4].n.substr(0, 128)) + "," + (todo.w_friendlist[_loc_4].a.toString().substr(0, 128)) + "," + (todo.w_friendlist[_loc_4].h.substr(0, 128)) + "," + todo.w_friendlist[_loc_4].v.toString();
  508.                             _loc_7 = 0;
  509.                             while(_loc_7 < todo.MAX_PWR_INDEX)
  510.                             {
  511.                                 _loc_6 = _loc_6 + "," + xatlib.xInt(todo.w_Mask[_loc_7]);
  512.                                 _loc_7++;
  513.                             }
  514.                         }
  515.                         _loc_8.NetworkSendMsg(todo.w_userno, _loc_6, 0, 0, 2);
  516.                         todo.w_friendlist2[_loc_5] = {flags:1};
  517.                         var _loc_8:network = _loc_8;
  518.                         var _loc_9:* = _loc_8.fs + 1;
  519.                         _loc_8.fs = _loc_9;
  520.                         if(_loc_9 >= 5)
  521.                         {
  522.                             break;
  523.                         }
  524.                     }
  525.                     _loc_4 = _loc_4 + 1;
  526.                 }
  527.                 if(fs == 0)
  528.                 {
  529.                     FI = false;
  530.                 }
  531.             }
  532.             var _loc_1:* = _loc_8.getTimer();
  533.             if(todo.lb == "t" && _loc_1 > UngagTimeout)
  534.             {
  535.                 _loc_4 = xatlib.FindUser(todo.w_userno);
  536.                 todo.Users[_loc_4].gagged = false;
  537.                 todo.DoBuildUserList = true;
  538.                 UngagTimeout = undefined;
  539.             }
  540.         }
  541.  
  542.         final private static function ipcompleteHandler(param1:Event) : void
  543.         {
  544.             if(ipLoaded)
  545.             {
  546.                 return;
  547.             }
  548.             var _loc_2:URLLoader = network.URLLoader(param1.target);
  549.             iprules = xJSON.decode(_loc_2.data);
  550.             xFlag = iprules["xFlag"];
  551.             xNumAttempts = iprules["order"].length;
  552.             ipLoaded = true;
  553.         }
  554.  
  555.         final public static function ipcompleteError(param1:ErrorEvent) : void
  556.         {
  557.             ipLoaded = true;
  558.         }
  559.  
  560.         final private static function ausercompleteHandler(param1:Event) : void
  561.         {
  562.             var _loc_2:URLLoader = network.URLLoader(param1.target);
  563.             var _loc_3:URLVariables = new URLVariables(_loc_2.data.substr(1));
  564.             UserId = _loc_3.UserId;
  565.             k1 = _loc_3.k1;
  566.             k2 = _loc_3.k2;
  567.         }
  568.  
  569.         final public static function auserLoaded()
  570.         {
  571.             var Port:* = undefined;
  572.             var IsBanned:Boolean = false;
  573.             var vx:* = undefined;
  574.             var ta:* = undefined;
  575.             var ctimeout:* = undefined;
  576.             var so4:* = undefined;
  577.             var rn:* = undefined;
  578.             if(UserId == undefined)
  579.             {
  580.             }
  581.             else
  582.             {
  583.                 if(UserId == 0)
  584.                 {
  585.                     network.SetNetworkState(0, -1);
  586.                     if(xFlag & 2)
  587.                     {
  588.                         xatlib.xLog("A_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  589.                     }
  590.                     xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (A)");
  591.                     todo.lb = "n";
  592.                     todo.DoUpdate = true;
  593.                 }
  594.                 else
  595.                 {
  596.                     if(UserId != 2)
  597.                     {
  598.                         todo.w_userno = xatlib.xInt(UserId);
  599.                         todo.w_k1 = k1;
  600.                         todo.w_k2 = xatlib.xInt(k2);
  601.                         so4 = xatlib.getLocal("chat", "/");
  602.                         so4.objectEncoding = ObjectEncoding.AMF0;
  603.                         if(todo.w_name == "")
  604.                         {
  605.                             todo.w_name = xatlib.GetDefaultName(todo.w_userno);
  606.                         }
  607.                         if(todo.w_avatar == "")
  608.                         {
  609.                             todo.w_avatar = xatlib.GetDefaultAvatar(todo.w_userno);
  610.                         }
  611.                         if(todo.w_homepage == "")
  612.                         {
  613.                             todo.w_homepage = "";
  614.                         }
  615.                     }
  616.                     else
  617.                     {
  618.                         rn = xatlib.xInt(Math.random() * 1000000);
  619.                         if(todo.w_name == "")
  620.                         {
  621.                             todo.w_name = xatlib.GetDefaultName(rn);
  622.                         }
  623.                         if(todo.w_avatar == "")
  624.                         {
  625.                             todo.w_avatar = xatlib.GetDefaultAvatar(rn);
  626.                         }
  627.                         if(todo.w_homepage == "")
  628.                         {
  629.                             todo.w_homepage = "";
  630.                         }
  631.                     }
  632.                     IsBanned = network.OnGagList(todo.w_useroom);
  633.                     vx = todo.Macros;
  634.                     xmessage.ClearLists(true);
  635.                     todo.Users.push({n:xatlib.NameNoXat(todo.w_name), s:todo.Macros != undefined ? todo.Macros["status"] : undefined, u:todo.w_userno, v:todo.w_userrev, a:todo.w_avatar, h:todo.w_homepage, online:true, banned:IsBanned, owner:false, OnXat:!(xatlib.xInt(global.xc) & 32) == 0, registered:todo.w_registered, VIP:todo.w_VIP, Bride:todo.w_d2, aFlags:todo.w_d0, Powers:todo.w_Powers, cb:todo.w_cb});
  636.                     network.AddGiftPower(0);
  637.                     todo.DoUpdateMessages = true;
  638.                     todo.ScrollDown = true;
  639.                     todo.LastScrollTime = undefined;
  640.                     ta = network.PickIP(todo.w_useroom);
  641.                     todo.sockdomain = ta[0];
  642.                     todo.useport = ta[1];
  643.                     ctimeout = ta[2];
  644.                     if(todo.sockdomain == "0" || todo.useport == 0)
  645.                     {
  646.                         network.SetNetworkState(0, -1);
  647.                         if(xFlag & 2)
  648.                         {
  649.                             xatlib.xLog("Z_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  650.                         }
  651.                         xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (Z)");
  652.                     }
  653.                     else
  654.                     {
  655.                         if(NetworkState == 3)
  656.                         {
  657.                             NetworkTimeout = 0;
  658.                         }
  659.                         var catchIOError:Function = _func_13;
  660.                         var catchSecurityError:Function = _func_14;
  661.                         socket = new XMLSocket();
  662.                         socket.addEventListener(Event.CONNECT, myOnConnect);
  663.                         socket.addEventListener(DataEvent.DATA, myOnXML);
  664.                         socket.addEventListener(Event.CLOSE, socketClose);
  665.                         socket.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
  666.                         socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, catchSecurityError);
  667.                         sjt = network.getTimer();
  668.                         Security.loadPolicyFile("xmlsocket://" + todo.sockdomain + ":10090");
  669.                         socket.connect(todo.sockdomain, todo.useport);
  670.                         if(xFlag & 4)
  671.                         {
  672.                             xatlib.xLog("C_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  673.                         }
  674.                         network.SetNetworkState(3, ctimeout);
  675.                     }
  676.                 }
  677.             }
  678.         }
  679.  
  680.         final public static function socketClose(param1:Event)
  681.         {
  682.             if(w_redirectport == undefined)
  683.             {
  684.                 network.SetNetworkState(5, Math.floor((Math.random() * 12) * 4));
  685.                 todo.lb = "n";
  686.                 todo.DoUpdate = true;
  687.             }
  688.             else
  689.             {
  690.             }
  691.         }
  692.  
  693.         final public static function myOnConnect(param1:Event)
  694.         {
  695.             var _loc_3:* = undefined;
  696.             var _loc_4:* = undefined;
  697.             var _loc_5:String = null;
  698.             var _loc_2:* = true;
  699.             if(NetworkState == 3)
  700.             {
  701.                 if(_loc_2)
  702.                 {
  703.                     YI = undefined;
  704.                     _loc_3 = new XMLDocument();
  705.                     _loc_4 = _loc_3.createElement("y");
  706.                     if(todo.useport == 80)
  707.                     {
  708.                         _loc_4.attributes.p = network.GetPort(todo.w_useroom);
  709.                         _loc_4.attributes.s = network.GetDom(todo.w_useroom);
  710.                     }
  711.                     if(todo.pass != undefined)
  712.                     {
  713.                         _loc_4.attributes.m = 1;
  714.                     }
  715.                     _loc_4.attributes.r = todo.w_useroom;
  716.                     _loc_4.attributes.v = attempt;
  717.                     _loc_4.attributes.u = todo.w_userno;
  718.                     _loc_3.appendChild(_loc_4);
  719.                     _loc_5 = xatlib.XMLOrder(_loc_3, new Array("w", "r", "m", "s", "p", "v", "u"));
  720.                     socket.send(_loc_5);
  721.                     network.SetNetworkState(6, 120);
  722.                 }
  723.                 else
  724.                 {
  725.                     if(attempt < xNumAttempts)
  726.                     {
  727.                         var _loc_6:network = network;
  728.                         var _loc_7:* = _loc_6.attempt + 1;
  729.                         _loc_6.attempt = _loc_7;
  730.                         _loc_6.SetNetworkState(0, -1);
  731.                         todo.lb = "n";
  732.                         todo.DoUpdate = true;
  733.                         _loc_6.NetworkClose();
  734.                         _loc_6.NetworkStartChat();
  735.                     }
  736.                     else
  737.                     {
  738.                         _loc_6.SetNetworkState(0, -1);
  739.                         if(xFlag & 2)
  740.                         {
  741.                             xatlib.xLog("CT_" + todo.w_useroom + "_" + todo.useport + "_" + todo.sockdomain);
  742.                         }
  743.                         xatlib.GeneralMessage(xconst.ST(100), xconst.ST(98) + " (F)");
  744.                     }
  745.                 }
  746.             }
  747.             else
  748.             {
  749.             }
  750.         }
  751.  
  752.         final public static function myOnJoin()
  753.         {
  754.             var _loc_8:int = 0;
  755.             network.SetNetworkState(4, -1);
  756.             todo.DoUserSnd = true;
  757.             var _loc_1:String = xatlib.CleanTextNoXat(todo.w_name);
  758.             var _loc_2:String = xatlib.CleanText(todo.w_avatar);
  759.             var _loc_3:String = xatlib.CleanText(todo.w_homepage);
  760.             if(_loc_1 == null)
  761.             {
  762.                 _loc_1 = "";
  763.             }
  764.             if(_loc_2 == null)
  765.             {
  766.                 _loc_2 = "";
  767.             }
  768.             if(_loc_3 == null)
  769.             {
  770.                 _loc_3 = "";
  771.             }
  772.             GotDone = false;
  773.             var _loc_4:* = new XMLDocument();
  774.             var _loc_5:* = _loc_4.createElement("j2");
  775.             _loc_5.attributes.v = todo.w_userrev == undefined ? 0 : todo.w_userrev;
  776.             _loc_5.attributes.h = _loc_3.substr(0, 128);
  777.             _loc_5.attributes.a = _loc_2.substr(0, 128);
  778.             _loc_5.attributes.n = _loc_1.substr(0, 256);
  779.             if(todo.Macros != undefined)
  780.             {
  781.                 if(todo.Macros["status"] != undefined)
  782.                 {
  783.                     _loc_5.attributes.n = _loc_5.attributes.n + "##" + (todo.Macros["status"].substr(0, 128));
  784.                 }
  785.             }
  786.             if(todo.w_registered != undefined)
  787.             {
  788.                 _loc_5.attributes.N = todo.w_registered;
  789.             }
  790.             if(todo.w_dt)
  791.             {
  792.                 _loc_5.attributes.dt = todo.w_dt;
  793.             }
  794.             if(todo.w_xats)
  795.             {
  796.                 _loc_5.attributes.dx = todo.w_xats;
  797.             }
  798.             if(todo.w_sn)
  799.             {
  800.                 _loc_5.attributes.sn = todo.w_sn;
  801.             }
  802.             if(todo.w_PowerO != undefined)
  803.             {
  804.                 _loc_5.attributes.dO = todo.w_PowerO;
  805.             }
  806.             if(todo.w_Powers != null)
  807.             {
  808.                 _loc_8 = 0;
  809.                 while(_loc_8 < todo.MAX_PWR_INDEX)
  810.                 {
  811.                     if(todo.w_Powers[_loc_8])
  812.                     {
  813.                         _loc_5.attributes["d" + (_loc_8 + 4)] = todo.w_Powers[_loc_8];
  814.                     }
  815.                     _loc_8++;
  816.                 }
  817.             }
  818.             if(todo.w_d3)
  819.             {
  820.                 _loc_5.attributes.d3 = todo.w_d3;
  821.             }
  822.             if(todo.w_d2)
  823.             {
  824.                 _loc_5.attributes.d2 = todo.w_d2;
  825.             }
  826.             if(todo.w_d0 != undefined)
  827.             {
  828.                 _loc_5.attributes.d0 = todo.w_d0;
  829.             }
  830.             if(todo.w_Mask != null)
  831.             {
  832.                 _loc_8 = 0;
  833.                 while(_loc_8 < todo.MAX_PWR_INDEX)
  834.                 {
  835.                     if(todo.w_Mask[_loc_8])
  836.                     {
  837.                         _loc_5.attributes["m" + _loc_8] = todo.w_Mask[_loc_8];
  838.                     }
  839.                     _loc_8++;
  840.                 }
  841.             }
  842.             _loc_5.attributes.u = todo.w_userrev == undefined ? 2 : todo.w_userno;
  843.             if(global.rf)
  844.             {
  845.                 _loc_5.attributes.e = "1";
  846.             }
  847.             _loc_5.attributes.f = (global.um != undefined ? 0 : todo.w_autologin & 1 ? 0 : 1) | (todo.LoginPressed ? 2 : 0) | (global.pass != undefined ? 4 : 0);
  848.             todo.w_autologin = todo.w_autologin | 1;
  849.             todo.pass;
  850.             if(!(todo.pass || global.pass == undefined))
  851.             {
  852.                 _loc_5.attributes.r = global.pass != undefined ? global.pass : todo.pass;
  853.             }
  854.             if(network.OnGagList(todo.w_useroom))
  855.             {
  856.                 _loc_5.attributes.b = network.GetGagTime(todo.w_useroom);
  857.             }
  858.             _loc_5.attributes.c = todo.w_useroom;
  859.             if(todo.w_pool != undefined)
  860.             {
  861.                 _loc_5.attributes.p = todo.w_pool;
  862.             }
  863.             if(todo.w_d1)
  864.             {
  865.                 _loc_5.attributes.d1 = todo.w_d1;
  866.             }
  867.             _loc_5.attributes.k3 = xatlib.xInt(todo.w_k3);
  868.             _loc_5.attributes.k = todo.w_k1;
  869.             _loc_5.attributes.y = YI;
  870.             if(global.xc & 32)
  871.             {
  872.                 _loc_5.attributes.q = 1;
  873.             }
  874.             _loc_5.attributes.l2 = jt1;
  875.             _loc_5.attributes.l3 = jt2;
  876.             _loc_5.attributes.l4 = network.getTimer() - sjt;
  877.             var _loc_6:BitmapData = new BitmapData(p_w, p_h, false, 13421772);
  878.             _loc_6.perlinNoise(p_w, p_h, p_octaves, p_seed, false, true, (BitmapDataChannel.ALPHA | BitmapDataChannel.RED) | BitmapDataChannel.GREEN | BitmapDataChannel.BLUE, false, null);
  879.             _loc_5.attributes.l5 = _loc_6.getPixel32(p_x, p_y);
  880.             if(WC > 1)
  881.             {
  882.                 _loc_5.attributes.Y = WC;
  883.             }
  884.             _loc_5.attributes.cb = todo.w_cb;
  885.             _loc_6.dispose();
  886.             _loc_4.appendChild(_loc_5);
  887.             if(!J2_Order)
  888.             {
  889.                 J2_Order = "cb,Y,l5,l4,l3,l2,q,y,k,k3,d1,z,p,c,b,r,f,e,u";
  890.                 _loc_8 = 0;
  891.                 while(_loc_8 < todo.MAX_PWR_INDEX)
  892.                 {
  893.                     J2_Order = J2_Order + ",m" + _loc_8;
  894.                     _loc_8++;
  895.                 }
  896.                 J2_Order = J2_Order + ",d0";
  897.                 _loc_8 = 2;
  898.                 while(_loc_8 < (todo.MAX_PWR_INDEX + 4))
  899.                 {
  900.                     J2_Order = J2_Order + ",d" + _loc_8;
  901.                     _loc_8++;
  902.                 }
  903.                 J2_Order = J2_Order + ",dO,sn,dx,dt,N,n,a,h,v";
  904.                 J2_Order = J2_Order.split(",");
  905.             }
  906.             var _loc_7:String = xatlib.XMLOrder(_loc_4, J2_Order);
  907.             socket.send(_loc_7);
  908.             todo.lb = "t";
  909.             todo.OnSuper = true;
  910.             todo.DoUpdate = true;
  911.             todo.ResetSmilies = true;
  912.             LurkerTimeout = LurkerLimit;
  913.             if(todo.messageecho == "s")
  914.             {
  915.                 if(chat.sending_lc)
  916.                 {
  917.                     chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "i");
  918.                 }
  919.             }
  920.             if(todo.messageecho == "a")
  921.             {
  922.                 if(chat.sending_lc)
  923.                 {
  924.                     chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "d");
  925.                 }
  926.             }
  927.             xatlib.MainSolWrite("w_lastroom", todo.w_useroom);
  928.         }
  929.  
  930.         final public static function myOnXML(param1:DataEvent)
  931.         {
  932.             var u:* = undefined;
  933.             var UserIndex:* = undefined;
  934.             var n:* = undefined;
  935.             var stra:* = undefined;
  936.             var t:int = 0;
  937.             var uid:int = 0;
  938.             var t55:* = undefined;
  939.             var s:* = undefined;
  940.             var vx:* = undefined;
  941.             var str:String = null;
  942.             var pstr:* = undefined;
  943.             var gpa:* = undefined;
  944.             var ll:* = undefined;
  945.             var j:* = undefined;
  946.             var c:* = undefined;
  947.             var temp_comm:* = undefined;
  948.             var IsPrivateMessage:Boolean = false;
  949.             var IsPrivateChat:Boolean = false;
  950.             var IsNew:Boolean = false;
  951.             var IsDeleteMessage:* = undefined;
  952.             var IsGagUser:* = undefined;
  953.             var IsUnGagUser:* = undefined;
  954.             var IsMakeUser:* = undefined;
  955.             var IsUnMakeUser:* = undefined;
  956.             var IsKickUser:* = undefined;
  957.             var IsUnknown:* = undefined;
  958.             var IsControlMessage:* = undefined;
  959.             var IsLocateUser:* = undefined;
  960.             var IsAtUser:* = undefined;
  961.             var IsScroller:* = undefined;
  962.             var FirstTwo:* = undefined;
  963.             var IsSlash:* = undefined;
  964.             var zz:* = undefined;
  965.             var tgagged:* = undefined;
  966.             var tbanned:* = undefined;
  967.             var tfriend:* = undefined;
  968.             var tmodplus:* = undefined;
  969.             var IsIgnored:Boolean = false;
  970.             var strText:String = null;
  971.             var lc:* = undefined;
  972.             var Links:* = undefined;
  973.             var Payload:* = undefined;
  974.             var TypeOn:* = undefined;
  975.             var TypeOff:* = undefined;
  976.             var farray:Array = null;
  977.             var id:* = undefined;
  978.             var f:* = undefined;
  979.             var friobj:Object = null;
  980.             var len:* = undefined;
  981.             var i:int = NaN;
  982.             var so93:* = undefined;
  983.             var pci:* = undefined;
  984.             var ptime:* = undefined;
  985.             var tt:* = undefined;
  986.             var TabsLength:* = undefined;
  987.             var uuid:* = undefined;
  988.             var arg:* = undefined;
  989.             var selfid:int = NaN;
  990.             var Friend:int = 0;
  991.             var loctext:* = undefined;
  992.             var pp:* = undefined;
  993.             var ii:* = undefined;
  994.             var d:* = undefined;
  995.             var g:* = undefined;
  996.             var msgno:* = undefined;
  997.             var v:* = undefined;
  998.             var NoBanMessage:* = undefined;
  999.             var BanTime:* = undefined;
  1000.             var my_date:Date = null;
  1001.             var UnfairTitle:String = null;
  1002.             var UnfairReport:String = null;
  1003.             var hh:* = undefined;
  1004.             var so47:* = undefined;
  1005.             var vt:* = undefined;
  1006.             var nopc:* = undefined;
  1007.             var nom:* = undefined;
  1008.             var maxpc:* = undefined;
  1009.             var maxm:* = undefined;
  1010.             var RemoveMessage:* = undefined;
  1011.             var HaveTab:* = undefined;
  1012.             var AllowPC:* = undefined;
  1013.             var TabNumber:int = NaN;
  1014.             var self:int = NaN;
  1015.             var IsMainOwner:Boolean = false;
  1016.             var IsOwner:Boolean = false;
  1017.             var IsModerator:Boolean = false;
  1018.             var IsMember:Boolean = false;
  1019.             var IsOnline:Boolean = false;
  1020.             var IsBanned:Boolean = false;
  1021.             var IsForever:Boolean = false;
  1022.             var IsGagged:Boolean = false;
  1023.             var OnXat:Boolean = false;
  1024.             var IsVIP:Boolean = false;
  1025.             var Powers:* = undefined;
  1026.             var IsStealth:Boolean = false;
  1027.             var cc:* = undefined;
  1028.             var a:* = undefined;
  1029.             var ee:* = undefined;
  1030.             var StringIndex:int = 0;
  1031.             var type:* = undefined;
  1032.             var Text:* = undefined;
  1033.             var left:int = NaN;
  1034.             var RndOr:* = undefined;
  1035.             var Rnd2:* = undefined;
  1036.             var q:* = undefined;
  1037.             var sarray:Array = null;
  1038.             var p:* = undefined;
  1039.             var doautoredirect:Boolean = false;
  1040.             var reason:* = undefined;
  1041.             var bootr:* = undefined;
  1042.             var errnum:int = 0;
  1043.             var event:DataEvent = param1;
  1044.             var doc:* = new XMLDocument(event.data);
  1045.             var e:* = doc.firstChild;
  1046.             if(e.attributes.n != undefined)
  1047.             {
  1048.                 e.attributes.n.replace(xatlib.r1, "");
  1049.                 e.attributes.n.replace(xatlib.r2, "");
  1050.             }
  1051.             if(e.attributes.t != undefined)
  1052.             {
  1053.                 e.attributes.t.replace(xatlib.r1, "");
  1054.                 e.attributes.t.replace(xatlib.r2, "");
  1055.             }
  1056.             if(e != null)
  1057.             {
  1058.                 u = xatlib.xInt(e.attributes.u);
  1059.                 UserIndex = xatlib.FindUser(u);
  1060.                 e.attributes.t;
  1061.                 if(e.attributes.t && e.attributes.u > 0)
  1062.                 {
  1063.                     n = 0;
  1064.                     while(n < e.attributes.t.length)
  1065.                     {
  1066.                         if(e.attributes.t.charCodeAt(n) < 32)
  1067.                         {
  1068.                             return;
  1069.                         }
  1070.                         n = n + 1;
  1071.                     }
  1072.                 }
  1073.                 if(e.nodeName == "y")
  1074.                 {
  1075.                     todo.WY = {i:e.attributes.i, k:e.attributes.k, j:e.attributes.j, t:e.attributes.t, s:e.attributes.s, au:e.attributes.au, v:e.attributes.v};
  1076.                     if(e.attributes.C)
  1077.                     {
  1078.                         WC = todo.WY;
  1079.                         network.doCap();
  1080.                         return;
  1081.                     }
  1082.                     YI = xatlib.xInt(e.attributes.i);
  1083.                     jt2 = network.getTimer() - sjt;
  1084.                     YC = xatlib.xInt(e.attributes.c);
  1085.                     YC2 = network.getTimer();
  1086.                     e.attributes.cb;
  1087.                     if(!(e.attributes.cb && global.sv == e.attributes.cb))
  1088.                     {
  1089.                         global.sv = e.attributes.cb;
  1090.                         xatlib.MainSolWrite("w_sv", e.attributes.cb);
  1091.                     }
  1092.                     if(e.attributes.j)
  1093.                     {
  1094.                         WC = todo.WY;
  1095.                         network.doCode();
  1096.                     }
  1097.                     else
  1098.                     {
  1099.                         WC = 1;
  1100.                     }
  1101.                     if(e.attributes.p)
  1102.                     {
  1103.                         stra = e.attributes.p.split("_");
  1104.                         p_w = xatlib.xInt(stra[0]);
  1105.                         p_h = xatlib.xInt(stra[1]);
  1106.                         p_octaves = xatlib.xInt(stra[2]);
  1107.                         p_seed = xatlib.xInt(stra[3]);
  1108.                         t = YI % (p_w * p_h);
  1109.                         p_x = t % p_w;
  1110.                         p_y = Math.floor(t / p_w);
  1111.                     }
  1112.                     attempt = 0;
  1113.                     prevrpool = -1;
  1114.                 }
  1115.                 else
  1116.                 {
  1117.                     if(e.nodeName == "x")
  1118.                     {
  1119.                         network.UpdateChannel(e.attributes.i, e.attributes.u);
  1120.                         todo.Users[UserIndex].mainowner;
  1121.                         todo.Users[UserIndex].owner;
  1122.                         if((e.attributes.i == 10001) || (e.attributes.t.substr(0, 1)) == "b" || todo.Users[UserIndex].mainowner || todo.Users[UserIndex].owner || todo.Users[UserIndex].moderator)
  1123.                         {
  1124.                             if(e.attributes.i >= 40000 && e.attributes.i < 50000)
  1125.                             {
  1126.                                 if(chat.sending_lc)
  1127.                                 {
  1128.                                     chat.sending_lc.send(chat.fromxat, "onMsg", e.attributes.i, e.attributes.u, e.toString());
  1129.                                 }
  1130.                             }
  1131.                             else
  1132.                             {
  1133.                                 if(e.attributes.i == 10000 && (e.attributes.t.substr(0, 1)) == "B" && (todo.HasPower(selfid, 44)) == false)
  1134.                                 {
  1135.                                 }
  1136.                                 else
  1137.                                 {
  1138.                                     if(chat.sending_lc)
  1139.                                     {
  1140.                                         chat.sending_lc.send(chat.fromxat, "onMsg", e.attributes.i, e.attributes.u, e.attributes.t);
  1141.                                     }
  1142.                                 }
  1143.                             }
  1144.                         }
  1145.                     }
  1146.                     else
  1147.                     {
  1148.                         if(e.nodeName == "a")
  1149.                         {
  1150.                             uid = xatlib.FindUser(e.attributes.u);
  1151.                             t55 = xconst.kssw[e.attributes.k];
  1152.                             if(t55)
  1153.                             {
  1154.                                 t55 = !(todo.HasPower(uid, t55));
  1155.                             }
  1156.                             if(!t55)
  1157.                             {
  1158.                                 if(!(e.attributes.u == todo.w_userno || uid < 0 || todo.Users[uid].ignored == true))
  1159.                                 {
  1160.                                     xkiss.Kiss({t:e.attributes.t, u:e.attributes.u, k:e.attributes.k, b:e.attributes.b, f:e.attributes.f, x:e.attributes.x, s:e.attributes.s});
  1161.                                 }
  1162.                             }
  1163.                             if(e.attributes.c != undefined)
  1164.                             {
  1165.                                 todo.w_coins = xatlib.xInt(e.attributes.c);
  1166.                                 xatlib.MainSolWrite("w_coins", todo.w_coins);
  1167.                             }
  1168.                         }
  1169.                         else
  1170.                         {
  1171.                             if(e.nodeName == "bl")
  1172.                             {
  1173.                                 xkiss.LoadWink(e);
  1174.                             }
  1175.                             else
  1176.                             {
  1177.                                 if(e.nodeName == "v")
  1178.                                 {
  1179.                                     if(e.attributes.e != undefined)
  1180.                                     {
  1181.                                         t = xatlib.xInt(e.attributes.t);
  1182.                                             n = xatlib.xInt(e.attributes.e);
  1183.                                         switch(xatlib.xInt(e.attributes.e))
  1184.                                         {
  1185.                                         case 6:
  1186.                                             s = xconst.ST(164);
  1187.                                             break;
  1188.                                         case 8:
  1189.                                             s = xconst.ST(165);
  1190.                                             break;
  1191.                                         case 10:
  1192.                                             s = xconst.ST(166);
  1193.                                             break;
  1194.                                         case 11:
  1195.                                             s = xconst.ST(167);
  1196.                                             break;
  1197.                                         case 13:
  1198.                                             s = xconst.ST(25);
  1199.                                             break;
  1200.                                         case 14:
  1201.                                             s = xconst.ST(168);
  1202.                                             break;
  1203.                                         case 15:
  1204.                                             s = xconst.ST(169);
  1205.                                             break;
  1206.                                         case 16:
  1207.                                             s = xconst.ST(170);
  1208.                                             break;
  1209.                                         case 17:
  1210.                                             s = xconst.ST(171);
  1211.                                             break;
  1212.                                         case 18:
  1213.                                             s = xconst.ST(172);
  1214.                                             break;
  1215.                                         case 22:
  1216.                                             s = xconst.ST(173);
  1217.                                             break;
  1218.                                         case 24:
  1219.                                             s = xconst.ST(187, t.toString());
  1220.                                             break;
  1221.                                         case 36:
  1222.                                             s = xconst.ST(215);
  1223.                                             break;
  1224.                                         case 38:
  1225.                                             s = xconst.ST(234);
  1226.                                             if(t)
  1227.                                             {
  1228.                                                 s = s + " " + (xconst.ST(235, t.toString()));
  1229.                                             }
  1230.                                             break;
  1231.                                         case 50:
  1232.                                             s = "Single power prevents this";
  1233.                                             break;
  1234.                                         default:
  1235.                                             s = (xconst.ST(174) + " ") + n;
  1236.                                             break;
  1237.                                         }
  1238.                                         if(n != 39)
  1239.                                         {
  1240.                                             xatlib.GeneralMessage(xconst.ST(175), s);
  1241.                                         }
  1242.                                         if(e.attributes.m == undefined)
  1243.                                         {
  1244.                                             var _loc_3:undefined = undefined;
  1245.                                             todo.w_Powers = _loc_3;
  1246.                                             var _loc_3:undefined = _loc_3;
  1247.                                             todo.w_VIP = _loc_3;
  1248.                                             var _loc_3:undefined = _loc_3;
  1249.                                             todo.w_registered = _loc_3;
  1250.                                             var _loc_3:undefined = _loc_3;
  1251.                                             todo.w_bride = _loc_3;
  1252.                                             todo.w_d0 = _loc_3;
  1253.                                             todo.w_k3 = 0;
  1254.                                             todo.w_PowerO = 0;
  1255.                                             todo.w_sn = 0;
  1256.                                             todo.w_xats = 0;
  1257.                                             var _loc_3:int = 0;
  1258.                                             todo.w_coins = _loc_3;
  1259.                                             var _loc_3:int = _loc_3;
  1260.                                             todo.w_dt = _loc_3;
  1261.                                             var _loc_3:int = _loc_3;
  1262.                                             todo.w_d3 = _loc_3;
  1263.                                             todo.w_d2 = _loc_3;
  1264.                                             if(todo.w_email == 0 && todo.w_password == "$0")
  1265.                                             {
  1266.                                                 network.SaveRegData();
  1267.                                                 try
  1268.                                                 {
  1269.                                                     main.mcLoad.LoggedIn(1);
  1270.                                                 }
  1271.                                                 catch(e:Error)
  1272.                                                 {
  1273.                                                 }
  1274.                                             }
  1275.                                             else
  1276.                                             {
  1277.                                                 try
  1278.                                                 {
  1279.                                                     main.mcLoad.LoggedIn(0);
  1280.                                                 }
  1281.                                                 catch(e:Error)
  1282.                                                 {
  1283.                                                 }
  1284.                                             }
  1285.                                         }
  1286.                                     }
  1287.                                     else
  1288.                                     {
  1289.                                         todo.w_userno = e.attributes.i;
  1290.                                         todo.w_userrev = 0;
  1291.                                         todo.w_k1 = e.attributes.k1;
  1292.                                         todo.w_d0 = e.attributes.d0;
  1293.                                         todo.w_d1 = e.attributes.d1;
  1294.                                         todo.w_d2 = xatlib.xInt(e.attributes.d2);
  1295.                                         todo.w_d3 = xatlib.xInt(e.attributes.d3);
  1296.                                         todo.w_dt = xatlib.xInt(e.attributes.dt);
  1297.                                         todo.w_Powers = [];
  1298.                                         t = 0;
  1299.                                         while(t < todo.MAX_PWR_INDEX)
  1300.                                         {
  1301.                                             todo.w_Powers.push(xatlib.xInt(e.attributes["d" + (t + 4)]));
  1302.                                             t = t + 1;
  1303.                                         }
  1304.                                         todo.w_PowerO = e.attributes.dO;
  1305.                                         t = xatlib.FindUser(todo.w_d2);
  1306.                                         if(t >= 0)
  1307.                                         {
  1308.                                             todo.w_bride = todo.Users[t].registered;
  1309.                                         }
  1310.                                         todo.w_coins = xatlib.xInt(e.attributes.c);
  1311.                                         todo.w_xats = e.attributes.dx;
  1312.                                         todo.w_sn = e.attributes.sn;
  1313.                                         if(todo.w_xats)
  1314.                                         {
  1315.                                             todo.w_coins = xatlib.xInt(todo.w_xats);
  1316.                                         }
  1317.                                         todo.w_registered = e.attributes.n;
  1318.                                         todo.w_k2 = e.attributes.k2;
  1319.                                         todo.w_k3 = e.attributes.k3;
  1320.                                         todo.w_cb = YC;
  1321.                                         network.SaveRegData();
  1322.                                         todo.WV2;
  1323.                                         if(todo.WV2 || e.attributes.RL)
  1324.                                         {
  1325.                                             todo.lb = "n";
  1326.                                             todo.DoUpdate = true;
  1327.                                             network.NetworkClose();
  1328.                                             network.NetworkStartChat();
  1329.                                             todo.WV2 = false;
  1330.                                         }
  1331.                                         vx = todo.Macros;
  1332.                                         xmessage.ClearLists(true);
  1333.                                         todo.Users.push({n:xatlib.NameNoXat(todo.w_name), s:todo.Macros != undefined ? todo.Macros["status"] : undefined, u:todo.w_userno, v:todo.w_userrev, a:todo.w_avatar, h:todo.w_homepage, online:true, banned:IsBanned, owner:false, OnXat:!(xatlib.xInt(global.xc) & 32) == 0, registered:todo.w_registered, VIP:todo.w_VIP, Bride:todo.w_d2, aFlags:todo.w_d0, Powers:todo.w_Powers});
  1334.                                         network.AddGiftPower(0);
  1335.                                         todo.DoBuildUserList = true;
  1336.                                         todo.DoUpdateMessages = true;
  1337.                                         todo.ScrollDown = true;
  1338.                                         todo.LastScrollTime = undefined;
  1339.                                         try
  1340.                                         {
  1341.                                             main.mcLoad.LoggedIn(1);
  1342.                                         }
  1343.                                         catch(e:Error)
  1344.                                         {
  1345.                                         }
  1346.                                         if(todo.messageecho == "s")
  1347.                                         {
  1348.                                             if(chat.sending_lc)
  1349.                                             {
  1350.                                                 chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "l");
  1351.                                             }
  1352.                                         }
  1353.                                     }
  1354.                                     todo.w_password = undefined;
  1355.                                     WV = false;
  1356.                                 }
  1357.                                 else
  1358.                                 {
  1359.                                     if(e.nodeName == "ap")
  1360.                                     {
  1361.                                         str = " ";
  1362.                                         pstr = xconst.pssa[xatlib.xInt(e.attributes.p) + 1];
  1363.                                         switch(xatlib.xInt(e.attributes.r))
  1364.                                         {
  1365.                                         case 0:
  1366.                                             str = xconst.ST(239, pstr);
  1367.                                             break;
  1368.                                         case 1:
  1369.                                             str = xconst.ST(240, pstr);
  1370.                                             break;
  1371.                                         case 2:
  1372.                                             str = xconst.ST(241, pstr);
  1373.                                             break;
  1374.                                         case 3:
  1375.                                             str = xconst.ST(242, pstr);
  1376.                                             break;
  1377.                                         case 4:
  1378.                                             str = pstr + " already assigned";
  1379.                                             break;
  1380.                                         case 9:
  1381.                                             str = pstr + " system error (db down)";
  1382.                                             break;
  1383.                                         default:
  1384.                                             str = pstr + " unknown errorcode";
  1385.                                             break;
  1386.                                         }
  1387.                                         xatlib.GeneralMessage(xconst.ST(237), str);
  1388.                                     }
  1389.                                     else
  1390.                                     {
  1391.                                         if(e.nodeName == "gp")
  1392.                                         {
  1393.                                             gpa = e.attributes.p.split("|");
  1394.                                             ll = 0;
  1395.                                             while(ll < gpa.length)
  1396.                                             {
  1397.                                                 todo.w_GroupPowers[ll] = xatlib.xInt(gpa[ll]);
  1398.                                                 ll = ll + 1;
  1399.                                             }
  1400.                                             var _loc_3:int = 0;
  1401.                                             var _loc_4:* = e.attributes;
  1402.                                             for each(ll in _loc_4)
  1403.                                             {
  1404.                                                 if(ll.charAt(0) == "g")
  1405.                                                 {
  1406.                                                     if(todo.HasPowerA(todo.w_GroupPowers, xatlib.xInt(ll.substr(1))))
  1407.                                                     {
  1408.                                                         todo.gconfig[ll] = e.attributes[ll];
  1409.                                                         if(todo.gconfig[ll].charAt(0) == "{")
  1410.                                                         {
  1411.                                                             todo.gconfig[ll] = xatlib.xJSONdecode(todo.gconfig[ll]);
  1412.                                                         }
  1413.                                                     }
  1414.                                                 }
  1415.                                             }
  1416.                                             if(todo.gconfig["g100"])
  1417.                                             {
  1418.                                                 ll = todo.gconfig["g100"].split(",");
  1419.                                                 todo.gconfig["g100"] = {};
  1420.                                                 j = 0;
  1421.                                                 while(j < ll.length)
  1422.                                                 {
  1423.                                                     todo.gconfig["g100"][ll[j]] = ll[j + 1];
  1424.                                                     j = j + 2;
  1425.                                                 }
  1426.                                             }
  1427.                                             if(todo.HasPowerA(todo.w_GroupPowers, 90))
  1428.                                             {
  1429.                                                 xconst.MakeBads(e.attributes.g90);
  1430.                                             }
  1431.                                             if(todo.HasPowerA(todo.w_GroupPowers, 106) && todo.gconfig["g106"])
  1432.                                             {
  1433.                                                 c = todo.gconfig["g106"].split("#");
  1434.                                                 if(todo.HasPowerA(todo.w_GroupPowers, 130))
  1435.                                                 {
  1436.                                                     todo.gconfig["g130"] = c.pop();
  1437.                                                     if(todo.Macros["gback"] === "off")
  1438.                                                     {
  1439.                                                     }
  1440.                                                 }
  1441.                                                 t = 0;
  1442.                                                 while(t < c.length)
  1443.                                                 {
  1444.                                                     c[t] = xatlib.DecodeColor(c[t]);
  1445.                                                     t = t + 1;
  1446.                                                 }
  1447.                                                 todo.gconfig["g106"] = c.join("#");
  1448.                                                 if(!todo.gconfig["g74"])
  1449.                                                 {
  1450.                                                     todo.gconfig["g74"] = "smile,biggrin,wink,eek,tongue,cool,mad,confused,redface,frown,crying,sleepy,rolleyes,star,kiss,vampire,pirate2";
  1451.                                                     todo.w_GroupPowers[2] = todo.w_GroupPowers[2] | 65535;
  1452.                                                 }
  1453.                                             }
  1454.                                             if(todo.HasPowerA(todo.w_GroupPowers, 206))
  1455.                                             {
  1456.                                                 temp_comm = "http://xat.com/json/lang/customlang2.php?t=" + todo.w_room_cb + "&r=" + todo.w_useroom;
  1457.                                                 xatlib.LoadVariables(temp_comm, chat.onLang);
  1458.                                             }
  1459.                                         }
  1460.                                         else
  1461.                                         {
  1462.                                             if(e.nodeName == "m" || e.nodeName == "p" || e.nodeName == "c" || e.nodeName == "z")
  1463.                                             {
  1464.                                                 if(!GotDone && global.xc & 32768)
  1465.                                                 {
  1466.                                                     return;
  1467.                                                 }
  1468.                                                 IsPrivateMessage = false;
  1469.                                                 IsPrivateChat = false;
  1470.                                                 IsNew = true;
  1471.                                                 IsDeleteMessage = false;
  1472.                                                 IsGagUser = false;
  1473.                                                 IsUnGagUser = false;
  1474.                                                 IsMakeUser = false;
  1475.                                                 IsUnMakeUser = false;
  1476.                                                 IsKickUser = false;
  1477.                                                 IsUnknown = false;
  1478.                                                 IsControlMessage = false;
  1479.                                                 IsLocateUser = false;
  1480.                                                 IsAtUser = false;
  1481.                                                 IsScroller = false;
  1482.                                                 if(!e.attributes.t)
  1483.                                                 {
  1484.                                                     e.attributes.t = "";
  1485.                                                 }
  1486.                                                 FirstTwo = e.attributes.t.substr(0, 2);
  1487.                                                 IsSlash = (FirstTwo.substr(0, 1)) == "/";
  1488.                                                 if(e.attributes.u == 0)
  1489.                                                 {
  1490.                                                     IsScroller = false;
  1491.                                                 }
  1492.                                                 zz = 0;
  1493.                                                 if(e.attributes.t === "zz7")
  1494.                                                 {
  1495.                                                     zz = zz + 1;
  1496.                                                 }
  1497.                                                 if(e.nodeName == "p" || e.nodeName == "z")
  1498.                                                 {
  1499.                                                     IsPrivateMessage = true;
  1500.                                                 }
  1501.                                                 if(e.nodeName == "c")
  1502.                                                 {
  1503.                                                     IsControlMessage = true;
  1504.                                                 }
  1505.                                                 if(e.attributes.s & 1)
  1506.                                                 {
  1507.                                                     IsNew = false;
  1508.                                                 }
  1509.                                                 if(IsPrivateMessage && e.attributes.s & 2)
  1510.                                                 {
  1511.                                                     IsPrivateChat = true;
  1512.                                                 }
  1513.                                                 if(!IsSlash && e.nodeName == "m" && e.attributes.u == undefined)
  1514.                                                 {
  1515.                                                     return;
  1516.                                                 }
  1517.                                                 if(e.attributes.t.indexOf("<inf7>") != -1)
  1518.                                                 {
  1519.                                                     IsSlash = true;
  1520.                                                 }
  1521.                                                 e.attributes.t = xatlib.Replace(e.attributes.t, ">", "}");
  1522.                                                 if(IsPrivateMessage && !IsPrivateChat && !IsSlash)
  1523.                                                 {
  1524.                                                     e.attributes.t = "<priv> " + e.attributes.t;
  1525.                                                 }
  1526.                                                 if(IsSlash)
  1527.                                                 {
  1528.                                                     if(FirstTwo == "/d")
  1529.                                                     {
  1530.                                                         IsDeleteMessage = true;
  1531.                                                     }
  1532.                                                     if(FirstTwo == "/s")
  1533.                                                     {
  1534.                                                         IsScroller = true;
  1535.                                                     }
  1536.                                                     if(e.nodeName == "c" && FirstTwo == "/g")
  1537.                                                     {
  1538.                                                         IsGagUser = true;
  1539.                                                     }
  1540.                                                     if(e.nodeName == "c" && FirstTwo == "/u")
  1541.                                                     {
  1542.                                                         IsUnGagUser = true;
  1543.                                                     }
  1544.                                                     if(e.nodeName == "c" || e.nodeName == "p")
  1545.                                                     {
  1546.                                                         if(FirstTwo == "/m")
  1547.                                                         {
  1548.                                                             IsMakeUser = true;
  1549.                                                         }
  1550.                                                         if(FirstTwo == "/r")
  1551.                                                         {
  1552.                                                             IsUnMakeUser = true;
  1553.                                                         }
  1554.                                                         if(FirstTwo == "/k")
  1555.                                                         {
  1556.                                                             IsKickUser = true;
  1557.                                                         }
  1558.                                                     }
  1559.                                                     if(e.nodeName == "z")
  1560.                                                     {
  1561.                                                         if(FirstTwo == "/l")
  1562.                                                         {
  1563.                                                             IsLocateUser = true;
  1564.                                                         }
  1565.                                                         if(FirstTwo == "/a")
  1566.                                                         {
  1567.                                                             IsAtUser = true;
  1568.                                                         }
  1569.                                                     }
  1570.                                                     if(FirstTwo == "/R")
  1571.                                                     {
  1572.                                                         Payload = e.attributes.t.substr(2);
  1573.                                                         TypeOn = Payload == "TypeOn";
  1574.                                                         TypeOff = Payload == "TypeOff";
  1575.                                                         if(TypeOn || TypeOff)
  1576.                                                         {
  1577.                                                             if(TypeOff || IsPrivateMessage || !main.ctabsmc.TabIsPrivate())
  1578.                                                             {
  1579.                                                                 main.SetTyping(u, TypeOn);
  1580.                                                             }
  1581.                                                         }
  1582.                                                         return;
  1583.                                                     }
  1584.                                                     if(FirstTwo == "/b")
  1585.                                                     {
  1586.                                                         if(e.attributes.t == "/bd")
  1587.                                                         {
  1588.                                                             todo.w_friendlist.length = 0;
  1589.                                                             todo.w_friendlist2 = new Object();
  1590.                                                         }
  1591.                                                         else
  1592.                                                         {
  1593.                                                             if(e.attributes.t == "/bf")
  1594.                                                             {
  1595.                                                                 xatlib.MainSolWrite("w_friendlist", todo.w_friendlist);
  1596.                                                                 xatlib.MainSolWrite("w_friendlist2", todo.w_friendlist2);
  1597.                                                             }
  1598.                                                             else
  1599.                                                             {
  1600.                                                                 farray = e.attributes.t.substr(3).split(",");
  1601.                                                                 id = xatlib.xInt(farray[0]);
  1602.                                                                 f = xatlib.xInt(farray[1]);
  1603.                                                                 if(id == todo.w_userno)
  1604.                                                                 {
  1605.                                                                     so93 = xatlib.getLocal("chat", "/");
  1606.                                                                     so93.objectEncoding = ObjectEncoding.AMF0;
  1607.                                                                 }
  1608.                                                                 len = todo.w_friendlist.length;
  1609.                                                                 i = 0;
  1610.                                                                 while(i < len)
  1611.                                                                 {
  1612.                                                                     if(todo.w_friendlist[i].u == id)
  1613.                                                                     {
  1614.                                                                         friobj = todo.w_friendlist[i];
  1615.                                                                         break;
  1616.                                                                     }
  1617.                                                                     i = i + 1;
  1618.                                                                 }
  1619.                                                                 if(!friobj)
  1620.                                                                 {
  1621.                                                                     friobj = new Object();
  1622.                                                                     todo.w_friendlist.push(friobj);
  1623.                                                                 }
  1624.                                                                 friobj.u = id;
  1625.                                                                 friobj.v = xatlib.xInt(friobj.v);
  1626.                                                                 friobj.n = xatlib.CleanTextNoXat(farray[3]);
  1627.                                                                 if(!friobj.a)
  1628.                                                                 {
  1629.                                                                     friobj.a = "";
  1630.                                                                 }
  1631.                                                                 if(!friobj.h)
  1632.                                                                 {
  1633.                                                                     friobj.h = "";
  1634.                                                                 }
  1635.                                                                 friobj.f = f;
  1636.                                                                 if(todo.w_friendlist2[id] == undefined)
  1637.                                                                 {
  1638.                                                                     todo.w_friendlist2[id] = new Object();
  1639.                                                                 }
  1640.                                                                 todo.w_friendlist2[id].flags = xatlib.xInt(todo.w_friendlist2[id].flags) | 1;
  1641.                                                             }
  1642.                                                         }
  1643.                                                     }
  1644.                                                     if(FirstTwo == "/p")
  1645.                                                     {
  1646.                                                         pci = xatlib.xInt(e.attributes.t.indexOf(","));
  1647.                                                         if(pci != -1)
  1648.                                                         {
  1649.                                                             i = xatlib.FindUser(todo.w_userno);
  1650.                                                             todo.Users[i].gagged = true;
  1651.                                                             todo.DoBuildUserList = true;
  1652.                                                             UngagTimeout = network.getTimer() + (xatlib.xInt(e.attributes.t.substr(pci + 1))) * 1000;
  1653.                                                         }
  1654.                                                         ptime = 0;
  1655.                                                         if(pci == -1)
  1656.                                                         {
  1657.                                                             ptime = xatlib.xInt(e.attributes.t.substr(2));
  1658.                                                         }
  1659.                                                         else
  1660.                                                         {
  1661.                                                             ptime = xatlib.xInt(e.attributes.t.substr(2, pci - 1));
  1662.                                                         }
  1663.                                                         id = " (" + e.attributes.d + ")";
  1664.                                                         if(ptime == 0)
  1665.                                                         {
  1666.                                                             if(pci == -1)
  1667.                                                             {
  1668.                                                                 UngagTimeout = 0;
  1669.                                                             }
  1670.                                                         }
  1671.                                                         else
  1672.                                                         {
  1673.                                                             if(ptime == -1)
  1674.                                                             {
  1675.                                                                 len = todo.Users.length;
  1676.                                                                 tt = 0;
  1677.                                                                 while(tt < len)
  1678.                                                                 {
  1679.                                                                     todo.Users[tt].gagged = undefined;
  1680.                                                                     tt = tt + 1;
  1681.                                                                 }
  1682.                                                                 todo.DoBuildUserList = true;
  1683.                                                                 todo.helpstr = xconst.ST(192) + id;
  1684.                                                                 todo.HelpUpdate = 0;
  1685.                                                             }
  1686.                                                             else
  1687.                                                             {
  1688.                                                                 if(!e.attributes.T || e.attributes.T == " ")
  1689.                                                                 {
  1690.                                                                     todo.helpstr = (xconst.ST(193, (Math.ceil(ptime / 60)).toString())) + id;
  1691.                                                                 }
  1692.                                                                 else
  1693.                                                                 {
  1694.                                                                     todo.helpstr = (xconst.ST(261) + " /p") + e.attributes.T + id;
  1695.                                                                 }
  1696.                                                                 todo.HelpUpdate = 0;
  1697.                                                             }
  1698.                                                         }
  1699.                                                     }
  1700.                                                     if(FirstTwo == "/t")
  1701.                                                     {
  1702.                                                         TabsLength = main.ctabsmc.tabs.length;
  1703.                                                         tt = 0;
  1704.                                                         while(tt < TabsLength)
  1705.                                                         {
  1706.                                                             if(main.ctabsmc.tabs[tt].User == u && main.ctabsmc.tabs[tt].Flags & 16)
  1707.                                                             {
  1708.                                                                 xkiss.Kiss({t:e.attributes.t.substr(2), u:e.attributes.u, k:"Ttth"});
  1709.                                                                 main.Private_onDelete(tt);
  1710.                                                                 break;
  1711.                                                             }
  1712.                                                             tt = tt + 1;
  1713.                                                         }
  1714.                                                     }
  1715.                                                     if(e.nodeName == "m")
  1716.                                                     {
  1717.                                                         if(FirstTwo == "/k" && e.attributes.t.charAt(2) == "a")
  1718.                                                         {
  1719.                                                             e.attributes.t = "<i> " + (xconst.ST(123, "(kickall#)", e.attributes.t));
  1720.                                                             IsSlash = false;
  1721.                                                         }
  1722.                                                         else
  1723.                                                         {
  1724.                                                             if(FirstTwo == "/g" || FirstTwo == "/u" || FirstTwo == "/m" || FirstTwo == "/r" || FirstTwo == "/k" || FirstTwo == "/n")
  1725.                                                             {
  1726.                                                                 if(e.attributes.p != undefined)
  1727.                                                                 {
  1728.                                                                     e.attributes.p = xatlib.Replace(e.attributes.p, ">", " ");
  1729.                                                                 }
  1730.                                                                 uid = xatlib.FindUser(e.attributes.d);
  1731.                                                                 if(uid != -1)
  1732.                                                                 {
  1733.                                                                     if(FirstTwo == "/g")
  1734.                                                                     {
  1735.                                                                         if((e.attributes.t.substr(0, 3)) == "/gg")
  1736.                                                                         {
  1737.                                                                             e.attributes.t = network.SysMsg(5, undefined, uid, e.attributes.p, xatlib.xInt(e.attributes.t.substr(3)));
  1738.                                                                         }
  1739.                                                                         else
  1740.                                                                         {
  1741.                                                                             if((e.attributes.t.substr(0, 3)) == "/gm")
  1742.                                                                             {
  1743.                                                                                 e.attributes.t = network.SysMsg(6, undefined, uid, e.attributes.p, xatlib.xInt(e.attributes.t.substr(3)));
  1744.                                                                             }
  1745.                                                                             else
  1746.                                                                             {
  1747.                                                                                 e.attributes.t = network.SysMsg(2, undefined, uid, e.attributes.p, xatlib.xInt(e.attributes.t.substr(2)), e.attributes.w);
  1748.                                                                             }
  1749.                                                                         }
  1750.                                                                     }
  1751.                                                                     else
  1752.                                                                     {
  1753.                                                                         if(FirstTwo == "/u")
  1754.                                                                         {
  1755.                                                                             e.attributes.t = network.SysMsg(3, undefined, uid, e.attributes.p, xatlib.xInt(e.attributes.t.substr(2)));
  1756.                                                                         }
  1757.                                                                         else
  1758.                                                                         {
  1759.                                                                             if(FirstTwo == "/m")
  1760.                                                                             {
  1761.                                                                                 e.attributes.t = network.SysMsg(0, e.attributes.p, uid);
  1762.                                                                             }
  1763.                                                                             else
  1764.                                                                             {
  1765.                                                                                 if(FirstTwo == "/r")
  1766.                                                                                 {
  1767.                                                                                     e.attributes.t = network.SysMsg(0, "r", uid);
  1768.                                                                                 }
  1769.                                                                                 else
  1770.                                                                                 {
  1771.                                                                                     if(FirstTwo == "/k")
  1772.                                                                                     {
  1773.                                                                                         uuid = xatlib.FindUser(e.attributes.u);
  1774.                                                                                         arg = [];
  1775.                                                                                         if(e.attributes.p)
  1776.                                                                                         {
  1777.                                                                                             arg = e.attributes.p.split("#");
  1778.                                                                                         }
  1779.                                                                                         if(arg.length == 2 && !(todo.HasPower(uuid, 25)))
  1780.                                                                                         {
  1781.                                                                                             e.attributes.p = arg[0];
  1782.                                                                                         }
  1783.                                                                                         if(arg.length == 3 && !(todo.HasPower(uuid, 121)))
  1784.                                                                                         {
  1785.                                                                                             e.attributes.p = arg[0];
  1786.                                                                                         }
  1787.                                                                                         e.attributes.t = network.SysMsg(1, undefined, uid, e.attributes.p);
  1788.                                                                                     }
  1789.                                                                                     else
  1790.                                                                                     {
  1791.                                                                                         if(FirstTwo == "/n")
  1792.                                                                                         {
  1793.                                                                                             e.attributes.t = network.SysMsg(4, e.attributes.p, uid);
  1794.                                                                                         }
  1795.                                                                                     }
  1796.                                                                                 }
  1797.                                                                             }
  1798.                                                                         }
  1799.                                                                     }
  1800.                                                                     IsSlash = false;
  1801.                                                                 }
  1802.                                                             }
  1803.                                                         }
  1804.                                                     }
  1805.                                                 }
  1806.                                                 if(!IsSlash)
  1807.                                                 {
  1808.                                                     if(UserIndex >= 0 && todo.Users[UserIndex].w == 176)
  1809.                                                     {
  1810.                                                         e.attributes.t = xatlib.ReversePower(e.attributes.t);
  1811.                                                     }
  1812.                                                     e.attributes.t = xatlib.PreProcSmilie(e.attributes.t, !(u == todo.w_userno));
  1813.                                                 }
  1814.                                                 if(todo.w_mainowner)
  1815.                                                 {
  1816.                                                     IsGagUser = false;
  1817.                                                 }
  1818.                                                 MessageCount = 0;
  1819.                                                 e.attributes.N;
  1820.                                                 if(UserIndex == -1 && !IsSlash || e.attributes.N || e.attributes.n)
  1821.                                                 {
  1822.                                                     if(u != 0)
  1823.                                                     {
  1824.                                                         if(todo.FlagBits & xconst.f_Live && e.nodeName == "m")
  1825.                                                         {
  1826.                                                             todo.Users.push({n:"", u:u, v:0, a:"", h:"", online:e.nodeName == "z" ? undefined : false, onsuper:e.nodeName == "z" ? true : undefined, owner:false, friend:network.OnFriendList(u)});
  1827.                                                             UserIndex = xatlib.FindUser(u);
  1828.                                                             todo.Users[UserIndex].n = xatlib.StripSmilies(xatlib.NameNoXat(e.attributes.n));
  1829.                                                             todo.Users[UserIndex].a = e.attributes.a;
  1830.                                                             todo.Users[UserIndex].h = e.attributes.h;
  1831.                                                             todo.Users[UserIndex].sn = xatlib.xJSONdecode(e.attributes.sn);
  1832.                                                             todo.Users[UserIndex].v = e.attributes.v;
  1833.                                                             if(todo.Users[UserIndex].n == "")
  1834.                                                             {
  1835.                                                                 todo.Users[UserIndex].n = xatlib.GetDefaultName(todo.Users[UserIndex].u);
  1836.                                                             }
  1837.                                                             if(todo.Users[UserIndex].a == "")
  1838.                                                             {
  1839.                                                                 todo.Users[UserIndex].a = xatlib.GetDefaultAvatar(todo.Users[UserIndex].u);
  1840.                                                             }
  1841.                                                             if(todo.Users[UserIndex].h == "")
  1842.                                                             {
  1843.                                                                 todo.Users[UserIndex].h = "";
  1844.                                                             }
  1845.                                                             todo.Users[UserIndex].registered = e.attributes.N;
  1846.                                                             todo.Users[UserIndex].q = e.attributes.q;
  1847.                                                             todo.Users[UserIndex].Bride = xatlib.xInt(e.attributes.d2);
  1848.                                                             todo.Users[UserIndex].aFlags = xatlib.xInt(e.attributes.d0);
  1849.                                                         }
  1850.                                                         else
  1851.                                                         {
  1852.                                                             todo.Users.push({n:"", u:u, v:0, a:"", h:"", online:e.nodeName == "z" ? undefined : false, onsuper:e.nodeName == "z" ? true : undefined, owner:false, friend:network.OnFriendList(u)});
  1853.                                                             UserIndex = xatlib.FindUser(u);
  1854.                                                         }
  1855.                                                     }
  1856.                                                 }
  1857.                                                 tgagged = UserIndex != -1 ? todo.Users[UserIndex].gagged : false;
  1858.                                                 if(UserIndex != -1)
  1859.                                                 {
  1860.                                                     todo.Users[UserIndex].banned;
  1861.                                                 }
  1862.                                                 else
  1863.                                                 {
  1864.                                                 }
  1865.                                                 tbanned = false;
  1866.                                                 tfriend = UserIndex != -1 ? todo.Users[UserIndex].friend : false;
  1867.                                                 if(todo.Users[UserIndex].banned && IsPrivateMessage && tgagged || tbanned || e.attributes.b == 1 && !tfriend && !IsAtUser && !IsLocateUser)
  1868.                                                 {
  1869.                                                     return;
  1870.                                                 }
  1871.                                                 if(UserIndex != -1)
  1872.                                                 {
  1873.                                                     todo.Users[UserIndex].mainowner;
  1874.                                                     todo.Users[UserIndex].owner;
  1875.                                                 }
  1876.                                                 else
  1877.                                                 {
  1878.                                                 }
  1879.                                                 tmodplus = false;
  1880.                                                 if(todo.Users[UserIndex].u < 1000 || todo.Users[UserIndex].mainowner || todo.Users[UserIndex].owner || IsPrivateMessage && !IsPrivateChat && todo.HasPowerA(todo.w_Powers, 69, todo.w_Mask) && !tfriend && !tmodplus && !IsAtUser && !IsLocateUser)
  1881.                                                 {
  1882.                                                     return;
  1883.                                                 }
  1884.                                                 if(IsControlMessage && tbanned)
  1885.                                                 {
  1886.                                                     return;
  1887.                                                 }
  1888.                                                 if(e.attributes.q & 2)
  1889.                                                 {
  1890.                                                     todo.Users[UserIndex].VIP = true;
  1891.                                                 }
  1892.                                                 if(e.nodeName == "z")
  1893.                                                 {
  1894.                                                     if(UserIndex != -1)
  1895.                                                     {
  1896.                                                         if(todo.Users[UserIndex].onsuper != true)
  1897.                                                         {
  1898.                                                             xmessage.DeleteOneUserMc(UserIndex);
  1899.                                                         }
  1900.                                                         todo.Users[UserIndex].onsuper = true;
  1901.                                                         todo.Users[UserIndex].available = false;
  1902.                                                     }
  1903.                                                 }
  1904.                                                 else
  1905.                                                 {
  1906.                                                     if(e.nodeName == "m" && GotDone)
  1907.                                                     {
  1908.                                                         if(!(UserIndex == -1) && todo.Users[UserIndex].gagged)
  1909.                                                         {
  1910.                                                             todo.Users[UserIndex].gagged = false;
  1911.                                                             todo.DoBuildUserList = true;
  1912.                                                         }
  1913.                                                         if((UserIndex == -1) && todo.Users[UserIndex].online == true)
  1914.                                                         {
  1915.                                                             xmessage.DeleteOneUserMc(UserIndex);
  1916.                                                         }
  1917.                                                         if(UserIndex != -1)
  1918.                                                         {
  1919.                                                             todo.Users[UserIndex].online = true;
  1920.                                                         }
  1921.                                                     }
  1922.                                                 }
  1923.                                                 if(!(UserIndex == -1) && todo.Users[UserIndex].online == false)
  1924.                                                 {
  1925.                                                     if(e.attributes.n != undefined)
  1926.                                                     {
  1927.                                                         if(UserIndex != -1)
  1928.                                                         {
  1929.                                                             if((e.attributes.n.substr(0, 1)) == "$")
  1930.                                                             {
  1931.                                                                 e.attributes.n = e.attributes.n.substr(1);
  1932.                                                             }
  1933.                                                             todo.Users[UserIndex].n = xatlib.NameNoXat(e.attributes.n);
  1934.                                                             todo.Users[UserIndex].a = e.attributes.a;
  1935.                                                             todo.Users[UserIndex].h = e.attributes.h;
  1936.                                                             todo.Users[UserIndex].v = e.attributes.v;
  1937.                                                             if(todo.Users[UserIndex].n == "")
  1938.                                                             {
  1939.                                                                 todo.Users[UserIndex].n = xatlib.GetDefaultName(todo.Users[UserIndex].u);
  1940.                                                             }
  1941.                                                             if(todo.Users[UserIndex].a == "")
  1942.                                                             {
  1943.                                                                 todo.Users[UserIndex].a = xatlib.GetDefaultAvatar(todo.Users[UserIndex].u);
  1944.                                                             }
  1945.                                                             if(todo.Users[UserIndex].h == "")
  1946.                                                             {
  1947.                                                                 todo.Users[UserIndex].h = "";
  1948.                                                             }
  1949.                                                             todo.Users[UserIndex].registered = e.attributes.N;
  1950.                                                             xmessage.DeleteOneUserMc(UserIndex);
  1951.                                                             todo.DoUpdateMessages = true;
  1952.                                                         }
  1953.                                                     }
  1954.                                                 }
  1955.                                                 if(!(UserIndex == -1) && GotDone && todo.Users[UserIndex].n == "" || network.GetRev(e.attributes.u) > todo.Users[UserIndex].v && !IsSlash)
  1956.                                                 {
  1957.                                                     network.NetworkLocateUser(u);
  1958.                                                 }
  1959.                                                 if(!(UserIndex == -1) && network.OnFriendList(todo.Users[UserIndex].u))
  1960.                                                 {
  1961.                                                     len = todo.w_friendlist.length;
  1962.                                                     g = 0;
  1963.                                                     while(g < len)
  1964.                                                     {
  1965.                                                         if(todo.w_friendlist[g].u == todo.Users[UserIndex].u)
  1966.                                                         {
  1967.                                                             if(!(xatlib.StripSpace_(todo.Users[UserIndex].n) == xatlib.StripSpace_(todo.w_friendlist[g].n)) || todo.Users[UserIndex].a == todo.w_friendlist[g].a || todo.Users[UserIndex].h == todo.w_friendlist[g].h)
  1968.                                                             {
  1969.                                                                 network.UpdateFriendList(todo.Users[UserIndex].u, todo.w_friendlist[g].f ? todo.w_friendlist[g].f : 1);
  1970.                                                             }
  1971.                                                             break;
  1972.                                                         }
  1973.                                                         g = g + 1;
  1974.                                                     }
  1975.                                                 }
  1976.                                                 IsIgnored = network.OnIgnoreList(u);
  1977.                                                 todo.w_mainowner;
  1978.                                                 todo.w_owner;
  1979.                                                 todo.w_moderator;
  1980.                                                 if(todo.w_mainowner || todo.w_owner || todo.w_moderator || network.IgnoreTime(u) < 0 && !IsPrivateMessage && !IsPrivateChat)
  1981.                                                 {
  1982.                                                     IsIgnored = false;
  1983.                                                 }
  1984.                                                 todo.Users[UserIndex].member;
  1985.                                                 todo.Users[UserIndex].moderator;
  1986.                                                 todo.Users[UserIndex].owner;
  1987.                                                 if(todo.FlagBits & xconst.f_Live && IsPrivateMessage && !IsPrivateChat && !IsSlash && todo.Users[UserIndex].member || todo.Users[UserIndex].moderator || todo.Users[UserIndex].owner || !todo.Users[UserIndex].mainowner)
  1988.                                                 {
  1989.                                                     return;
  1990.                                                 }
  1991.                                                 strText = e.attributes.t;
  1992.                                                 strText = (xatlib.CleanText(strText, 1)).toLowerCase();
  1993.                                                 lc = strText.toLowerCase();
  1994.                                                 if(!(strText.indexOf("chat.php?") == -1) || lc.indexOf("freexat") == -1 || lc.indexOf("freesub") == -1 || lc.indexOf("listchats") == -1 || lc.indexOf("llstchats") == -1)
  1995.                                                 {
  1996.                                                     if((FirstTwo.substr(0, 1)) != "/")
  1997.                                                     {
  1998.                                                         IsSlash = true;
  1999.                                                     }
  2000.                                                 }
  2001.                                                 Links = xatlib.CountLinks(e.attributes.t);
  2002.                                                 if(!(UserIndex == -1) && e.nodeName == "m" && todo.Users[UserIndex].u > 101 && !todo.Users[UserIndex].member && !todo.Users[UserIndex].moderator && !todo.Users[UserIndex].owner && !todo.Users[UserIndex].mainowner)
  2003.                                                 {
  2004.                                                     if(Links > 0)
  2005.                                                     {
  2006.                                                         IsSlash = true;
  2007.                                                     }
  2008.                                                 }
  2009.                                                 if(e.nodeName == "m" && todo.messageecho == "l" && Links > 0)
  2010.                                                 {
  2011.                                                     if(chat.sending_lc)
  2012.                                                     {
  2013.                                                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, e.attributes.u, e.attributes.t);
  2014.                                                     }
  2015.                                                 }
  2016.                                                 if(IsLocateUser)
  2017.                                                 {
  2018.                                                     selfid = xatlib.FindUser(todo.w_userno);
  2019.                                                     uid = xatlib.FindUser(u);
  2020.                                                     if(u > 101 && main.utabsmc.tabs[2])
  2021.                                                     {
  2022.                                                         if(uid < 0)
  2023.                                                         {
  2024.                                                             var _loc_3:todo = todo;
  2025.                                                             var _loc_4:* = _loc_3.Tickled + 1;
  2026.                                                             _loc_3.Tickled = _loc_4;
  2027.                                                             todo.Users.push({n:"", u:u, v:0, a:"", h:"", TickCnt:_loc_3.Tickled});
  2028.                                                         }
  2029.                                                         else
  2030.                                                         {
  2031.                                                             var _loc_3:todo = todo;
  2032.                                                             var _loc_4:* = _loc_3.Tickled + 1;
  2033.                                                             _loc_3.Tickled = _loc_4;
  2034.                                                             todo.Users[uid].TickCnt = _loc_3.Tickled;
  2035.                                                             if(!todo.Users[uid].ignored)
  2036.                                                             {
  2037.                                                                 main.utabsmc.ColorTab(2, 39168);
  2038.                                                                 main.utabsmc.GlowTab(2);
  2039.                                                                 main.utabsmc.Notif = true;
  2040.                                                             }
  2041.                                                         }
  2042.                                                     }
  2043.                                                     if(todo.Users[selfid].flag0 & 1024 && u > 101)
  2044.                                                     {
  2045.                                                     }
  2046.                                                     else
  2047.                                                     {
  2048.                                                         Friend = 1;
  2049.                                                         Friend = network.OnFriendList(u);
  2050.                                                         if(Friend == 3)
  2051.                                                         {
  2052.                                                             Friend = todo.foe ? 0 : 1;
  2053.                                                         }
  2054.                                                         if(Friend == 5)
  2055.                                                         {
  2056.                                                             Friend = 1;
  2057.                                                         }
  2058.                                                         if(network.OnIgnoreList(u))
  2059.                                                         {
  2060.                                                             Friend = 0;
  2061.                                                         }
  2062.                                                         if(Friend == 1 && todo.HasPower(selfid, 5))
  2063.                                                         {
  2064.                                                             Friend = 2;
  2065.                                                         }
  2066.                                                         if(!(UserIndex == -1) && todo.Users[UserIndex].online === true && Friend)
  2067.                                                         {
  2068.                                                             Friend = 1;
  2069.                                                         }
  2070.                                                         if(u <= 101)
  2071.                                                         {
  2072.                                                             Friend = 1;
  2073.                                                         }
  2074.                                                         switch(Friend)
  2075.                                                         {
  2076.                                                         case 2:
  2077.                                                             str = "_NF";
  2078.                                                             break;
  2079.                                                         case 1:
  2080.                                                             str = xatlib.GroupUrl();
  2081.                                                             break;
  2082.                                                         default:
  2083.                                                             str = "_" + xconst.ST(126);
  2084.                                                             break;
  2085.                                                         }
  2086.                                                         if((network.getTimer() - LastLocate) > 1150)
  2087.                                                         {
  2088.                                                             if(todo.w_userno <= 101 && (todo.w_name.substr(0, 2)) == "$$")
  2089.                                                             {
  2090.                                                             }
  2091.                                                             else
  2092.                                                             {
  2093.                                                                 network.NetworkSendMsg(todo.w_userno, "/a" + str, 0, u, 0);
  2094.                                                                 LastLocate = network.getTimer();
  2095.                                                             }
  2096.                                                         }
  2097.                                                     }
  2098.                                                 }
  2099.                                                 else
  2100.                                                 {
  2101.                                                     if(IsAtUser)
  2102.                                                     {
  2103.                                                         loctext = "";
  2104.                                                         if((e.attributes.t.substr(0, 3)) == "/a_")
  2105.                                                         {
  2106.                                                             if((e.attributes.t.substr(3, 2)) == "NF")
  2107.                                                             {
  2108.                                                                 loctext = "NoFollow";
  2109.                                                             }
  2110.                                                             else
  2111.                                                             {
  2112.                                                                 loctext = xconst.ST(126);
  2113.                                                             }
  2114.                                                         }
  2115.                                                         else
  2116.                                                         {
  2117.                                                             if((e.attributes.t.substr(2, xconst.usedomain.length)) == xconst.usedomain)
  2118.                                                             {
  2119.                                                                 loctext = xconst.ST(129, e.attributes.t.substr(2));
  2120.                                                             }
  2121.                                                             else
  2122.                                                             {
  2123.                                                                 loctext = e.attributes.t.substr(2);
  2124.                                                             }
  2125.                                                         }
  2126.                                                         UserIndex = xatlib.FindUser(xatlib.xInt(e.attributes.u));
  2127.                                                         if(todo.Users[UserIndex].UnmaskedPowers == undefined)
  2128.                                                         {
  2129.                                                             todo.Users[UserIndex].UnmaskedPowers = new Array();
  2130.                                                         }
  2131.                                                         if(todo.Users[UserIndex].Powers == undefined)
  2132.                                                         {
  2133.                                                             todo.Users[UserIndex].Powers = new Array();
  2134.                                                         }
  2135.                                                         pp = 0;
  2136.                                                         while(pp < todo.MAX_PWR_INDEX)
  2137.                                                         {
  2138.                                                             ii = "p" + pp;
  2139.                                                             if(e.attributes[ii] != undefined)
  2140.                                                             {
  2141.                                                                 todo.Users[UserIndex].UnmaskedPowers[pp] = xatlib.xInt(e.attributes[ii]);
  2142.                                                                 if(!todo.Users[UserIndex].Powers[pp])
  2143.                                                                 {
  2144.                                                                     todo.Users[UserIndex].Powers[pp] = xatlib.xInt(e.attributes[ii]);
  2145.                                                                 }
  2146.                                                             }
  2147.                                                             pp = pp + 1;
  2148.                                                         }
  2149.                                                         if(e.attributes.po != undefined)
  2150.                                                         {
  2151.                                                             todo.Users[UserIndex].PowerO = e.attributes.po;
  2152.                                                         }
  2153.                                                         todo.Users[UserIndex].n = xatlib.NameNoXat(e.attributes.n);
  2154.                                                         todo.Users[UserIndex].s = xatlib.GetStatus(e.attributes.n);
  2155.                                                         todo.Users[UserIndex].coins = e.attributes.x;
  2156.                                                         todo.Users[UserIndex].days = e.attributes.y;
  2157.                                                         todo.Users[UserIndex].debug = e.attributes.g;
  2158.                                                         i = 0;
  2159.                                                         while(i < main.dialog_layer.numChildren)
  2160.                                                         {
  2161.                                                             d = main.dialog_layer.getChildAt(i);
  2162.                                                             if(d is DialogActions)
  2163.                                                             {
  2164.                                                                 d.WriteLocation(loctext, e.attributes.u, e.attributes.N);
  2165.                                                             }
  2166.                                                             i = i + 1;
  2167.                                                         }
  2168.                                                         if(e.attributes.n != undefined)
  2169.                                                         {
  2170.                                                             UserIndex = xatlib.FindUser(xatlib.xInt(e.attributes.u));
  2171.                                                             if(UserIndex != -1)
  2172.                                                             {
  2173.                                                                 if((e.attributes.n.substr(0, 1)) == "$")
  2174.                                                                 {
  2175.                                                                     e.attributes.n = e.attributes.n.substr(1);
  2176.                                                                 }
  2177.                                                                 todo.Users[UserIndex].v = e.attributes.v;
  2178.                                                                 todo.Users[UserIndex].n = xatlib.NameNoXat(e.attributes.n);
  2179.                                                                 todo.Users[UserIndex].u = xatlib.xInt(e.attributes.u);
  2180.                                                                 todo.Users[UserIndex].a = e.attributes.a;
  2181.                                                                 todo.Users[UserIndex].h = e.attributes.h;
  2182.                                                                 todo.Users[UserIndex].sn = xatlib.xJSONdecode(e.attributes.sn);
  2183.                                                                 todo.Users[UserIndex].cb = e.attributes.cb;
  2184.                                                                 todo.Users[UserIndex].registered = e.attributes.N;
  2185.                                                                 if(todo.Users[UserIndex].n == "")
  2186.                                                                 {
  2187.                                                                     todo.Users[UserIndex].n = xatlib.GetDefaultName(todo.Users[UserIndex].u);
  2188.                                                                 }
  2189.                                                                 if(todo.Users[UserIndex].a == "")
  2190.                                                                 {
  2191.                                                                     todo.Users[UserIndex].a = xatlib.GetDefaultAvatar(todo.Users[UserIndex].u);
  2192.                                                                 }
  2193.                                                                 if(todo.Users[UserIndex].h == "")
  2194.                                                                 {
  2195.                                                                     todo.Users[UserIndex].h = "";
  2196.                                                                 }
  2197.                                                                 xmessage.DeleteOneUserMc(UserIndex);
  2198.                                                                 xatlib.PurgeMessageFromUser(todo.Users[UserIndex].u);
  2199.                                                                 todo.DoUpdateMessages = true;
  2200.                                                                 todo.DoBuildUserList = true;
  2201.                                                                 if(todo.Users[UserIndex].tUpd != undefined)
  2202.                                                                 {
  2203.                                                                     var _loc_3:* = todo.Users[UserIndex].n;
  2204.                                                                     main.ctabsmc.tabs[todo.Users[UserIndex].tUpd].h = _loc_3;
  2205.                                                                     main.ctabsmc.tabs[todo.Users[UserIndex].tUpd].t = _loc_3;
  2206.                                                                     main.ctabsmc.UpdateTabs();
  2207.                                                                     todo.Users[UserIndex].tUpd = undefined;
  2208.                                                                 }
  2209.                                                                 if(network.OnFriendList(todo.Users[UserIndex].u))
  2210.                                                                 {
  2211.                                                                     len = todo.w_friendlist.length;
  2212.                                                                     g = 0;
  2213.                                                                     while(g < len)
  2214.                                                                     {
  2215.                                                                         if(todo.w_friendlist[g].u == todo.Users[UserIndex].u)
  2216.                                                                         {
  2217.                                                                             if(!(xatlib.StripSpace_(todo.Users[UserIndex].n) == xatlib.StripSpace_(todo.w_friendlist[g].n)) || todo.Users[UserIndex].a == todo.w_friendlist[g].a || todo.Users[UserIndex].h == todo.w_friendlist[g].h)
  2218.                                                                             {
  2219.                                                                                 network.UpdateFriendList(todo.Users[UserIndex].u, todo.w_friendlist[g].f ? todo.w_friendlist[g].f : 1);
  2220.                                                                             }
  2221.                                                                             break;
  2222.                                                                         }
  2223.                                                                         g = g + 1;
  2224.                                                                     }
  2225.                                                                 }
  2226.                                                             }
  2227.                                                         }
  2228.                                                     }
  2229.                                                     else
  2230.                                                     {
  2231.                                                         if(IsKickUser)
  2232.                                                         {
  2233.                                                             uuid = xatlib.FindUser(e.attributes.u);
  2234.                                                             arg = [];
  2235.                                                             if(e.attributes.p)
  2236.                                                             {
  2237.                                                                 arg = e.attributes.p.split("#");
  2238.                                                             }
  2239.                                                             if(arg.length == 3 && todo.HasPower(uuid, 121))
  2240.                                                             {
  2241.                                                                 var _loc_3:* = arg[1];
  2242.                                                                 todo.CustomSound = _loc_3;
  2243.                                                                 todo.BumpSound = _loc_3;
  2244.                                                                 todo.DoAudieSnd = true;
  2245.                                                             }
  2246.                                                             network.NetworkClose();
  2247.                                                             network.SetNetworkState(0, -1);
  2248.                                                             todo.lb = "n";
  2249.                                                             todo.DoUpdate = true;
  2250.                                                         }
  2251.                                                         else
  2252.                                                         {
  2253.                                                             if(IsDeleteMessage)
  2254.                                                             {
  2255.                                                                 msgno = xatlib.xInt(e.attributes.t.substr(2));
  2256.                                                                 if(msgno != 0)
  2257.                                                                 {
  2258.                                                                     len = todo.Message.length;
  2259.                                                                     v = 0;
  2260.                                                                     while(v < len)
  2261.                                                                     {
  2262.                                                                         if(todo.Message[v].n == msgno)
  2263.                                                                         {
  2264.                                                                             todo.Message[v].ignored = true;
  2265.                                                                         }
  2266.                                                                         v = v + 1;
  2267.                                                                     }
  2268.                                                                     todo.DoUpdateMessages = true;
  2269.                                                                 }
  2270.                                                             }
  2271.                                                             else
  2272.                                                             {
  2273.                                                                 if(IsGagUser || IsUnGagUser)
  2274.                                                                 {
  2275.                                                                     network.UpdateGagList(todo.w_useroom, xatlib.xInt(e.attributes.t.substr(2)), IsGagUser);
  2276.                                                                     i = xatlib.FindUser(todo.w_userno);
  2277.                                                                     if(i > -1)
  2278.                                                                     {
  2279.                                                                         todo.Users[i].banned = IsGagUser ? true : false;
  2280.                                                                         xmessage.DeleteOneUserMc(i);
  2281.                                                                         xkiss.ClosePuzzle();
  2282.                                                                     }
  2283.                                                                     if(GotDone && IsGagUser)
  2284.                                                                     {
  2285.                                                                         UnfairGroupName = todo.w_room == todo.w_useroom ? global.gn != undefined ? xatlib.CleanCommas(global.gn) : xconst.ST(0) : todo.BackVars[1] != undefined ? xatlib.CleanCommas(todo.BackVars[1]) : xconst.ST(0);
  2286.                                                                         if(i >= 0 && todo.Users[i].w)
  2287.                                                                         {
  2288.                                                                             BanTime = network.GetGagTime(todo.w_useroom);
  2289.                                                                             if(BanTime)
  2290.                                                                             {
  2291.                                                                                 BanTime = BanTime - xatlib.SockTime();
  2292.                                                                                 if(BanTime <= (10 * 3600))
  2293.                                                                                 {
  2294.                                                                                     NoBanMessage = true;
  2295.                                                                                 }
  2296.                                                                             }
  2297.                                                                         }
  2298.                                                                         if(NoBanMessage && UnfairGroupName == xconst.ST(0))
  2299.                                                                         {
  2300.                                                                             my_date = new Date();
  2301.                                                                             t = network.Number(my_date.getTime());
  2302.                                                                             UnfairFile = (network.String(xatlib.xInt(Math.random() * 999999))) + t;
  2303.                                                                             UnfairMessage = (todo.w_useroom + ",") + UnfairGroupName + "," + todo.w_userno + "," + (xatlib.CleanTextNoXat(todo.w_name).substr(0, 128)) + "," + u + "," + xatlib.CleanCommas(xatlib.GetUsername(u)) + ",,";
  2304.                                                                             UnfairTitle = xconst.ST(125);
  2305.                                                                             UnfairReport = UnfairTitle;
  2306.                                                                             len = todo.Message.length;
  2307.                                                                             hh = 0;
  2308.                                                                             while(hh < len)
  2309.                                                                             {
  2310.                                                                                 if(!(todo.Message[hh].s & 2) && todo.Message[hh].n == 0 ? true : todo.Message[hh].d == 0)
  2311.                                                                                 {
  2312.                                                                                     UnfairMessage = UnfairMessage + (todo.Message[hh].u + ",") + xatlib.CleanCommas(xatlib.GetUsername(todo.Message[hh].u)) + "," + xatlib.CleanCommas(todo.Message[hh].t) + ",,";
  2313.                                                                                 }
  2314.                                                                                 if(todo.Message[hh].u == u)
  2315.                                                                                 {
  2316.                                                                                     if((todo.Message[hh].t.substr(0, 20)) == "<i> " + xconst.ST(119))
  2317.                                                                                     {
  2318.                                                                                         UnfairTitle = (xatlib.GetUsername(todo.Message[hh].u) + " ") + xconst.ST(127);
  2319.                                                                                         UnfairReport = todo.Message[hh].t.substr(7);
  2320.                                                                                     }
  2321.                                                                                 }
  2322.                                                                                 hh = hh + 1;
  2323.                                                                             }
  2324.                                                                             xatlib.UnfairPopup(UnfairTitle, UnfairReport);
  2325.                                                                         }
  2326.                                                                     }
  2327.                                                                 }
  2328.                                                                 else
  2329.                                                                 {
  2330.                                                                     if(IsMakeUser || IsUnMakeUser)
  2331.                                                                     {
  2332.                                                                         if(IsMakeUser && todo.FlagBits & xconst.f_Live)
  2333.                                                                         {
  2334.                                                                             w_redirectport = undefined;
  2335.                                                                         }
  2336.                                                                         so47 = xatlib.getLocal("chat" + network.String(todo.w_useroom), "/");
  2337.                                                                         so47.objectEncoding = ObjectEncoding.AMF0;
  2338.                                                                         if(IsMakeUser)
  2339.                                                                         {
  2340.                                                                             todo.w_userrev = xatlib.xInt(todo.w_userrev);
  2341.                                                                             so47.data.pass = xatlib.xInt(e.attributes.t.substr(2));
  2342.                                                                         }
  2343.                                                                         else
  2344.                                                                         {
  2345.                                                                         }
  2346.                                                                         so47.flush();
  2347.                                                                         i = xatlib.FindUser(todo.w_userno);
  2348.                                                                         if(i > -1)
  2349.                                                                         {
  2350.                                                                             if(todo.Users[i].gagged == true)
  2351.                                                                             {
  2352.                                                                                 todo.Users[i].gagged = false;
  2353.                                                                                 todo.DoBuildUserList = true;
  2354.                                                                             }
  2355.                                                                         }
  2356.                                                                     }
  2357.                                                                     else
  2358.                                                                     {
  2359.                                                                         if(IsScroller)
  2360.                                                                         {
  2361.                                                                             main.SetScroller(e.attributes.t.substr(2, 510));
  2362.                                                                         }
  2363.                                                                         else
  2364.                                                                         {
  2365.                                                                             if(!IsUnknown && !IsSlash)
  2366.                                                                             {
  2367.                                                                                 var _loc_3:todo = todo;
  2368.                                                                                 var _loc_4:* = _loc_3.mi + 1;
  2369.                                                                                 _loc_3.mi = _loc_4;
  2370.                                                                                 todo.Message.push({i:todo.mi * 2, n:e.attributes.i, t:e.attributes.t, u:u, ignored:IsIgnored, s:e.attributes.s, d:IsPrivateChat ? u : 0, p:IsPrivateMessage, pb:e.attributes.pb});
  2371.                                                                                 if(todo.messageecho == "m")
  2372.                                                                                 {
  2373.                                                                                     if(network.YC)
  2374.                                                                                     {
  2375.                                                                                         vt = xatlib.xInt(todo.w_d1) - network.YC;
  2376.                                                                                         if(vt < 0)
  2377.                                                                                         {
  2378.                                                                                             vt = 0;
  2379.                                                                                         }
  2380.                                                                                         vt = xatlib.xInt((vt / (24 * 3600)) + 0.30);
  2381.                                                                                         if(vt > 0)
  2382.                                                                                         {
  2383.                                                                                             if(chat.sending_lc)
  2384.                                                                                             {
  2385.                                                                                                 chat.sending_lc.send(chat.fromxat, "onMsg", 4, todo.mi * 2, e.attributes.t);
  2386.                                                                                             }
  2387.                                                                                         }
  2388.                                                                                     }
  2389.                                                                                 }
  2390.                                                                                 todo.bMobile;
  2391.                                                                                 if(!(todo.bMobile && main.mscrollmc.Scrolling == true || todo.bMobile && main.mbs.Scrolling == true))
  2392.                                                                                 {
  2393.                                                                                     nopc = 0;
  2394.                                                                                     nom = 0;
  2395.                                                                                     len = todo.Message.length;
  2396.                                                                                     tt = 0;
  2397.                                                                                     while(tt < len)
  2398.                                                                                     {
  2399.                                                                                         if(todo.Message[tt].s == 2)
  2400.                                                                                         {
  2401.                                                                                             nopc = nopc + 1;
  2402.                                                                                         }
  2403.                                                                                         else
  2404.                                                                                         {
  2405.                                                                                             nom = nom + 1;
  2406.                                                                                         }
  2407.                                                                                         tt = tt + 1;
  2408.                                                                                     }
  2409.                                                                                     maxpc = 100;
  2410.                                                                                     maxm = 150;
  2411.                                                                                     while(nopc > maxpc || nom > maxm)
  2412.                                                                                     {
  2413.                                                                                         len = todo.Message.length;
  2414.                                                                                         RemoveMessage = undefined;
  2415.                                                                                         tt = 0;
  2416.                                                                                         while(tt < len)
  2417.                                                                                         {
  2418.                                                                                             if(nopc > maxpc)
  2419.                                                                                             {
  2420.                                                                                                 if(todo.Message[tt].s == 2)
  2421.                                                                                                 {
  2422.                                                                                                     xmessage.DeleteOneMessageMc(tt);
  2423.                                                                                                     RemoveMessage = todo.Message.splice(tt, 1);
  2424.                                                                                                     nopc = nopc - 1;
  2425.                                                                                                     break;
  2426.                                                                                                 }
  2427.                                                                                             }
  2428.                                                                                             else
  2429.                                                                                             {
  2430.                                                                                                 if(nom > maxm)
  2431.                                                                                                 {
  2432.                                                                                                     if(todo.Message[tt].s != 2)
  2433.                                                                                                     {
  2434.                                                                                                         xmessage.DeleteOneMessageMc(tt);
  2435.                                                                                                         RemoveMessage = todo.Message.splice(tt, 1);
  2436.                                                                                                         nom = nom - 1;
  2437.                                                                                                         break;
  2438.                                                                                                     }
  2439.                                                                                                 }
  2440.                                                                                             }
  2441.                                                                                             tt = tt + 1;
  2442.                                                                                         }
  2443.                                                                                         if(!network.UserGotMessage(RemoveMessage[0].u))
  2444.                                                                                         {
  2445.                                                                                             len = todo.Users.length;
  2446.                                                                                             tt = 0;
  2447.                                                                                             while(tt < len)
  2448.                                                                                             {
  2449.                                                                                                 if(todo.Users[tt].u == RemoveMessage[0].u)
  2450.                                                                                                 {
  2451.                                                                                                     if(todo.Users[tt].online)
  2452.                                                                                                     {
  2453.                                                                                                         break;
  2454.                                                                                                     }
  2455.                                                                                                     else
  2456.                                                                                                     {
  2457.                                                                                                         if(todo.Users[tt].u != todo.w_userno)
  2458.                                                                                                         {
  2459.                                                                                                             if(todo.Users[tt].friend)
  2460.                                                                                                             {
  2461.                                                                                                                 if(todo.Users[tt].online != undefined)
  2462.                                                                                                                 {
  2463.                                                                                                                     xmessage.DeleteOneUserMc(tt);
  2464.                                                                                                                 }
  2465.                                                                                                                 todo.Users[tt].online = undefined;
  2466.                                                                                                             }
  2467.                                                                                                             else
  2468.                                                                                                             {
  2469.                                                                                                                 xmessage.DeleteOneUserMc(tt);
  2470.                                                                                                                 todo.Users.splice(tt, 1);
  2471.                                                                                                             }
  2472.                                                                                                             todo.DoBuildUserList = true;
  2473.                                                                                                         }
  2474.                                                                                                         break;
  2475.                                                                                                     }
  2476.                                                                                                 }
  2477.                                                                                                 tt = tt + 1;
  2478.                                                                                             }
  2479.                                                                                         }
  2480.                                                                                     }
  2481.                                                                                 }
  2482.                                                                                 if(!IsUnknown && IsNew && !IsIgnored)
  2483.                                                                                 {
  2484.                                                                                     if(!(main.ctabsmc.TabIsPrivate() && main.ctabsmc.TabUser() == u))
  2485.                                                                                     {
  2486.                                                                                     }
  2487.                                                                                     else
  2488.                                                                                     {
  2489.                                                                                         selfid = xatlib.FindUser(todo.w_userno);
  2490.                                                                                         main.ProcessSounds(e.attributes.t, selfid != -1 ? !(todo.HasPower(selfid, 8)) : 0, selfid);
  2491.                                                                                     }
  2492.                                                                                 }
  2493.                                                                                 if(!IsUnknown && IsNew && !IsPrivateChat)
  2494.                                                                                 {
  2495.                                                                                     network.GlowUser(u);
  2496.                                                                                     if(main.ctabsmc.TabIsPrivate())
  2497.                                                                                     {
  2498.                                                                                         if(todo.w_useroom == todo.w_room)
  2499.                                                                                         {
  2500.                                                                                             main.ctabsmc.ColorTab(0, 39168);
  2501.                                                                                             main.ctabsmc.GlowTab(0);
  2502.                                                                                         }
  2503.                                                                                         else
  2504.                                                                                         {
  2505.                                                                                             if(todo.w_useroom == todo.group)
  2506.                                                                                             {
  2507.                                                                                                 main.ctabsmc.ColorTab(1, 39168);
  2508.                                                                                                 main.ctabsmc.GlowTab(1);
  2509.                                                                                             }
  2510.                                                                                         }
  2511.                                                                                     }
  2512.                                                                                 }
  2513.                                                                                 if(!IsUnknown && IsPrivateChat && !IsIgnored)
  2514.                                                                                 {
  2515.                                                                                     selfid = xatlib.FindUser(todo.w_userno);
  2516.                                                                                     HaveTab = -1;
  2517.                                                                                     AllowPC = true;
  2518.                                                                                     if(e.attributes.u != undefined)
  2519.                                                                                     {
  2520.                                                                                         if(!todo.Users[UserIndex].mainowner && !todo.Users[UserIndex].owner && !todo.Users[UserIndex].moderator)
  2521.                                                                                         {
  2522.                                                                                             if(todo.HasPowerA(todo.w_Powers, 10, todo.w_Mask) || todo.FlagBits & xconst.f_Live && !(todo.HasPowerA(todo.w_Powers, 10)))
  2523.                                                                                             {
  2524.                                                                                                 f = network.OnFriendList(todo.Users[UserIndex].u);
  2525.                                                                                                 if(f == 5)
  2526.                                                                                                 {
  2527.                                                                                                     f = 1;
  2528.                                                                                                 }
  2529.                                                                                                 if(f != 1)
  2530.                                                                                                 {
  2531.                                                                                                     if(todo.Users[UserIndex].u > 101)
  2532.                                                                                                     {
  2533.                                                                                                         AllowPC = false;
  2534.                                                                                                         tt = 0;
  2535.                                                                                                         while(tt < main.ctabsmc.tabs.length)
  2536.                                                                                                         {
  2537.                                                                                                             if(main.ctabsmc.tabs[tt].User == todo.Users[UserIndex].u)
  2538.                                                                                                             {
  2539.                                                                                                                 AllowPC = true;
  2540.                                                                                                                 HaveTab = tt;
  2541.                                                                                                                 break;
  2542.                                                                                                             }
  2543.                                                                                                             tt = tt + 1;
  2544.                                                                                                         }
  2545.                                                                                                     }
  2546.                                                                                                 }
  2547.                                                                                             }
  2548.                                                                                         }
  2549.                                                                                         if(AllowPC)
  2550.                                                                                         {
  2551.                                                                                             TabNumber = HaveTab != -1 ? HaveTab : main.ctabsmc.TabAdd(u, 16777215, 1, main.Private_onRelease, main.Private_onDelete);
  2552.                                                                                             main.ctabsmc.UpdateTabs();
  2553.                                                                                             if(main.ctabsmc.TabSelected() != TabNumber)
  2554.                                                                                             {
  2555.                                                                                                 main.ctabsmc.GlowTab(TabNumber);
  2556.                                                                                                 main.ctabsmc.ColorTab(TabNumber, 39168);
  2557.                                                                                             }
  2558.                                                                                             todo.DoBuildUserList = true;
  2559.                                                                                         }
  2560.                                                                                         if(AllowPC)
  2561.                                                                                         {
  2562.                                                                                             if(todo.HasPower(UserIndex, 75))
  2563.                                                                                             {
  2564.                                                                                                 if(e.attributes.t.indexOf("(bump") != -1)
  2565.                                                                                                 {
  2566.                                                                                                     if(todo.Users[param1].mainowner)
  2567.                                                                                                     {
  2568.                                                                                                         return false;
  2569.                                                                                                     }
  2570.                                                                                                     if(todo.Users[param1].owner)
  2571.                                                                                                     {
  2572.                                                                                                         return todo.Users[param2].mainowner ? true : false;
  2573.                                                                                                     }
  2574.                                                                                                     else
  2575.                                                                                                     {
  2576.                                                                                                         if(todo.Users[param1].moderator)
  2577.                                                                                                         {
  2578.                                                                                                             todo.Users[param2].mainowner;
  2579.                                                                                                             return todo.Users[param2].mainowner || todo.Users[param2].owner ? true : false;
  2580.                                                                                                         }
  2581.                                                                                                         else
  2582.                                                                                                         {
  2583.                                                                                                             todo.Users[param2].mainowner;
  2584.                                                                                                             todo.Users[param2].owner;
  2585.                                                                                                             if(todo.Users[param2].mainowner || todo.Users[param2].owner || todo.Users[param2].moderator)
  2586.                                                                                                             {
  2587.                                                                                                                 return true;
  2588.                                                                                                             }
  2589.                                                                                                         }
  2590.                                                                                                     }
  2591.                                                                                                     return false;
  2592.                                                                                                     var Superior:Function = _func_19;
  2593.                                                                                                     self = xatlib.FindUser(todo.w_userno);
  2594.                                                                                                     if(network.OnFriendList(todo.Users[UserIndex].u) || todo.Users[UserIndex].u < 101 || Superior(self, UserIndex))
  2595.                                                                                                     {
  2596.                                                                                                         main.ctabsmc.ColorTab(TabNumber, 16711680);
  2597.                                                                                                         t = network.getTimer();
  2598.                                                                                                         if(todo.LastBump == -1 || (t - todo.LastBump) > 20000)
  2599.                                                                                                         {
  2600.                                                                                                             var _loc_3:String = "laserfire3";
  2601.                                                                                                             todo.BumpSound = _loc_3;
  2602.                                                                                                             todo.CustomSound = _loc_3;
  2603.                                                                                                             todo.DoAudieSnd = true;
  2604.                                                                                                             todo.LastBump = t;
  2605.                                                                                                         }
  2606.                                                                                                     }
  2607.                                                                                                 }
  2608.                                                                                             }
  2609.                                                                                         }
  2610.                                                                                     }
  2611.                                                                                 }
  2612.                                                                                 todo.DoUpdateMessages = true;
  2613.                                                                                 todo.ScrollDown = true;
  2614.                                                                             }
  2615.                                                                         }
  2616.                                                                     }
  2617.                                                                 }
  2618.                                                             }
  2619.                                                         }
  2620.                                                     }
  2621.                                                 }
  2622.                                             }
  2623.                                             else
  2624.                                             {
  2625.                                                 if(e.nodeName == "g")
  2626.                                                 {
  2627.                                                     if(UserIndex >= 0)
  2628.                                                     {
  2629.                                                         todo.Users[UserIndex].xNum = e.attributes.x;
  2630.                                                         xmessage.DeleteOneUserMc(UserIndex);
  2631.                                                     }
  2632.                                                 }
  2633.                                                 else
  2634.                                                 {
  2635.                                                     if(e.nodeName == "u" || e.nodeName == "o")
  2636.                                                     {
  2637.                                                         if(e.attributes.n == null || e.attributes.n == undefined)
  2638.                                                         {
  2639.                                                             e.attributes.n = "";
  2640.                                                         }
  2641.                                                         if(e.attributes.a == null || e.attributes.a == undefined)
  2642.                                                         {
  2643.                                                             e.attributes.a = "";
  2644.                                                         }
  2645.                                                         if(e.attributes.h == null || e.attributes.h == undefined)
  2646.                                                         {
  2647.                                                             e.attributes.h = "";
  2648.                                                         }
  2649.                                                         IsMainOwner = false;
  2650.                                                         IsOwner = false;
  2651.                                                         IsModerator = false;
  2652.                                                         IsMember = false;
  2653.                                                         IsOnline = false;
  2654.                                                         IsBanned = false;
  2655.                                                         IsForever = false;
  2656.                                                         IsGagged = false;
  2657.                                                         IsNew = e.nodeName == "u";
  2658.                                                         OnXat = !(xatlib.xInt(e.attributes.q) & 1) == 0;
  2659.                                                         IsVIP = (xatlib.xInt(e.attributes.f) & 32) == 0 || (xatlib.xInt(e.attributes.q) & 2) == 0;
  2660.                                                         Powers = [];
  2661.                                                         if(IsVIP)
  2662.                                                         {
  2663.                                                             t = 0;
  2664.                                                             while(t < todo.MAX_PWR_INDEX)
  2665.                                                             {
  2666.                                                                 Powers.push(xatlib.xInt(e.attributes["p" + t]));
  2667.                                                                 t = t + 1;
  2668.                                                             }
  2669.                                                         }
  2670.                                                         if((e.attributes.f & 7) == 1)
  2671.                                                         {
  2672.                                                             IsMainOwner = true;
  2673.                                                         }
  2674.                                                         if((e.attributes.f & 7) == 2)
  2675.                                                         {
  2676.                                                             IsModerator = true;
  2677.                                                         }
  2678.                                                         if((e.attributes.f & 7) == 3)
  2679.                                                         {
  2680.                                                             IsMember = true;
  2681.                                                         }
  2682.                                                         if((e.attributes.f & 7) == 4)
  2683.                                                         {
  2684.                                                             IsOwner = true;
  2685.                                                         }
  2686.                                                         if(e.nodeName == "u")
  2687.                                                         {
  2688.                                                             IsOnline = true;
  2689.                                                         }
  2690.                                                         if(e.attributes.s & 1 || e.attributes.f & 8)
  2691.                                                         {
  2692.                                                             IsNew = false;
  2693.                                                         }
  2694.                                                         if(e.attributes.f & 16)
  2695.                                                         {
  2696.                                                             IsBanned = true;
  2697.                                                         }
  2698.                                                         if(e.attributes.f & 64)
  2699.                                                         {
  2700.                                                             IsForever = true;
  2701.                                                         }
  2702.                                                         if(e.attributes.f & 256)
  2703.                                                         {
  2704.                                                             IsGagged = true;
  2705.                                                         }
  2706.                                                         if(IsNew && todo.w_sound & 1 && !IsBanned && u <= (2000000000 - 100000))
  2707.                                                         {
  2708.                                                             if(!(main.ctabsmc.TabIsPrivate() && main.ctabsmc.TabUser() == u))
  2709.                                                             {
  2710.                                                             }
  2711.                                                             else
  2712.                                                             {
  2713.                                                                 todo.DoUserSnd = true;
  2714.                                                             }
  2715.                                                         }
  2716.                                                         if(u != todo.w_userno)
  2717.                                                         {
  2718.                                                             UserIndex = xatlib.FindUser(u);
  2719.                                                             IsStealth = false;
  2720.                                                             if(!(e.attributes.n == undefined) && (e.attributes.n.substr(0, 1)) == "$")
  2721.                                                             {
  2722.                                                                 IsStealth = IsMainOwner;
  2723.                                                                 e.attributes.n = IsOwner || e.attributes.n.substr(1);
  2724.                                                             }
  2725.                                                             if(UserIndex == -1)
  2726.                                                             {
  2727.                                                                 if(e.attributes.n == "")
  2728.                                                                 {
  2729.                                                                     e.attributes.n = xatlib.GetDefaultName(u);
  2730.                                                                 }
  2731.                                                                 if(e.attributes.a == "")
  2732.                                                                 {
  2733.                                                                     e.attributes.a = xatlib.GetDefaultAvatar(u);
  2734.                                                                 }
  2735.                                                                 if(e.attributes.h == "")
  2736.                                                                 {
  2737.                                                                     e.attributes.h = "";
  2738.                                                                 }
  2739.                                                                 UserIndex = todo.Users.push({}) - 1;
  2740.                                                             }
  2741.                                                             else
  2742.                                                             {
  2743.                                                                 xmessage.DeleteOneUserMc(UserIndex);
  2744.                                                             }
  2745.                                                             todo.Users[UserIndex].n = xatlib.NameNoXat(e.attributes.n);
  2746.                                                             todo.Users[UserIndex].s = xatlib.GetStatus(e.attributes.n);
  2747.                                                             todo.Users[UserIndex].v = xatlib.xInt(e.attributes.v);
  2748.                                                             todo.Users[UserIndex].u = u;
  2749.                                                             todo.Users[UserIndex].a = e.attributes.a;
  2750.                                                             todo.Users[UserIndex].h = e.attributes.h;
  2751.                                                             todo.Users[UserIndex].cb = e.attributes.cb;
  2752.                                                             todo.Users[UserIndex].online = IsOnline;
  2753.                                                             todo.Users[UserIndex].mainowner = IsMainOwner;
  2754.                                                             todo.Users[UserIndex].owner = IsOwner;
  2755.                                                             todo.Users[UserIndex].moderator = IsModerator;
  2756.                                                             todo.Users[UserIndex].member = IsMember;
  2757.                                                             todo.Users[UserIndex].onsuper = undefined;
  2758.                                                             todo.Users[UserIndex].available = undefined;
  2759.                                                             todo.Users[UserIndex].OnXat = OnXat;
  2760.                                                             todo.Users[UserIndex].Stealth = IsStealth;
  2761.                                                             todo.Users[UserIndex].friend = network.OnFriendList(u);
  2762.                                                             todo.Users[UserIndex].registered = e.attributes.N;
  2763.                                                             todo.Users[UserIndex].sn = xatlib.xJSONdecode(e.attributes.sn);
  2764.                                                             todo.Users[UserIndex].VIP = IsVIP;
  2765.                                                             todo.Users[UserIndex].Powers = Powers;
  2766.                                                             todo.Users[UserIndex].Bride = xatlib.xInt(e.attributes.d2);
  2767.                                                             todo.Users[UserIndex].aFlags = xatlib.xInt(e.attributes.d0);
  2768.                                                             todo.Users[UserIndex].flag0 = xatlib.xInt(e.attributes.f);
  2769.                                                             todo.Users[UserIndex].w = xatlib.xInt(e.attributes.w);
  2770.                                                             network.AddGiftPower(UserIndex);
  2771.                                                             todo.Users[UserIndex].xNum = e.attributes.x;
  2772.                                                             if(todo.Users[UserIndex].u == 4294967295.00)
  2773.                                                             {
  2774.                                                                 todo.Users[UserIndex].n = todo.Users[UserIndex].n + " Spectators";
  2775.                                                             }
  2776.                                                             if(IsNew && main.ctabsmc.TabIsPrivate())
  2777.                                                             {
  2778.                                                                 if(todo.w_useroom == todo.w_room)
  2779.                                                                 {
  2780.                                                                     main.ctabsmc.ColorTab(0, 39168);
  2781.                                                                 }
  2782.                                                                 else
  2783.                                                                 {
  2784.                                                                     if(todo.w_useroom == todo.group)
  2785.                                                                     {
  2786.                                                                         main.ctabsmc.ColorTab(1, 39168);
  2787.                                                                     }
  2788.                                                                 }
  2789.                                                             }
  2790.                                                             todo.DoBuildUserList = true;
  2791.                                                             if(UserIndex > -1)
  2792.                                                             {
  2793.                                                                 todo.Users[UserIndex].banned = IsBanned;
  2794.                                                                 todo.Users[UserIndex].forever = IsForever;
  2795.                                                                 todo.Users[UserIndex].gagged = IsGagged;
  2796.                                                                 len = todo.Message.length;
  2797.                                                                 cc = 0;
  2798.                                                                 while(cc < len)
  2799.                                                                 {
  2800.                                                                     if(xatlib.xInt(todo.Message[cc].u) == xatlib.xInt(todo.Users[UserIndex].u))
  2801.                                                                     {
  2802.                                                                         if(IsBanned)
  2803.                                                                         {
  2804.                                                                             todo.Message[cc].ignored = true;
  2805.                                                                         }
  2806.                                                                     }
  2807.                                                                     cc = cc + 1;
  2808.                                                                 }
  2809.                                                                 todo.DoBuildUserList = true;
  2810.                                                                 todo.DoUpdateMessages = true;
  2811.                                                             }
  2812.                                                             if(todo.Users[UserIndex].friend)
  2813.                                                             {
  2814.                                                                 len = todo.w_friendlist.length;
  2815.                                                                 g = 0;
  2816.                                                                 while(g < len)
  2817.                                                                 {
  2818.                                                                     if(todo.w_friendlist[g].u == u)
  2819.                                                                     {
  2820.                                                                         if(!(xatlib.StripSpace_(todo.Users[UserIndex].n) == xatlib.StripSpace_(todo.w_friendlist[g].n)) || todo.Users[UserIndex].a == todo.w_friendlist[g].a || todo.Users[UserIndex].h == todo.w_friendlist[g].h)
  2821.                                                                         {
  2822.                                                                             network.UpdateFriendList(u, todo.w_friendlist[g].f ? todo.w_friendlist[g].f : 1);
  2823.                                                                         }
  2824.                                                                         break;
  2825.                                                                     }
  2826.                                                                     g = g + 1;
  2827.                                                                 }
  2828.                                                             }
  2829.                                                             if(todo.messageecho == "a")
  2830.                                                             {
  2831.                                                                 if(todo.Users[UserIndex].banned == true || network.OnIgnoreList(u))
  2832.                                                                 {
  2833.                                                                     if(chat.sending_lc)
  2834.                                                                     {
  2835.                                                                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, u, "l");
  2836.                                                                     }
  2837.                                                                 }
  2838.                                                                 else
  2839.                                                                 {
  2840.                                                                     if(chat.sending_lc)
  2841.                                                                     {
  2842.                                                                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, u, "u" + e.attributes.a);
  2843.                                                                     }
  2844.                                                                 }
  2845.                                                             }
  2846.                                                         }
  2847.                                                     }
  2848.                                                     else
  2849.                                                     {
  2850.                                                         if(e.nodeName == "l")
  2851.                                                         {
  2852.                                                             UserIndex = xatlib.FindUser(u);
  2853.                                                             xmessage.DeleteOneUserMc(UserIndex);
  2854.                                                             if((UserIndex == -1) && u == todo.w_userno)
  2855.                                                             {
  2856.                                                                 if((todo.Users[UserIndex].online == false) || todo.Users[UserIndex].onsuper == false)
  2857.                                                                 {
  2858.                                                                     xmessage.DeleteOneUserMc(UserIndex);
  2859.                                                                 }
  2860.                                                                 var _loc_3:Boolean = false;
  2861.                                                                 todo.Users[UserIndex].online = _loc_3;
  2862.                                                                 var _loc_3:Boolean = _loc_3;
  2863.                                                                 todo.Users[UserIndex].available = _loc_3;
  2864.                                                                 todo.Users[UserIndex].onsuper = _loc_3;
  2865.                                                                 todo.Users[UserIndex].xNum = undefined;
  2866.                                                             }
  2867.                                                             if(!(UserIndex == -1) && !network.UserGotMessage(todo.Users[UserIndex].u))
  2868.                                                             {
  2869.                                                                 len = todo.Users.length;
  2870.                                                                 tt = 0;
  2871.                                                                 while(tt < len)
  2872.                                                                 {
  2873.                                                                     if(!(todo.Users[tt].u == todo.Users[UserIndex].u && todo.Users[tt].u == todo.w_userno))
  2874.                                                                     {
  2875.                                                                         todo.Users.splice(tt, 1);
  2876.                                                                         todo.DoBuildUserList = true;
  2877.                                                                         break;
  2878.                                                                     }
  2879.                                                                     tt = tt + 1;
  2880.                                                                 }
  2881.                                                             }
  2882.                                                             todo.DoBuildUserList = true;
  2883.                                                             if(todo.messageecho == "a")
  2884.                                                             {
  2885.                                                                 if(chat.sending_lc)
  2886.                                                                 {
  2887.                                                                     chat.sending_lc.send(chat.fromxat, "onMsg", 4, u, "l");
  2888.                                                                 }
  2889.                                                             }
  2890.                                                         }
  2891.                                                         else
  2892.                                                         {
  2893.                                                             if(e.nodeName == "i")
  2894.                                                             {
  2895.                                                                 todo.gconfig = new Object();
  2896.                                                                 todo.w_room_cb = xatlib.xInt(e.attributes.cb);
  2897.                                                                 xconst.MakeBads();
  2898.                                                                 if(todo.w_useroom == todo.w_room)
  2899.                                                                 {
  2900.                                                                     xatlib.SplitBackground(e.attributes.b);
  2901.                                                                     a = todo.BackVars;
  2902.                                                                 }
  2903.                                                                 else
  2904.                                                                 {
  2905.                                                                     a = e.attributes.b.split(";=");
  2906.                                                                 }
  2907.                                                                 todo.usebackground = a[0];
  2908.                                                                 todo.useRadio = a[4];
  2909.                                                                 if(!(todo.useRadio == undefined) && global.xc & 4096 || todo.useRadio.length < 10)
  2910.                                                                 {
  2911.                                                                     todo.useRadio = undefined;
  2912.                                                                 }
  2913.                                                                 if(todo.config["noradio"])
  2914.                                                                 {
  2915.                                                                     todo.useRadio = undefined;
  2916.                                                                 }
  2917.                                                                 todo.ButCol = a[5];
  2918.                                                                 if(todo.ButCol == undefined || todo.ButCol.length == 0)
  2919.                                                                 {
  2920.                                                                     todo.ButCol = 13158600;
  2921.                                                                 }
  2922.                                                                 else
  2923.                                                                 {
  2924.                                                                     if(todo.ButCol.charAt(0) == "#")
  2925.                                                                     {
  2926.                                                                         todo.ButCol = network.parseInt(todo.ButCol.substr(1), 16);
  2927.                                                                     }
  2928.                                                                 }
  2929.                                                                 todo.ButCol = xatlib.xInt(todo.ButCol) & 16777215;
  2930.                                                                 todo.ButColW2 = (todo.ButCol & 255) + (todo.ButCol >> 8) & 255 + (todo.ButCol >> 16) & 255;
  2931.                                                                 if(todo.ButColW2 > 384)
  2932.                                                                 {
  2933.                                                                     todo.ButColW = 0;
  2934.                                                                 }
  2935.                                                                 else
  2936.                                                                 {
  2937.                                                                     todo.ButColW = 16777215;
  2938.                                                                 }
  2939.                                                                 main.mcgetachat.RefreshColor();
  2940.                                                                 main.ButtonLoginMc.RefreshColor();
  2941.                                                                 main.retmc.RefreshColor();
  2942.                                                                 if(todo.bThin)
  2943.                                                                 {
  2944.                                                                     main.retmcBut.Col = todo.ButColW;
  2945.                                                                 }
  2946.                                                                 else
  2947.                                                                 {
  2948.                                                                     xatlib.McSetRGB(main.retmcBut.xitem.back, todo.ButColW);
  2949.                                                                 }
  2950.                                                                 if(!todo.bMobile)
  2951.                                                                 {
  2952.                                                                     main.mscrollmc.RefreshColor();
  2953.                                                                     main.uscrollmc.RefreshColor();
  2954.                                                                 }
  2955.                                                                 todo.FlagBits = xatlib.xInt(e.attributes.f);
  2956.                                                                 if(todo.FlagBits & xconst.f_Deleted)
  2957.                                                                 {
  2958.                                                                     chat.mainDlg.visible = false;
  2959.                                                                     xatlib.getURL("http://alltop.com", "_self");
  2960.                                                                     if(todo.lb != "n")
  2961.                                                                     {
  2962.                                                                         main.logoutbutonPress();
  2963.                                                                     }
  2964.                                                                     return;
  2965.                                                                 }
  2966.                                                                 main.logo.visible = true;
  2967.                                                                 chat.mainDlg.MkGpBut();
  2968.                                                                 if(todo.MainFlagBits == undefined)
  2969.                                                                 {
  2970.                                                                     todo.MainFlagBits = todo.FlagBits;
  2971.                                                                 }
  2972.                                                                 if(todo.w_sound == undefined)
  2973.                                                                 {
  2974.                                                                     if(todo.FlagBits & xconst.f_DefNoSound)
  2975.                                                                     {
  2976.                                                                         todo.w_sound = 4;
  2977.                                                                     }
  2978.                                                                     else
  2979.                                                                     {
  2980.                                                                         todo.w_sound = 253;
  2981.                                                                     }
  2982.                                                                 }
  2983.                                                                 if((todo.w_sound & 4) == 0)
  2984.                                                                 {
  2985.                                                                     todo.w_sound = todo.w_sound | 254;
  2986.                                                                 }
  2987.                                                                 if(global.xc & 8192)
  2988.                                                                 {
  2989.                                                                     todo.w_sound = todo.w_sound & ~2;
  2990.                                                                 }
  2991.                                                                 if(global.xt == undefined)
  2992.                                                                 {
  2993.                                                                     main.ctabsmc.tabs[1].t = todo.BackVars[1];
  2994.                                                                     main.ctabsmc.tabs[1].h = main.ctabsmc.tabs[1].t + " ";
  2995.                                                                 }
  2996.                                                                 if(global.xl == undefined)
  2997.                                                                 {
  2998.                                                                     todo.group = todo.BackVars[2];
  2999.                                                                 }
  3000.                                                                 if(xconst.f_Lobby & todo.MainFlagBits)
  3001.                                                                 {
  3002.                                                                     main.ctabsmc.tabs[0].Skip = undefined;
  3003.                                                                     main.ctabsmc.tabs[1].Skip = undefined;
  3004.                                                                 }
  3005.                                                                 else
  3006.                                                                 {
  3007.                                                                     main.ctabsmc.tabs[0].Skip = true;
  3008.                                                                     main.ctabsmc.tabs[1].Skip = true;
  3009.                                                                 }
  3010.                                                                 main.ctabsmc.UpdateTabs();
  3011.                                                                 if(e.attributes.v & 1)
  3012.                                                                 {
  3013.                                                                 }
  3014.                                                                 else
  3015.                                                                 {
  3016.                                                                     todo.w_registered = undefined;
  3017.                                                                 }
  3018.                                                                 todo.w_VIP = (e.attributes.v & 3) == 3;
  3019.                                                                 todo.w_ALLP = e.attributes.v & 4;
  3020.                                                                 todo.w_mainowner = false;
  3021.                                                                 todo.w_owner = false;
  3022.                                                                 todo.w_moderator = false;
  3023.                                                                 todo.w_member = false;
  3024.                                                                 if(xatlib.xInt(e.attributes.r) == 1)
  3025.                                                                 {
  3026.                                                                     todo.w_mainowner = true;
  3027.                                                                     todo.w_owner = true;
  3028.                                                                 }
  3029.                                                                 else
  3030.                                                                 {
  3031.                                                                     if(xatlib.xInt(e.attributes.r) == 2)
  3032.                                                                     {
  3033.                                                                         todo.w_moderator = true;
  3034.                                                                     }
  3035.                                                                     else
  3036.                                                                     {
  3037.                                                                         if(xatlib.xInt(e.attributes.r) == 3)
  3038.                                                                         {
  3039.                                                                             todo.w_member = true;
  3040.                                                                         }
  3041.                                                                         else
  3042.                                                                         {
  3043.                                                                             if(xatlib.xInt(e.attributes.r) == 4)
  3044.                                                                             {
  3045.                                                                                 todo.w_owner = true;
  3046.                                                                             }
  3047.                                                                             else
  3048.                                                                             {
  3049.                                                                                 todo.pass = undefined;
  3050.                                                                             }
  3051.                                                                         }
  3052.                                                                     }
  3053.                                                                 }
  3054.                                                                 if(todo.w_mainowner)
  3055.                                                                 {
  3056.                                                                     if(network.OnGagList(todo.w_useroom))
  3057.                                                                     {
  3058.                                                                         network.UpdateGagList(todo.w_useroom, 0, false);
  3059.                                                                     }
  3060.                                                                     i = xatlib.FindUser(todo.w_userno);
  3061.                                                                     if(i > -1)
  3062.                                                                     {
  3063.                                                                         todo.Users[i].banned = false;
  3064.                                                                         xmessage.DeleteOneUserMc(i);
  3065.                                                                     }
  3066.                                                                 }
  3067.                                                                 len = todo.Users.length;
  3068.                                                                 ee = 0;
  3069.                                                                 while(ee < len)
  3070.                                                                 {
  3071.                                                                     if(todo.Users[ee].u == todo.w_userno)
  3072.                                                                     {
  3073.                                                                         var _loc_3:Boolean = false;
  3074.                                                                         todo.Users[ee].member = _loc_3;
  3075.                                                                         var _loc_3:Boolean = _loc_3;
  3076.                                                                         todo.Users[ee].moderator = _loc_3;
  3077.                                                                         var _loc_3:Boolean = _loc_3;
  3078.                                                                         todo.Users[ee].owner = _loc_3;
  3079.                                                                         todo.Users[ee].mainowner = _loc_3;
  3080.                                                                         IsBanned = network.OnGagList(todo.w_useroom);
  3081.                                                                         todo.Users[ee].banned = IsBanned;
  3082.                                                                         if(todo.w_mainowner)
  3083.                                                                         {
  3084.                                                                             todo.Users[ee].mainowner = true;
  3085.                                                                         }
  3086.                                                                         if(todo.w_owner)
  3087.                                                                         {
  3088.                                                                             todo.Users[ee].owner = true;
  3089.                                                                         }
  3090.                                                                         todo.w_owner;
  3091.                                                                         todo.w_mainowner;
  3092.                                                                         if(todo.w_owner || todo.w_mainowner && (todo.w_name.substr(0, 1)) == "$")
  3093.                                                                         {
  3094.                                                                             todo.Users[ee].Stealth = true;
  3095.                                                                         }
  3096.                                                                         if(todo.w_moderator)
  3097.                                                                         {
  3098.                                                                             todo.Users[ee].moderator = true;
  3099.                                                                         }
  3100.                                                                         if(todo.w_member)
  3101.                                                                         {
  3102.                                                                             todo.Users[ee].member = true;
  3103.                                                                         }
  3104.                                                                         todo.Users[ee].VIP = todo.w_VIP;
  3105.                                                                         if(!todo.w_VIP)
  3106.                                                                         {
  3107.                                                                             todo.w_Powers = undefined;
  3108.                                                                         }
  3109.                                                                         todo.Users[ee].Powers = todo.w_Powers != undefined ? todo.w_Powers.slice() : todo.NO_POWERS.slice();
  3110.                                                                         if(todo.w_ALLP)
  3111.                                                                         {
  3112.                                                                             todo.Users[ee].Powers[0] = todo.Users[ee].Powers[0] | 1;
  3113.                                                                         }
  3114.                                                                         network.AddGiftPower(ee);
  3115.                                                                         t = 0;
  3116.                                                                         while(t < todo.MAX_PWR_INDEX)
  3117.                                                                         {
  3118.                                                                             todo.Users[ee].Powers[t] = todo.Users[ee].Powers[t] & (~(xatlib.xInt(todo.w_Mask != undefined ? todo.w_Mask[t] : 0)));
  3119.                                                                             t = t + 1;
  3120.                                                                         }
  3121.                                                                         todo.Users[ee].Bride = todo.w_d2;
  3122.                                                                         todo.Users[ee].aFlags = todo.w_d0;
  3123.                                                                         todo.Users[ee].flag0 = xatlib.xInt(e.attributes.f2);
  3124.                                                                         todo.w_r = xatlib.xInt(e.attributes.r);
  3125.                                                                         todo.Users[ee].w = xatlib.xInt(e.attributes.w);
  3126.                                                                         todo.Users[ee].sn = xatlib.xJSONdecode(todo.w_sn);
  3127.                                                                         todo.foe = todo.HasPower(ee, 212);
  3128.                                                                         xmessage.DeleteOneUserMc(ee);
  3129.                                                                         todo.DoBuildUserList = true;
  3130.                                                                         break;
  3131.                                                                     }
  3132.                                                                     ee = ee + 1;
  3133.                                                                 }
  3134.                                                                 if(todo.config["uselogindialog"])
  3135.                                                                 StringIndex = todo.config["uselogindialog"] ? 0 : todo.w_mainowner && !global.xb ? 34 : 5;
  3136.                                                                 main.mcgetachat.SetText(StringIndex ? xconst.ST(StringIndex) : "Login");
  3137.                                                                 main.mcgetachat.lc = StringIndex;
  3138.                                                                 todo.w_owner;
  3139.                                                                 todo.w_moderator;
  3140.                                                                 if((xconst.f_MembersOnly | xconst.f_MembersOnly2) & todo.FlagBits && todo.w_owner || todo.w_moderator || !todo.w_member)
  3141.                                                                 {
  3142.                                                                     type = undefined;
  3143.                                                                     switch((xconst.f_MembersOnly | xconst.f_MembersOnly2) & todo.FlagBits)
  3144.                                                                     {
  3145.                                                                     case xconst.f_MembersOnly | xconst.f_MembersOnly2:
  3146.                                                                         if(!todo.w_VIP)
  3147.                                                                         {
  3148.                                                                             type = xconst.ST(176);
  3149.                                                                         }
  3150.                                                                         break;
  3151.                                                                     case xconst.f_MembersOnly2:
  3152.                                                                         if(todo.w_registered == undefined)
  3153.                                                                         {
  3154.                                                                             type = xconst.ST(177);
  3155.                                                                         }
  3156.                                                                         break;
  3157.                                                                     default:
  3158.                                                                         type = xconst.ST(178);
  3159.                                                                         break;
  3160.                                                                     }
  3161.                                                                     if(type != undefined)
  3162.                                                                     {
  3163.                                                                         todo.helpstr = xconst.ST(37, type);
  3164.                                                                         todo.HelpUpdate = 0;
  3165.                                                                     }
  3166.                                                                 }
  3167.                                                                 if(todo.messageecho == "a")
  3168.                                                                 {
  3169.                                                                     if(chat.sending_lc)
  3170.                                                                     {
  3171.                                                                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "d");
  3172.                                                                     }
  3173.                                                                 }
  3174.                                                                 main.SetScroller(todo.FlagBits & xconst.f_Live ? xconst.ST(217) : "");
  3175.                                                                 UserIndex = xatlib.FindUser(todo.w_userno);
  3176.                                                                 todo.Users[UserIndex].banned;
  3177.                                                                 if(UserIndex >= 0 && todo.Users[UserIndex].banned && todo.Users[UserIndex].w)
  3178.                                                                 {
  3179.                                                                     xkiss.LoadPuzzle(todo.Users[UserIndex].w);
  3180.                                                                 }
  3181.                                                                 else
  3182.                                                                 {
  3183.                                                                     xkiss.ClosePuzzle();
  3184.                                                                 }
  3185.                                                             }
  3186.                                                             else
  3187.                                                             {
  3188.                                                                 if(e.nodeName == "w")
  3189.                                                                 {
  3190.                                                                     while(todo.Pools.length)
  3191.                                                                     {
  3192.                                                                         todo.Pools.shift();
  3193.                                                                     }
  3194.                                                                     Text = e.attributes.v;
  3195.                                                                     left = 0;
  3196.                                                                     RndOr = todo.w_userno ^ 2863311530.00;
  3197.                                                                     Rnd2 = RndOr;
  3198.                                                                     len = Text.length;
  3199.                                                                     q = 0;
  3200.                                                                     while(q < len)
  3201.                                                                     {
  3202.                                                                         if((Text.substr(q, 1)) == " " || q == (Text.length - 1))
  3203.                                                                         {
  3204.                                                                             todo.pool = xatlib.xInt(Text.substr(left, q == (Text.length - 1) ? (q - left) + 1 : q - left));
  3205.                                                                             if(left == 0)
  3206.                                                                             {
  3207.                                                                                 todo.newpool = todo.pool;
  3208.                                                                             }
  3209.                                                                             else
  3210.                                                                             {
  3211.                                                                                 if(Rnd2 & 1)
  3212.                                                                                 {
  3213.                                                                                     todo.Pools.push(todo.pool);
  3214.                                                                                 }
  3215.                                                                                 else
  3216.                                                                                 {
  3217.                                                                                     todo.Pools.unshift(todo.pool);
  3218.                                                                                 }
  3219.                                                                                 Rnd2 = Rnd2 >>> 1;
  3220.                                                                                 if(Rnd2 == 0)
  3221.                                                                                 {
  3222.                                                                                     Rnd2 = RndOr;
  3223.                                                                                 }
  3224.                                                                             }
  3225.                                                                             left = q + 1;
  3226.                                                                         }
  3227.                                                                         q = q + 1;
  3228.                                                                     }
  3229.                                                                     if(todo.newpool != todo.w_pool)
  3230.                                                                     {
  3231.                                                                         main.ctabsmc.UpdateTabs();
  3232.                                                                         todo.w_pool = todo.newpool;
  3233.                                                                         xmessage.ClearLists(false);
  3234.                                                                         todo.DoBuildUserListScrollUp = true;
  3235.                                                                         todo.DoUpdateMessages = true;
  3236.                                                                     }
  3237.                                                                     else
  3238.                                                                     {
  3239.                                                                         todo.DoBuildUserListScrollUp = true;
  3240.                                                                     }
  3241.                                                                     if(todo.messageecho == "a")
  3242.                                                                     {
  3243.                                                                         if(chat.sending_lc)
  3244.                                                                         {
  3245.                                                                             chat.sending_lc.send(chat.fromxat, "onMsg", 4, 0, "d");
  3246.                                                                         }
  3247.                                                                     }
  3248.                                                                 }
  3249.                                                                 else
  3250.                                                                 {
  3251.                                                                     if(e.nodeName == "f")
  3252.                                                                     {
  3253.                                                                         str = e.attributes.v;
  3254.                                                                         sarray = str.split(",");
  3255.                                                                         len = sarray.length;
  3256.                                                                         p = 0;
  3257.                                                                         while(p < len)
  3258.                                                                         {
  3259.                                                                             UserIndex = xatlib.FindUser(sarray[p]);
  3260.                                                                             if(UserIndex != -1)
  3261.                                                                             {
  3262.                                                                                 todo.Users[UserIndex].onsuper = true;
  3263.                                                                                 todo.Users[UserIndex].available = sarray[p].charAt(0) === "0";
  3264.                                                                                 xmessage.DeleteOneUserMc(UserIndex);
  3265.                                                                             }
  3266.                                                                             p = p + 1;
  3267.                                                                         }
  3268.                                                                         todo.DoBuildUserListScrollUp = true;
  3269.                                                                     }
  3270.                                                                     else
  3271.                                                                     {
  3272.                                                                         if(e.nodeName == "k")
  3273.                                                                         {
  3274.                                                                             todo.OnSuper = false;
  3275.                                                                         }
  3276.                                                                         else
  3277.                                                                         {
  3278.                                                                             if(e.nodeName == "dup")
  3279.                                                                             {
  3280.                                                                                 todo.helpstr = xconst.ST(36);
  3281.                                                                                 todo.HelpUpdate = 0;
  3282.                                                                                 network.SetNetworkState(0, -1);
  3283.                                                                                 todo.lb = "n";
  3284.                                                                                 todo.DoUpdate = true;
  3285.                                                                                 network.NetworkClose();
  3286.                                                                             }
  3287.                                                                             else
  3288.                                                                             {
  3289.                                                                                 if(e.nodeName == "q")
  3290.                                                                                 {
  3291.                                                                                     if(e.attributes.k != undefined)
  3292.                                                                                     {
  3293.                                                                                         network.SetNetworkState(0, -1);
  3294.                                                                                         todo.lb = "n";
  3295.                                                                                         todo.DoUpdate = true;
  3296.                                                                                         network.NetworkClose();
  3297.                                                                                         if(QK != true)
  3298.                                                                                         {
  3299.                                                                                             QK = true;
  3300.                                                                                             todo.w_userno = 0;
  3301.                                                                                             todo.w_userrev = 0;
  3302.                                                                                             todo.w_k1 = 0;
  3303.                                                                                             todo.w_k2 = 0;
  3304.                                                                                             network.NetworkStartChat();
  3305.                                                                                         }
  3306.                                                                                     }
  3307.                                                                                     else
  3308.                                                                                     {
  3309.                                                                                         doautoredirect = w_redirectport == undefined;
  3310.                                                                                         network.SetNetworkState(0, -1);
  3311.                                                                                         if(e.attributes.r != undefined)
  3312.                                                                                         {
  3313.                                                                                             var _loc_3:xInt = xatlib.xInt(e.attributes.r);
  3314.                                                                                             todo.w_useroom = _loc_3;
  3315.                                                                                             todo.w_room = _loc_3;
  3316.                                                                                             main.ctabsmc.UpdateTabs(0);
  3317.                                                                                         }
  3318.                                                                                         else
  3319.                                                                                         {
  3320.                                                                                             w_redirectport = xatlib.xInt(e.attributes.p);
  3321.                                                                                             w_redirectdom = e.attributes.d;
  3322.                                                                                             if((w_redirectdom.substr(0, 1)) == "e")
  3323.                                                                                             {
  3324.                                                                                                 w_redirectdom = w_redirectdom + ".xatech.com";
  3325.                                                                                             }
  3326.                                                                                         }
  3327.                                                                                         if((e.attributes.p2 == undefined) && e.attributes.d2 == undefined)
  3328.                                                                                         {
  3329.                                                                                             uid = xatlib.FindUser(e.attributes.d2);
  3330.                                                                                             if((e.attributes.p2.indexOf("#") == -1) && uid == -1)
  3331.                                                                                             {
  3332.                                                                                                 reason = e.attributes.p2.substr(0, e.attributes.p2.indexOf("#"));
  3333.                                                                                                 bootr = e.attributes.p2.substr(e.attributes.p2.indexOf("#") + 1);
  3334.                                                                                                 Bootp = (todo.Users[uid].n + " (") + todo.Users[uid].u + ") booted you to " + bootr + (reason != "" ? ". Reason:" + reason : ".");
  3335.                                                                                             }
  3336.                                                                                         }
  3337.                                                                                         todo.lb = "n";
  3338.                                                                                         todo.DoUpdate = true;
  3339.                                                                                         network.NetworkClose();
  3340.                                                                                         if(doautoredirect)
  3341.                                                                                         {
  3342.                                                                                             network.NetworkStartChat();
  3343.                                                                                         }
  3344.                                                                                     }
  3345.                                                                                 }
  3346.                                                                                 else
  3347.                                                                                 {
  3348.                                                                                     if(e.nodeName == "logout")
  3349.                                                                                     {
  3350.                                                                                         if(e.attributes.e == "F016" || e.attributes.e == "F021")
  3351.                                                                                         {
  3352.                                                                                             if(attempt < xNumAttempts)
  3353.                                                                                             {
  3354.                                                                                                 var _loc_3:network = network;
  3355.                                                                                                 var _loc_4:* = _loc_3.attempt + 1;
  3356.                                                                                                 _loc_3.attempt = _loc_4;
  3357.                                                                                                 _loc_3.SetNetworkState(0, -1);
  3358.                                                                                                 todo.lb = "n";
  3359.                                                                                                 todo.DoUpdate = true;
  3360.                                                                                                 _loc_3.NetworkClose();
  3361.                                                                                                 _loc_3.NetworkStartChat();
  3362.                                                                                                 return;
  3363.                                                                                             }
  3364.                                                                                         }
  3365.                                                                                         todo.helpstr = xconst.ST(35);
  3366.                                                                                         todo.HelpUpdate = 0;
  3367.                                                                                         errnum = xatlib.xInt(e.attributes.e.substr(1));
  3368.                                                                                         switch(errnum)
  3369.                                                                                         {
  3370.                                                                                         case 36:
  3371.                                                                                             todo.helpstr = xconst.ST(260);
  3372.                                                                                             break;
  3373.                                                                                         case 37:
  3374.                                                                                             todo.helpstr = xconst.ST(260);
  3375.                                                                                             break;
  3376.                                                                                         case 38:
  3377.                                                                                             todo.helpstr = xconst.ST(260);
  3378.                                                                                             break;
  3379.                                                                                         default:
  3380.                                                                                             break;
  3381.                                                                                         }
  3382.                                                                                         _loc_3.SetNetworkState(0, -1);
  3383.                                                                                         todo.lb = "n";
  3384.                                                                                         todo.DoUpdate = true;
  3385.                                                                                         _loc_3.NetworkClose();
  3386.                                                                                         uid = xatlib.FindUser(todo.w_userno);
  3387.                                                                                         todo.Users[uid].online = false;
  3388.                                                                                         xmessage.DeleteOneUserMc(uid);
  3389.                                                                                         _loc_3.RemoveMessagesWithNoUser();
  3390.                                                                                     }
  3391.                                                                                     else
  3392.                                                                                     {
  3393.                                                                                         if(e.nodeName == "idle")
  3394.                                                                                         {
  3395.                                                                                             todo.helpstr = xconst.ST(33);
  3396.                                                                                             todo.HelpUpdate = 0;
  3397.                                                                                             _loc_3.SetNetworkState(0, -1);
  3398.                                                                                             todo.lb = "n";
  3399.                                                                                             todo.DoUpdate = true;
  3400.                                                                                             _loc_3.NetworkClose();
  3401.                                                                                             _loc_3.RemoveMessagesWithNoUser();
  3402.                                                                                         }
  3403.                                                                                         else
  3404.                                                                                         {
  3405.                                                                                             if(e.nodeName == "abort")
  3406.                                                                                             {
  3407.                                                                                                 todo.lb = "n";
  3408.                                                                                                 todo.DoUpdate = true;
  3409.                                                                                                 _loc_3.NetworkClose();
  3410.                                                                                                 _loc_3.SetNetworkState(5, 12 * 6);
  3411.                                                                                             }
  3412.                                                                                             else
  3413.                                                                                             {
  3414.                                                                                                 if(e.nodeName == "BB")
  3415.                                                                                                 {
  3416.                                                                                                     if(YI != xatlib.xInt(e.attributes.y))
  3417.                                                                                                     {
  3418.                                                                                                         return;
  3419.                                                                                                     }
  3420.                                                                                                     tickcode.BB = e.attributes.t.split(",");
  3421.                                                                                                 }
  3422.                                                                                                 else
  3423.                                                                                                 {
  3424.                                                                                                     if(e.nodeName == "done")
  3425.                                                                                                     {
  3426.                                                                                                         chat.mainDlg.UpdateBackground(todo.usebackground);
  3427.                                                                                                         chat.mainDlg.UpdateEmotes();
  3428.                                                                                                         xmessage.OpenGifts(todo.w_userno, 0);
  3429.                                                                                                         if(global.um != undefined)
  3430.                                                                                                         {
  3431.                                                                                                             xatlib.GeneralMessage("", (xconst.ST(135) + ":\n\n") + global.um);
  3432.                                                                                                             network.NetworkMakeUser(global.um, "r");
  3433.                                                                                                             network.SetNetworkState(0, -1);
  3434.                                                                                                             todo.lb = "n";
  3435.                                                                                                             todo.DoUpdate = true;
  3436.                                                                                                             network.NetworkClose();
  3437.                                                                                                             main.box_layer.GeneralMessageH.Delete();
  3438.                                                                                                             global.um = undefined;
  3439.                                                                                                             main.box_layer.GeneralMessageH.Dia.Ok.But.PressFunc = _func_20;
  3440.                                                                                                         }
  3441.                                                                                                         _loc_3.RemoveMessagesWithNoUser();
  3442.                                                                                                         _loc_3.RemoveUsersWithNoMessages();
  3443.                                                                                                         if(xatlib.IsDefaultName(todo.w_name) && todo.helpstr == "")
  3444.                                                                                                         {
  3445.                                                                                                             todo.helpstr = xconst.ST(12, " <o> <l>" + todo.w_name);
  3446.                                                                                                             todo.HelpUpdate = 0;
  3447.                                                                                                         }
  3448.                                                                                                         todo.FV = xatlib.xInt(Capabilities.version.split(" ")[1]);
  3449.                                                                                                         if(todo.FV < 10)
  3450.                                                                                                         {
  3451.                                                                                                             todo.helpstr = "Please update your Flash player for best performance, click here: http://www.adobe.com/go/getflashplayer";
  3452.                                                                                                             todo.helpupdate = 0;
  3453.                                                                                                         }
  3454.                                                                                                         if(Bootp != undefined)
  3455.                                                                                                         {
  3456.                                                                                                             todo.helpstr = Bootp;
  3457.                                                                                                             todo.HelpUpdate = 0;
  3458.                                                                                                             Bootp = undefined;
  3459.                                                                                                         }
  3460.                                                                                                         xmessage.UpdateMessages(true, false);
  3461.                                                                                                         todo.DoBuildUserList = true;
  3462.                                                                                                         GotDone = true;
  3463.                                                                                                         FI = true;
  3464.                                                                                                         if(todo.connectchannel != undefined)
  3465.                                                                                                         {
  3466.                                                                                                             if(chat.sending_lc)
  3467.                                                                                                             {
  3468.                                                                                                                 chat.sending_lc.send(chat.fromxat, "onMsg", chat.connectchannel, chat.connectuser, chat.connectmsg);
  3469.                                                                                                             }
  3470.                                                                                                             todo.connectchannel = undefined;
  3471.                                                                                                         }
  3472.                                                                                                         if(todo.RefreshLogin)
  3473.                                                                                                         {
  3474.                                                                                                             _loc_3.NetworkLogin(todo.w_userno, 0);
  3475.                                                                                                             todo.WV2 = true;
  3476.                                                                                                             todo.RefreshLogin = false;
  3477.                                                                                                         }
  3478.                                                                                                         if(todo.gconfig["g112"])
  3479.                                                                                                         {
  3480.                                                                                                             todo.Message.push({n:0, t:"<inf8> " + todo.gconfig["g112"], u:0, s:0, d:0});
  3481.                                                                                                             todo.DoUpdateMessages = true;
  3482.                                                                                                             todo.ScrollDown = true;
  3483.                                                                                                         }
  3484.                                                                                                         uid = xatlib.FindUser(todo.w_userno);
  3485.                                                                                                         todo.Away = todo.HasPower(uid, 144) ? 1 : 0;
  3486.                                                                                                         todo.Typing = todo.HasPower(uid, 172) ? 1 : 0;
  3487.                                                                                                     }
  3488.                                                                                                 }
  3489.                                                                                             }
  3490.                                                                                         }
  3491.                                                                                     }
  3492.                                                                                 }
  3493.                                                                             }
  3494.                                                                         }
  3495.                                                                     }
  3496.                                                                 }
  3497.                                                             }
  3498.                                                         }
  3499.                                                     }
  3500.                                                 }
  3501.                                             }
  3502.                                         }
  3503.                                     }
  3504.                                 }
  3505.                             }
  3506.                         }
  3507.                     }
  3508.                 }
  3509.             }
  3510.         }
  3511.  
  3512.         final public static function NetworkSendMsg(param1:*, param2:*, param3:* = undefined, param4:* = undefined, param5:* = undefined, param6:* = undefined, param7:* = undefined)
  3513.         {
  3514.             var _loc_9:* = undefined;
  3515.             if(todo.lb == "n")
  3516.             {
  3517.                 return;
  3518.             }
  3519.             if(param3 == undefined)
  3520.             {
  3521.                 param3 = 0;
  3522.             }
  3523.             if(param4 == undefined)
  3524.             {
  3525.                 param4 = 0;
  3526.             }
  3527.             if(param5 == undefined)
  3528.             {
  3529.                 param5 = 0;
  3530.             }
  3531.             var _loc_8:* = new XMLDocument();
  3532.             var _loc_10:* = true;
  3533.             var _loc_11:String = "";
  3534.             if(param5 != 0)
  3535.             {
  3536.                 _loc_9 = _loc_8.createElement("c");
  3537.                 if(param3 != 0)
  3538.                 {
  3539.                     _loc_9.attributes.d = todo.w_userno;
  3540.                     _loc_9.attributes.s = 2;
  3541.                 }
  3542.                 _loc_9.attributes.t = param2;
  3543.                 _loc_9.attributes.u = param5;
  3544.                 if(param6 != undefined)
  3545.                 {
  3546.                     _loc_9.attributes.p = param6;
  3547.                 }
  3548.                 if(param7 != undefined)
  3549.                 {
  3550.                     _loc_9.attributes.w = param7;
  3551.                 }
  3552.                 _loc_8.appendChild(_loc_9);
  3553.                 _loc_11 = xatlib.XMLOrder(_loc_8, new Array("w", "p", "u", "t", "s", "d"));
  3554.                 socket.send(_loc_11);
  3555.             }
  3556.             else
  3557.             {
  3558.                 if(param4 != 0)
  3559.                 {
  3560.                     if(!(network.OnUserList(param4) && (param2.substr(0, 2)) == "/a") && (param2.substr(0, 2)) == "/l" && (param2.substr(0, 2)) == "/t")
  3561.                     {
  3562.                         _loc_9 = _loc_8.createElement("p");
  3563.                         if(param3 != 0)
  3564.                         {
  3565.                             _loc_9.attributes.d = todo.w_userno;
  3566.                             _loc_9.attributes.s = 2;
  3567.                         }
  3568.                         _loc_9.attributes.t = param2;
  3569.                         _loc_9.attributes.u = param4;
  3570.                         _loc_8.appendChild(_loc_9);
  3571.                         _loc_11 = xatlib.XMLOrder(_loc_8, new Array("u", "t", "s", "d"));
  3572.                         socket.send(_loc_11);
  3573.                     }
  3574.                     else
  3575.                     {
  3576.                         _loc_9 = _loc_8.createElement("z");
  3577.                         if(param3 != 0)
  3578.                         {
  3579.                             _loc_9.attributes.s = 2;
  3580.                         }
  3581.                         _loc_9.attributes.t = param2;
  3582.                         _loc_9.attributes.u = (todo.w_userno + "_") + todo.w_userrev;
  3583.                         _loc_9.attributes.d = param4;
  3584.                         _loc_10 = false;
  3585.                         _loc_8.appendChild(_loc_9);
  3586.                         _loc_11 = xatlib.XMLOrder(_loc_8, new Array("d", "u", "t", "s"));
  3587.                         socket.send(_loc_11);
  3588.                     }
  3589.                 }
  3590.                 else
  3591.                 {
  3592.                     if(param3 != 0)
  3593.                     {
  3594.                         if(network.OnUserList(param3))
  3595.                         {
  3596.                             _loc_9 = _loc_8.createElement("p");
  3597.                             _loc_9.attributes.d = todo.w_userno;
  3598.                             _loc_9.attributes.s = 2;
  3599.                             _loc_9.attributes.t = param2;
  3600.                             _loc_9.attributes.u = param3;
  3601.                             _loc_8.appendChild(_loc_9);
  3602.                             _loc_11 = xatlib.XMLOrder(_loc_8, new Array("u", "t", "s", "d"));
  3603.                             socket.send(_loc_11);
  3604.                         }
  3605.                         else
  3606.                         {
  3607.                             _loc_9 = _loc_8.createElement("z");
  3608.                             _loc_9.attributes.s = 2;
  3609.                             _loc_9.attributes.t = param2;
  3610.                             _loc_9.attributes.u = (todo.w_userno + "_") + todo.w_userrev;
  3611.                             _loc_9.attributes.d = param3;
  3612.                             _loc_10 = false;
  3613.                             _loc_8.appendChild(_loc_9);
  3614.                             _loc_11 = xatlib.XMLOrder(_loc_8, new Array("d", "u", "t", "s"));
  3615.                             socket.send(_loc_11);
  3616.                         }
  3617.                     }
  3618.                     else
  3619.                     {
  3620.                         _loc_9 = _loc_8.createElement("m");
  3621.                         _loc_9.attributes.u = todo.w_userrev <= 0 ? param1 : (param1 + "_") + todo.w_userrev;
  3622.                         _loc_9.attributes.t = param2;
  3623.                         if(xatlib.CountLinks(param2) > 0)
  3624.                         {
  3625.                             _loc_9.attributes.l = 1;
  3626.                         }
  3627.                         _loc_8.appendChild(_loc_9);
  3628.                         _loc_11 = xatlib.XMLOrder(_loc_8, new Array("t", "u", "l"));
  3629.                         socket.send(_loc_11);
  3630.                     }
  3631.                 }
  3632.             }
  3633.             if((param2.substr(0, 1)) != "/")
  3634.             {
  3635.                 network.GlowUser(todo.w_userno);
  3636.             }
  3637.             if((param2.substr(0, 3)) == "/KD")
  3638.             {
  3639.                 _loc_10 = false;
  3640.             }
  3641.             if(_loc_10)
  3642.             {
  3643.                 LurkerTimeout = LurkerLimit;
  3644.             }
  3645.         }
  3646.  
  3647.         final public static function UpdateChannel(param1:*, param2:*)
  3648.         {
  3649.             var _loc_3:Number = xatlib.FindUser(param2);
  3650.             if(_loc_3 < 0)
  3651.             {
  3652.                 return;
  3653.             }
  3654.             todo.Users[_loc_3].banned;
  3655.             todo.Users[_loc_3].w;
  3656.             if(todo.Users[_loc_3].banned && todo.Users[_loc_3].w && !(todo.Users[_loc_3].flag0 & 131072))
  3657.             {
  3658.                 param1 = 50000 + todo.Users[_loc_3].w;
  3659.             }
  3660.             if(param1 < 10000)
  3661.             {
  3662.                 param1 = 0;
  3663.             }
  3664.             if(todo.Users[_loc_3].xNum != param1)
  3665.             {
  3666.                 todo.Users[_loc_3].xNum = param1;
  3667.                 xmessage.DeleteOneUserMc(_loc_3);
  3668.             }
  3669.         }
  3670.  
  3671.         final public static function NetworkSendExtMessage(param1:*, param2:* = undefined, param3:* = undefined)
  3672.         {
  3673.             var _loc_5:* = undefined;
  3674.             LurkerTimeout = LurkerLimit;
  3675.             var _loc_4:* = new XMLDocument();
  3676.             _loc_5 = _loc_4.createElement("x");
  3677.             _loc_5.attributes.t = param3 == undefined ? "undefined" : param3;
  3678.             if(param2 != 0)
  3679.             {
  3680.                 _loc_5.attributes.d = param2 == undefined ? "undefined" : param2;
  3681.             }
  3682.             _loc_5.attributes.u = todo.w_userno;
  3683.             _loc_5.attributes.i = param1;
  3684.             network.UpdateChannel(param1, todo.w_userno);
  3685.             _loc_4.appendChild(_loc_5);
  3686.             var _loc_6:String = xatlib.XMLOrder(_loc_4, new Array("i", "u", "d", "t"));
  3687.             socket.send(_loc_6);
  3688.         }
  3689.  
  3690.         final public static function NetworkSendxmlExtMessage(param1:*)
  3691.         {
  3692.             LurkerTimeout = LurkerLimit;
  3693.             var _loc_2:* = new XMLDocument(param1);
  3694.             network.UpdateChannel(_loc_2.firstChild.attributes.i, todo.w_userno);
  3695.             var _loc_3:* = "";
  3696.             if((_loc_2.toString().indexOf("t=\"/m") == -1) || _loc_2.toString().indexOf("t=\"/g") == -1)
  3697.             {
  3698.                 _loc_3 = xatlib.XMLOrder(_loc_2, new Array("j", "i", "u", "t", "p"));
  3699.             }
  3700.             else
  3701.             {
  3702.                 _loc_3 = xatlib.XMLOrder(_loc_2, new Array("H", "j", "i", "t", "u", "d0", "d2", "q", "N", "n", "a", "h", "v"));
  3703.             }
  3704.             socket.send(_loc_3);
  3705.         }
  3706.  
  3707.         final public static function NetworkLogin(param1:*, param2:*)
  3708.         {
  3709.             var _loc_3:* = new XMLDocument();
  3710.             var _loc_4:* = _loc_3.createElement("v");
  3711.             _loc_4.attributes.n = param1;
  3712.             _loc_4.attributes.p = param2;
  3713.             _loc_3.appendChild(_loc_4);
  3714.             socket.send(_loc_3);
  3715.         }
  3716.  
  3717.         final public static function NetworkDeleteMessage(param1:*)
  3718.         {
  3719.             network.NetworkSendMsg(todo.w_userno, "/d" + param1);
  3720.         }
  3721.  
  3722.         final public static function NetworkGagUser(param1:*, param2:*, param3:*, param4:*, param5:* = undefined, param6:* = undefined)
  3723.         {
  3724.             network.NetworkSendMsg(todo.w_userno, param3 ? "/" + param1 + param4 : "/u", 0, 0, param2, param5, param6);
  3725.         }
  3726.  
  3727.         final public static function NetworkKickUser(param1:*, param2:*)
  3728.         {
  3729.             network.NetworkSendMsg(todo.w_userno, "/k", 0, 0, param1, param2);
  3730.         }
  3731.  
  3732.         final public static function NetworkMakeUser(param1:*, param2:*)
  3733.         {
  3734.             network.NetworkSendMsg(todo.w_userno, "/" + param2, 0, 0, param1);
  3735.         }
  3736.  
  3737.         final public static function SysMsg(param1:*, param2:*, param3:* = undefined, param4:* = undefined, param5:* = undefined, param6:int = 0) : String
  3738.         {
  3739.             var _loc_8:* = undefined;
  3740.             var _loc_10:* = undefined;
  3741.             var _loc_11:* = undefined;
  3742.             var _loc_7:String = "";
  3743.             var _loc_9:* = todo.Users[param3].n.substr(0, 128);
  3744.             if(param4 == undefined)
  3745.             {
  3746.                 param4 = "";
  3747.             }
  3748.             if(xatlib.CountLinks(_loc_9) > 0)
  3749.             {
  3750.                 _loc_9 = todo.Users[param3].registered;
  3751.                 if(!_loc_9)
  3752.                 {
  3753.                     _loc_9 = todo.Users[param3].u;
  3754.                 }
  3755.             }
  3756.             if(param1 == 0)
  3757.             {
  3758.                 if(param2 == "M")
  3759.                 {
  3760.                     _loc_7 = _loc_7 + (xconst.ST(137, _loc_9));
  3761.                 }
  3762.                 else
  3763.                 {
  3764.                     if(param2.charAt(0) == "m")
  3765.                     {
  3766.                         _loc_7 = _loc_7 + (xconst.ST(128, _loc_9));
  3767.                     }
  3768.                     else
  3769.                     {
  3770.                         if(param2.charAt(0) == "e")
  3771.                         {
  3772.                             _loc_7 = _loc_7 + (xconst.ST(132, _loc_9));
  3773.                         }
  3774.                         else
  3775.                         {
  3776.                             if(param2.charAt(0) == "o")
  3777.                             {
  3778.                                 _loc_7 = _loc_7 + (xconst.ST(137, _loc_9));
  3779.                             }
  3780.                             else
  3781.                             {
  3782.                                 if(param2 == "r")
  3783.                                 {
  3784.                                     _loc_7 = _loc_7 + (xconst.ST(138, _loc_9));
  3785.                                 }
  3786.                             }
  3787.                         }
  3788.                     }
  3789.                 }
  3790.                 _loc_10 = (xatlib.xInt(param2.substr(1) / 36)) / 100;
  3791.                 if(_loc_10 > 0)
  3792.                 {
  3793.                     _loc_7 = _loc_7 + "(" + _loc_10 + " " + xconst.ST(116) + ")";
  3794.                 }
  3795.             }
  3796.             else
  3797.             {
  3798.                 if(param1 == 1)
  3799.                 {
  3800.                     _loc_11 = param4.split("#");
  3801.                     if(_loc_11.length == 2)
  3802.                     {
  3803.                         _loc_7 = _loc_7 + (xconst.ST(194, _loc_9, _loc_11[1], _loc_11[0]));
  3804.                     }
  3805.                     else
  3806.                     {
  3807.                         if(_loc_11.length == 3)
  3808.                         {
  3809.                             _loc_7 = _loc_7 + "I have zapped " + _loc_9 + " Reason: " + _loc_11[0];
  3810.                         }
  3811.                         else
  3812.                         {
  3813.                             _loc_7 = _loc_7 + (xconst.ST(123, _loc_9, _loc_11[0]));
  3814.                         }
  3815.                     }
  3816.                 }
  3817.                 else
  3818.                 {
  3819.                     if(param1 == 7)
  3820.                     {
  3821.                         _loc_7 = _loc_7 + (xconst.ST(123, _loc_9, _loc_11[0]));
  3822.                     }
  3823.                     else
  3824.                     {
  3825.                         if(param1 == 2)
  3826.                         {
  3827.                             if(param4.length == 0)
  3828.                             {
  3829.                                 if(param5 == 0)
  3830.                                 {
  3831.                                     _loc_7 = _loc_7 + (xconst.ST(119, _loc_9));
  3832.                                 }
  3833.                                 else
  3834.                                 {
  3835.                                     _loc_7 = _loc_7 + (xconst.ST(120, _loc_9, network.String(param5 / 3600)));
  3836.                                 }
  3837.                             }
  3838.                             else
  3839.                             {
  3840.                                 if(param5 == 0)
  3841.                                 {
  3842.                                     _loc_7 = _loc_7 + (xconst.ST(121, _loc_9, param4));
  3843.                                 }
  3844.                                 else
  3845.                                 {
  3846.                                     _loc_7 = _loc_7 + (xconst.ST(122, _loc_9, network.String(param5 / 3600), param4));
  3847.                                 }
  3848.                             }
  3849.                             _loc_8 = 0;
  3850.                             switch(param6)
  3851.                             {
  3852.                             case 158:
  3853.                                 _loc_8 = xconst.ST(259);
  3854.                                 break;
  3855.                             case 264:
  3856.                                 _loc_8 = xconst.ST(265);
  3857.                                 break;
  3858.                             case 284:
  3859.                                 _loc_8 = xconst.ST(268);
  3860.                                 break;
  3861.                             case 292:
  3862.                                 _loc_8 = xconst.ST(272);
  3863.                                 break;
  3864.                             default:
  3865.                                 if(param6)
  3866.                                 {
  3867.                                     _loc_8 = xconst.Puzzle[param6] + xconst.ST(258);
  3868.                                 }
  3869.                                 break;
  3870.                             }
  3871.                             if(_loc_8)
  3872.                             {
  3873.                                 _loc_7 = xatlib.Replace(_loc_7, xconst.ST(258), _loc_8);
  3874.                             }
  3875.                         }
  3876.                         else
  3877.                         {
  3878.                             if(param1 == 3)
  3879.                             {
  3880.                                 if(param4.indexOf(",") >= 0)
  3881.                                 {
  3882.                                     _loc_8 = param4.split(",");
  3883.                                     _loc_7 = xconst.ST(250, _loc_8[2], xconst.Puzzle[_loc_8[0]], _loc_8[1]);
  3884.                                 }
  3885.                                 else
  3886.                                 {
  3887.                                     _loc_7 = _loc_7 + (xconst.ST(90) + " ") + _loc_9 + ".";
  3888.                                 }
  3889.                             }
  3890.                             else
  3891.                             {
  3892.                                 if(param1 == 4)
  3893.                                 {
  3894.                                     if(param2.charAt(0) == "n")
  3895.                                     {
  3896.                                         _loc_7 = _loc_7 + (xconst.ST(196, _loc_9));
  3897.                                         _loc_10 = (xatlib.xInt(param2.substr(1) / 36)) / 100;
  3898.                                         if(_loc_10 > 0)
  3899.                                         {
  3900.                                             _loc_7 = _loc_7 + "(" + _loc_10 + " " + xconst.ST(116) + ")";
  3901.                                         }
  3902.                                     }
  3903.                                 }
  3904.                                 else
  3905.                                 {
  3906.                                     if(param1 == 5 || param1 == 6)
  3907.                                     {
  3908.                                         if(param4.length == 0)
  3909.                                         {
  3910.                                             _loc_7 = _loc_7 + (xconst.ST(199, param1 == 5 ? xconst.ST(188) : xconst.ST(201), _loc_9, network.String(param5 / 3600)));
  3911.                                         }
  3912.                                         else
  3913.                                         {
  3914.                                             _loc_7 = _loc_7 + (xconst.ST(200, param1 == 5 ? xconst.ST(188) : xconst.ST(201), _loc_9, network.String(param5 / 3600), param4));
  3915.                                         }
  3916.                                     }
  3917.                                     else
  3918.                                     {
  3919.                                         return "";
  3920.                                     }
  3921.                                 }
  3922.                             }
  3923.                         }
  3924.                     }
  3925.                 }
  3926.             }
  3927.             return "<i> " + _loc_7;
  3928.         }
  3929.  
  3930.         final public static function NetworkFriendUser(param1:*, param2:*)
  3931.         {
  3932.             var _loc_4:* = undefined;
  3933.             var _loc_3:* = xatlib.FindUser(param1);
  3934.             todo.Users[_loc_3].friend = param2;
  3935.             xmessage.DeleteOneUserMc(_loc_3);
  3936.             network.UpdateFriendList(param1, param2);
  3937.             if(todo.w_registered == undefined)
  3938.             {
  3939.                 return;
  3940.             }
  3941.             var _loc_5:* = "/b " + param1 + "," + (param2 == 0 ? 2 : param2);
  3942.             if(param2)
  3943.             {
  3944.                 _loc_4 = todo.Users[_loc_3].registered;
  3945.                 if(_loc_4 == undefined)
  3946.                 {
  3947.                     _loc_4 = "";
  3948.                 }
  3949.                 _loc_5 = _loc_5 + "," + _loc_4 + "," + (todo.Users[_loc_3].n.substr(0, 20));
  3950.             }
  3951.             network.NetworkSendMsg(todo.w_userno, _loc_5, 0, 0, 2);
  3952.         }
  3953.  
  3954.         final public static function NetworkSetPool(param1:*)
  3955.         {
  3956.             var _loc_2:* = new XMLDocument();
  3957.             var _loc_3:* = _loc_2.createElement("w" + xatlib.xInt(param1));
  3958.             _loc_2.appendChild(_loc_3);
  3959.             socket.send(_loc_2);
  3960.         }
  3961.  
  3962.         final public static function NetworkLocateUser(param1:*)
  3963.         {
  3964.             if(param1 >= (2000000000 - (100000 * 2)))
  3965.             {
  3966.                 return;
  3967.             }
  3968.             network.NetworkSendMsg(todo.w_userno, "/l", 0, param1, 0);
  3969.         }
  3970.  
  3971.         final public static function RemoveMessagesWithNoUser()
  3972.         {
  3973.             var _loc_3:* = undefined;
  3974.             var _loc_1:* = todo.Message.length;
  3975.             var _loc_2:* = 0;
  3976.             while(_loc_2 < _loc_1)
  3977.             {
  3978.                 _loc_3 = xatlib.FindUser(todo.Message[_loc_2].u);
  3979.                 if(_loc_3 == -1)
  3980.                 {
  3981.                 }
  3982.                 else
  3983.                 {
  3984.                     if(todo.Users[_loc_3].n == "")
  3985.                     {
  3986.                         todo.Message[_loc_2].ignored = true;
  3987.                     }
  3988.                 }
  3989.                 _loc_2 = _loc_2 + 1;
  3990.             }
  3991.             todo.DoUpdateMessages = true;
  3992.         }
  3993.  
  3994.         final public static function RemoveUsersWithNoMessages()
  3995.         {
  3996.             var _loc_1:* = undefined;
  3997.             var _loc_2:* = undefined;
  3998.             _loc_1 = todo.Users.length;
  3999.             _loc_2 = 0;
  4000.             while(_loc_2 < _loc_1)
  4001.             {
  4002.                 if(todo.Users[_loc_2] == undefined)
  4003.                 {
  4004.                 }
  4005.                 else
  4006.                 {
  4007.                     if(todo.Users[_loc_2].u != todo.w_userno)
  4008.                     {
  4009.                         if(!network.UserGotUnignoredMessage(todo.Users[_loc_2].u))
  4010.                         {
  4011.                             if(todo.Users[_loc_2].online == false)
  4012.                             {
  4013.                                 if(todo.Users[_loc_2].friend)
  4014.                                 {
  4015.                                     if(todo.Users[_loc_2].online != undefined)
  4016.                                     {
  4017.                                         xmessage.DeleteOneUserMc(_loc_2);
  4018.                                     }
  4019.                                     todo.Users[_loc_2].online = undefined;
  4020.                                 }
  4021.                                 else
  4022.                                 {
  4023.                                     xmessage.DeleteOneUserMc(_loc_2);
  4024.                                     todo.Users.splice(_loc_2, 1);
  4025.                                     _loc_2 = _loc_2 - 1;
  4026.                                 }
  4027.                                 todo.DoBuildUserList = true;
  4028.                             }
  4029.                         }
  4030.                     }
  4031.                 }
  4032.                 _loc_2 = _loc_2 + 1;
  4033.             }
  4034.         }
  4035.  
  4036.         final public static function GlowUser(param1:Number)
  4037.         {
  4038.             var _loc_2:* = undefined;
  4039.             var _loc_3:* = undefined;
  4040.             _loc_2 = xatlib.FindUser(param1);
  4041.             if(_loc_2 == -1)
  4042.             {
  4043.                 return;
  4044.             }
  4045.             _loc_3 = todo.Users[_loc_2];
  4046.             if(_loc_3.mc)
  4047.             {
  4048.                 tickcode.GlowFlag = true;
  4049.                 _loc_3.glowc = 6;
  4050.                 _loc_3 = _loc_3.mc.av1;
  4051.                 _loc_3.filters = [todo.TextGlow];
  4052.             }
  4053.         }
  4054.  
  4055.         final public static function UserGotMessage(param1:Number) : Boolean
  4056.         {
  4057.             var _loc_2:* = undefined;
  4058.             var _loc_3:* = undefined;
  4059.             _loc_2 = todo.Message.length;
  4060.             _loc_3 = 0;
  4061.             while(_loc_3 < _loc_2)
  4062.             {
  4063.                 if(todo.Message[_loc_3].u == param1)
  4064.                 {
  4065.                     return true;
  4066.                 }
  4067.                 _loc_3 = _loc_3 + 1;
  4068.             }
  4069.             return false;
  4070.         }
  4071.  
  4072.         final public static function UserGotUnignoredMessage(param1:Number) : Boolean
  4073.         {
  4074.             var _loc_2:* = undefined;
  4075.             var _loc_3:* = undefined;
  4076.             _loc_2 = todo.Message.length;
  4077.             _loc_3 = 0;
  4078.             while(_loc_3 < _loc_2)
  4079.             {
  4080.                 if(!(todo.Message[_loc_3].u == param1 && todo.Message[_loc_3].ignored == true))
  4081.                 {
  4082.                     return true;
  4083.                 }
  4084.                 _loc_3 = _loc_3 + 1;
  4085.             }
  4086.             return false;
  4087.         }
  4088.  
  4089.         final public static function OnGagList(param1:Number) : Boolean
  4090.         {
  4091.             var _loc_2:* = undefined;
  4092.             var _loc_3:* = undefined;
  4093.             _loc_2 = todo.w_banlist.length;
  4094.             _loc_3 = 0;
  4095.             while(_loc_3 < _loc_2)
  4096.             {
  4097.                 if(todo.w_banlist[_loc_3].r == param1)
  4098.                 {
  4099.                     return true;
  4100.                 }
  4101.                 _loc_3 = _loc_3 + 1;
  4102.             }
  4103.             return false;
  4104.         }
  4105.  
  4106.         final public static function GetGagTime(param1:Number)
  4107.         {
  4108.             var _loc_2:* = undefined;
  4109.             var _loc_3:* = undefined;
  4110.             _loc_2 = todo.w_banlist.length;
  4111.             _loc_3 = 0;
  4112.             while(_loc_3 < _loc_2)
  4113.             {
  4114.                 if(todo.w_banlist[_loc_3].r == param1)
  4115.                 {
  4116.                     return todo.w_banlist[_loc_3].t;
  4117.                 }
  4118.                 _loc_3 = _loc_3 + 1;
  4119.             }
  4120.             return 0;
  4121.         }
  4122.  
  4123.         final public static function UpdateGagList(param1:Number, param2:Number, param3:Boolean)
  4124.         {
  4125.             var _loc_4:* = undefined;
  4126.             var _loc_5:* = undefined;
  4127.             var _loc_6:Object = null;
  4128.             if(param3 == true)
  4129.             {
  4130.                 if(network.OnGagList(param1))
  4131.                 {
  4132.                     _loc_4 = todo.w_banlist.length;
  4133.                     _loc_5 = 0;
  4134.                     while(_loc_5 < _loc_4)
  4135.                     {
  4136.                         if(todo.w_banlist[_loc_5].r == param1)
  4137.                         {
  4138.                             todo.w_banlist[_loc_5].t = param2;
  4139.                             break;
  4140.                         }
  4141.                         _loc_5 = _loc_5 + 1;
  4142.                     }
  4143.                 }
  4144.                 else
  4145.                 {
  4146.                     _loc_6 = new Object();
  4147.                     _loc_6.r = param1;
  4148.                     _loc_6.t = param2;
  4149.                     todo.w_banlist.push(_loc_6);
  4150.                 }
  4151.             }
  4152.             else
  4153.             {
  4154.                 _loc_4 = todo.w_banlist.length;
  4155.                 _loc_5 = 0;
  4156.                 while(_loc_5 < _loc_4)
  4157.                 {
  4158.                     if(todo.w_banlist[_loc_5].r == param1)
  4159.                     {
  4160.                         todo.w_banlist.splice(_loc_5);
  4161.                         break;
  4162.                     }
  4163.                     _loc_5 = _loc_5 + 1;
  4164.                 }
  4165.             }
  4166.             xatlib.MainSolWrite("w_banlist", todo.w_banlist);
  4167.         }
  4168.  
  4169.         final public static function OnUserList(param1:Number, param2:Boolean = false) : Boolean
  4170.         {
  4171.             var _loc_3:* = undefined;
  4172.             _loc_3 = xatlib.FindUser(param1);
  4173.             if(_loc_3 == -1)
  4174.             {
  4175.                 return false;
  4176.             }
  4177.             if(param2 == true || todo.Users[_loc_3].online)
  4178.             {
  4179.                 return true;
  4180.             }
  4181.             return false;
  4182.         }
  4183.  
  4184.         final public static function OnFriendList(param1:Number)
  4185.         {
  4186.             var _loc_2:* = undefined;
  4187.             var _loc_3:* = undefined;
  4188.             _loc_2 = todo.w_friendlist.length;
  4189.             _loc_3 = 0;
  4190.             while(_loc_3 < _loc_2)
  4191.             {
  4192.                 if(todo.w_friendlist[_loc_3].u == param1)
  4193.                 {
  4194.                     return todo.w_friendlist[_loc_3].f ? todo.w_friendlist[_loc_3].f : 1;
  4195.                 }
  4196.                 _loc_3 = _loc_3 + 1;
  4197.             }
  4198.             return 0;
  4199.         }
  4200.  
  4201.         final public static function UpdateFriendList(param1:Number, param2:int, param3:String = undefined)
  4202.         {
  4203.             var _loc_4:* = undefined;
  4204.             var _loc_5:Object = null;
  4205.             var _loc_6:* = undefined;
  4206.             var _loc_7:* = undefined;
  4207.             _loc_4 = xatlib.FindUser(param1);
  4208.             if(param2)
  4209.             {
  4210.                 if(!network.OnFriendList(param1))
  4211.                 {
  4212.                     _loc_5 = new Object();
  4213.                     _loc_5.u = param1;
  4214.                     _loc_5.f = param2;
  4215.                     if(_loc_4 != -1)
  4216.                     {
  4217.                         _loc_5.v = todo.Users[_loc_4].v;
  4218.                         _loc_5.n = xatlib.CleanTextNoXat(todo.Users[_loc_4].n);
  4219.                         _loc_5.a = todo.Users[_loc_4].a;
  4220.                         _loc_5.h = todo.Users[_loc_4].h;
  4221.                     }
  4222.                     else
  4223.                     {
  4224.                         _loc_5.v = 0;
  4225.                         _loc_5.n = param3;
  4226.                     }
  4227.                     todo.w_friendlist.push(_loc_5);
  4228.                     FI = true;
  4229.                 }
  4230.                 else
  4231.                 {
  4232.                     _loc_6 = todo.w_friendlist.length;
  4233.                     _loc_7 = 0;
  4234.                     while(_loc_7 < _loc_6)
  4235.                     {
  4236.                         if(todo.w_friendlist[_loc_7].u == param1)
  4237.                         {
  4238.                             todo.w_friendlist[_loc_7].v = todo.Users[_loc_4].v;
  4239.                             todo.w_friendlist[_loc_7].n = xatlib.CleanTextNoXat(todo.Users[_loc_4].n);
  4240.                             todo.w_friendlist[_loc_7].a = todo.Users[_loc_4].a;
  4241.                             todo.w_friendlist[_loc_7].h = todo.Users[_loc_4].h;
  4242.                             todo.w_friendlist[_loc_7].f = param2;
  4243.                             break;
  4244.                         }
  4245.                         _loc_7 = _loc_7 + 1;
  4246.                     }
  4247.                 }
  4248.             }
  4249.             else
  4250.             {
  4251.                 _loc_6 = todo.w_friendlist.length;
  4252.                 _loc_7 = 0;
  4253.                 while(_loc_7 < _loc_6)
  4254.                 {
  4255.                     if(todo.w_friendlist[_loc_7].u == param1)
  4256.                     {
  4257.                         todo.w_friendlist.splice(_loc_7, 1);
  4258.                         if(todo.w_friendlist2 != undefined)
  4259.                         {
  4260.                             if(todo.w_friendlist[_loc_7] != undefined)
  4261.                             {
  4262.                                 if(todo.w_friendlist2[todo.w_friendlist[_loc_7].u] != undefined)
  4263.                                 {
  4264.                                     todo.w_friendlist2[todo.w_friendlist[_loc_7].u] = undefined;
  4265.                                 }
  4266.                             }
  4267.                         }
  4268.                         break;
  4269.                     }
  4270.                     _loc_7 = _loc_7 + 1;
  4271.                 }
  4272.             }
  4273.             xatlib.MainSolWrite("w_friendlist", todo.w_friendlist);
  4274.             xatlib.MainSolWrite("w_friendlist2", todo.w_friendlist2);
  4275.         }
  4276.  
  4277.         final public static function NetworkIgnore(param1:*, param2:* = undefined)
  4278.         {
  4279.             var _loc_3:* = undefined;
  4280.             var _loc_4:* = undefined;
  4281.             var _loc_5:* = undefined;
  4282.             var _loc_6:* = undefined;
  4283.             var _loc_7:* = undefined;
  4284.             _loc_3 = network.OnIgnoreList(param1);
  4285.             network.UpdateIgnoreList(param1, !_loc_3, param2);
  4286.             if(param2 == undefined)
  4287.             {
  4288.                 _loc_4 = todo.Message.length;
  4289.                 _loc_5 = 0;
  4290.                 while(_loc_5 < _loc_4)
  4291.                 {
  4292.                     if(xatlib.xInt(todo.Message[_loc_5].u) == param1)
  4293.                     {
  4294.                         todo.Message[_loc_5].ignored = !_loc_3;
  4295.                     }
  4296.                     _loc_5 = _loc_5 + 1;
  4297.                 }
  4298.             }
  4299.             if(!_loc_3)
  4300.             {
  4301.                 _loc_6 = main.ctabsmc.tabs.length;
  4302.                 _loc_7 = 0;
  4303.                 while(_loc_7 < _loc_6)
  4304.                 {
  4305.                     if(main.ctabsmc.tabs[_loc_7].User == param1)
  4306.                     {
  4307.                         main.Private_onDelete(_loc_7);
  4308.                         break;
  4309.                     }
  4310.                     _loc_7 = _loc_7 + 1;
  4311.                 }
  4312.             }
  4313.             todo.DoBuildUserList = true;
  4314.             todo.DoUpdateMessages = true;
  4315.         }
  4316.  
  4317.         final public static function TrimIgnoreList()
  4318.         {
  4319.             var _loc_1:Date = null;
  4320.             var _loc_2:* = undefined;
  4321.             var _loc_3:* = undefined;
  4322.             var _loc_4:* = undefined;
  4323.             _loc_1 = new Date();
  4324.             _loc_2 = (xatlib.xInt(network.Number(_loc_1.getTime()) / 1000)) - (7 * 24) * 3600;
  4325.             var _loc_5:int = 0;
  4326.             var _loc_6:* = todo.w_ignorelist2;
  4327.             for each(_loc_3 in _loc_6)
  4328.             {
  4329.                 _loc_4 = todo.w_ignorelist2[_loc_3];
  4330.                 if(_loc_4 < 0)
  4331.                 {
  4332.                     _loc_4 = _loc_4 * -1;
  4333.                 }
  4334.                 if(_loc_4 < _loc_2)
  4335.                 {
  4336.                 }
  4337.             }
  4338.         }
  4339.  
  4340.         final public static function OnIgnoreList(param1:Number) : Boolean
  4341.         {
  4342.             return !(todo.w_ignorelist2[param1] == undefined);
  4343.         }
  4344.  
  4345.         final public static function IgnoreTime(param1:Number)
  4346.         {
  4347.             return todo.w_ignorelist2[param1];
  4348.         }
  4349.  
  4350.         final public static function UpdateIgnoreList(param1:Number, param2:Boolean, param3:*)
  4351.         {
  4352.             var _loc_4:* = undefined;
  4353.             var _loc_5:* = undefined;
  4354.             var _loc_6:Date = null;
  4355.             var _loc_7:* = undefined;
  4356.             _loc_4 = xatlib.FindUser(param1);
  4357.             _loc_5 = xatlib.FindUser(todo.w_userno);
  4358.             if(todo.Users[_loc_5].xNum == 30004)
  4359.             {
  4360.                 if(param2 == true)
  4361.                 {
  4362.                     if(chat.sending_lc)
  4363.                     {
  4364.                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, param1, "l");
  4365.                     }
  4366.                 }
  4367.                 else
  4368.                 {
  4369.                     if(chat.sending_lc)
  4370.                     {
  4371.                         chat.sending_lc.send(chat.fromxat, "onMsg", 4, param1, "u" + todo.Users[_loc_4].a);
  4372.                     }
  4373.                 }
  4374.             }
  4375.             xmessage.DeleteOneUserMc(_loc_4);
  4376.             if(param2 == true)
  4377.             {
  4378.                 _loc_6 = new Date();
  4379.                 _loc_7 = xatlib.xInt(network.Number(_loc_6.getTime()) / 1000);
  4380.                 todo.w_ignorelist2[param1] = param3 == undefined ? _loc_7 : -_loc_7;
  4381.             }
  4382.             else
  4383.             {
  4384.             }
  4385.             xatlib.MainSolWrite("w_ignorelist2", todo.w_ignorelist2);
  4386.             todo.DoBuildUserList = true;
  4387.         }
  4388.  
  4389.         final public static function GetFriendStatus()
  4390.         {
  4391.             var _loc_1:* = undefined;
  4392.             var _loc_3:* = undefined;
  4393.             var _loc_4:String = null;
  4394.             var _loc_5:* = undefined;
  4395.             var _loc_6:* = undefined;
  4396.             var _loc_7:* = undefined;
  4397.             var _loc_8:* = undefined;
  4398.             var _loc_9:* = undefined;
  4399.             _loc_1 = todo.w_friendlist.length;
  4400.             var _loc_2:* = network.getTimer();
  4401.             _loc_3 = 0;
  4402.             while(_loc_3 < _loc_1)
  4403.             {
  4404.                 _loc_6 = xatlib.FindUser(todo.w_friendlist[_loc_3].u);
  4405.                 if(_loc_6 == -1)
  4406.                 {
  4407.                     if(todo.w_friendlist[_loc_3].n != undefined)
  4408.                     {
  4409.                         todo.Users.push({n:xatlib.NameNoXat(todo.w_friendlist[_loc_3].n), u:todo.w_friendlist[_loc_3].u, v:todo.w_friendlist[_loc_3].v, a:todo.w_friendlist[_loc_3].a, h:todo.w_friendlist[_loc_3].h, online:undefined, banned:false, owner:false, friend:todo.w_friendlist[_loc_3].f ? todo.w_friendlist[_loc_3].f : 1, onsuper:false});
  4410.                     }
  4411.                 }
  4412.                 else
  4413.                 {
  4414.                     if(todo.Users[_loc_6].friend || todo.Users[_loc_6].onsuper == false)
  4415.                     {
  4416.                         xmessage.DeleteOneUserMc(_loc_6);
  4417.                     }
  4418.                     todo.Users[_loc_6].friend = todo.w_friendlist[_loc_3].f ? todo.w_friendlist[_loc_3].f : 1;
  4419.                     todo.Users[_loc_6].onsuper = false;
  4420.                 }
  4421.                 _loc_3 = _loc_3 + 1;
  4422.             }
  4423.             if(todo.lb == "n")
  4424.             {
  4425.                 return;
  4426.             }
  4427.             _loc_4 = "";
  4428.             _loc_5 = 0;
  4429.             _loc_4 = "f";
  4430.             if(todo.w_friendlist.length > 0)
  4431.             {
  4432.                 if(todo.w_friendlist[0].u != undefined)
  4433.                 {
  4434.                     _loc_1 = todo.w_friendlist.length;
  4435.                     _loc_7 = 0;
  4436.                     while(_loc_7 < _loc_1)
  4437.                     {
  4438.                         _loc_5 = _loc_5 + 1;
  4439.                         _loc_4 = _loc_4 + " " + todo.w_friendlist[_loc_7].u;
  4440.                         if(_loc_5 == 80 || _loc_7 >= (_loc_1 - 1))
  4441.                         {
  4442.                             _loc_8 = new XMLDocument();
  4443.                             _loc_9 = _loc_8.createElement(_loc_4);
  4444.                             _loc_8.appendChild(_loc_9);
  4445.                             socket.send(_loc_8);
  4446.                             _loc_5 = 0;
  4447.                             _loc_4 = "f";
  4448.                         }
  4449.                         _loc_7 = _loc_7 + 1;
  4450.                     }
  4451.                 }
  4452.             }
  4453.         }
  4454.  
  4455.         final public static function GetRev(param1:*) : Number
  4456.         {
  4457.             return param1.indexOf("_") != -1 ? xatlib.xInt(param1.substr(param1.indexOf("_") + 1)) : 0;
  4458.         }
  4459.  
  4460.         final public static function SaveRegData()
  4461.         {
  4462.             var _loc_1:* = undefined;
  4463.             _loc_1 = xatlib.getLocal("chat", "/");
  4464.             _loc_1.objectEncoding = ObjectEncoding.AMF0;
  4465.         }
  4466.  
  4467.         final public static function AddGiftPower(param1:*)
  4468.         {
  4469.             var _loc_2:* = undefined;
  4470.             if(param1 < 0)
  4471.             {
  4472.                 return;
  4473.             }
  4474.             _loc_2 = todo.Users[param1];
  4475.             if(!(_loc_2.aFlags & (1 << 24)))
  4476.             {
  4477.                 return;
  4478.             }
  4479.             if(!_loc_2.Powers)
  4480.             {
  4481.                 _loc_2.Powers = [0];
  4482.             }
  4483.             if(!_loc_2.Powers[-1])
  4484.             {
  4485.                 _loc_2.Powers[-1] = 0;
  4486.             }
  4487.             _loc_2.Powers[-1] = _loc_2.Powers[-1] | 4;
  4488.         }
  4489.  
  4490.         final public static function doCap()
  4491.         {
  4492.             var _loc_1:* = undefined;
  4493.             if(global.xc & 2048)
  4494.             {
  4495.                 _loc_1 = WC;
  4496.                 WC["roomid"] = todo.w_useroom;
  4497.                 WC["type"] = "AYAH";
  4498.                 main.mcLoad.OpenByN(xJSON.encode(_loc_1));
  4499.             }
  4500.             else
  4501.             {
  4502.                 xatlib.UrlPopup(xconst.ST(264), (xconst.chatdomain + "AreYouaHuman.php") + xatlib.MakeQuery(WC) + "&r=" + todo.w_useroom);
  4503.             }
  4504.         }
  4505.  
  4506.         final public static function doCode()
  4507.         {
  4508.             var _loc_1:* = undefined;
  4509.             _loc_1 = "";
  4510.             if(WC.v > 1)
  4511.             {
  4512.                 _loc_1 = WC.v;
  4513.             }
  4514.             codeLoad = xatlib.LoadMovie(chat.mainDlg, (todo.flashdomain + "auth") + _loc_1 + "/auth" + WC.au + ".swf", onCodeLoaded);
  4515.         }
  4516.  
  4517.         final public static function onCodeLoaded(param1:Event)
  4518.         {
  4519.             mcCode = network.MovieClip(codeLoad.contentLoaderInfo.content);
  4520.             if(WC.v > 1)
  4521.             {
  4522.                 mcCode.Call(todo.sockdomain, todo.useport, todo.w_userno, todo.w_useroom, todo.WY.k);
  4523.             }
  4524.         }
  4525.  
  4526.         public function network()
  4527.         {
  4528.             super();
  4529.         }
  4530.     }
  4531. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement