Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load("items.asc");
- load("locations.asc");
- load("bodyparts.asc");
- var msHost = "http://185.231.155.141";
- var homeInv = [{
- ID: 3676,
- AObjectTypeId: 1,
- AObjectId: 3676,
- AObjectRefTypeId: 20,
- MediaResourceID: 10223,
- TextResourceID: 10641,
- IsActive: 0
- }, {
- ID: 8326,
- AObjectTypeId: 1,
- AObjectId: 8326,
- AObjectRefTypeId: 20,
- MediaResourceID: 26415,
- TextResourceID: 26240,
- IsActive: 0
- }];
- var sbox = new Array(255);
- var mykey = new Array(255);
- function objInvToStr(Inventory) {
- var str = "";
- for (var tab in Inventory) {
- for (var i = 0; i < Inventory[tab].length; i++) {
- var ms = "";
- for (var key in Inventory[tab][i]) {
- if (key != "tab") {
- ms = ms + key + ">" + Inventory[tab][i][key] + "|";
- }
- }
- str += ms + "<";
- }
- str = str.slice(0, -1) + ";";
- }
- return str.slice(0, -1);
- }
- function meme(Id) {
- return g[Id];
- }
- //<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" />
- //</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>
- //<item ID="17" IsUsed="0" IsLimited="0" GoodID="17" Date="2018-12-28T19:50:31.107" MediaResourceID="13" TextResourceID="201" Pollution="0" />
- //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">'}]};
- function makeInvXML(Inventory) {
- var InvXML = '';
- for (var i = 0; i < homeInv.length; i++) {
- trace(homeInv[i]["ID"])
- var test = '<group ID="1$' + homeInv[i]["ID"] + '" AObjectTypeId="' + Inventory[i]["AObjectTypeId"] + '" AObjectId="' + Inventory[i]["AObjectId"] + '" AObjectRefTypeId="' + Inventory[i]["AObjectRefTypeId"] + '" MediaResourceID="' + Inventory[i]["MediaResourceID"];
- if (Inventory[i]["TextResourceID"] != undefined) {
- test = test + '" TextResourceID="' + Inventory[i]["TextResourceID"] + '"><object ID="' + Inventory[i]["ID"] + '" IsActive="' + Inventory[i]["IsActive"] + '" /></group>'
- } else {
- test = test + '"><object ID="' + Inventory[i]["ID"] + '" IsActive="' + Inventory[i]["IsActive"] + '" /></group>';
- }
- InvXML = InvXML + test;
- }
- trace(InvXML);
- return InvXML;
- }
- //мне пока лень добавлять столько шапок)
- //<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" />
- //LayerID="36" - одежда
- //LayerID="45" - прически
- //LayerID="31" - Очки
- //LayerID="11" - обувь
- //LayerID="56" - аксессуары
- //LayerID="27" - костюмы
- //LayerID="57" - спутники
- //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" >'}]};
- //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};
- function makeXML(inv) {
- var bigXML = '';
- for (var m = 0; m < 7; m++) {
- var InvXML = inv[m][0]["tab"]
- for (var i = 1; i < inv[m].length; i++) {
- if (inv[m][i] != undefined) {
- 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"];
- if (inv[m][i]["TextResourceID"] != undefined) {
- test = test + '" TextResourceID="' + inv[m][i]["TextResourceID"] + '" Pollution="0" />'
- } else {
- test = test + '" Pollution="0" />'
- }
- InvXML = InvXML + test;
- }
- }
- bigXML = bigXML + InvXML + '</tab>';
- }
- return bigXML;
- }
- function getBody(changes) {
- var newSmesh = {
- RoleFlags: 262144,
- User: {
- Body: {},
- "State": 0,
- "Name": "esme",
- "Level": 999,
- y: 400,
- x: 480
- }
- };
- for (var i = 0; i < changes["BodyParts"].length; i++) {
- var Id = changes["BodyParts"][i]["Id"];
- newSmesh["User"]["Body"][Id] = {};
- newSmesh["User"]["Body"][Id]["IsBodyPart"] = true;
- newSmesh["User"]["Body"][Id]["BodyPartTypeId"] = bodyParts[changes["BodyParts"][i]["Id"]]["BodyPartTypeId"];
- newSmesh["User"]["Body"][Id]["MediaResourceID"] = bodyParts[changes["BodyParts"][i]["Id"]]["MediaResourceID"];
- newSmesh["User"]["Body"][Id]["LayerID"] = bodyParts[changes["BodyParts"][i]["Id"]]["LayerID"] - 1;
- newSmesh["User"]["Body"][Id]["BodyPartId"] = bodyParts[changes["BodyParts"][i]["Id"]]["BodyPartId"];
- newSmesh["User"]["Body"][Id]["Id"] = changes["BodyParts"][i]["Id"];
- if (changes["BodyParts"][i]["Color"] != undefined) {
- newSmesh["User"]["Body"][Id]["Color"] = changes["BodyParts"][i]["Color"];
- }
- }
- for (var i = 0; i < changes["Inventory"].length; i++) {
- var Id = changes["Inventory"][i]["Id"];
- var well = meme(changes["Inventory"][i]["Id"]);
- newSmesh["User"]["Body"][Id] = {};
- newSmesh["User"]["Body"][Id]["IsBodyPart"] = false;
- newSmesh["User"]["Body"][Id]["GoodID"] = changes["Inventory"][i]["Id"];
- newSmesh["User"]["Body"][Id]["MediaResourceID"] = well["MRId"];
- newSmesh["User"]["Body"][Id]["GoodTypeID"] = well["GoodTypeId"];
- newSmesh["User"]["Body"][Id]["LayerID"] = well["LayerId"];
- newSmesh["User"]["Body"][Id]["Id"] = changes["Inventory"][i]["Id"];
- }
- return newSmesh;
- }
- function parseCoolString(cstr) {
- if (typeof(cstr) !== 'string') {
- return;
- }
- var pieces = cstr.split("|");
- var obj = {};
- for (var i = 0; i < pieces.length; i++) {
- var smol = pieces[i].split(">");
- var mkey = smol[0];
- var mvalue = smol[1];
- if (mvalue == 'true') {
- mvalue = 1;
- } else if (mvalue == 'false') {
- mvalue = 0;
- }
- obj[mkey] = mvalue;
- }
- return obj;
- }
- function parseNOCTMML(NOCTMML) {
- var arr = {};
- var s = NOCTMML.split(";");
- for (var i = 0; i < s.length; i++) {
- arr[i] = parseCoolString(s[i]);
- }
- trace(arr[0]["Id"] + " ID");
- return arr;
- }
- function objectToCoolString(obj) {
- var str = "";
- for (var el in obj) {
- str += el + ">" + obj[el] + "|";
- }
- str = str.slice(0, -1);
- return str;
- }
- function pseudoArrayToNOCTMML(steam) {
- var str = "";
- for (var e in steam) {
- str += objectToCoolString(steam[e]) + ";";
- }
- str = str.slice(0, -1);
- return str;
- }
- function H2CA(hex) {
- var _loc3_ = [];
- var _loc1_ = hex.substr(0, 2) != "0x" ? 0 : 2;
- while (_loc1_ < hex.length) {
- _loc3_.push(parseInt(hex.substr(_loc1_, 2), 16));
- _loc1_ = _loc1_ + 2;
- }
- return _loc3_;
- }
- var usersArr = [];
- function strToChars(str) {
- var codes = new Array();
- for (var i = 0; i < str.length; i++) {
- codes.push(str.charCodeAt(i));
- }
- return codes;
- }
- function charsToHex(chars) {
- var result = new String("");
- var hexes = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
- for (var i = 0; i < chars.length; i++) {
- result += hexes[chars[i] >> 4] + hexes[chars[i] & 0xf];
- }
- return result;
- }
- function initialize(pwd) {
- var b = 0;
- var tempSwap;
- var intLength = pwd.length;
- for (var a = 0; a <= 255; a++) {
- mykey[a] = pwd[(a % intLength)];
- sbox[a] = a;
- }
- for (var a = 0; a <= 255; a++) {
- b = (b + sbox[a] + mykey[a]) % 256;
- tempSwap = sbox[a];
- sbox[a] = sbox[b];
- sbox[b] = tempSwap;
- }
- }
- function calculate(plaintxt, psw) {
- initialize(psw);
- var i = 0;
- var j = 0;
- var cipher = new Array();
- var k, temp, cipherby;
- for (var a = 0; a < plaintxt.length; a++) {
- i = (i + 1) % 256;
- j = (j + sbox[i]) % 256;
- temp = sbox[i];
- sbox[i] = sbox[j];
- sbox[j] = temp;
- var idx = (sbox[i] + sbox[j]) % 256;
- k = sbox[idx];
- cipherby = plaintxt[a] ^ k;
- cipher.push(cipherby);
- }
- return cipher;
- }
- function rc4(src, key) {
- var mtxt = strToChars(src);
- var mkey = strToChars(key);
- var result = calculate(mtxt, mkey);
- return charsToHex(result);
- }
- function avaToXML(ava) {
- var xml = "";
- for (var e in ava) {
- if (ava[e]["IsBodyPart"] == "1") {
- xml += '<item Id="' + ava[e]["Id"] + '" IsBodyPart="1" LayerID="' + ava[e]["LayerID"] + '" MediaResourceID="' + ava[e]["MediaResourceID"] + '" BodyPartId="' + ava[e]["BodyPartId"] + '" BodyPartTypeId="' + ava[e]["BodyPartTypeId"] + '"';
- // if (bodyParts[ava[e]["Id"]]["isColorable"] == 1) {
- // trace(ava[e]["Id"] + "##e#" + ava[e]["Color"]);
- // xml += " Color='" + ava[e]["Color"] + "' />";
- // } else {
- xml += " />";
- // }
- } else {
- xml += '<item Id="' + ava[e]["Id"] + '" GoodTypeID="' + ava[e]["GoodTypeID"] + '" IsBodyPart="0" GoodID="' + ava[e]["GoodID"] + '" LayerID="' + ava[e]["LayerID"] + '" MediaResourceID="' + ava[e]["MediaResourceID"] + '" />';
- }
- }
- return xml;
- }
- function randomRange(minNum, maxNum) {
- {
- return Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
- }
- }
- application.onConnect = function(client, uid, sid, ticket, hwid) {
- trace("hwid " + hwid);
- var initialData = new LoadVars();
- var initdata = initialData.load(msHost + "/kek.php?ticket=" + ticket + "&secret");
- var conn = this;
- client.ticket = ticket;
- client.inv = {
- 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" >'
- }],
- 6: [{
- tab: '<tab ID="94" MediaResourceID="214" TextResourceID="25" LayerID="57" >'
- }]
- };
- initialData.onLoad = function(success) {
- trace(this.toString());
- //_NUB(TRID0, TRID1)
- client.userObj["User"]["Name"] = this.username;
- client.userObj["User"]["Level"] = this.level;
- client.userObj["User"]["RoleFlags"] = this.roleflags;
- client.userObj["User"]["Money"] = this.money;
- client.userObj["User"]["Gold"] = this.gold;
- client.userObj["User"]["Magic"] = this.magic;
- client.weaponCount = 999999999;
- client.userObj["User"]["Body"] = parseNOCTMML(this.avatar);
- client.regdate = this.regdate;
- client.role = Number(this.roleflags);
- client.houseStr = this.houseStr;
- client.isBanned = this.isbanned;
- client.smeshID = this.id;
- client.backgroundID = this.bg;
- trace(client.smeshID);
- var e = this.inventory.split(";");
- if (client.isBanned !== "1") {
- conn.acceptConnection(client);
- }
- client.call("_NNR", null, client.role);
- usersArr[client.smeshID] = client.userObj;
- for (var i = 0; i < e.length; i++) {
- var m = e[i].split("<");
- for (var id = 0; id < m.length; id++) {
- var mem = m[id].split("|");
- var obj = {};
- for (var meme = 0; meme < mem.length; meme++) {
- var keys = mem[meme].split(">");
- if (keys[1] != undefined) {
- obj[keys[0]] = keys[1];
- }
- }
- if (obj["ID"]) {
- client.inv[i][id + 1] = obj;
- }
- }
- }
- }
- client.userObj = {
- RoleFlags: 2,
- User: {
- Body: {
- "1": {
- "State": 1,
- Id: 1,
- IsBodyPart: true,
- Color: 8009440,
- BodyPartTypeId: 1,
- MediaResourceID: 55,
- LayerID: 10,
- BodyPartId: "73"
- },
- "2": {
- IsBodyPart: true,
- BodyPartTypeId: "1",
- MediaResourceID: 56,
- LayerID: 20,
- Id: 2,
- Color: 8009440,
- BodyPartId: "74"
- },
- "4": {
- IsBodyPart: true,
- BodyPartTypeId: "3",
- MediaResourceID: 59,
- LayerID: 30,
- Id: 4,
- BodyPartId: "75"
- },
- "50": {
- IsBodyPart: true,
- BodyPartTypeId: "4",
- MediaResourceID: 82,
- LayerID: 40,
- Id: 50,
- BodyPartId: "76"
- },
- 18108: {
- IsBodyPart: false,
- MediaResourceID: 464,
- GoodID: 38,
- GoodTypeID: 4,
- Id: 18108,
- LayerID: 45
- },
- 112: {
- IsBodyPart: false,
- MediaResourceID: 274,
- GoodID: 38,
- GoodTypeID: 14,
- Id: 112,
- LayerID: 31
- }
- },
- "State": 2,
- "Name": "esme",
- "Level": 999,
- y: 400,
- x: 480
- }
- };
- client.house = [];
- client.location = 2;
- client.ufr = "1,test|2,kek|3,destator";
- client._P = function(point, tweenId) {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
- client.userObj["User"]["x"] = point.x;
- client.userObj["User"]["y"] = point.y;
- application.clients[i].call("_P", null, client.smeshID, point, tweenId);
- }
- }
- }
- client._LS = function(descriptor, startPoint, startState) {
- client.userObj["User"]["x"] = startPoint.x;
- client.userObj["User"]["y"] = startPoint.y;
- if (descriptor != "LOAD") {
- trace("descr: " + descriptor.split("$")[2]);
- client.location = descriptor.split("$")[2];
- } else {
- return "0";
- }
- var usrs = [];
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
- usrs[application.clients[i].smeshID] = application.clients[i].userObj;
- application.clients[i].call("_UE", null, client.smeshID, client.userObj);
- }
- }
- client.call("_LS", null, usrs);
- }
- client._S = function(state) {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location && usersArr[application.clients[i].smeshID] != undefined) {
- application.clients[i].call("_S", null, client.smeshID, state);
- }
- }
- }
- client._SS = function(hidden) {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_SS", null, client.smeshID, hidden);
- }
- }
- }
- client._SCA = function(methodName, data) {
- trace(methodName, data);
- return "meme";
- }
- client._NSF = function() {
- //return '<response isPong="true" />';
- }
- function hStrToArr(str) {
- var arr = [];
- var pieces = str.split(";");
- for (var i = 0; i < pieces.length; i++) {
- var obj = {};
- var e = pieces[i].split("|");
- for (var id = 0; id < e.length; id++) {
- var p = e[id].split(">");
- obj[p[0].replace(" ", "")] = p[1];
- }
- arr.push(obj);
- }
- return arr;
- }
- function houseToXML(house) {
- //ID>46043197|AObjectTypeId>1|AObjectId>573|AObjectRefTypeId>20|MediaResourceID>1242|TextResourceID>1034|x>219.4|y>246.7;
- //<object ID="46043197" AObjectTypeId="1" AObjectId="573" AObjectRefTypeId="20" MediaResourceID="1242" TextResourceID="1034" x="219.4" y="246.7" Frame="2" />
- var xml = "";
- for (var i = 0; i < house.length; i++) {
- xml += "<object ";
- for (var e in house[i]) {
- xml += e + "='" + house[i][e] + "' ";
- }
- xml += "/>";
- }
- return xml;
- }
- function hstrToXML(str) {
- return houseToXML(hStrToArr(str));
- }
- function updateInventory(ticket, inv) {
- var str = objInvToStr(inv);
- var lv = new LoadVars();
- lv.inventory = str;
- lv.ticket = ticket;
- lv.send(msHost + "/inv.php");
- }
- function hObjToStr(obj) {
- var str = "";
- for (var i = 0; i < obj.length; i++) {
- if (obj[i] != undefined) {
- for (var key in obj[i]) {
- str += key + ">" + obj[i][key] + "|";
- }
- str = str.slice(0, -1);
- str = str + ";";
- }
- }
- str = str.slice(0, -1);
- return str;
- }
- client.$ = function(methodName, descr, calledRoomId, arguments, callback) {
- if (methodName == "_QV") {
- return true;
- } else if (methodName == "_QF") {
- return true;
- } else if (methodName == "_LC") {
- for (var changes in arguments[1]) {
- trace(changes);
- for (var changed in arguments[1][changes]) {
- trace(changed + " ### " + arguments[1][changes][changed]);
- for (var e in arguments[1][changes][changed]) {
- trace(e + " #### " + arguments[1][changes][changed][e]);
- if (changes == "Remove") {
- var harr = hStrToArr(client.houseStr);
- for (var i = 0; i < harr.length; i++) {
- trace(harr[i]['ID'] + "harry");
- if (harr[i]['ID'] == changed) {
- trace("found!!");
- harr[i] = undefined;
- client.houseStr = hObjToStr(harr);
- }
- }
- } else if (changes == "Change") {
- var houseArr = hStrToArr(client.houseStr);
- for (var i = 0; i < houseArr.length; i++) {
- if (houseArr[i]['ID'] == changed) {
- houseArr[i]['x'] = arguments[1][changes][changed]['x'];
- houseArr[i]['y'] = arguments[1][changes][changed]['y'];
- client.houseStr = hObjToStr(houseArr);
- trace("new str: " + client.houseStr);
- }
- }
- } else if (changes == "Add") {
- var ek = [arguments[1][changes][changed]];
- client.houseStr = client.houseStr + hObjToStr(ek);
- }
- }
- }
- }
- if (descr == "ROOM") {
- for (var i = 0; i < application.clients.length; i++) {
- application.clients[i].call("_LC", null, client.smeshID, arguments[1], arguments[2]);
- }
- }
- } else if (methodName == "_SCA") {
- return true;
- } else if (methodName == "_QI") {
- return "0";
- } else if (methodName == "_NUC") {
- if (client.role >= "393230") {
- var ban = new LoadVars();
- ban.id = arguments[0];
- ban.ticket = client.ticket;
- ban.send(msHost + "/ban.php");
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].smeshID == arguments[0]) {
- application.clients[i].call("_NUB", [arguments[0], 162]);
- }
- }
- }
- } else if (methodName == "_WAR") {
- if (client.role >= "393230") {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].smeshID == arguments) {
- application.disconnect(application.clients[i]);
- }
- }
- }
- } else if (methodName == "_BG") {
- } else if (methodName == "_SDB") {
- client.backgroundID = arguments[0];
- var lv = new LoadVars();
- lv.bg = arguments[0];
- lv.ticket = client.ticket;
- lv.send(msHost + "/bg.php");
- trace(client.backgroundID + "bg");
- } else if (methodName == "_GG") {
- // 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}};
- // return '<item ID="243" GameName="ÐвигаÑелÑ" NameTRId="10094" TextResourceID="519" MediaResourceID="19456" ScoreDivisor="5" AvatarType="0" IsPromptUsed="1" IsFullscreen="1" IsShowPoints="1" Token="KfF7WUhsPUqxXOyMfCX5tZV45gKfeF9HhwPzfvmeRsw" />';
- 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" />';
- } else if (methodName == "_UUG") {
- return arguments;
- } else if (methodName == "_SAG") {
- //return {NameTRId: , BestsaleGoodIds, Goods Id, DaysLeft};
- return {
- callback_uid: callback
- };
- } else if (methodName == "_GD") {
- return "0";
- } else if (methodName == "_CUR") {
- return H2CA(rc4("<response MediaResourceID='" + arguments[0] + "' IsNotEnoughRole='0' IsNotEnoughLevel='0' IsNotEnoughMagicTickets='0' IsNotEnoughUsualTickets='0'></response>", "_level0"));
- } else if (methodName == "_MSTL") {
- return [];
- } else if (methodName == "_GD") {
- return "";
- } else if (methodName == "_GCI") {
- if (arguments == 4) {
- 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>';
- }
- } else if (methodName == "_C") {
- trace("Чат ", arguments[1], "id ", client.smeshID);
- if (arguments[1].indexOf("$G$") > -1) {
- var ret = arguments[1].replace("$G$", "");
- var m = Number(ret);
- var item = meme(Number(ret));
- var newItem = {
- ID: item["Id"],
- IsUsed: 0,
- IsLimited: 0,
- GoodID: item["Id"],
- Date: "2018-12-28T19:50:31.107",
- MediaResourceID: item["MRId"],
- TextResourceID: item["TRId"]
- };
- if (item["Id"] != "undefined") {
- if(item["IsExclusive"] == 1) {
- if(client.smeshID == item["OwnerID"] || client.role == 393230) {
- if (item["LayerId"] == 36) {
- client.inv[0].push(newItem);
- } else if (item["LayerId"] == 45) {
- client.inv[1].push(newItem);
- } else if (item["LayerId"] == 31) {
- client.inv[2].push(newItem);
- } else if (item["LayerId"] == 11) {
- client.inv[3].push(newItem);
- } else if (item["LayerId"] == 56) {
- client.inv[4].push(newItem);
- } else if (item["LayerId"] == 27) {
- client.inv[5].push(newItem);
- } else if (item["LayerId"] == 57) {
- client.inv[6].push(newItem);
- } else if (item["LayerId"] == 85) {
- client.backgroundID = ret;
- var lv = new LoadVars();
- lv.bg = ret;
- lv.ticket = client.ticket;
- lv.send(msHost + "/bg.php");
- trace("bg");
- // client.call("_SDB", null, ret);
- } else {
- trace("такого объекта нет!");
- }
- }
- } else {
- if (item["LayerId"] == 36) {
- client.inv[0].push(newItem);
- } else if (item["LayerId"] == 45) {
- client.inv[1].push(newItem);
- } else if (item["LayerId"] == 31) {
- client.inv[2].push(newItem);
- } else if (item["LayerId"] == 11) {
- client.inv[3].push(newItem);
- } else if (item["LayerId"] == 56) {
- client.inv[4].push(newItem);
- } else if (item["LayerId"] == 27) {
- client.inv[5].push(newItem);
- } else if (item["LayerId"] == 57) {
- client.inv[6].push(newItem);
- } else if (item["LayerId"] == 85) {
- client.backgroundID = ret;
- var lv = new LoadVars();
- lv.bg = ret;
- lv.ticket = client.ticket;
- lv.send(msHost + "/bg.php");
- trace("bg");
- // client.call("_SDB", null, ret);
- } else {
- trace("такого объекта нет!");
- }
- }
- }
- updateInventory(client.ticket, client.inv);
- return;
- }
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_C", null, client.smeshID, arguments[1]);
- }
- }
- } else if (methodName == "_AS") {
- //<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" />
- //trace([0]["BodyParts"][0]["Id"]);
- //"18108": { IsBodyPart: false, MediaResourceID: 464, GoodID: 38, GoodTypeID: 4, Id: 18108, LayerID: 45}
- var test = getBody(arguments[0]);
- var changes = arguments[0];
- for (var i = 0; i < 7; i++) {
- for (var itemId = 1; itemId < client.inv[i].length; itemId++) {
- if (client.inv[i][itemId] != undefined) {
- client.inv[i][itemId]["IsUsed"] = "0";
- }
- }
- }
- for (var i = 0; i < changes["Inventory"].length; i++) {
- var Id = changes["Inventory"][i]["Id"];
- var well = meme(changes["Inventory"][i]["Id"]);
- for (var id = 0; id < 7; id++) {
- for (var m = 0; m < client.inv[id].length; m++) {
- if (client.inv[id][m] != undefined && client.inv[id][m]["ID"] == Id) {
- client.inv[id][m]["IsUsed"] = "1";
- }
- }
- }
- }
- client.userObj["User"]["Body"] = test["User"]["Body"];
- usersArr[client.smeshID] = client.userObj;
- updateInventory(client.ticket, client.inv);
- var lv = new LoadVars();
- lv.avatar = pseudoArrayToNOCTMML(client.userObj['User']['Body']);
- lv.ticket = client.ticket;
- lv.send(msHost + "/setAvatar.php");
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_D", null, client.smeshID, client.userObj);
- }
- }
- return callback;
- } else if (methodName == "_CAQ") {
- return {
- "2": {
- "0": "1",
- "1": "esme"
- }
- };
- } else if (methodName == "_FL") {
- 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>';
- } else if (methodName == "_AG") {
- trace("_AG");
- 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 />';
- } else if (methodName == "_UI") {
- trace("_UI");
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].smeshID == arguments) {
- var cl = application.clients[i];
- }
- }
- 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>';
- } else if (methodName == "_NUM") {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_NUM", null, arguments[0], arguments[1], arguments[2]);
- }
- }
- } else if (methodName == "_NUS") {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_NUS", null, client.smeshID, arguments[1], arguments[2]);
- }
- }
- } else if (methodName == "_I") {
- trace("_I");
- var magic = ''
- for (i = 1; i < 282; i++) {
- magic += '<item Id="'+i+'" ExpirationDate="2020-04-28T19:50:31.107" IsLimited="0" />';
- }
- 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"))];
- return putin;
- } else if (methodName == "_UFG") {
- var obj = {};
- /*
- var u = client.ufg.split("|");
- for (var i = 0; i < u.length; i++) {
- var s = u[i].split(",");
- obj[s[0]] = {
- userId: s[0],
- UserName: s[1],
- IsOnline: true
- };
- }
- */
- return obj;
- } else if (methodName == "_UFR") {
- var obj = {};
- /*
- var ufrstr = client.ufr.split("|");
- for (var i = 0; i < ufrstr.length; i++) {
- var splitted = ufrstr[i].split(",");
- obj[i] = {
- userId: 3,
- UserName: splitted[1]
- };
- }
- */
- return obj;
- } else if (methodName == "_CM") {
- return "<clubmap />";
- } else if (methodName == "_LDH") {
- 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>';
- } else if (methodName == "_SNFP") {
- return '<root> <!-- we don\'t need this lol --> </root>';
- } else if (methodName == "_D") {
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_D", null, client.smeshID, client.userObj);
- }
- }
- } else if (methodName == "_LGI") {
- return travelPlaces[arguments[0]];
- } else if (methodName == "_LML") {
- return '<user_magic_level Level="10" TicketLevel="10" Days="0"><lesson QuestId="466" />';
- } else if (methodName == "_JD") {
- 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>';
- } else if (methodName == "_LG") {
- // for (var i = 0; i < application.clients.length; i++) {
- // if (application.clients[i].location == client.location && application.clients[i].smeshID != client.smeshID) {
- // application.clients[i].call("_UL", null, client.smeshID);
- // }
- // }
- if (arguments[1] == -1) {
- 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>';
- }
- if (locationsArray[arguments[1]]) {
- return locationsArray[arguments[1]];
- } else {
- return locationsArray[23];
- }
- } else if (methodName == "_UOG") {
- return true;
- } else if (methodName == "_GMB") {
- return {
- "Amount": 900000
- };
- } else if (methodName == "_MTB") {
- return {
- "Success": true
- };
- } else if (methodName == "_UOS") {
- trace("ШО");
- if (arguments == "SA_IsFirstStepPassed") {
- return true;
- }
- client.call("_UOS", null, arguments);
- } else if (methodName == "_UFO") {
- return '0';
- } else if (methodName == "_GOGI") {
- 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>';
- } else if (methodName == "_ULNS") {
- return true;
- } else if (methodName == "_DA") {
- return '<test ID="1" IsSecretAgent="1" IsMember="1" IsPresent="1" IsActive="1" Units="1" MessageID="1"></test>';
- } else if (methodName == "_GSD") {
- return '<Result SecToRun="3084" DefInterval="1200" IsActive="1" />';
- } else if (methodName == "_BGB") {
- for (var id in arguments[0][0]["item"]) {
- var value = arguments[0][0]["item"][id];
- trace(id + " = " + value);
- }
- if (arguments[0][0]["item"]["goodTypeId"] == 20) {
- var tesb = {
- ID: arguments[0][0]["item"]["id"],
- AObjectTypeId: 1,
- AObjectId: arguments[0][0]["item"]["id"],
- AObjectRefTypeId: 20,
- MediaResourceID: arguments[0][0]["item"]["MRid"],
- TextResourceID: arguments[0][0]["item"]["TRid"],
- IsActive: 0
- };
- homeInv.push(tesb);
- } else {
- var tesa = {
- ID: arguments[0][0]["item"]["id"],
- IsUsed: 0,
- IsLimited: 0,
- GoodID: arguments[0][0]["item"]["id"],
- Date: "2018-12-28T19:50:31.107",
- MediaResourceID: arguments[0][0]["item"]["MRid"],
- TextResourceID: arguments[0][0]["item"]["TRid"]
- };
- trace(arguments[0][0]["item"]["layerId"]);
- if (arguments[0][0]["item"]["layerId"] == 36) {
- client.inv[0].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 45) {
- client.inv[1].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 31) {
- client.inv[2].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 11) {
- client.inv[3].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 56) {
- client.inv[4].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 27) {
- client.inv[5].push(tesa);
- } else if (arguments[0][0]["item"]["layerId"] == 57) {
- client.inv[6].push(tesa);
- }
- }
- updateInventory(client.ticket, client.inv);
- return {
- Error: 0,
- Result: '<result><item Id="1"><Transaction /></item></result>',
- GoodInfo: 0,
- MagicTickets: 0,
- TRId: 0,
- GoodTypeId: 0,
- IsUnlock: true,
- UsualTickets: 0,
- GoodId: 0,
- GoodTypeTRId: 0,
- BelongType: 0
- };
- }
- }
- client._SCD = function() {
- return new Date();
- }
- }
- application.onDisconnect = function(client) {
- usersArr[client.smeshID] = undefined;
- for (var i = 0; i < application.clients.length; i++) {
- if (application.clients[i].location == client.location) {
- application.clients[i].call("_UL", null, client.smeshID);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement