Mt2Hizmet 1
Mt2Hizmet
Scarlet 1
Scarlet
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Hikaye Ekle

[C++ - Python]Ingame Channel Game Uzerinden | rMelih

  • Konuyu başlatan Konuyu başlatan rMelih
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 13
  • Görüntüleme Görüntüleme 4K
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!

konudakini biraz düzeltmeye çalıştım ama denemedim.
Kod:
void CHARACTER::ChannelSwitch(int iNewChannel)
{
	if (!GetDesc())
		return;


	long lAddr, lMapIndex;
	long x = GetX(); long y = GetY();  
	WORD wPort;
	
	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)
		return;
	
	int iNewPort = 0;
	int iPorts[] = { 1000, 2000, 3000, 4000 };
	for (int i = 0; i < sizeof(iPorts)/sizeof(iPorts[0]); i++) {
		if (iNewChannel == i + 1){
			iNewPort = iPorts[i];
			break;
		}
	}


	if (!iNewPort)
	    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		= iNewPort;
	
	GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}


Daha önce paylaştığım sorunsuz olan;
 
konudakini biraz düzeltmeye çalıştım ama denemedim.
Kod:
void CHARACTER::ChannelSwitch(int iNewChannel)
{
	if (!GetDesc())
		return;


	long lAddr, lMapIndex;
	long x = GetX(); long y = GetY();  
	WORD wPort;
	
	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)
		return;
	
	int iNewPort = 0;
	int iPorts[] = { 1000, 2000, 3000, 4000 };
	for (int i = 0; i < sizeof(iPorts)/sizeof(iPorts[0]); i++) {
		if (iNewChannel == i + 1){
			iNewPort = iPorts[i];
			break;
		}
	}


	if (!iNewPort)
	    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		= iNewPort;
	
	GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}


Daha önce paylaştığım sorunsuz olan;

teşekkürler :)
 
konudakini biraz düzeltmeye çalıştım ama denemedim.
Kod:
void CHARACTER::ChannelSwitch(int iNewChannel)
{
    if (!GetDesc())
        return;


    long lAddr, lMapIndex;
    long x = GetX(); long y = GetY();  
    WORD wPort;
    
    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)
        return;
    
    int iNewPort = 0;
    int iPorts[] = { 1000, 2000, 3000, 4000 };
    for (int i = 0; i < sizeof(iPorts)/sizeof(iPorts[0]); i++) {
        if (iNewChannel == i + 1){
            iNewPort = iPorts[i];
            break;
        }
    }


    if (!iNewPort)
        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        = iNewPort;
    
    GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}


Daha önce paylaştığım sorunsuz olan;

Seninki client üzeri sanırım bakmadım konuya ?
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst