Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.08 KB | None | 0 0
  1. class server.RTMPConnector extends NetConnection
  2. {
  3. var isClosed = false;
  4. function RTMPConnector()
  5. {
  6. super();
  7. mx.events.EventDispatcher.initialize(this);
  8. this._B = utilites.CallbackHandler.ApplyCallback;
  9. }
  10. function onStatus(info)
  11. {
  12. var _loc2_ = info.code.substring(info.code.indexOf(".") + 1);
  13. switch(_loc2_)
  14. {
  15. case "Сonnect.Success":
  16. this.dispatchEvent({target:this,type:"onConnect",info:info});
  17. break;
  18. case "Connect.InvalidApp":
  19. case "Connect.Rejected":
  20. this.OnConnectionClosed("onReject",info);
  21. break;
  22. case "Connect.Closed":
  23. this.OnConnectionClosed("onClose",info);
  24. break;
  25. case "Connect.Failed":
  26. this.OnConnectionClosed("onFail",info);
  27. break;
  28. case "Connect.AppShutdown":
  29. this.OnConnectionClosed("onClose",info);
  30. break;
  31. case "Call.Failed":
  32. this.dispatchEvent({target:this,type:"onCall",info:info});
  33. }
  34. }
  35. function connect()
  36. {
  37. this.isClosed = false;
  38. return super.connect.apply(super,arguments);
  39. }
  40. function close()
  41. {
  42. this.isClosed = true;
  43. super.close();
  44. }
  45. function AddMethodHandler(name, fn)
  46. {
  47. this[name] = fn;
  48. }
  49. function RemoveMethodHandler(name)
  50. {
  51. delete this.name;
  52. }
  53. function OnConnectionClosed(type, info)
  54. {
  55. if(!this.isClosed)
  56. {
  57. this.dispatchEvent({target:this,type:type,info:info});
  58. this.isClosed = true;
  59. }
  60. }
  61. function _MP(messageXml)
  62. {
  63. var _loc1_ = $.XMLToObject(new XML(messageXml).firstChild,{index:"Id"});
  64. I.__get__StatisticsManager().TrackEvent("","Games",_loc1_.SenderId,"Started");
  65. I.__get__UserContactData().AddNewPhoneMessage(_loc1_,true);
  66. }
  67. function _NP()
  68. {
  69. MessageBox.ShowOk(I.__get__ResourceManager().FormatString(utilites.Const.PHONE_CALL_IMPOSSIBLE_MSG_TEXT));
  70. }
  71. function _MC(messageXml)
  72. {
  73. I.__get__UserContactData().AddNewCardMessage(new XML(messageXml).firstChild.firstChild,true);
  74. }
  75. function _G(eventName, clientArguments, calledUserId)
  76. {
  77. I.__get__GameController().ApplyLocalEvent(eventName,clientArguments,calledUserId);
  78. }
  79. function _KS(result)
  80. {
  81. I.__get__BabyStatusController().OnUpdate(result);
  82. }
  83. function _NXK()
  84. {
  85. }
  86. function _UFLA(user)
  87. {
  88. I.__get__UserContactData().OnFriendsAdded(user);
  89. }
  90. function _UFLD(userId)
  91. {
  92. I.__get__UserContactData().OnFriendsRemoved(userId);
  93. }
  94. function _UFLR(user)
  95. {
  96. I.__get__UserContactData().OnFriendshipRequestAdded(user);
  97. }
  98. function _C(userId, Text)
  99. {
  100. var _loc3_ = undefined;
  101. if(I.__get__GameController())
  102. {
  103. I.__get__GameController().ApplyLocalEvent(utilites.Const.GAME_EVENT_ON_CHAT_MESSAGE,[Text],userId);
  104. _loc3_ = $.SelectObject(I.__get__GameController().GetGameUsers(),"ID",userId).Name;
  105. }
  106. else
  107. {
  108. var _loc2_ = Base.__get__Instance().Location.GetUserAvatar(userId) || I.__get__AvatarController().GetUserAvatar(userId);
  109. _loc2_.ShowTextBabble(Text);
  110. _loc3_ = _loc2_.AvatarData.Name;
  111. }
  112. if(Text.indexOf("$") != 0)
  113. {
  114. $.__get___().dispatchEvent({type:utilites.Const.RECEIVE_CHAT_MESSAGE,text:Text,userName:_loc3_,userId:userId});
  115. }
  116. }
  117. function _UE(userId, UserData)
  118. {
  119. if(I.__get__UserCollection())
  120. {
  121. I.__get__UserCollection().AddUser(userId,UserData);
  122. }
  123. else
  124. {
  125. Base.__get__Instance().Location.UserCollection.AddUser(userId,UserData);
  126. }
  127. }
  128. function _UL(userId)
  129. {
  130. if(I.__get__UserCollection())
  131. {
  132. I.__get__UserCollection().RemoveUser(userId);
  133. }
  134. else
  135. {
  136. Base.__get__Instance().Location.UserCollection.RemoveUser(userId);
  137. }
  138. }
  139. function _LS(usersData)
  140. {
  141. if(I.__get__UserCollection())
  142. {
  143. I.__get__UserCollection().AddUserList(usersData);
  144. }
  145. else
  146. {
  147. Base.__get__Instance().Location.UserCollection.AddUserList(usersData);
  148. }
  149. $.__get___().dispatchEvent({type:"onEnterLocation",usersData:usersData});
  150. }
  151. function _LC(ownerId, locationId, changes)
  152. {
  153. if(I.__get__Users().GetSelfUserID() != ownerId && Base.__get__Instance().Location.LocationId == locationId)
  154. {
  155. Base.__get__Instance().Location.ApplyLocationChanges(changes);
  156. }
  157. }
  158. function _LR(requestUserId)
  159. {
  160. if(requestUserId == Base.__get__Instance().Location.OwnerId)
  161. {
  162. var _loc1_ = Base.__get__Instance().Location;
  163. if(_loc1_.IsHome)
  164. {
  165. LocationController.CreateLocation(requestUserId,utilites.Const.LOCATION_HOME,undefined,true);
  166. }
  167. if(_loc1_.IsClub)
  168. {
  169. if(_loc1_.IsMyLocation)
  170. {
  171. LocationController.CreateLocation(requestUserId,utilites.Const.LOCATION_CLUB,undefined,true);
  172. }
  173. else
  174. {
  175. MessageBox.ShowOk(I.__get__ResourceManager().GetStringH(5388),$.Fn(I.__get__Link(),I.__get__Link().ExecuteAction,"R$28"));
  176. }
  177. }
  178. }
  179. }
  180. function _CAQ(userId, userName)
  181. {
  182. if($.SelectObjectId(location.ClubAccessQueue.__get__Instance().__get__Data(),"UserId",userId) == undefined && !Base.__get__Instance().Location.IsLocked)
  183. {
  184. location.ClubAccessQueue.__get__Instance().Add({UserId:userId,UserName:userName});
  185. }
  186. }
  187. function _CAO(userId, userName, orderData)
  188. {
  189. if(!Base.__get__Instance().Location.IsLocked)
  190. {
  191. orderData.UserId = userId;
  192. orderData.UserName = userName;
  193. location.ClubOrderQueue.__get__Instance().Add(orderData);
  194. }
  195. }
  196. function _CAR(ownerId, isAllowed)
  197. {
  198. if(Base.__get__Instance().Location.IsClub && Base.__get__Instance().Location.OwnerId == ownerId && !I.__get__Users().IsModerator())
  199. {
  200. if(isAllowed)
  201. {
  202. LocationController.EnterClub(true);
  203. }
  204. else
  205. {
  206. MessageBox.ShowOk(I.__get__ResourceManager().GetStringH(5389),$.Fn(I.__get__Link(),I.__get__Link().ExecuteAction,"R$28"));
  207. }
  208. }
  209. }
  210. function _LT()
  211. {
  212. }
  213. function _NNT(usualTickets, magicTickets)
  214. {
  215. var _loc3_ = Base.__get__Storage().user_data.UsualTickets;
  216. var _loc4_ = Base.__get__Storage().user_data.MagicTickets;
  217. Base.__get__Storage().user_data.UsualTickets = usualTickets;
  218. Base.__get__Storage().user_data.MagicTickets = magicTickets;
  219. $.__get___().dispatchEvent({type:"onTicketsUpdated",usualTickets:usualTickets,magicTickets:magicTickets,oldUsualTickets:_loc3_,oldMagicTickets:_loc4_});
  220. }
  221. function _NNE(experience, level)
  222. {
  223. Base.__get__Storage().user_data.Experience = experience;
  224. Base.__get__Storage().user_data.Level = level;
  225. $.__get___().dispatchEvent({type:"onExperienceUpdated",experience:experience,level:level});
  226. I.__get__CatalogsFacade().UpdateLevelUnlocks();
  227. }
  228. function _NNR(roleFlags)
  229. {
  230. var _loc3_ = Base.__get__Storage().user_data.RoleFlags;
  231. Base.__get__Storage().user_data.RoleFlags = roleFlags;
  232. $.__get___().dispatchEvent({type:"onRolesUpdated",oldRoleFlags:_loc3_,newRoleFlags:roleFlags});
  233. }
  234. function _SCN(type, data)
  235. {
  236. }
  237. function _NNL(licenceId, description, cost)
  238. {
  239. I.__get__StatisticsManager().TrackQuickTransaction("","Cash",String(20000 + licenceId),description,"License",cost);
  240. }
  241. function _GAE(category, action, label, value)
  242. {
  243. I.__get__StatisticsManager().TrackEvent("",category,action,label,value);
  244. }
  245. function _NUK(userId, FrameName)
  246. {
  247. if(I.__get__AvatarController())
  248. {
  249. I.__get__AvatarController().GetBabyAvatar(userId).PlayBabyAnimation(FrameName);
  250. }
  251. else
  252. {
  253. Base.__get__Instance().Location.GetBabyAvatar(userId).PlayBabyAnimation(FrameName);
  254. }
  255. }
  256. function _P(userId, point, tweenerId)
  257. {
  258. if(I.__get__AvatarController())
  259. {
  260. I.__get__AvatarController().OnRemotePositionChanged(userId,utilites.Point.FromObject(point),tweenerId);
  261. }
  262. else
  263. {
  264. Base.__get__Instance().Location.OnRemotePositionChanged(userId,utilites.Point.FromObject(point),tweenerId);
  265. }
  266. }
  267. function _S(userId, state)
  268. {
  269. if(I.__get__AvatarController())
  270. {
  271. I.__get__AvatarController().OnRemoteStateChanged(userId,state);
  272. }
  273. else
  274. {
  275. Base.__get__Instance().Location.OnRemoteStateChanged(userId,state);
  276. }
  277. }
  278. function _PS(userId, FrameName)
  279. {
  280. if(I.__get__AvatarController())
  281. {
  282. I.__get__AvatarController().GetBabyAvatar(userId).AttachPetQualities(FrameName);
  283. }
  284. else
  285. {
  286. Base.__get__Instance().Location.GetBabyAvatar(userId).AttachPetQualities(FrameName);
  287. }
  288. }
  289. function _SS(userId, hidden)
  290. {
  291. if(I.__get__AvatarController())
  292. {
  293. I.__get__AvatarController().OnRemoteSecrecyChanged(userId,hidden);
  294. }
  295. else
  296. {
  297. Base.__get__Instance().Location.OnRemoteSecrecyChanged(userId,hidden);
  298. }
  299. }
  300. function _NUM(userId, abilityId, targetUserId)
  301. {
  302. I.__get__MagicAbility().Use(abilityId,true,userId,targetUserId);
  303. }
  304. function _D(userId, userData)
  305. {
  306. var _loc1_ = Base.__get__Instance().Location.GetUserAvatar(userId) || I.__get__AvatarController().GetUserAvatar(userId);
  307. var _loc3_ = Base.__get__Instance().Location.GetBabyAvatar(userId) || I.__get__AvatarController().GetBabyAvatar(userId);
  308. _loc1_.RoleFlags = userData.RoleFlags;
  309. _loc1_.UpdateData(userData.User);
  310. if(userData.Pet)
  311. {
  312. if(_loc3_)
  313. {
  314. _loc3_.UpdateData(userData.Pet);
  315. }
  316. else if(I.__get__AvatarController())
  317. {
  318. I.__get__AvatarController().CreatePetAvatar(_loc1_,userData.Pet);
  319. }
  320. else
  321. {
  322. Base.__get__Instance().Location.CreatePetAvatar(_loc1_,userData.Pet);
  323. }
  324. }
  325. else if(_loc3_)
  326. {
  327. _loc1_.RemoveChild(0);
  328. }
  329. }
  330. function _NUB(TRID0, TRID1)
  331. {
  332. kernel.ErrorHandler.AbuseBanMessage(TRID1);
  333. }
  334. function _NNM(text)
  335. {
  336. I.__get__MessageBox().ShowOk(text);
  337. }
  338. function _NUS(userId, x, y, weaponType, whizbangType)
  339. {
  340. new firing.ShootHandler(userId,x,y,weaponType,whizbangType);
  341. }
  342. function _BCLS(userId, locationId, isLocked)
  343. {
  344. kernel.informer.OpenClubController.__get__Instance().ChangeClubState(userId,locationId,isLocked);
  345. }
  346. function _NUD(userId, orderData)
  347. {
  348. if(Base.__get__Instance().Location.OwnerId == userId)
  349. {
  350. if(I.__get__AvatarController())
  351. {
  352. I.__get__AvatarController().GetUserAvatar(orderData.UserId).AttachFoodOrder(orderData);
  353. }
  354. else
  355. {
  356. Base.__get__Instance().Location.GetUserAvatar(orderData.UserId).AttachFoodOrder(orderData);
  357. }
  358. }
  359. }
  360. function _SDE(key, parameters)
  361. {
  362. kernel.BoomboxPlayer.DoEvent(key,parameters);
  363. }
  364. function _SSS(info)
  365. {
  366. kernel.BoomboxPlayer.SetStateSound(info);
  367. }
  368. function _QUS(name, state, queue)
  369. {
  370. kernel.queue.QueueSessionController.UpdateState(name,state,queue);
  371. }
  372. function _MT(messageXml)
  373. {
  374. I.__get__TMessageController().UpdateMessage(messageXml);
  375. }
  376. function _AM(missionXml)
  377. {
  378. I.__get__MissionController().Update(missionXml);
  379. }
  380. function _ROE(event)
  381. {
  382. I.__get__RoomObjectFactory().OnEvent(event);
  383. }
  384. function _NNN(typeId, xml)
  385. {
  386. switch(typeId)
  387. {
  388. case 13:
  389. var _loc2_ = $.XMLToObject(new XML(xml),{index:"Id"});
  390. modules.BaseModule.ShowLevelNotice(modules.BaseModule.POPUP_LEVEL_CONGRATULATION,null,_loc2_.data);
  391. break;
  392. case 15:
  393. _loc2_ = $.XMLToObject(new XML(xml),{index:"Id"});
  394. Base.__get__Storage().GrantsCount = Base.__get__Storage().GrantsCount + $.Count(_loc2_);
  395. I.__get__CounterController().SetCounter(utilites.Const.COUNTER_GRANT,Base.__get__Storage().GrantsCount + Base.__get__Storage().RequestsCount);
  396. break;
  397. case 18:
  398. _loc2_ = $.XMLToObject(new XML(xml),{index:"Id"});
  399. Base.__get__Storage().RequestsCount = Base.__get__Storage().RequestsCount + $.Count(_loc2_);
  400. I.__get__CounterController().SetCounter(utilites.Const.COUNTER_GRANT,Base.__get__Storage().GrantsCount + Base.__get__Storage().RequestsCount);
  401. break;
  402. case 21:
  403. _loc2_ = $.XMLToObject(new XML(xml),{index:"Id",convert:{NewPositiveEnergy:Number,OldPositiveEnergy:Number}});
  404. var _loc3_ = _loc2_.data.NewPositiveEnergy;
  405. var _loc4_ = _loc2_.data.OldPositiveEnergy;
  406. Base.__get__Storage().user_data.PositiveEnergy = _loc3_;
  407. $.__get___().dispatchEvent({type:"onPositiveEnergyUpdated",oldPositiveEnergy:_loc4_,newPositiveEnergy:_loc3_});
  408. break;
  409. case 19:
  410. I.__get__NoticesController().addCachedNotice(100004);
  411. break;
  412. case 40:
  413. var _loc5_ = new storage.pets_list.PetsListVO(new XML(xml).firstChild);
  414. I.__get__Base().Storage().pets_list = _loc5_;
  415. I.__get__FMSApi().UpdateUserData(true);
  416. break;
  417. case 41:
  418. modules.BaseModule.ShopPetVarietyPopup(10);
  419. break;
  420. case 42:
  421. modules.BaseModule.ShopPetVarietyPopup(11,new XML(xml).firstChild);
  422. break;
  423. case 43:
  424. modules.BaseModule.ShopPetVarietyPopup(12,new XML(xml).firstChild);
  425. break;
  426. default:
  427. I.__get__NoticesController().addNotice(typeId,xml);
  428. }
  429. }
  430. function _MQI(userMiniquestId, miniquestId)
  431. {
  432. I.__get__MiniQuestsFacade().serverQuestInited(userMiniquestId,miniquestId);
  433. }
  434. function _MQF(userMiniquestId)
  435. {
  436. I.__get__MiniQuestsFacade().serverQuestFinished(userMiniquestId);
  437. }
  438. function _MQTI(userMiniquestTaskId, userMiniquestId, taskId)
  439. {
  440. I.__get__MiniQuestsFacade().serverQuestTaskInited(userMiniquestId,userMiniquestTaskId,taskId);
  441. }
  442. function _MQTU(userMiniquestTaskId, userMiniquestId, count)
  443. {
  444. I.__get__MiniQuestsFacade().serverQuestTaskUpdated(userMiniquestId,userMiniquestTaskId,count);
  445. }
  446. function _MQTF(userMiniquestTaskId, userMiniquestId)
  447. {
  448. I.__get__MiniQuestsFacade().serverQuestTaskFinished(userMiniquestId,userMiniquestTaskId);
  449. }
  450. function _UGGR()
  451. {
  452. trace(arguments);
  453. }
  454. function _UDF(list)
  455. {
  456. I.__get__PEObjectsController().setObjectsData(list);
  457. }
  458. function _PDQ(qualities)
  459. {
  460. I.__get__Base().Storage().pets_list.updateCurrentPetQualities(new XML(qualities).firstChild);
  461. }
  462. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement