Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Moje porty:
- Ch11:
- PORT: 13000
- P2P_PORT: 14000
- Ch12:
- PORT: 13050
- P2P_PORT: 14050
- Ch21:
- PORT: 13001
- P2P_PORT: 14001
- Ch22:
- PORT: 13051
- P2P_PORT: 14051
- Ch31:
- PORT: 13002
- P2P_PORT: 14002
- Ch32:
- PORT: 13052
- P2P_PORT: 14052
- Ch41:
- PORT: 13003
- P2P_PORT: 14003
- Ch42:
- PORT: 13053
- P2P_PORT: 14053
- void CHARACTER::ChannelSwitch(int iNewChannel)
- {
- long lAddr;
- long lMapIndex;
- WORD wPort;
- long x = this->GetX();
- long y = this->GetY();
- if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
- {
- return;
- }
- if(lMapIndex >= 10000){
- return;
- }
- if (IsHack ())
- return;
- std::map<WORD, int>ch;
- for(int i = 0; i < 4; i++)
- {
- for(int i2 = 0; i < 2; i++)
- {
- ch[(13 * 1000) + (i * 3000) + i2] = i + 1;
- if (i == 3)
- ch[(13 * 1000) + ((i * 3000) - 1000) + i2] = i + 1;
- }
- }
- int chan;
- if(ch.find(wPort) != ch.end())
- {
- chan = ch[wPort];
- }
- else
- {
- return;
- }
- Stop();
- Save();
- if(GetSectree())
- {
- GetSectree()->RemoveEntity(this);
- ViewCleanup();
- EncodeRemovePacket(this);
- }
- TPacketGCWarp p;
- p.bHeader = HEADER_GC_WARP;
- p.lX = x;
- p.lY = y;
- p.lAddr = lAddr;
- p.wPort = (wPort - 3000*(chan-1) + 3000*(iNewChannel-1));
- ChatPacket(CHAT_TYPE_COMMAND, "Update %d",iNewChannel);
- GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement