SafeCheck_21201.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties:
  4. {
  5. m_IconIp:cc.Sprite,
  6. m_IconDis:cc.Sprite,
  7. m_Frame:[cc.SpriteFrame],
  8. m_LabIPTitle:cc.Label,
  9. m_LabDisTitle:cc.Label,
  10. m_LabIPName:[cc.Label],
  11. m_LabIP:[cc.Label],
  12. m_LabDis:[cc.Label],
  13. },
  14. OnShowView:function()
  15. {
  16. ShowS2N(this.node);//ShowS2N
  17. this.InitIP();
  18. this.InitDis();
  19. },
  20. OnHideView:function()
  21. {
  22. HideN2S(this.node);
  23. },
  24. InitIP:function()
  25. {
  26. var bHas = false;
  27. for(var i = 0; i < 4; i++)
  28. {
  29. this.m_LabIPName[i].string = '';
  30. this.m_LabIP[i].string = '';
  31. if(this.m_Hook.m_GameClientView.m_strCheckIP[i][0] != 0)
  32. {
  33. this.m_LabIPName[i].string = this.m_Hook.m_GameClientView.m_strCheckIP[i][1];
  34. this.m_LabIP[i].string = '(IP:'+this.m_Hook.m_GameClientView.m_strCheckIP[i][2]+')';
  35. bHas = true;
  36. }
  37. }
  38. if(bHas == true)
  39. {
  40. this.m_IconIp.spriteFrame = this.m_Frame[1];
  41. this.m_LabIPTitle.string = '已發現同IP玩家'
  42. }
  43. else
  44. {
  45. this.m_IconIp.spriteFrame = this.m_Frame[0];
  46. this.m_LabIPTitle.string = '未發現同IP玩家'
  47. }
  48. },
  49. InitDis:function()
  50. {
  51. var bHas = false;
  52. for(var i = 0; i < 6; i++)
  53. {
  54. this.m_LabDis[i].string = '';
  55. if(this.m_Hook.m_GameClientView.m_strCheckDistance[i] != null)
  56. {
  57. this.m_LabDis[i].string = this.m_Hook.m_GameClientView.m_strCheckDistance[i];
  58. bHas = true;
  59. }
  60. }
  61. if(bHas == true)
  62. {
  63. this.m_IconDis.spriteFrame = this.m_Frame[1];
  64. this.m_LabDisTitle.string = '已發現距離過近玩家'
  65. }
  66. else
  67. {
  68. this.m_IconDis.spriteFrame = this.m_Frame[0];
  69. this.m_LabDisTitle.string = '未發現距離過近玩家'
  70. }
  71. },
  72. });