Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. Moje porty:
  2. Ch11:
  3. PORT: 13000
  4. P2P_PORT: 14000
  5.  
  6. Ch12:
  7. PORT: 13050
  8. P2P_PORT: 14050
  9.  
  10. Ch21:
  11. PORT: 13001
  12. P2P_PORT: 14001
  13.  
  14. Ch22:
  15. PORT: 13051
  16. P2P_PORT: 14051
  17.  
  18. Ch31:
  19. PORT: 13002
  20. P2P_PORT: 14002
  21.  
  22. Ch32:
  23. PORT: 13052
  24. P2P_PORT: 14052
  25.  
  26. Ch41:
  27. PORT: 13003
  28. P2P_PORT: 14003
  29.  
  30. Ch42:
  31. PORT: 13053
  32. P2P_PORT: 14053
  33.  
  34. void CHARACTER::ChannelSwitch(int iNewChannel)
  35. {
  36.  
  37. long lAddr;
  38. long lMapIndex;
  39. WORD wPort;
  40. long x = this->GetX();
  41. long y = this->GetY();
  42.  
  43. if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
  44. {
  45. return;
  46. }
  47.  
  48. if(lMapIndex >= 10000){
  49. return;
  50. }
  51.  
  52. if (IsHack ())
  53. return;
  54.  
  55. std::map<WORD, int>ch;
  56.  
  57. for(int i = 0; i < 4; i++)
  58. {
  59. for(int i2 = 0; i < 2; i++)
  60. {
  61. ch[(13 * 1000) + (i * 3000) + i2] = i + 1;
  62. if (i == 3)
  63. ch[(13 * 1000) + ((i * 3000) - 1000) + i2] = i + 1;
  64. }
  65. }
  66.  
  67. int chan;
  68. if(ch.find(wPort) != ch.end())
  69. {
  70. chan = ch[wPort];
  71. }
  72. else
  73. {
  74. return;
  75. }
  76. Stop();
  77. Save();
  78.  
  79. if(GetSectree())
  80. {
  81. GetSectree()->RemoveEntity(this);
  82. ViewCleanup();
  83.  
  84. EncodeRemovePacket(this);
  85. }
  86.  
  87. TPacketGCWarp p;
  88. p.bHeader = HEADER_GC_WARP;
  89. p.lX = x;
  90. p.lY = y;
  91. p.lAddr = lAddr;
  92. p.wPort = (wPort - 3000*(chan-1) + 3000*(iNewChannel-1));
  93.  
  94. ChatPacket(CHAT_TYPE_COMMAND, "Update %d",iNewChannel);
  95. GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement