Tallywa 35 Posted August 10, 2020 Share Posted August 10, 2020 Version of Files : XXX Hello, i use this fonction for switch channel void CHARACTER::ChangeChannel(DWORD channelId){ long lAddr; long lMapIndex; WORD wPort; long x = this->GetX(); long y = this->GetY(); if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort)) { sys_err("cannot find map location index %d x %d y %d name %s", lMapIndex, x, y, GetName()); return; } if(lMapIndex >= 10000){ this->ChatPacket(CHAT_TYPE_INFO, ("You can't change channel in private map.")); return; } //this->ChatPacket(CHAT_TYPE_COMMAND, "RefreshChannel %d", channelId); 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 - 100*(g_bChannel-1) + 100*(channelId-1)); GetDesc()->Packet(&p, sizeof(TPacketGCWarp)); } but i cant switch channel, i have timer when if i click, but, after, i retourn in page of login my port channel 1 16002 my port channel 2 16102 and core 2 of channel 1 16003 core 2 of channel 2 16103 i dont know why and thank you for reply Link to comment Share on other sites More sharing options...
Catalin2o14 142 Posted August 11, 2020 Share Posted August 11, 2020 p.wPort = (wPort - 100*(g_bChannel-1) + 100*(channelId-1)); = 16002 = 16001+channelId Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted April 13, 2021 Share Posted April 13, 2021 On 8/11/2020 at 3:55 PM, Catalin2o14 said: p.wPort = (wPort - 100*(g_bChannel-1) + 100*(channelId-1)); = 16002 = 16001+channelId What that mean? How it works? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now