SHARE
TWEET

Untitled

a guest Oct 20th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. load("items.asc");
  2. load("locations.asc");
  3. load("bodyparts.asc");
  4.  
  5. var msHost = "http://185.231.155.141";
  6.  
  7. var homeInv = [{
  8.     ID: 3676,
  9.     AObjectTypeId: 1,
  10.     AObjectId: 3676,
  11.     AObjectRefTypeId: 20,
  12.     MediaResourceID: 10223,
  13.     TextResourceID: 10641,
  14.     IsActive: 0
  15. }, {
  16.     ID: 8326,
  17.     AObjectTypeId: 1,
  18.     AObjectId: 8326,
  19.     AObjectRefTypeId: 20,
  20.     MediaResourceID: 26415,
  21.     TextResourceID: 26240,
  22.     IsActive: 0
  23. }];
  24.  
  25. var sbox = new Array(255);
  26. var mykey = new Array(255);
  27.  
  28. function objInvToStr(Inventory) {
  29.     var str = "";
  30.  
  31.     for (var tab in Inventory) {
  32.         for (var i = 0; i < Inventory[tab].length; i++) {
  33.             var ms = "";
  34.             for (var key in Inventory[tab][i]) {
  35.                 if (key != "tab") {
  36.                     ms = ms + key + ">" + Inventory[tab][i][key] + "|";
  37.                 }
  38.             }
  39.             str += ms + "<";
  40.         }
  41.         str = str.slice(0, -1) + ";";
  42.     }
  43.  
  44.     return str.slice(0, -1);
  45. }
  46.  
  47. function meme(Id) {
  48.     return g[Id];
  49. }
  50. //<item ID="387" IsUsed="0" IsLimited="0" GoodID="387" Date="2018-12-28T19:50:31.107" MediaResourceID="815" TextResourceID="827" Pollution="0" /><item ID="335" IsUsed="0" IsLimited="0" GoodID="335" Date="2018-12-28T19:50:31.107" MediaResourceID="618" Pollution="0" /><item ID="177" IsUsed="0" IsLimited="0" GoodID="22" Date="2018-12-28T19:50:31.107" MediaResourceID="508" TextResourceID="13996" Pollution="0" /><item ID="22" IsUsed="0" IsLimited="0" GoodID="22" Date="2018-12-28T19:50:31.107" MediaResourceID="23" TextResourceID="13996" Pollution="0" /><item ID="13" IsUsed="0" IsLimited="0" GoodID="19" Date="2018-12-28T19:50:31.107" MediaResourceID="12" TextResourceID="13996" Pollution="0" /><item ID="19" IsUsed="0" IsLimited="0" GoodID="19" Date="2018-12-28T19:50:31.107" MediaResourceID="19" TextResourceID="13996" Pollution="0" /><item ID="3057" IsUsed="0" IsLimited="0" GoodID="3057" Date="2018-12-28T19:50:31.107" MediaResourceID="7180" TextResourceID="13996" Pollution="0" /><item ID="11" IsUsed="0" IsLimited="0" GoodID="11" Date="2018-12-28T19:50:31.107" MediaResourceID="11" TextResourceID="18658" Pollution="0" /><item ID="2303" IsUsed="0" IsLimited="0" GoodID="2303" Date="2018-12-28T19:50:31.107" MediaResourceID="4880" TextResourceID="3916" Pollution="0" /><item ID="10" IsUsed="0" IsLimited="0" GoodID="10" Date="2018-12-28T19:50:31.107" MediaResourceID="10" TextResourceID="18658" Pollution="0" /><item ID="7" IsUsed="0" IsLimited="0" GoodID="7" Date="2018-12-28T19:50:31.107" MediaResourceID="15" TextResourceID="18658" Pollution="0" /><item ID="5722" IsUsed="0" IsLimited="0" GoodID="5722" Date="2018-12-28T19:50:31.107" MediaResourceID="15941" TextResourceID="18658" Pollution="0" /><item ID="5111" IsUsed="0" IsLimited="0" GoodID="5111" Date="2018-12-28T19:50:31.107" MediaResourceID="8125" TextResourceID="9361" Pollution="0" /><item ID="38" IsUsed="0" IsLimited="0" GoodID="38" Date="2018-12-28T19:50:31.107" MediaResourceID="464" TextResourceID="17898" Pollution="0" /><item ID="37" IsUsed="0" IsLimited="0" GoodID="37" Date="2018-12-28T19:50:31.107" MediaResourceID="463" TextResourceID="17899" Pollution="0" /><item ID="36" IsUsed="0" IsLimited="0" GoodID="36" Date="2018-12-28T19:50:31.107" MediaResourceID="462" TextResourceID="17900" Pollution="0" /><item ID="35" IsUsed="0" IsLimited="0" GoodID="35" Date="2018-12-28T19:50:31.107" MediaResourceID="461" TextResourceID="17901" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="34" IsUsed="0" IsLimited="0" GoodID="34" Date="2018-12-28T19:50:31.107" MediaResourceID="460" TextResourceID="17902" Pollution="0" /><item ID="33" IsUsed="0" IsLimited="0" GoodID="33" Date="2018-12-28T19:50:31.107" MediaResourceID="459" TextResourceID="17897" Pollution="0" /><item ID="32" IsUsed="0" IsLimited="0" GoodID="32" Date="2018-12-28T19:50:31.107" MediaResourceID="458" TextResourceID="17895" Pollution="0" /><item ID="31" IsUsed="0" IsLimited="0" GoodID="31" Date="2018-12-28T19:50:31.107" MediaResourceID="457" TextResourceID="17896" Pollution="0" /></tab><tab ID="14" MediaResourceID="210" TextResourceID="124" LayerID="31"><item ID="20" IsUsed="0" IsLimited="0" GoodID="20" Date="2018-12-28T20:03:35.087" MediaResourceID="20" TextResourceID="24613" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="5" IsUsed="0" IsLimited="0" GoodID="5" Date="2018-12-28T20:03:35.087" MediaResourceID="453" TextResourceID="277" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="112" IsUsed="0" IsLimited="0" GoodID="112" Date="2018-12-28T20:03:35.087" MediaResourceID="274" TextResourceID="490" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="180" IsUsed="0" IsLimited="0" GoodID="180" Date="2018-12-28T20:03:35.087" MediaResourceID="511" TextResourceID="2245" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="1967" IsUsed="0" IsLimited="0" GoodID="1967" Date="2018-12-28T20:03:35.087" MediaResourceID="3414" TextResourceID="2245" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" />
  51.  
  52. //</tab><tab ID="32" MediaResourceID="213" TextResourceID="123" LayerID="11"><item ID="21" IsUsed="0" IsLimited="0" GoodID="21" Date="2018-12-28T19:50:31.107" MediaResourceID="21" TextResourceID="24614" Pollution="0" /><item ID="14" IsUsed="0" IsLimited="0" GoodID="14" Date="2018-12-28T19:50:31.107" MediaResourceID="454" TextResourceID="278" Pollution="0" /><item ID="178" IsUsed="0" IsLimited="0" GoodID="178" Date="2018-12-28T19:50:31.107" MediaResourceID="509" TextResourceID="17896" Pollution="0" /><item ID="45" IsUsed="0" IsLimited="0" GoodID="45" Date="2018-12-28T19:50:31.107" MediaResourceID="465" TextResourceID="115" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="5112" IsUsed="0" IsLimited="0" GoodID="5112" Date="2018-12-28T19:50:31.107" MediaResourceID="8122" TextResourceID="9358" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /></tab><tab ID="36" MediaResourceID="214" TextResourceID="24" LayerID="56" ><item ID="125" IsUsed="0" IsLimited="0" GoodID="125" Date="2018-12-28T20:03:35.087" MediaResourceID="488" TextResourceID="499" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="3590" IsUsed="0" IsLimited="0" GoodID="3590" Date="2018-12-28T20:03:35.087" MediaResourceID="9983" TextResourceID="10252" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /></tab><tab ID="40" MediaResourceID="429" TextResourceID="697" LayerID="27" ><item ID="23" IsUsed="0" IsLimited="0" GoodID="23" Date="2018-12-28T20:03:35.087" MediaResourceID="51" TextResourceID="2245" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /></tab><tab ID="94" MediaResourceID="214" TextResourceID="25" LayerID="57" ><item ID="26" IsUsed="0" IsLimited="0" GoodID="26" Date="2018-12-28T19:50:31.107" MediaResourceID="13018" TextResourceID="15172" Pollution="0" /><item ID="9235" IsUsed="0" IsLimited="0" GoodID="9235" Date="2018-12-28T19:50:31.107" MediaResourceID="29235" TextResourceID="29271" Pollution="0" /><item ID="3269" IsUsed="0" IsLimited="0" GoodID="3269" Date="2018-12-28T19:50:31.107" MediaResourceID="7892" TextResourceID="13998" Pollution="0" /><item ID="7078" IsUsed="0" IsLimited="0" GoodID="7078" Date="2018-12-28T19:50:31.107" MediaResourceID="18542" TextResourceID="22980" Pollution="0" /></tab>
  53. //<item ID="17" IsUsed="0" IsLimited="0" GoodID="17" Date="2018-12-28T19:50:31.107" MediaResourceID="13" TextResourceID="201" Pollution="0" />
  54. //var Inventory = { 0: [{tab: '<tab ID="1" MediaResourceID="212" TextResourceID="120" LayerID="36">'}, {ID:16, IsUsed:0, IsLimited:0, GoodID: 16, Date: "2018-12-28T19:50:31.107", MediaResourceID: 456, TextResourceID: 217}, {ID:15, IsUsed:0, IsLimited:0, GoodID: 15, Date: "2018-12-28T19:50:31.107", MediaResourceID: 455, TextResourceID: 216}, {ID:8, IsUsed:0, IsLimited:0, GoodID: 8, Date: "2018-12-28T19:50:31.107", MediaResourceID: 16, TextResourceID: 24615}, {ID:338, IsUsed:0, IsLimited:0, GoodID: 338, Date: "2018-12-28T19:50:31.107", MediaResourceID: 621}, {ID:235, IsUsed:0, IsLimited:0, GoodID: 235, Date: "2018-12-28T19:50:31.107", MediaResourceID: 560, TextResourceID: 117}, {ID:179, IsUsed:0, IsLimited:0, GoodID: 179, Date: "2018-12-28T19:50:31.107", MediaResourceID: 510}, {ID:25, IsUsed:0, IsLimited:0, GoodID: 25, Date: "2018-12-28T19:50:31.107", MediaResourceID: 11151, TextResourceID: 13963}, {ID:24, IsUsed:0, IsLimited:0, GoodID: 24, Date: "2018-12-28T19:50:31.107", MediaResourceID: 10395, TextResourceID: 13962}, {ID:4, IsUsed:0, IsLimited:0, GoodID: 4, Date: "2018-12-28T19:50:31.107", MediaResourceID: 452, TextResourceID: 213}, {ID:18, IsUsed:0, IsLimited:0, GoodID: 18, Date: "2018-12-28T19:50:31.107", MediaResourceID: 442, TextResourceID: 495}, {ID:3075, IsUsed:0, IsLimited:0, GoodID: 3075, Date: "2018-12-28T19:50:31.107", MediaResourceID: 7303, TextResourceID: 13997}, {ID:6152, IsUsed:0, IsLimited:0, GoodID: 6152, Date: "2018-12-28T19:50:31.107", MediaResourceID: 532, TextResourceID: 586}, {ID:2235, IsUsed:0, IsLimited:0, GoodID: 2235, Date: "2018-12-28T19:50:31.107", MediaResourceID: 4142, TextResourceID: 3033}], 1: [{tab:'<tab ID="4" MediaResourceID="211" TextResourceID="21" LayerID="45">'}, {ID:17, IsUsed:0, IsLimited:0, GoodID: 17, Date: "2018-12-28T19:50:31.107", MediaResourceID: 13, TextResourceID: 201}], 2: [{tab: '<tab ID="32" MediaResourceID="213" TextResourceID="123" LayerID="11">'}]};
  55.  
  56.  
  57.  
  58. function makeInvXML(Inventory) {
  59.     var InvXML = '';
  60.     for (var i = 0; i < homeInv.length; i++) {
  61.         trace(homeInv[i]["ID"])
  62.         var test = '<group ID="1$' + homeInv[i]["ID"] + '" AObjectTypeId="' + Inventory[i]["AObjectTypeId"] + '" AObjectId="' + Inventory[i]["AObjectId"] + '" AObjectRefTypeId="' + Inventory[i]["AObjectRefTypeId"] + '" MediaResourceID="' + Inventory[i]["MediaResourceID"];
  63.         if (Inventory[i]["TextResourceID"] != undefined) {
  64.             test = test + '" TextResourceID="' + Inventory[i]["TextResourceID"] + '"><object ID="' + Inventory[i]["ID"] + '" IsActive="' + Inventory[i]["IsActive"] + '" /></group>'
  65.         } else {
  66.             test = test + '"><object ID="' + Inventory[i]["ID"] + '" IsActive="' + Inventory[i]["IsActive"] + '" /></group>';
  67.         }
  68.         InvXML = InvXML + test;
  69.     }
  70.     trace(InvXML);
  71.     return InvXML;
  72. }
  73.  
  74.  
  75. //мне пока лень добавлять столько шапок)
  76. //<item ID="5722" IsUsed="0" IsLimited="0" GoodID="5722" Date="2018-12-28T19:50:31.107" MediaResourceID="15941" TextResourceID="18658" Pollution="0" /><item ID="5111" IsUsed="0" IsLimited="0" GoodID="5111" Date="2018-12-28T19:50:31.107" MediaResourceID="8125" TextResourceID="9361" Pollution="0" /><item ID="38" IsUsed="0" IsLimited="0" GoodID="38" Date="2018-12-28T19:50:31.107" MediaResourceID="464" TextResourceID="17898" Pollution="0" /><item ID="37" IsUsed="0" IsLimited="0" GoodID="37" Date="2018-12-28T19:50:31.107" MediaResourceID="463" TextResourceID="17899" Pollution="0" /><item ID="36" IsUsed="0" IsLimited="0" GoodID="36" Date="2018-12-28T19:50:31.107" MediaResourceID="462" TextResourceID="17900" Pollution="0" /><item ID="35" IsUsed="0" IsLimited="0" GoodID="35" Date="2018-12-28T19:50:31.107" MediaResourceID="461" TextResourceID="17901" Pollution="0" LastUseDate="2018-12-28T20:03:52.530" /><item ID="34" IsUsed="0" IsLimited="0" GoodID="34" Date="2018-12-28T19:50:31.107" MediaResourceID="460" TextResourceID="17902" Pollution="0" /><item ID="33" IsUsed="0" IsLimited="0" GoodID="33" Date="2018-12-28T19:50:31.107" MediaResourceID="459" TextResourceID="17897" Pollution="0" /><item ID="32" IsUsed="0" IsLimited="0" GoodID="32" Date="2018-12-28T19:50:31.107" MediaResourceID="458" TextResourceID="17895" Pollution="0" /><item ID="31" IsUsed="0" IsLimited="0" GoodID="31" Date="2018-12-28T19:50:31.107" MediaResourceID="457" TextResourceID="17896" Pollution="0" />
  77.  
  78. //LayerID="36" - одежда
  79. //LayerID="45" - прически
  80. //LayerID="31" - Очки
  81. //LayerID="11" - обувь
  82. //LayerID="56" - аксессуары
  83. //LayerID="27" - костюмы
  84. //LayerID="57" - спутники
  85. //var Inventory = { 0: [{tab: '<tab ID="1" MediaResourceID="212" TextResourceID="120" LayerID="36">'}], 1: [{tab:'<tab ID="4" MediaResourceID="211" TextResourceID="21" LayerID="45">'}], 2: [{tab: '<tab ID="14" MediaResourceID="210" TextResourceID="124" LayerID="31">'}], 3: [{tab: '<tab ID="32" MediaResourceID="213" TextResourceID="123" LayerID="11">'}], 4: [{tab: '<tab ID="36" MediaResourceID="214" TextResourceID="24" LayerID="56" >'}], 5:  [{tab: '<tab ID="40" MediaResourceID="429" TextResourceID="697" LayerID="27" >'}]};
  86.  
  87. //g[10568] = {Id:10568,MRId:9983,TRId:10252,GoodTypeId:14,RoleFlags:0,UsualTickets:-1,MagicTickets:-1,DefCurrency:0,LevelThreshold:0,UnlockCost:0,SortOrder:0,PublishDate:"2018-12-29T14:03:06.343",Tags:"",LayerId:31,IsActive:1};
  88.  
  89. function makeXML(inv) {
  90.     var bigXML = '';
  91.     for (var m = 0; m < 7; m++) {
  92.         var InvXML = inv[m][0]["tab"]
  93.         for (var i = 1; i < inv[m].length; i++) {
  94.             if (inv[m][i] != undefined) {
  95.                 var test = '<item ID="' + inv[m][i]["ID"] + '" IsUsed="' + inv[m][i]["IsUsed"] + '" IsLimited="' + inv[m][i]["IsLimited"] + '" GoodID="' + inv[m][i]["GoodID"] + '" Date="' + inv[m][i]["Date"] + '" MediaResourceID="' + inv[m][i]["MediaResourceID"];
  96.                 if (inv[m][i]["TextResourceID"] != undefined) {
  97.                     test = test + '" TextResourceID="' + inv[m][i]["TextResourceID"] + '" Pollution="0" />'
  98.                 } else {
  99.                     test = test + '" Pollution="0" />'
  100.                 }
  101.                 InvXML = InvXML + test;
  102.             }
  103.         }
  104.         bigXML = bigXML + InvXML + '</tab>';
  105.  
  106.     }
  107.     return bigXML;
  108. }
  109.  
  110. function getBody(changes) {
  111.     var newSmesh = {
  112.         RoleFlags: 262144,
  113.         User: {
  114.             Body: {},
  115.             "State": 0,
  116.             "Name": "esme",
  117.             "Level": 999,
  118.             y: 400,
  119.             x: 480
  120.         }
  121.     };
  122.     for (var i = 0; i < changes["BodyParts"].length; i++) {
  123.         var Id = changes["BodyParts"][i]["Id"];
  124.         newSmesh["User"]["Body"][Id] = {};
  125.         newSmesh["User"]["Body"][Id]["IsBodyPart"] = true;
  126.         newSmesh["User"]["Body"][Id]["BodyPartTypeId"] = bodyParts[changes["BodyParts"][i]["Id"]]["BodyPartTypeId"];
  127.         newSmesh["User"]["Body"][Id]["MediaResourceID"] = bodyParts[changes["BodyParts"][i]["Id"]]["MediaResourceID"];
  128.         newSmesh["User"]["Body"][Id]["LayerID"] = bodyParts[changes["BodyParts"][i]["Id"]]["LayerID"] - 1;
  129.         newSmesh["User"]["Body"][Id]["BodyPartId"] = bodyParts[changes["BodyParts"][i]["Id"]]["BodyPartId"];
  130.         newSmesh["User"]["Body"][Id]["Id"] = changes["BodyParts"][i]["Id"];
  131.         if (changes["BodyParts"][i]["Color"] != undefined) {
  132.             newSmesh["User"]["Body"][Id]["Color"] = changes["BodyParts"][i]["Color"];
  133.         }
  134.     }
  135.     for (var i = 0; i < changes["Inventory"].length; i++) {
  136.         var Id = changes["Inventory"][i]["Id"];
  137.         var well = meme(changes["Inventory"][i]["Id"]);
  138.         newSmesh["User"]["Body"][Id] = {};
  139.         newSmesh["User"]["Body"][Id]["IsBodyPart"] = false;
  140.         newSmesh["User"]["Body"][Id]["GoodID"] = changes["Inventory"][i]["Id"];
  141.         newSmesh["User"]["Body"][Id]["MediaResourceID"] = well["MRId"];
  142.         newSmesh["User"]["Body"][Id]["GoodTypeID"] = well["GoodTypeId"];
  143.         newSmesh["User"]["Body"][Id]["LayerID"] = well["LayerId"];
  144.         newSmesh["User"]["Body"][Id]["Id"] = changes["Inventory"][i]["Id"];
  145.     }
  146.     return newSmesh;
  147. }
  148.  
  149.  
  150.  
  151. function parseCoolString(cstr) {
  152.  
  153.     if (typeof(cstr) !== 'string') {
  154.         return;
  155.     }
  156.  
  157.     var pieces = cstr.split("|");
  158.  
  159.     var obj = {};
  160.  
  161.     for (var i = 0; i < pieces.length; i++) {
  162.         var smol = pieces[i].split(">");
  163.  
  164.         var mkey = smol[0];
  165.         var mvalue = smol[1];
  166.  
  167.         if (mvalue == 'true') {
  168.             mvalue = 1;
  169.         } else if (mvalue == 'false') {
  170.             mvalue = 0;
  171.         }
  172.  
  173.  
  174.         obj[mkey] = mvalue;
  175.     }
  176.     return obj;
  177. }
  178.  
  179. function parseNOCTMML(NOCTMML) {
  180.     var arr = {};
  181.  
  182.     var s = NOCTMML.split(";");
  183.  
  184.     for (var i = 0; i < s.length; i++) {
  185.         arr[i] = parseCoolString(s[i]);
  186.     }
  187.  
  188.     trace(arr[0]["Id"] + " ID");
  189.  
  190.     return arr;
  191. }
  192.  
  193. function objectToCoolString(obj) {
  194.     var str = "";
  195.     for (var el in obj) {
  196.         str += el + ">" + obj[el] + "|";
  197.     }
  198.     str = str.slice(0, -1);
  199.     return str;
  200. }
  201.  
  202. function pseudoArrayToNOCTMML(steam) {
  203.     var str = "";
  204.     for (var e in steam) {
  205.         str += objectToCoolString(steam[e]) + ";";
  206.     }
  207.     str = str.slice(0, -1);
  208.     return str;
  209. }
  210.  
  211.  
  212. function H2CA(hex) {
  213.     var _loc3_ = [];
  214.     var _loc1_ = hex.substr(0, 2) != "0x" ? 0 : 2;
  215.     while (_loc1_ < hex.length) {
  216.         _loc3_.push(parseInt(hex.substr(_loc1_, 2), 16));
  217.         _loc1_ = _loc1_ + 2;
  218.     }
  219.     return _loc3_;
  220. }
  221. var usersArr = [];
  222.  
  223. function strToChars(str) {
  224.     var codes = new Array();
  225.     for (var i = 0; i < str.length; i++) {
  226.         codes.push(str.charCodeAt(i));
  227.     }
  228.     return codes;
  229. }
  230.  
  231. function charsToHex(chars) {
  232.     var result = new String("");
  233.     var hexes = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
  234.     for (var i = 0; i < chars.length; i++) {
  235.         result += hexes[chars[i] >> 4] + hexes[chars[i] & 0xf];
  236.     }
  237.     return result;
  238. }
  239.  
  240. function initialize(pwd) {
  241.     var b = 0;
  242.     var tempSwap;
  243.     var intLength = pwd.length;
  244.     for (var a = 0; a <= 255; a++) {
  245.         mykey[a] = pwd[(a % intLength)];
  246.         sbox[a] = a;
  247.     }
  248.     for (var a = 0; a <= 255; a++) {
  249.         b = (b + sbox[a] + mykey[a]) % 256;
  250.         tempSwap = sbox[a];
  251.         sbox[a] = sbox[b];
  252.         sbox[b] = tempSwap;
  253.     }
  254. }
  255.  
  256. function calculate(plaintxt, psw) {
  257.     initialize(psw);
  258.     var i = 0;
  259.     var j = 0;
  260.     var cipher = new Array();
  261.     var k, temp, cipherby;
  262.     for (var a = 0; a < plaintxt.length; a++) {
  263.         i = (i + 1) % 256;
  264.         j = (j + sbox[i]) % 256;
  265.         temp = sbox[i];
  266.         sbox[i] = sbox[j];
  267.         sbox[j] = temp;
  268.         var idx = (sbox[i] + sbox[j]) % 256;
  269.         k = sbox[idx];
  270.         cipherby = plaintxt[a] ^ k;
  271.         cipher.push(cipherby);
  272.     }
  273.     return cipher;
  274. }
  275.  
  276. function rc4(src, key) {
  277.     var mtxt = strToChars(src);
  278.     var mkey = strToChars(key);
  279.     var result = calculate(mtxt, mkey);
  280.     return charsToHex(result);
  281. }
  282.  
  283.  
  284.  
  285.  
  286. function avaToXML(ava) {
  287.     var xml = "";
  288.     for (var e in ava) {
  289.         if (ava[e]["IsBodyPart"] == "1") {
  290.             xml += '<item Id="' + ava[e]["Id"] + '" IsBodyPart="1" LayerID="' + ava[e]["LayerID"] + '" MediaResourceID="' + ava[e]["MediaResourceID"] + '" BodyPartId="' + ava[e]["BodyPartId"] + '" BodyPartTypeId="' + ava[e]["BodyPartTypeId"] + '"';
  291.             // if (bodyParts[ava[e]["Id"]]["isColorable"] == 1) {
  292.             //    trace(ava[e]["Id"] + "##e#" + ava[e]["Color"]);
  293.             //    xml += " Color='" + ava[e]["Color"] + "' />";
  294.             //  } else {
  295.             xml += " />";
  296.             // }
  297.         } else {
  298.             xml += '<item Id="' + ava[e]["Id"] + '" GoodTypeID="' + ava[e]["GoodTypeID"] + '" IsBodyPart="0" GoodID="' + ava[e]["GoodID"] + '" LayerID="' + ava[e]["LayerID"] + '" MediaResourceID="' + ava[e]["MediaResourceID"] + '" />';
  299.         }
  300.     }
  301.  
  302.     return xml;
  303. }
  304.  
  305. function randomRange(minNum, maxNum)  {
  306. {
  307.     return Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
  308. }
  309. }
  310. application.onConnect = function(client, uid, sid, ticket, hwid) {
  311.     trace("hwid " + hwid);
  312.     var initialData = new LoadVars();
  313.     var initdata = initialData.load(msHost + "/kek.php?ticket=" + ticket + "&secret");
  314.     var conn = this;
  315.     client.ticket = ticket;
  316.     client.inv = {
  317.         0: [{
  318.             tab: '<tab ID="1" MediaResourceID="212" TextResourceID="120" LayerID="36">'
  319.         }],
  320.         1: [{
  321.             tab: '<tab ID="4" MediaResourceID="211" TextResourceID="21" LayerID="45">'
  322.         }],
  323.         2: [{
  324.             tab: '<tab ID="14" MediaResourceID="210" TextResourceID="124" LayerID="31">'
  325.         }],
  326.         3: [{
  327.             tab: '<tab ID="32" MediaResourceID="213" TextResourceID="123" LayerID="11">'
  328.         }],
  329.         4: [{
  330.             tab: '<tab ID="36" MediaResourceID="214" TextResourceID="24" LayerID="56" >'
  331.         }],
  332.         5: [{
  333.             tab: '<tab ID="40" MediaResourceID="429" TextResourceID="697" LayerID="27" >'
  334.         }],
  335.         6: [{
  336.             tab: '<tab ID="94" MediaResourceID="214" TextResourceID="25" LayerID="57" >'
  337.         }]
  338.     };     
  339.     initialData.onLoad = function(success) {
  340.         trace(this.toString());
  341.         //_NUB(TRID0, TRID1)
  342.         client.userObj["User"]["Name"] = this.username;
  343.         client.userObj["User"]["Level"] = this.level;
  344.         client.userObj["User"]["RoleFlags"] = this.roleflags;
  345.         client.userObj["User"]["Money"] = this.money;
  346.         client.userObj["User"]["Gold"] = this.gold;
  347.         client.userObj["User"]["Magic"] = this.magic;
  348.         client.weaponCount = 999999999;
  349.         client.userObj["User"]["Body"] = parseNOCTMML(this.avatar);
  350.         client.regdate = this.regdate;
  351.         client.role = Number(this.roleflags);
  352.         client.houseStr = this.houseStr;
  353.         client.isBanned = this.isbanned;
  354.         client.smeshID = this.id;
  355.         client.backgroundID = this.bg;
  356.         trace(client.smeshID);
  357.         var e = this.inventory.split(";");
  358.         if (client.isBanned !== "1") {
  359.         conn.acceptConnection(client);
  360.         }
  361.         client.call("_NNR", null, client.role);
  362.         usersArr[client.smeshID] = client.userObj;
  363.         for (var i = 0; i < e.length; i++) {
  364.             var m = e[i].split("<");
  365.  
  366.             for (var id = 0; id < m.length; id++) {
  367.                 var mem = m[id].split("|");
  368.                 var obj = {};
  369.                 for (var meme = 0; meme < mem.length; meme++) {
  370.                     var keys = mem[meme].split(">");
  371.                     if (keys[1] != undefined) {
  372.                         obj[keys[0]] = keys[1];
  373.                     }
  374.                 }
  375.                 if (obj["ID"]) {
  376.                     client.inv[i][id + 1] = obj;
  377.                 }
  378.             }
  379.         }
  380.     }
  381.  
  382.     client.userObj = {
  383.         RoleFlags: 2,
  384.         User: {
  385.             Body: {
  386.                 "1": {
  387.                     "State": 1,
  388.                     Id: 1,
  389.                     IsBodyPart: true,
  390.                     Color: 8009440,
  391.                     BodyPartTypeId: 1,
  392.                     MediaResourceID: 55,
  393.                     LayerID: 10,
  394.                     BodyPartId: "73"
  395.                 },
  396.                 "2": {
  397.                     IsBodyPart: true,
  398.                     BodyPartTypeId: "1",
  399.                     MediaResourceID: 56,
  400.                     LayerID: 20,
  401.                     Id: 2,
  402.                     Color: 8009440,
  403.                     BodyPartId: "74"
  404.                 },
  405.                 "4": {
  406.                     IsBodyPart: true,
  407.                     BodyPartTypeId: "3",
  408.                     MediaResourceID: 59,
  409.                     LayerID: 30,
  410.                     Id: 4,
  411.                     BodyPartId: "75"
  412.                 },
  413.                 "50": {
  414.                     IsBodyPart: true,
  415.                     BodyPartTypeId: "4",
  416.                     MediaResourceID: 82,
  417.                     LayerID: 40,
  418.                     Id: 50,
  419.                     BodyPartId: "76"
  420.                 },
  421.                 18108: {
  422.                     IsBodyPart: false,
  423.                     MediaResourceID: 464,
  424.                     GoodID: 38,
  425.                     GoodTypeID: 4,
  426.                     Id: 18108,
  427.                     LayerID: 45
  428.                 },
  429.                 112: {
  430.                     IsBodyPart: false,
  431.                     MediaResourceID: 274,
  432.                     GoodID: 38,
  433.                     GoodTypeID: 14,
  434.                     Id: 112,
  435.                     LayerID: 31
  436.                 }
  437.             },
  438.             "State": 2,
  439.             "Name": "esme",
  440.             "Level": 999,
  441.             y: 400,
  442.             x: 480
  443.         }
  444.     };
  445.  
  446.     client.house = [];
  447.    
  448.     client.location = 2;
  449.  
  450.     client.ufr = "1,test|2,kek|3,destator";
  451.  
  452.     client._P = function(point, tweenId) {
  453.  
  454.         for (var i = 0; i < application.clients.length; i++) {
  455.             if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
  456.                 client.userObj["User"]["x"] = point.x;
  457.                 client.userObj["User"]["y"] = point.y;
  458.                 application.clients[i].call("_P", null, client.smeshID, point, tweenId);
  459.             }
  460.         }
  461.     }
  462.  
  463.  
  464.     client._LS = function(descriptor, startPoint, startState) {
  465.         client.userObj["User"]["x"] = startPoint.x;
  466.         client.userObj["User"]["y"] = startPoint.y;
  467.  
  468.         if (descriptor != "LOAD") {
  469.             trace("descr: " + descriptor.split("$")[2]);
  470.             client.location = descriptor.split("$")[2];
  471.         } else {
  472.             return "0";
  473.  
  474.         }
  475.  
  476.         var usrs = [];
  477.  
  478.         for (var i = 0; i < application.clients.length; i++) {
  479.             if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
  480.                 usrs[application.clients[i].smeshID] = application.clients[i].userObj;
  481.                 application.clients[i].call("_UE", null, client.smeshID, client.userObj);
  482.             }
  483.         }
  484.  
  485.         client.call("_LS", null, usrs);
  486.  
  487.     }
  488.  
  489.     client._S = function(state) {
  490.  
  491.         for (var i = 0; i < application.clients.length; i++) {
  492.             if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
  493.                 application.clients[i].call("_S", null, client.smeshID, state);
  494.             }
  495.         }
  496.     }
  497.  
  498.  
  499.     client._SS = function(hidden) {
  500.         for (var i = 0; i < application.clients.length; i++) {
  501.             if (application.clients[i].location == client.location) {
  502.                 application.clients[i].call("_SS", null, client.smeshID, hidden);
  503.             }
  504.         }
  505.     }
  506.  
  507.     client._SCA = function(methodName, data) {
  508.         trace(methodName, data);
  509.         return "meme";
  510.     }
  511.  
  512.     client._NSF = function() {
  513.         //return '<response isPong="true" />';
  514.     }
  515.  
  516.     function hStrToArr(str) {
  517.         var arr = [];
  518.         var pieces = str.split(";");
  519.  
  520.         for (var i = 0; i < pieces.length; i++) {
  521.             var obj = {};
  522.             var e = pieces[i].split("|");
  523.  
  524.             for (var id = 0; id < e.length; id++) {
  525.                 var p = e[id].split(">");
  526.                 obj[p[0].replace(" ", "")] = p[1];
  527.             }
  528.  
  529.             arr.push(obj);
  530.         }
  531.  
  532.         return arr;
  533.     }
  534.  
  535.     function houseToXML(house) {
  536.         //ID>46043197|AObjectTypeId>1|AObjectId>573|AObjectRefTypeId>20|MediaResourceID>1242|TextResourceID>1034|x>219.4|y>246.7;
  537.         //<object ID="46043197" AObjectTypeId="1" AObjectId="573" AObjectRefTypeId="20" MediaResourceID="1242" TextResourceID="1034" x="219.4" y="246.7" Frame="2" />
  538.  
  539.         var xml = "";
  540.         for (var i = 0; i < house.length; i++) {
  541.             xml += "<object ";
  542.             for (var e in house[i]) {
  543.                 xml += e + "='" + house[i][e] + "' ";
  544.             }
  545.             xml += "/>";
  546.         }
  547.  
  548.         return xml;
  549.     }
  550.  
  551.     function hstrToXML(str) {
  552.         return houseToXML(hStrToArr(str));
  553.     }
  554.  
  555.     function updateInventory(ticket, inv) {
  556.         var str = objInvToStr(inv);
  557.         var lv = new LoadVars();
  558.         lv.inventory = str;
  559.         lv.ticket = ticket;
  560.  
  561.  
  562.         lv.send(msHost + "/inv.php");
  563.  
  564.     }
  565.  
  566.     function hObjToStr(obj) {
  567.         var str = "";
  568.         for (var i = 0; i < obj.length; i++) {
  569.             if (obj[i] != undefined) {
  570.                 for (var key in obj[i]) {
  571.                     str += key + ">" + obj[i][key] + "|";
  572.                 }
  573.                 str = str.slice(0, -1);
  574.                 str = str + ";";
  575.             }
  576.         }
  577.         str = str.slice(0, -1);
  578.         return str;
  579.     }
  580.  
  581.     client.$ = function(methodName, descr, calledRoomId, arguments, callback) {
  582.         if (methodName == "_QV") {
  583.             return true;
  584.         } else if (methodName == "_QF") {
  585.             return true;
  586.         } else if (methodName == "_LC") {
  587.  
  588.             for (var changes in arguments[1]) {
  589.                 trace(changes);
  590.  
  591.                 for (var changed in arguments[1][changes]) {
  592.                     trace(changed + " ### " + arguments[1][changes][changed]);
  593.  
  594.                     for (var e in arguments[1][changes][changed]) {
  595.                         trace(e + " #### " + arguments[1][changes][changed][e]);
  596.                         if (changes == "Remove") {
  597.                             var harr = hStrToArr(client.houseStr);
  598.                             for (var i = 0; i < harr.length; i++) {
  599.                                 trace(harr[i]['ID'] + "harry");
  600.                                 if (harr[i]['ID'] == changed) {
  601.                                     trace("found!!");
  602.                                     harr[i] = undefined;
  603.                                     client.houseStr = hObjToStr(harr);
  604.                                 }
  605.                             }
  606.                         } else if (changes == "Change") {
  607.                             var houseArr = hStrToArr(client.houseStr);
  608.  
  609.                             for (var i = 0; i < houseArr.length; i++) {
  610.                                 if (houseArr[i]['ID'] == changed) {
  611.                                     houseArr[i]['x'] = arguments[1][changes][changed]['x'];
  612.                                     houseArr[i]['y'] = arguments[1][changes][changed]['y'];
  613.                                     client.houseStr = hObjToStr(houseArr);
  614.                                     trace("new str: " + client.houseStr);
  615.                                 }
  616.                             }
  617.  
  618.                         } else if (changes == "Add") {
  619.                             var ek = [arguments[1][changes][changed]];
  620.                             client.houseStr = client.houseStr + hObjToStr(ek);
  621.                         }
  622.                     }
  623.                 }
  624.             }
  625.             if (descr == "ROOM") {
  626.                 for (var i = 0; i < application.clients.length; i++) {
  627.                     application.clients[i].call("_LC", null, client.smeshID, arguments[1], arguments[2]);
  628.                 }
  629.             }
  630.  
  631.         } else if (methodName == "_SCA") {
  632.             return true;
  633.         } else if (methodName == "_QI") {
  634.             return "0";
  635.         } else if (methodName == "_NUC") {
  636.             if (client.role >= "393230") {
  637.                 var ban = new LoadVars();
  638.                 ban.id = arguments[0];
  639.                 ban.ticket = client.ticket;
  640.                 ban.send(msHost + "/ban.php");
  641.                 for (var i = 0; i < application.clients.length; i++) {
  642.                     if (application.clients[i].smeshID == arguments[0]) {
  643.                         application.clients[i].call("_NUB", [arguments[0], 162]);
  644.                     }
  645.                 }
  646.             }
  647.         } else if (methodName == "_WAR") {
  648.             if (client.role >= "393230") {
  649.  
  650.                 for (var i = 0; i < application.clients.length; i++) {
  651.                     if (application.clients[i].smeshID == arguments) {
  652.                         application.disconnect(application.clients[i]);
  653.                     }
  654.                 }
  655.             }
  656.         } else if (methodName == "_BG") {
  657.  
  658.  
  659.         } else if (methodName == "_SDB") {
  660.             client.backgroundID = arguments[0];
  661.             var lv = new LoadVars();
  662.             lv.bg = arguments[0];
  663.             lv.ticket = client.ticket;
  664.             lv.send(msHost + "/bg.php");
  665.             trace(client.backgroundID + "bg");
  666.         } else if (methodName == "_GG") {
  667.             //  var _loc8_ = {index:"ID",remove_index:false,convert:{ID:Number,MediaResourceID:Number,TextResourceID:Number,MaxUsersCount:Number,MinUsersCount:Number,LackTime:Number,ScoreDivisor:Number,AvatarType:Number,MenuState:Number,MessageID:Number,StartLackTime:Number,StartFullTime:Number,IsPromptUsed:$.ToBoolean,IsFullscreen:$.ToBoolean,IsShowPoints:$.ToBoolean,Token:String}};
  668.             // return '<item ID="243" GameName="ÐвигаÑелÑ" NameTRId="10094" TextResourceID="519" MediaResourceID="19456" ScoreDivisor="5" AvatarType="0" IsPromptUsed="1" IsFullscreen="1" IsShowPoints="1" Token="KfF7WUhsPUqxXOyMfCX5tZV45gKfeF9HhwPzfvmeRsw" />';
  669.             return '<item ID="243" GameName="ÐвигаÑелÑ" NameTRId="10094" TextResourceID="519" MediaResourceID="19Ã456" ScoreDivisor="5" AvatarType="0" IsPromptUsed="0" IsFullscreen="1" IsShowPoints="1" Token="fZlkRJiLECyHjHfO2NKUutB7QbSGNBtBCÃcRZT0dxw" />';
  670.         } else if (methodName == "_UUG") {
  671.             return arguments;
  672.         } else if (methodName == "_SAG") {
  673.             //return {NameTRId: , BestsaleGoodIds, Goods Id, DaysLeft};
  674.             return {
  675.                 callback_uid: callback
  676.             };
  677.         } else if (methodName == "_GD") {
  678.             return "0";
  679.         } else if (methodName == "_CUR") {
  680.             return H2CA(rc4("<response MediaResourceID='" + arguments[0] + "' IsNotEnoughRole='0' IsNotEnoughLevel='0' IsNotEnoughMagicTickets='0' IsNotEnoughUsualTickets='0'></response>", "_level0"));
  681.         } else if (methodName == "_MSTL") {
  682.             return [];
  683.         } else if (methodName == "_GD") {
  684.             return "";
  685.         } else if (methodName == "_GCI") {
  686.             if (arguments == 4) {
  687.                 return '<catalog CatalogTypeId="666" MediaResourceId="15171"><item Id="360" TId="361" UsualTickets="0" MagicTickets="0" /><item Id="361" TId="362" UsualTickets="0" MagicTickets="0" /><item Id="362" TId="363" UsualTickets="0" MagicTickets="0" /><item Id="363" TId="364" UsualTickets="0" MagicTickets="0" /></catalog>';
  688.             }
  689.         } else if (methodName == "_C") {
  690.             trace("Чат ", arguments[1], "id ", client.smeshID);
  691.  
  692.             if (arguments[1].indexOf("$G$") > -1) {
  693.                 var ret = arguments[1].replace("$G$", "");
  694.                 var m = Number(ret);
  695.                 var item = meme(Number(ret));
  696.  
  697.                 var newItem = {
  698.                     ID: item["Id"],
  699.                     IsUsed: 0,
  700.                     IsLimited: 0,
  701.                     GoodID: item["Id"],
  702.                     Date: "2018-12-28T19:50:31.107",
  703.                     MediaResourceID: item["MRId"],
  704.                     TextResourceID: item["TRId"]
  705.                 };
  706.                
  707.                 if (item["Id"] != "undefined") {
  708.                     if(item["IsExclusive"] == 1) {
  709.                                        
  710.                     if(client.smeshID == item["OwnerID"] || client.role == 393230) {
  711.                                                                              
  712.                     if (item["LayerId"] == 36) {
  713.                         client.inv[0].push(newItem);
  714.                     } else if (item["LayerId"] == 45) {
  715.                         client.inv[1].push(newItem);
  716.                     } else if (item["LayerId"] == 31) {
  717.                         client.inv[2].push(newItem);
  718.                     } else if (item["LayerId"] == 11) {
  719.                         client.inv[3].push(newItem);
  720.                     } else if (item["LayerId"] == 56) {
  721.                         client.inv[4].push(newItem);
  722.                     } else if (item["LayerId"] == 27) {
  723.                         client.inv[5].push(newItem);
  724.                     } else if (item["LayerId"] == 57) {
  725.                         client.inv[6].push(newItem);
  726.                     } else if (item["LayerId"] == 85) {
  727.                         client.backgroundID = ret;
  728.                         var lv = new LoadVars();
  729.                         lv.bg = ret;
  730.                         lv.ticket = client.ticket;
  731.                         lv.send(msHost + "/bg.php");
  732.                         trace("bg");
  733.                        // client.call("_SDB", null, ret);
  734.                     } else {
  735.                         trace("такого объекта нет!");
  736.                     }
  737.                     }
  738.                     } else {
  739.                     if (item["LayerId"] == 36) {
  740.                         client.inv[0].push(newItem);
  741.                     } else if (item["LayerId"] == 45) {
  742.                         client.inv[1].push(newItem);
  743.                     } else if (item["LayerId"] == 31) {
  744.                         client.inv[2].push(newItem);
  745.                     } else if (item["LayerId"] == 11) {
  746.                         client.inv[3].push(newItem);
  747.                     } else if (item["LayerId"] == 56) {
  748.                         client.inv[4].push(newItem);
  749.                     } else if (item["LayerId"] == 27) {
  750.                         client.inv[5].push(newItem);
  751.                     } else if (item["LayerId"] == 57) {
  752.                         client.inv[6].push(newItem);
  753.                     } else if (item["LayerId"] == 85) {
  754.                         client.backgroundID = ret;
  755.                         var lv = new LoadVars();
  756.                         lv.bg = ret;
  757.                         lv.ticket = client.ticket;
  758.                         lv.send(msHost + "/bg.php");
  759.                         trace("bg");
  760.                        // client.call("_SDB", null, ret);
  761.                     } else {
  762.                         trace("такого объекта нет!");
  763.                     }
  764.                     }
  765.                    
  766.  
  767.                 }
  768.                 updateInventory(client.ticket, client.inv);
  769.                 return;
  770.             }
  771.  
  772.  
  773.             for (var i = 0; i < application.clients.length; i++) {
  774.                 if (application.clients[i].location == client.location) {
  775.                     application.clients[i].call("_C", null, client.smeshID, arguments[1]);
  776.                 }
  777.             }
  778.         } else if (methodName == "_AS") {
  779.             //<item Id="5arguments6" IsBodyPart="1" LayerID="20" MediaResourceID="56" BodyPartId="2" BodyPartTypeId="3" Color="16762375" /><item Id="67" IsBodyPart="1" LayerID="26" MediaResourceID="67" BodyPartId="30" BodyPartTypeId="5" /><item Id="68" IsBodyPart="1" LayerID="40" MediaResourceID="68" BodyPartId="31" BodyPartTypeId="6" Color="16762375" /><item Id="74" IsBodyPart="1" LayerID="30" MediaResourceID="74" BodyPartId="40" BodyPartTypeId="7" /><item Id="98" IsBodyPart="1" LayerID="50" MediaResourceID="98" BodyPartId="73" BodyPartTypeId="8" />
  780.             //trace([0]["BodyParts"][0]["Id"]);
  781.             //"18108": { IsBodyPart: false, MediaResourceID: 464, GoodID: 38, GoodTypeID: 4, Id: 18108, LayerID: 45}
  782.             var test = getBody(arguments[0]);
  783.             var changes = arguments[0];
  784.  
  785.             for (var i = 0; i < 7; i++) {
  786.                 for (var itemId = 1; itemId < client.inv[i].length; itemId++) {
  787.                     if (client.inv[i][itemId] != undefined) {
  788.                         client.inv[i][itemId]["IsUsed"] = "0";
  789.                     }
  790.                 }
  791.             }
  792.  
  793.  
  794.             for (var i = 0; i < changes["Inventory"].length; i++) {
  795.                 var Id = changes["Inventory"][i]["Id"];
  796.                 var well = meme(changes["Inventory"][i]["Id"]);
  797.  
  798.                 for (var id = 0; id < 7; id++) {
  799.                     for (var m = 0; m < client.inv[id].length; m++) {
  800.                         if (client.inv[id][m] != undefined && client.inv[id][m]["ID"] == Id) {
  801.                             client.inv[id][m]["IsUsed"] = "1";
  802.                         }
  803.                     }
  804.                 }
  805.             }
  806.  
  807.             client.userObj["User"]["Body"] = test["User"]["Body"];
  808.  
  809.             usersArr[client.smeshID] = client.userObj;
  810.  
  811.             updateInventory(client.ticket, client.inv);
  812.  
  813.             var lv = new LoadVars();
  814.             lv.avatar = pseudoArrayToNOCTMML(client.userObj['User']['Body']);
  815.             lv.ticket = client.ticket;
  816.             lv.send(msHost + "/setAvatar.php");
  817.             for (var i = 0; i < application.clients.length; i++) {
  818.                 if (application.clients[i].location == client.location) {
  819.                     application.clients[i].call("_D", null, client.smeshID, client.userObj);
  820.                 }
  821.             }
  822.  
  823.             return callback;
  824.         } else if (methodName == "_CAQ") {
  825.             return {
  826.                 "2": {
  827.                     "0": "1",
  828.                     "1": "esme"
  829.                 }
  830.             };
  831.         } else if (methodName == "_FL") {
  832.             return '<depot_items><group TextResourceID="1405"><item Price="59" Count="1" GoodId="973" UsualTickets="40" MagicTickets="0" TextResourceID="1416" MediaResourceID="1955" /><item Price="92" Count="1" GoodId="976" UsualTickets="30" MagicTickets="0" TextResourceID="1419" MediaResourceID="1958" /><item Price="34" Count="1" GoodId="980" UsualTickets="25" MagicTickets="0" TextResourceID="1423" MediaResourceID="1962" /><item Price="39" Count="1" GoodId="1254" UsualTickets="25" MagicTickets="0" TextResourceID="1605" MediaResourceID="2281" /></group><group TextResourceID="1406" /><group TextResourceID="1407"><item Price="53" Count="1" GoodId="1261" UsualTickets="45" MagicTickets="0" TextResourceID="1612" MediaResourceID="2288" /><item Price="34" Count="1" GoodId="1363" UsualTickets="22" MagicTickets="0" TextResourceID="1715" MediaResourceID="2479" /></group></depot_items>';
  833.         } else if (methodName == "_AG") {
  834.             trace("_AG");
  835.             return '<Shape TextResourceID="199"><tab ID="3" TextResourceID="48" MediaResourceID="202" LayerID="20"><item ID="56" BodyPartId="2" MediaResourceID="56" Color="16762375" IsColorable="1" IsUsed="1" /></tab><tab ID="2" TextResourceID="47" MediaResourceID="201" LayerID="10"><item ID="55" BodyPartId="1" MediaResourceID="55" IsColorable="1" IsUsed="1" /><item ID="62" BodyPartId="22" MediaResourceID="62" IsColorable="0" IsUsed="0" /><item ID="66" BodyPartId="28" MediaResourceID="66" IsColorable="1" IsUsed="0" /><item ID="71" BodyPartId="36" MediaResourceID="71" IsColorable="0" IsUsed="0" /><item ID="75" BodyPartId="41" MediaResourceID="75" IsColorable="0" IsUsed="0" /><item ID="80" BodyPartId="48" MediaResourceID="80" IsColorable="1" IsUsed="0" /><item ID="86" BodyPartId="57" MediaResourceID="86" IsColorable="1" IsUsed="0" /><item ID="92" BodyPartId="65" MediaResourceID="92" IsColorable="1" IsUsed="0" /></tab></Shape><BodyParts TextResourceID="205"><tab ID="8" TextResourceID="70" MediaResourceID="206" LayerID="50"><item ID="78" BodyPartId="45" MediaResourceID="78" IsColorable="1" IsUsed="0" /><item ID="84" BodyPartId="54" MediaResourceID="84" IsColorable="1" IsUsed="0" /><item ID="90" BodyPartId="62" MediaResourceID="90" IsColorable="1" IsUsed="0" /><item ID="95" BodyPartId="68" MediaResourceID="95" IsColorable="1" IsUsed="0" /><item ID="96" BodyPartId="71" MediaResourceID="96" IsColorable="1" IsUsed="0" /><item ID="97" BodyPartId="72" MediaResourceID="97" IsColorable="1" IsUsed="0" /><item ID="98" BodyPartId="73" MediaResourceID="98" IsColorable="0" IsUsed="1" /></tab><tab ID="7" TextResourceID="58" MediaResourceID="205" LayerID="30"><item ID="59" BodyPartId="13" MediaResourceID="59" IsColorable="0" IsUsed="0" /><item ID="61" BodyPartId="21" MediaResourceID="61" IsColorable="0" IsUsed="0" /><item ID="65" BodyPartId="27" MediaResourceID="65" IsColorable="0" IsUsed="0" /><item ID="70" BodyPartId="35" MediaResourceID="70" IsColorable="0" IsUsed="0" /><item ID="74" BodyPartId="40" MediaResourceID="74" IsColorable="0" IsUsed="1" /><item ID="79" BodyPartId="47" MediaResourceID="79" IsColorable="0" IsUsed="0" /><item ID="85" BodyPartId="56" MediaResourceID="85" IsColorable="0" IsUsed="0" /><item ID="91" BodyPartId="64" MediaResourceID="91" IsColorable="0" IsUsed="0" /></tab><tab ID="6" TextResourceID="57" MediaResourceID="204" LayerID="40"><item ID="58" BodyPartId="12" MediaResourceID="58" IsColorable="0" IsUsed="0" /><item ID="68" BodyPartId="31" MediaResourceID="68" Color="16762375" IsColorable="0" IsUsed="1" /><item ID="82" BodyPartId="50" MediaResourceID="82" IsColorable="0" IsUsed="0" /><item ID="88" BodyPartId="59" MediaResourceID="88" IsColorable="0" IsUsed="0" /><item ID="94" BodyPartId="67" MediaResourceID="94" IsColorable="0" IsUsed="0" /></tab><tab ID="5" TextResourceID="56" MediaResourceID="203" LayerID="26"><item ID="57" BodyPartId="4" MediaResourceID="57" IsColorable="0" IsUsed="0" /><item ID="67" BodyPartId="30" MediaResourceID="67" IsColorable="0" IsUsed="1" /><item ID="81" BodyPartId="49" MediaResourceID="81" IsColorable="0" IsUsed="0" /><item ID="87" BodyPartId="58" MediaResourceID="87" IsColorable="0" IsUsed="0" /><item ID="93" BodyPartId="66" MediaResourceID="93" IsColorable="0" IsUsed="0" /></tab><tab ID="11" TextResourceID="110" MediaResourceID="208" LayerID="41"><item ID="63" BodyPartId="23" MediaResourceID="63" IsColorable="0" IsUsed="0" /><item ID="72" BodyPartId="37" MediaResourceID="72" IsColorable="0" IsUsed="0" /><item ID="76" BodyPartId="42" MediaResourceID="76" IsColorable="0" IsUsed="0" /></tab><tab ID="12" TextResourceID="166" MediaResourceID="209" LayerID="55"><item ID="99" BodyPartId="74" MediaResourceID="99" IsColorable="0" IsUsed="0" /><item ID="100" BodyPartId="75" MediaResourceID="100" IsColorable="0" IsUsed="0" /><item ID="101" BodyPartId="76" MediaResourceID="101" IsColorable="0" IsUsed="0" /><item ID="102" BodyPartId="77" MediaResourceID="102" IsColorable="0" IsUsed="0" /><item ID="103" BodyPartId="78" MediaResourceID="103" IsColorable="0" IsUsed="0" /></tab></BodyParts><Inventory TextResourceID="206">' + makeXML(client.inv) + '</Inventory><Incompatibles><item ID="1" IncBPID0="11" IncBPID1="5" /><item ID="2" IncBPID0="11" IncBPID1="6" /><item ID="3" IncBPID0="5" IncBPID1="11" /><item ID="4" IncBPID0="6" IncBPID1="11" /><item ID="5" IncBPID0="12" IncGID1="4" /><item ID="6" IncGID0="4" IncBPID1="12" /><item ID="7" IncBPID0="12" IncBPID1="8" /><item ID="8" IncBPID0="8" IncBPID1="12" /><item ID="9" IncBPID0="2" IncGID1="32" /><item ID="10" IncGID0="32" IncBPID1="2" /><item ID="11" IncGID0="4" IncGID1="40" /><item ID="12" IncGID0="40" IncGID1="4" /><item ID="13" IncGID0="1" IncGID1="40" /><item ID="14" IncGID0="40" IncGID1="1" /><item ID="15" IncBPID0="12" IncGID1="40" /><item ID="16" IncBPID0="8" IncGID1="40" /><item ID="17" IncGID0="40" IncBPID1="12" /><item ID="18" IncGID0="40" IncBPID1="8" /><item ID="19" IncGID0="48" IncGID1="49" /><item ID="20" IncGID0="48" IncGID1="50" /><item ID="21" IncGID0="48" IncBPID1="11" /><item ID="22" IncGID0="49" IncGID1="48" /><item ID="23" IncGID0="49" IncGID1="50" /><item ID="24" IncGID0="49" IncBPID1="5" /><item ID="25" IncGID0="49" IncBPID1="6" /><item ID="26" IncGID0="50" IncGID1="49" /><item ID="27" IncGID0="50" IncBPID1="11" /><item ID="28" IncBPID0="5" IncGID1="49" /><item ID="29" IncBPID0="6" IncGID1="49" /><item ID="30" IncBPID0="11" IncGID1="48" /><item ID="31" IncBPID0="11" IncGID1="50" /></Incompatibles><Backgrounds TextResourceID="230"><item ID="'+ client.backgroundID +'" InUse="1" IsLimited="0" /><item ID="339" InUse="0" IsLimited="0" /><item ID="349" InUse="0" IsLimited="0" /><item ID="430" InUse="0" IsLimited="0" /><item ID="431" InUse="0" IsLimited="0" /></Backgrounds><Phones TextResourceID="231"><item ID="127" InUse="1" IsLimited="0" /></Phones><SportInventory TextResourceID="211" /><Bin TextResourceID="12821" /><Stuff />';
  836.         } else if (methodName == "_UI") {
  837.             trace("_UI");
  838.             for (var i = 0; i < application.clients.length; i++) {
  839.                 if (application.clients[i].smeshID == arguments) {
  840.                     var cl = application.clients[i];
  841.                 }
  842.             }
  843.  
  844.             return '<user UserId="' + cl.smeshID + '" Name="' + cl.userObj['User']['Name'] + '" RoleFlags="' + cl.userObj['User']['RoleFlags'] + '" DateRegistered="' + cl.regdate + '" IsLimited="1" IsOnline="1" IsMinorSecretAgent="1" IsHomeLocked="1" IsClubLocked="1" IsClubPresent="0" ClubAccessType="0" IsFriend="0" Experience="150" Level="' + cl.userObj["User"]["Level"] + '" PositiveEnergy="4" MagicLevel="' + cl.userObj["User"]["Magic"] + '" RaceLevel="0" PhoneID="127" BackgroundID="' + client.backgroundID + '" CampId="1" NiftTotalCount="0"><ExtendedInfo UserId="33042756" HasKey="0" /><SpecialOffers><Offer Id="173" MinsLeft="243469" ActionTypeId="0" PopupMRId="33143" /><Offer Id="5000" MinsLeft="26029" ActionTypeId="0" IconMRId="33181" PopupMRId="33182" /><Offer Id="10006" MinsLeft="-378611" ActionTypeId="3" IconMRId="14831" PopupMRId="14832" /></SpecialOffers></user><avatar>' + avaToXML(cl.userObj["User"]["Body"]) + '</avatar>';
  845.         } else if (methodName == "_NUM") {
  846.             for (var i = 0; i < application.clients.length; i++) {
  847.                 if (application.clients[i].location == client.location) {
  848.                     application.clients[i].call("_NUM", null, arguments[0], arguments[1], arguments[2]);
  849.                 }
  850.             }
  851.         } else if (methodName == "_NUS") {
  852.             for (var i = 0; i < application.clients.length; i++) {
  853.                 if (application.clients[i].location == client.location) {
  854.                     application.clients[i].call("_NUS", null, client.smeshID, arguments[1], arguments[2]);
  855.                 }
  856.             }
  857.         } else if (methodName == "_I") {
  858.             trace("_I");
  859.             var magic = ''
  860.             for (i = 1; i < 282; i++) {
  861.                 magic += '<item Id="'+i+'" ExpirationDate="2020-04-28T19:50:31.107" IsLimited="0" />';
  862.             }
  863.             var putin = [H2CA(rc4('<response><user UserId="' + client.smeshID + '" Name="' + client.userObj["User"]["Name"] + '" RoleFlags="' + client.userObj["User"]["RoleFlags"] + '" InstructorLevel="8" MagicLevel="' + client.userObj["User"]["Level"] + '" RaceLevel="8" PhoneID="127" BackgroundID="' + client.backgroundID + '" UsualTickets="' + client.userObj["User"]["Money"] + '" MagicTickets="' + client.userObj["User"]["Money"] + '" Experience="150" Level="' + client.userObj["User"]["Level"] + '" PositiveEnergy="150" VisaId="1" CurrentUseCount="0" LastNewspaperId="0" IsClubPresent="1" IsMinorSecretAgent="1" IsLimited="1" HasSnFriends="1" HasInformer="1" /><sharagent IsActive="true"/><secret_agent StartDate="2017-04-28T19:50:31.107" Number="1" Interval="1" /><user_phone BufferSize="1" SkinMediaResourceID="32392" PhoneId="127" Balance="222"/><user_avatar>' + avaToXML(client.userObj["User"]["Body"]) + '</user_avatar><account PhoneCardBalance="123" WeaponsCount="999999" OxigenUnits="2221" /><user_magic_abilities>' + magic + '</user_magic_abilities><smiles><item Id="1" ExpDate="2020-04-28T19:50:31.107" Order="1"></smile><sms NewCount="69" /></response>', "_level0"))];
  864.             return putin;
  865.         } else if (methodName == "_UFG") {
  866.             var obj = {};
  867.             /*
  868.                 var u = client.ufg.split("|");
  869.  
  870.                 for (var i = 0; i < u.length; i++) {
  871.                   var s = u[i].split(",");
  872.                   obj[s[0]] = {
  873.                     userId: s[0],
  874.                     UserName: s[1],
  875.                     IsOnline: true
  876.                   };
  877.                 }
  878.             */
  879.             return obj;
  880.  
  881.         } else if (methodName == "_UFR") {
  882.             var obj = {};
  883.             /*
  884.                 var ufrstr = client.ufr.split("|");
  885.                for (var i = 0; i < ufrstr.length; i++) {
  886.                  var splitted = ufrstr[i].split(",");
  887.                  obj[i] = {
  888.                    userId: 3,
  889.                    UserName: splitted[1]
  890.                  };
  891.                }
  892.             */
  893.             return obj;
  894.         } else if (methodName == "_CM") {
  895.             return "<clubmap />";
  896.         } else if (methodName == "_LDH") {
  897.             return '<root><inventory><group ID="1$3676" AObjectTypeId="1" AObjectId="3676" AObjectRefTypeId="20" MediaResourceID="10223" TextResourceID="10641"><object ID="265650213" IsActive="0" /></group></inventory><locations><item ID="31079824" MediaResourceID="1399" IsHome="1" IsCurrent="1" IsLocked="1" /></locations></root>';
  898.         } else if (methodName == "_SNFP") {
  899.             return '<root> <!-- we don\'t need this lol --> </root>';
  900.         } else if (methodName == "_D") {
  901.             for (var i = 0; i < application.clients.length; i++) {
  902.                 if (application.clients[i].location == client.location) {
  903.                     application.clients[i].call("_D", null, client.smeshID, client.userObj);
  904.                 }
  905.             }
  906.         } else if (methodName == "_LGI") {
  907.             return travelPlaces[arguments[0]];
  908.         } else if (methodName == "_LML") {
  909.             return '<user_magic_level Level="10" TicketLevel="10" Days="0"><lesson QuestId="466" />';
  910.         } else if (methodName == "_JD") {
  911.             return '<garage><Car><item Id="8156304" CarTypeId="1" MediaResourceID="2135" IsCurrent="1" /></Car><Inventory><item Id="75" TypeId="75" CarTypeId="1" MediaResourceID="2235"><item Id="59497575" UserCarId="8156304" /></item><item Id="76" TypeId="77" CarTypeId="1" MediaResourceID="2131"><item Id="59497576" UserCarId="8156304" /></item><item Id="77" TypeId="72" CarTypeId="1" MediaResourceID="2127"><item Id="59497577" UserCarId="8156304" /></item><item Id="78" TypeId="74" CarTypeId="1" MediaResourceID="2236"><item Id="59497578" UserCarId="8156304" /></item><item Id="79" TypeId="73" CarTypeId="1" MediaResourceID="2237"><item Id="59497579" UserCarId="8156304" /></item><item Id="80" TypeId="76" CarTypeId="1" MediaResourceID="2238"><item Id="59497580" UserCarId="8156304" /></item><item Id="81" TypeId="81" CarTypeId="1" MediaResourceID="2239"><item Id="59497581" UserCarId="8156304" /></item></Inventory></garage>';
  912.         } else if (methodName == "_LG") {
  913.  
  914.             // for (var i = 0; i < application.clients.length; i++) {
  915.             //   if (application.clients[i].location == client.location && application.clients[i].smeshID != client.smeshID) {
  916.             //     application.clients[i].call("_UL", null, client.smeshID);
  917.             //   }
  918.             // }
  919.  
  920.             if (arguments[1] == -1) {
  921.                 return '<location ID="35507324" OwnerId="2" OwnerName="маÑи 65е" IsHome="1" IsClub="0" IsLocked="0" IsVisaAccessPermitted="1" MediaResourceID="32888" x="650.0" y="320.0">' + hstrToXML(client.houseStr) + '</location>';
  922.             }
  923.  
  924.             if (locationsArray[arguments[1]]) {
  925.                 return locationsArray[arguments[1]];
  926.             } else {
  927.                 return locationsArray[23];
  928.             }
  929.         } else if (methodName == "_UOG") {
  930.             return true;
  931.         } else if (methodName == "_GMB") {
  932.             return {
  933.                 "Amount": 900000
  934.             };
  935.         } else if (methodName == "_MTB") {
  936.             return {
  937.                 "Success": true
  938.             };
  939.         } else if (methodName == "_UOS") {
  940.             trace("ШО");
  941.  
  942.             if (arguments == "SA_IsFirstStepPassed") {
  943.                 return true;
  944.             }
  945.  
  946.             client.call("_UOS", null, arguments);
  947.         } else if (methodName == "_UFO") {
  948.             return '0';
  949.         } else if (methodName == "_GOGI") {
  950.             return '<group_object UOGId="-6193" ObjectGroupId="6193" ObjectGroupTypeId="101" ControllerType="4" Stored="0" ContorollerMRId="32939"><item Id="6193010" AObjectId="3594" AObjectTypeId="50" MediaResourceID="32991" LocationId="2" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193024" AObjectId="3612" AObjectTypeId="50" MediaResourceID="33023" LocationId="2" X="389.0" Y="333.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193011" AObjectId="3595" AObjectTypeId="50" MediaResourceID="32991" LocationId="6" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193028" AObjectId="3616" AObjectTypeId="50" MediaResourceID="33027" LocationId="6" X="551.0" Y="345.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193012" AObjectId="3596" AObjectTypeId="50" MediaResourceID="32991" LocationId="12" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193026" AObjectId="3614" AObjectTypeId="50" MediaResourceID="33025" LocationId="12" X="312.0" Y="298.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193001" AObjectId="3584" AObjectTypeId="50" MediaResourceID="32919" LocationId="16" X="360.0" Y="261.0" Frame="L$0" IsActive="1" IsInterractable="1" /><item Id="6193002" AObjectId="3585" AObjectTypeId="50" MediaResourceID="32926" LocationId="16" X="198.0" Y="192.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193009" AObjectId="3593" AObjectTypeId="50" MediaResourceID="32991" LocationId="16" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193013" AObjectId="3597" AObjectTypeId="50" MediaResourceID="32991" LocationId="18" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193027" AObjectId="3615" AObjectTypeId="50" MediaResourceID="33026" LocationId="18" X="480.0" Y="286.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193008" AObjectId="3592" AObjectTypeId="50" MediaResourceID="32991" LocationId="19" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193029" AObjectId="3617" AObjectTypeId="50" MediaResourceID="33028" LocationId="19" X="440.0" Y="310.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193014" AObjectId="3598" AObjectTypeId="50" MediaResourceID="32991" LocationId="21" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193023" AObjectId="3611" AObjectTypeId="50" MediaResourceID="33022" LocationId="21" X="214.0" Y="328.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193025" AObjectId="3613" AObjectTypeId="50" MediaResourceID="33024" LocationId="86" X="570.0" Y="354.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193030" AObjectId="3624" AObjectTypeId="50" MediaResourceID="32991" LocationId="86" X="0.0" Y="510.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193003" AObjectId="3586" AObjectTypeId="50" MediaResourceID="32929" LocationId="526" X="561.0" Y="385.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193004" AObjectId="3587" AObjectTypeId="50" MediaResourceID="32930" LocationId="526" X="356.0" Y="397.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193005" AObjectId="3588" AObjectTypeId="50" MediaResourceID="32931" LocationId="526" X="236.0" Y="376.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193006" AObjectId="3589" AObjectTypeId="50" MediaResourceID="32932" LocationId="526" X="462.0" Y="307.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193007" AObjectId="3591" AObjectTypeId="50" MediaResourceID="32990" LocationId="526" X="387.0" Y="247.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193031" AObjectId="3625" AObjectTypeId="50" MediaResourceID="33141" LocationId="526" X="0.0" Y="0.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193015" AObjectId="3599" AObjectTypeId="50" MediaResourceID="32993" LocationId="527" X="342.0" Y="345.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193016" AObjectId="3604" AObjectTypeId="50" MediaResourceID="33015" LocationId="527" X="46.0" Y="56.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193017" AObjectId="3605" AObjectTypeId="50" MediaResourceID="33016" LocationId="527" X="110.0" Y="104.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193018" AObjectId="3606" AObjectTypeId="50" MediaResourceID="33017" LocationId="527" X="235.0" Y="49.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193019" AObjectId="3607" AObjectTypeId="50" MediaResourceID="33018" LocationId="527" X="448.0" Y="51.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193020" AObjectId="3608" AObjectTypeId="50" MediaResourceID="33019" LocationId="527" X="520.0" Y="79.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193021" AObjectId="3609" AObjectTypeId="50" MediaResourceID="33020" LocationId="527" X="653.0" Y="57.0" Frame="F$0" IsActive="1" IsInterractable="1" /><item Id="6193022" AObjectId="3610" AObjectTypeId="50" MediaResourceID="33021" LocationId="527" X="326.0" Y="73.0" Frame="F$0" IsActive="1" IsInterractable="1" /></group_object>';
  951.         } else if (methodName == "_ULNS") {
  952.             return true;
  953.         } else if (methodName == "_DA") {
  954.             return '<test ID="1" IsSecretAgent="1" IsMember="1" IsPresent="1" IsActive="1" Units="1" MessageID="1"></test>';
  955.         } else if (methodName == "_GSD") {
  956.             return '<Result SecToRun="3084" DefInterval="1200" IsActive="1" />';
  957.         } else if (methodName == "_BGB") {
  958.  
  959.             for (var id in arguments[0][0]["item"]) {
  960.                 var value = arguments[0][0]["item"][id];
  961.  
  962.                 trace(id + " = " + value);
  963.             }
  964.  
  965.             if (arguments[0][0]["item"]["goodTypeId"] == 20) {
  966.                 var tesb = {
  967.                     ID: arguments[0][0]["item"]["id"],
  968.                     AObjectTypeId: 1,
  969.                     AObjectId: arguments[0][0]["item"]["id"],
  970.                     AObjectRefTypeId: 20,
  971.                     MediaResourceID: arguments[0][0]["item"]["MRid"],
  972.                     TextResourceID: arguments[0][0]["item"]["TRid"],
  973.                     IsActive: 0
  974.                 };
  975.                 homeInv.push(tesb);
  976.             } else {
  977.  
  978.                 var tesa = {
  979.                     ID: arguments[0][0]["item"]["id"],
  980.                     IsUsed: 0,
  981.                     IsLimited: 0,
  982.                     GoodID: arguments[0][0]["item"]["id"],
  983.                     Date: "2018-12-28T19:50:31.107",
  984.                     MediaResourceID: arguments[0][0]["item"]["MRid"],
  985.                     TextResourceID: arguments[0][0]["item"]["TRid"]
  986.                 };
  987.                 trace(arguments[0][0]["item"]["layerId"]);
  988.                 if (arguments[0][0]["item"]["layerId"] == 36) {
  989.                     client.inv[0].push(tesa);
  990.                 } else if (arguments[0][0]["item"]["layerId"] == 45) {
  991.                     client.inv[1].push(tesa);
  992.                 } else if (arguments[0][0]["item"]["layerId"] == 31) {
  993.                     client.inv[2].push(tesa);
  994.                 } else if (arguments[0][0]["item"]["layerId"] == 11) {
  995.                     client.inv[3].push(tesa);
  996.                 } else if (arguments[0][0]["item"]["layerId"] == 56) {
  997.                     client.inv[4].push(tesa);
  998.                 } else if (arguments[0][0]["item"]["layerId"] == 27) {
  999.                     client.inv[5].push(tesa);
  1000.                 } else if (arguments[0][0]["item"]["layerId"] == 57) {
  1001.                     client.inv[6].push(tesa);
  1002.                 }
  1003.             }
  1004.  
  1005.             updateInventory(client.ticket, client.inv);
  1006.  
  1007.             return {
  1008.                 Error: 0,
  1009.                 Result: '<result><item Id="1"><Transaction /></item></result>',
  1010.                 GoodInfo: 0,
  1011.                 MagicTickets: 0,
  1012.                 TRId: 0,
  1013.                 GoodTypeId: 0,
  1014.                 IsUnlock: true,
  1015.                 UsualTickets: 0,
  1016.                 GoodId: 0,
  1017.                 GoodTypeTRId: 0,
  1018.                 BelongType: 0
  1019.             };
  1020.         }
  1021.     }
  1022.  
  1023.     client._SCD = function() {
  1024.         return new Date();
  1025.     }
  1026.  
  1027.  
  1028. }
  1029.  
  1030. application.onDisconnect = function(client) {
  1031.     usersArr[client.smeshID] = undefined;
  1032.  
  1033.     for (var i = 0; i < application.clients.length; i++) {
  1034.         if (application.clients[i].location == client.location) {
  1035.             application.clients[i].call("_UL", null, client.smeshID);
  1036.         }
  1037.     }
  1038. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top