Jump to content

Recommended Posts

  • Premium

Hi guys !

Anyone managed iptables rules or something similar to stop kicking character after selecting character in that situation when Metin2 server runs behind a internal ip ?(separate VPS)

best regards.

  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/19205-internal-ip-redirect-to-public-ip-linux/
Share on other sites

  • 2 weeks later...

desc_client.cpp in void CLIENT_DESC::SetPhase(int iPhase) edit

				if (!bSentBoot)
				{
					bSentBoot = true;
					TPacketGDBoot p;
					p.dwItemIDRange[0] = 0;
					p.dwItemIDRange[1] = 0;
					memcpy(p.szIP, g_szPublicIP, 16); // set you external ip instead g_szPublicIP 
					DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
				}

or you can do it in client side at NetAddress.cpp

void CNetworkAddress::GetIP(char* szIP, int len)
{
	BYTE IPs[4];
	*((DWORD*)IPs)=m_sockAddrIn.sin_addr.s_addr;

	_snprintf(szIP, len, "%d.%d.%d.%d", IPs[0], IPs[1], IPs[2], IPs[3]); // replace with you external server ip
}

 

  • Love 1
  • Premium
La 20.08.2018 la 0:15, IceShiva a spus:

desc_client.cpp in void CLIENT_DESC::SetPhase(int iPhase) edit


				if (!bSentBoot)
				{
					bSentBoot = true;
					TPacketGDBoot p;
					p.dwItemIDRange[0] = 0;
					p.dwItemIDRange[1] = 0;
					memcpy(p.szIP, g_szPublicIP, 16); // set you external ip instead g_szPublicIP 
					DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
				}

or you can do it in client side at NetAddress.cpp


void CNetworkAddress::GetIP(char* szIP, int len)
{
	BYTE IPs[4];
	*((DWORD*)IPs)=m_sockAddrIn.sin_addr.s_addr;

	_snprintf(szIP, len, "%d.%d.%d.%d", IPs[0], IPs[1], IPs[2], IPs[3]); // replace with you external server ip
}

 

Thank you very much but in this way doesn't work because cannot bind on this IP.

  • 3 weeks later...
  • 7 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

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.