Advertisement
Guest User

main

a guest
Aug 25th, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.03 KB | None | 0 0
  1. load("components.asc");
  2.  
  3. application.topic = "";
  4. application.cameraNo = 0;
  5. application.performer = null;
  6. application.hash = null;
  7. application.fmsId = null;
  8.  
  9. application.flvName = null;
  10.  
  11. application.videoStream;
  12.  
  13. application.baseUrl = "http://www.pcheld.nl/arco/chat/";
  14. application.banUrl = "fms/banmanager";
  15. application.authUrl = "fms/auth";
  16. application.authPerformerUrl = "performer/fms/auth";
  17. application.taxUrl = "fms/tax";
  18. application.truePrivateUrl = "fms/trueprivate";
  19. application.endSessionUrl = "fms/endsession";
  20. application.chatLogUrl = "fms/log";
  21. application.tipUrl = "fms/tip";
  22. application.validateChipsUrl = "fms/validatechips";
  23.  
  24. application.onAppStart = function()
  25. {
  26. trace("onAppStart");
  27.  
  28. application.allowDebug = true;
  29. }
  30.  
  31. application.onConnect = function(clientObj, performerId, pasword,
  32. userId, userType, userName, uniqId, sessionType, md5Check, truePrivate)
  33. {
  34. load("hash.as");
  35. trace("onConnect");
  36. application.hash = hash;
  37. application.fmsId = md5Check;
  38. trace("onConnect, performerId: " + performerId + ", pasword: " +
  39. pasword + ", userId: " + userId + ", userType: " + userType +
  40. ", userName: ", userName + ", uniqId: " +
  41. uniqId + ", sessionType: " + sessionType + ", md5Check: " + md5Check + ", truePrivate: " + truePrivate);
  42.  
  43. // Set the number of cameras activated if performer
  44. if(userType == "performer")
  45. {
  46. application.cameraNo = sessionType;
  47. application.performer = clientObj;
  48. }
  49.  
  50. application.initClient(clientObj);
  51.  
  52. clientObj.userId = userId;
  53.  
  54. clientObj.releaseStream = function() { trace("releaseStream"); };
  55. clientObj.FCPublish = function() { trace("FCPublish"); };
  56. clientObj.FCUnpublish = function() { trace("FCUnpublish"); };
  57.  
  58. // TODO: Check if user isnt logged in already
  59. // Variables
  60. application.acceptConnection(clientObj);
  61. clientObj.userType = userType;
  62. clientObj.userName = userName;
  63. clientObj.performerId = performerId;
  64. clientObj.pasword = pasword;
  65. clientObj.sessionType = sessionType;
  66. clientObj.uniqId = uniqId;
  67. clientObj.truePrivate = truePrivate;
  68. clientObj.md5Check = md5Check;
  69.  
  70. if(userType == "viewer" || userType == "performer")
  71. application.userCheck(clientObj);
  72. else
  73. application.initClientInterval(clientObj);
  74. };
  75.  
  76. application.initClient = function(clientObj)
  77. {
  78. // Functions
  79. clientObj.broadcastChatLine = application.broadcastChatLine;
  80. clientObj.broadcastChatLineIcon = application.broadcastChatLineIcon;
  81. clientObj.updateTopic = application.updateTopic;
  82. clientObj.getTopic = application.getTopic;
  83. clientObj.askForNumberOfCameras = application.askForNumberOfCameras;
  84. clientObj.ask_song = application.ask_song;
  85. clientObj.change_song = application.change_song;
  86. clientObj.send_song = application.send_song;
  87. clientObj.initializeSpy = application.initializeSpy;
  88. clientObj.rec = application.rec;
  89. clientObj.recStop = application.recStop;
  90. clientObj.kick = application.kick;
  91. clientObj.ban = application.ban;
  92. clientObj.kickSelf = application.kickSelf;
  93. clientObj.banSelf = application.banSelf;
  94. clientObj.privateInvitation = application.privateInvitation;
  95. clientObj.acceptInvitation = application.acceptInvitation;
  96. clientObj.enterPrivate = application.enterPrivate;
  97. clientObj.changeSessionTypeToPrivate = application.changeSessionTypeToPrivate;
  98. clientObj.rejectInvitation = application.rejectInvitation;
  99. clientObj.tipPerfromer = application.tipPerfromer;
  100. clientObj.setViewerBroadcast = application.setViewerBroadcast;
  101. clientObj.getFmsVersion = application.getFmsVersion;
  102.  
  103. if(clientObj.userType == "viewer")
  104. {
  105. clientObj.taxIntervalId = setInterval(application.checkTax, 5000, clientObj);
  106. }
  107.  
  108. trace("User is ACEPTED");
  109. }
  110.  
  111. application.initClientInterval = function(clientObj)
  112. {
  113. if(clientObj.userType == "viewer")
  114. {
  115. clientObj.taxIntervalId = setInterval(application.checkTax, 5000, clientObj);
  116. }
  117.  
  118. trace("User is ACCEPTED");
  119. }
  120.  
  121. application.checkTax = function(client)
  122. {
  123. trace("checkTax " + client.sessionType);
  124.  
  125. // Check if the user has session still
  126. var isLoggedIn = false;
  127. var clients = application.clients;
  128. var n = clients.length;
  129. for(var i = 0; i < n; i++)
  130. {
  131. if(clients[i] == client)
  132. {
  133. isLoggedIn = true;
  134. break;
  135. }
  136. }
  137.  
  138. if(!isLoggedIn)
  139. clearInterval(client.taxIntervalId);
  140.  
  141. var taxSendLV = new LoadVars();
  142. var taxRecvLV = new LoadVars();
  143. taxSendLV.userId = client.userId;
  144. taxSendLV.userType = client.userType;
  145. taxSendLV.pasword = client.pasword;
  146. taxSendLV.uniqId = client.uniqId;
  147. taxSendLV.performerId = client.performerId;
  148. taxSendLV.truePrivate = client.truePrivate;
  149. taxSendLV.sessionType = (client.sessionType == "true_private") ? "private" : client.sessionType;
  150. taxSendLV.hash = application.hash;
  151.  
  152. taxSendLV.sendAndLoad(application.baseUrl + application.taxUrl, taxRecvLV, "POST");
  153.  
  154. taxRecvLV.onLoad = function(success)
  155. {
  156. if (success)
  157. {
  158. if (this.status == "allow")
  159. {
  160. //trace("Tax allowed " + this.status);
  161. }
  162. else
  163. {
  164. trace("Tax denied " + this.status);
  165.  
  166. application.disconnect(client);
  167. }
  168. }
  169. else
  170. {
  171. trace("Call to tax unsuccess");
  172. }
  173. }
  174. }
  175.  
  176. application.userCheck = function(client)
  177. {
  178. var urlParams = "ip=" + client.ip + "&userId=" + client.userId +
  179. "&userType=" + client.userType + "&pasword=" + client.pasword +
  180. "&uniqId=" + client.uniqId + "&userName=" + client.userName +
  181. "&performerId=" + client.performerId + "&hash=" + hash;
  182. var authSendLV = new LoadVars();
  183. var authRecvLV = new LoadVars();
  184. authSendLV.ip = client.ip;
  185. authSendLV.userId = client.userId;
  186.  
  187. authSendLV.userType = client.userType;
  188. authSendLV.pasword = client.pasword;
  189. authSendLV.uniqId = client.uniqId;
  190. authSendLV.userName = client.userName;
  191. authSendLV.performerId = client.performerId;
  192. authSendLV.hash = application.hash;
  193.  
  194. if(client.userType == "performer")
  195. {
  196. authSendLV.numberOfCameras = application.cameraNo;
  197.  
  198. urlParams += "&numberOfCameras=" + application.cameraNo;
  199. }
  200.  
  201. if(client.userType == "viewer")
  202. {
  203. authSendLV.sessionType = client.sessionType;
  204. authSendLV.md5 = client.md5Check;
  205. authSendLV.truePrivate = (client.truePrivate == null) ? false : client.truePrivate;
  206. urlParams += "&sessionType=" + client.sessionType + "&md5=" + client.md5Check + "&truePrivate=" + authSendLV.truePrivate;
  207. }
  208.  
  209. trace(urlParams);
  210.  
  211. if(client.userType == "viewer")
  212. authSendLV.sendAndLoad(application.baseUrl + application.authUrl, authRecvLV, "POST");
  213. else if(client.userType == "performer")
  214. authSendLV.sendAndLoad(application.baseUrl + application.authPerformerUrl, authRecvLV, "POST");
  215.  
  216. authRecvLV.onLoad = function(success)
  217. {
  218. if (success)
  219. {
  220. if (this.status == "allow")
  221. {
  222. trace("Auth allowed " + this.status);
  223. application.initClientInterval(client);
  224. }
  225. else
  226. {
  227. trace("Auth denied " + this.status);
  228. }
  229. }
  230. else
  231. {
  232. trace("Call to auth unsuccess");
  233. }
  234. }
  235. }
  236.  
  237. application.updateTopic = function(topic)
  238. {
  239. trace("updateTopic " + topic);
  240.  
  241. application.topic = topic;
  242.  
  243. var clients = application.clients;
  244. var n = clients.length;
  245. for(var i = 0; i < n; i++)
  246. {
  247. clients[i].call("updateTopic", null, topic);
  248. }
  249. }
  250.  
  251. application.getTopic = function()
  252. {
  253. trace("getTopic " + application.topic + ", " + this);
  254. return application.topic;
  255. }
  256.  
  257. application.askForNumberOfCameras = function()
  258. {
  259. trace("askForNumberOfCameras " + application.cameraNo);
  260.  
  261. var clients = application.clients;
  262. var n = clients.length;
  263. for(var i = 0; i < n; i++)
  264. {
  265. if(clients[i].userType != "performer")
  266. clients[i].call("setCameraNo", null, application.cameraNo);
  267. }
  268. }
  269.  
  270. application.ask_song = function()
  271. {
  272. trace("ask_song " + this.userId);
  273.  
  274. var clients = application.clients;
  275. var n = clients.length;
  276. for(var i = 0; i < n; i++)
  277. {
  278. if(clients[i].userType == "performer")
  279. clients[i].call("ask_song", null, this.userId);
  280. }
  281. }
  282.  
  283. application.send_song = function(song_path, position, id, title)
  284. {
  285. trace("send_song " + song_path + ", " + position + ", " + id + ", " + title);
  286.  
  287. var clients = application.clients;
  288. var n = clients.length;
  289. for(var i = 0; i < n; i++)
  290. {
  291. if(clients[i].userId == id)
  292. clients[i].call("send_song", null, song_path, position, title);
  293. }
  294. }
  295.  
  296. application.change_song = function(path, title)
  297. {
  298. trace("change_song " + path + ", " + title);
  299.  
  300. var clients = application.clients;
  301. var n = clients.length;
  302. for(var i = 0; i < n; i++)
  303. {
  304. clients[i].call("play_song", null, path, title);
  305. }
  306. }
  307.  
  308. application.initializeSpy = function()
  309. {
  310. trace("initializeSpy");
  311. }
  312.  
  313. application.onPublish = function(clientObj, streamObj)
  314. {
  315. trace("onPublish " + clientObj + ", " + streamObj);
  316. }
  317.  
  318. application.onUnpublish = function(clientObj, streamObj)
  319. {
  320. trace("onUnpublish " + clientObj + ", " + streamObj);
  321. }
  322.  
  323. application.onStatus = function(info){
  324. trace("code: " + info.code + " level: " + info.level);
  325. trace(info.code + " details: " + info.details);
  326. };
  327.  
  328. application.onStreamStatus = function(infoObject)
  329. {
  330. trace("onStreamStatus " + infoObject.code + ", " + infoObject.description + ", " + infoObject.details + ", " + infoObject.level);
  331. }
  332.  
  333. application.rec = function(flvName, recStreamName, type)
  334. {
  335. trace("rec " + flvName + ", " + recStreamName + ", " + type);
  336. application.flvName = flvName;
  337.  
  338. application.videoStream = Stream.get(flvName);
  339.  
  340. if(application.videoStream)
  341. {
  342. application.videoStream.onStatus = application.onStreamStatus;
  343. trace("video stream recording");
  344. application.videoStream.record();
  345. application.videoStream.play(recStreamName);
  346. }
  347. }
  348.  
  349. application.recStop = function(type)
  350. {
  351. trace("recstop " + type);
  352.  
  353. if(application.videoStream)
  354. {
  355. trace("Stream length " + Stream.length(application.flvName));
  356. //application.videoStream.flush();
  357. application.videoStream.record(false);
  358. trace("Stream length " + Math.floor(Stream.length(application.flvName)));
  359. }
  360.  
  361. var taxSendLV = new LoadVars();
  362. var taxRecvLV = new LoadVars();
  363. taxSendLV.performerId = application.performer.performerId;
  364. taxSendLV.userId = application.performer.userId;
  365. taxSendLV.userType = application.performer.userType;
  366. taxSendLV.uniqId = application.performer.uniqId;
  367. taxSendLV.pasword = application.performer.pasword;
  368. taxSendLV.lengt = Math.floor(Stream.length(application.flvName));
  369. taxSendLV.fmsId = application.fmsId;
  370. taxSendLV.flvName = application.flvName;
  371. taxSendLV.type = type;
  372. taxSendLV.hash = application.hash;
  373.  
  374. taxSendLV.sendAndLoad(application.baseUrl + "fms/addvideo", taxRecvLV, "POST");
  375.  
  376. taxRecvLV.onLoad = function(success)
  377. {
  378. if (success)
  379. {
  380. if (this.status == "allow")
  381. {
  382. trace("rec allowed " + this.status);
  383. }
  384. else
  385. {
  386. trace("rec denied " + this.status + ", " + this.log);
  387. }
  388. }
  389. else
  390. {
  391. trace("Call to rec unsuccess");
  392. }
  393. }
  394. }
  395.  
  396. application.kick = function(id)
  397. {
  398. trace("kick " + id);
  399.  
  400. var clients = application.clients;
  401. var n = clients.length;
  402. for(var i = 0; i < n; i++)
  403. {
  404. if(clients[i].userId == id)
  405. {
  406. clients[i].call("disconMes", null, "kick");
  407.  
  408. application.disconnect(clients[i]);
  409. break;
  410. }
  411. }
  412. }
  413.  
  414. application.kickSelf = function()
  415. {
  416. application.kick(this.userId);
  417. }
  418.  
  419. application.ban = function(id)
  420. {
  421. trace("ban " + id);
  422.  
  423. var clients = application.clients;
  424. var n = clients.length;
  425. for(var i = 0; i < n; i++)
  426. {
  427. if(clients[i].userId == id)
  428. {
  429. var banSendLV = new LoadVars();
  430. var banRecvLV = new LoadVars();
  431. banSendLV.ip = clients[i].ip;
  432. banSendLV.bannedUserId = id;
  433. banSendLV.userId = this.userId;
  434. banSendLV.pasword = this.pasword;
  435. banSendLV.performerId = clients[i].performerId;
  436. banSendLV.sendAndLoad(application.baseUrl + application.banUrl, banRecvLV, "POST");
  437. banRecvLV.onLoad = function(success)
  438. {
  439. if (success)
  440. {
  441. clients[i].call("disconMes", null, "ban");
  442.  
  443. application.disconnect(clients[i]);
  444. trace("user banned successfully");
  445. }
  446. else
  447. {
  448. trace("Error banning user");
  449. }
  450. }
  451. break;
  452. }
  453. }
  454. }
  455.  
  456. application.banSelf = function()
  457. {
  458. application.ban(this.userId);
  459. }
  460.  
  461. application.privateInvitation = function(userName, userId, chips)
  462. {
  463. trace("privateInvitation " + userName + ", " + userId + ", " + chips);
  464.  
  465. var clients = application.clients;
  466. var n = clients.length;
  467. for(var i = 0; i < n; i++)
  468. {
  469. if(clients[i].userId == userId)
  470. {
  471. var validateChipsSendLV = new LoadVars();
  472. var validateChipsRecvLV = new LoadVars();
  473. validateChipsSendLV.ip = clients[i].ip;
  474. validateChipsSendLV.userId = userId;
  475. validateChipsSendLV.userName = userName;
  476. validateChipsSendLV.userType = clients[i].userType;
  477. validateChipsSendLV.pasword = clients[i].pasword;
  478. validateChipsSendLV.performerId = clients[i].performerId;
  479. validateChipsSendLV.uniqId = clients[i].uniqId;
  480. validateChipsSendLV.hash = application.hash;
  481.  
  482. validateChipsSendLV.sendAndLoad(application.baseUrl + application.validateChipsUrl, validateChipsRecvLV, "POST");
  483.  
  484. validateChipsRecvLV.onLoad = function(success)
  485. {
  486. if(success)
  487. {
  488. if(this.status == "allow")
  489. application.performer.call("privateInvitation", null, userName, userId, chips);
  490.  
  491. trace("validate chips " + this.status + ", log" + this.log);
  492. }
  493. else
  494. {
  495. trace("validate chips unsuccessful");
  496. }
  497. }
  498. }
  499. if(clients[i].userType == "performer")
  500. {
  501. clients[i].call("privateInvitation", null, userName, userId, chips);
  502. }
  503. }
  504. }
  505.  
  506. application.acceptInvitation = function(id)
  507. {
  508. trace("acceptInvitation " + id);
  509.  
  510. var clients = application.clients;
  511. var n = clients.length;
  512. for(var i = 0; i < n; i++)
  513. {
  514. if(clients[i].userId == id)
  515. {
  516. clients[i].call("acceptInvitation", null);
  517. }
  518. }
  519. }
  520.  
  521. application.rejectInvitation = function(id)
  522. {
  523. trace("rejectInvitation " + id);
  524.  
  525. var clients = application.clients;
  526. var n = clients.length;
  527. for(var i = 0; i < n; i++)
  528. {
  529. if(clients[i].userId == id)
  530. {
  531. clients[i].call("rejectInvitation", null);
  532. break;
  533. }
  534. }
  535. }
  536.  
  537. application.enterPrivate = function()
  538. {
  539. trace("enterPrivate");
  540.  
  541. var clients = application.clients;
  542. var n = clients.length;
  543. for(var i = 0; i < n; i++)
  544. {
  545. /*if(clients[i].userType == "performer")
  546. clients[i].call("changeStatus", null, "private");*/
  547. }
  548. }
  549.  
  550. application.changeSessionTypeToPrivate = function(isRealPrivate)
  551. {
  552. var privateSendLV = new LoadVars();
  553. var privateRecvLV = new LoadVars();
  554. privateSendLV.userId = this.userId;
  555. privateSendLV.uniqId = this.uniqId;
  556. privateSendLV.performerId = this.performerId;
  557. privateSendLV.isTruePrivate = isRealPrivate;
  558. privateSendLV.hash = application.hash;
  559.  
  560. privateSendLV.sendAndLoad(application.baseUrl + application.truePrivateUrl, privateRecvLV, "POST");
  561.  
  562. privateRecvLV.onLoad = function(success)
  563. {
  564. if (success)
  565. {
  566. trace("trueprivate called successfully");
  567. }
  568. else
  569. {
  570. trace("Call to trueprivate unsuccess");
  571. }
  572. }
  573.  
  574. trace("changeSessionTypeToPrivate " + isRealPrivate);
  575. this.truePrivate = isRealPrivate;
  576. this.sessionType = (isRealPrivate == "true") ? "true_private" : "private";
  577.  
  578. application.performer.call("changeStatus", null, "private");
  579.  
  580. var clients = application.clients;
  581. var n = clients.length;
  582. for(var i = 0; i < n; i++)
  583. {
  584. if(clients[i] == this)
  585. {
  586. clients[i].call("changeStatus", null, "private");
  587. }
  588. else if(clients[i].userType != "performer")
  589. {
  590. //if(isRealPrivate == "true")
  591. clients[i].call("disconMes", null, "private");
  592. /*else
  593. clients[i].call("disconMes", null, "private_public");*/
  594.  
  595. application.disconnect(clients[i]);
  596. }
  597. }
  598. }
  599.  
  600. application.setViewerBroadcast = function(status)
  601. {
  602. trace("setViewerBroadcast " + status);
  603.  
  604. var clients = application.clients;
  605. var n = clients.length;
  606. for(var i = 0; i < n; i++)
  607. {
  608. if(clients[i].userType == "performer")
  609. {
  610. clients[i].call("setViewerBroadcast", null, status, this.userId);
  611. }
  612. }
  613. }
  614.  
  615. application.chatLogs = "";
  616.  
  617. application.broadcastChatLine = function(userName, message, userId, nickColor)
  618. {
  619. trace("broadcastChatLine " + userName + ", " + message + ", " + userId, ", " + nickColor);
  620.  
  621. var clients = application.clients;
  622. var n = clients.length;
  623. for(var i = 0; i < n; i++)
  624. {
  625. clients[i].call("getMsg", null, userName, message, userId, nickColor);
  626. }
  627.  
  628. application.chatLogs += message + " ";
  629. }
  630.  
  631. application.broadcastChatLineIcon = function(userName, message, userId, nickColor)
  632. {
  633. trace("broadcastChatLineIcon " + userName + ", " + message + ", " + userId, ", " + nickColor);
  634.  
  635. var clients = application.clients;
  636. var n = clients.length;
  637. for(var i = 0; i < n; i++)
  638. {
  639. clients[i].call("getMsg", null, userName, message, userId, nickColor);
  640. }
  641.  
  642. application.chatLogs += message + " ";
  643. }
  644.  
  645. application.getFmsVersion = function()
  646. {
  647. return FMS_VERSION;
  648. }
  649.  
  650. application.onDisconnect = function(client)
  651. {
  652. if(!client)
  653. return;
  654.  
  655. trace("onDisconnect " + client.userName);
  656.  
  657. if(client.userType == "performer")
  658. {
  659. var clients = application.clients;
  660. var n = clients.length;
  661. for(var i = 0; i < n; i++)
  662. {
  663. if(clients[i] != client)
  664. {
  665. clients[i].call("disconMes", null, "left");
  666. application.disconnect(clients[i]);
  667. }
  668. }
  669. }
  670.  
  671. if(client != application.performer && client.sessionType == "private" || client.sessionType == "true_private")
  672. application.performer.call("changeStatus", null, "available");
  673.  
  674. if(client != application.performer && client.sessionType == "true_private")
  675. application.performer.call("dressTime", null);
  676.  
  677. if(client.userType == "performer" || client.userType == "viewer")
  678. {
  679. var endSessionSendLV = new LoadVars();
  680. var endSessionRecvLV = new LoadVars();
  681. endSessionSendLV.userId = client.userId;
  682. endSessionSendLV.userType = client.userType;
  683. endSessionSendLV.userName = client.userName;
  684. endSessionSendLV.uniqId = client.uniqId;
  685. endSessionSendLV.performerId = client.performerId;
  686. endSessionSendLV.ip = client.ip;
  687. endSessionSendLV.hash = application.hash;
  688. endSessionSendLV.pasword = client.pasword;
  689.  
  690. endSessionSendLV.sendAndLoad(application.baseUrl + application.endSessionUrl, endSessionRecvLV, "POST");
  691.  
  692. endSessionRecvLV.onLoad = function(success)
  693. {
  694. if (success)
  695. {
  696. trace("endsession called successfully " + this.status);
  697. }
  698. else
  699. {
  700. trace("Call to endsession unsuccess");
  701. }
  702. }
  703. }
  704.  
  705. if(client.userType == "performer")
  706. {
  707. var chatLogSendLV = new LoadVars();
  708. var chatLogRecvLV = new LoadVars();
  709. chatLogSendLV.performerId = application.performer.userId;
  710. chatLogSendLV.pasword = application.performer.pasword;
  711. chatLogSendLV.mess = application.chatLogs;
  712. chatLogSendLV.hash = application.hash;
  713. trace("chatLogs " + application.chatLogs);
  714. chatLogSendLV.sendAndLoad(application.baseUrl + application.chatLogUrl, chatLogRecvLV, "POST");
  715.  
  716. chatLogRecvLV.onLoad = function(success)
  717. {
  718. if (success)
  719. {
  720. trace("chat log called successfully " + this.status + ", log " + application.baseUrl + application.chatLogUrl);
  721. }
  722. else
  723. {
  724. trace("Call to chat log unsuccess");
  725. }
  726. }
  727.  
  728. application.chatLogs = "";
  729. }
  730. }
  731.  
  732. application.tipPerfromer = function(tipValue)
  733. {
  734. trace("tipPerfromer: " + tipValue + ", " + this.userName + ", " + this.userId);
  735.  
  736. var tipSendLV = new LoadVars();
  737. var tipRecvLV = new LoadVars();
  738. tipSendLV.userId = this.userId;
  739. tipSendLV.uniqId = this.uniqId;
  740. tipSendLV.performerId = this.performerId;
  741. tipSendLV.amount = tipValue;
  742. tipSendLV.hash = application.hash;
  743. tipSendLV.pasword = this.pasword;
  744.  
  745. tipSendLV.sendAndLoad(application.baseUrl + application.tipUrl, tipRecvLV, "POST");
  746.  
  747. tipRecvLV.onLoad = function(success)
  748. {
  749. if (success)
  750. {
  751. trace("tipPerfromer called successfully " + this.status);
  752. }
  753. else
  754. {
  755. trace("Call to tipPerfromer unsuccess");
  756. }
  757. }
  758.  
  759.  
  760. var clients = application.clients;
  761. var n = clients.length;
  762. for(var i = 0; i < n; i++)
  763. {
  764. if(clients[i].userType == "performer")
  765. {
  766. clients[i].call("receivedTip", null, this.userId, this.userName, tipValue);
  767. }
  768. }
  769. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement