Jump to content
×
×
  • Create New...
  • 0

C++ Move Channel


Tallywa

Question

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

  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

2 answers to this question

Recommended Posts

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 7

      Wear (use) item only on specific map

    2. 4

      Python tool for analyzing average yang drop per hour in each map.

    3. 162

      Plechito - Halloween 2022

    4. 0

      disable quest esc

    5. 7

      Wear (use) item only on specific map

    6. 7

      Wear (use) item only on specific map

    7. 7

      Wear (use) item only on specific map

    8. 4

      max level exp

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.