C++:#ifdef ENABLE_CHANNEL_SWITCHER void CHARACTER::SwitchChannel(int iNewChannel) { long lAddr, lMapIndex; WORD wPort; long x = GetX(); long y = GetY(); if (!CMapLocation::Instance().Get(x, y, lMapIndex, lAddr, wPort)) return; std::map<WORD, BYTE> ChannelsPorts; for(int i = 1; i <= SWITCHER_CHANNELS; i++) { for(int i2 = 1; i2 <= SWITCHER_CORES; i2++) { ChannelsPorts[26*1000 + i*100 + i2] = i; } } int iChannel = ChannelsPorts.find(wPort) != ChannelsPorts.end() ? ChannelsPorts[wPort] : 0; Stop(); Save(); if (GetSectree()) { GetSectree()->RemoveEntity(this); ViewCleanup(); EncodeRemovePacket(this); }...
p.wPort = (wPort - 10*(iChannel - 1) + 10*(iNewChannel - 1));
#ifdef ENABLE_CHANNEL_SWITCHER
void CHARACTER::SwitchChannel(int iNewChannel)
{
long lAddr, lMapIndex;
WORD wPort;
long x = GetX();
long y = GetY();
if (!CMapLocation::Instance().Get(x, y, lMapIndex, lAddr, wPort))
return;
std::map<WORD, BYTE> ChannelsPorts;
for(int i = 1; i <= SWITCHER_CHANNELS; i++)
{
for(int i2 = 1; i2 <= SWITCHER_CORES; i2++)
{
ChannelsPorts[26*1000 + i*100 + i2] = i;
}
}
int iChannel = ChannelsPorts.find(wPort) != ChannelsPorts.end() ? ChannelsPorts[wPort] : 0;
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 - 10*(iChannel - 1) + 10*(iNewChannel - 1));
GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}
#endif
ChannelsPorts[26*1000 + i*100 + i2] = i;
C++:#ifdef ENABLE_CHANNEL_SWITCHER void CHARACTER::SwitchChannel(int iNewChannel) { long lAddr, lMapIndex; WORD wPort; long x = GetX(); long y = GetY(); if (!CMapLocation::Instance().Get(x, y, lMapIndex, lAddr, wPort)) return; std::map<WORD, BYTE> ChannelsPorts; for(int i = 1; i <= SWITCHER_CHANNELS; i++) { for(int i2 = 1; i2 <= SWITCHER_CORES; i2++) { ChannelsPorts[26*1000 + i*100 + i2] = i; } } int iChannel = ChannelsPorts.find(wPort) != ChannelsPorts.end() ? ChannelsPorts[wPort] : 0; 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 - 10*(iChannel - 1) + 10*(iNewChannel - 1)); GetDesc()->Packet(&p, sizeof(TPacketGCWarp)); } #endif
şu kısmı hiç anlamadım .
ellemeye gerek oldugunu kimse söylemiyor amaKod:ChannelsPorts[26*1000 + i*100 + i2] = i;