Jump to content

Compiling on 64bit chroot - Error check_server.cpp


Recommended Posts

Hey guys!

I've been trying to compile a clean version of the mainline_released source on a 64bit FreeBSD Machine using a chroot / jail. I think I got everything set up correctly and am able to compile the source, however when I do compile I get the following error:

Edit: adding #include <stdlib.h> to SIM.h in libserverkey (fixed?) this error

The new error now is:

I already recieved a bunch of errors before which I were able to fix. I am compiling with g++49. The only changes to the source are removed time bomb / license.

If anyone knows how to fix this error, I'd be grateful as for now I have run out of ideas and google isn't being helpful.

Spoiler

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Premium

remove Metin2Server_Check(); from main.cpp

it's useless

Spoiler

void Metin2Server_Check()
{
#ifdef _USE_SERVER_KEY_
	if (false == CheckServer::CheckIp(g_szPublicIP))
	{
#ifdef _WIN32
		fprintf(stderr, "check ip failed\n");
#endif
		g_isInvalidServer = true;
	}
	return;
#endif

	if (LC_IsEurope() || test_server)
		return;


	// 브라질 ip
	if (strncmp (g_szPublicIP, "189.112.1", 9) == 0)
	{
		return;
	}

	// 캐나다 ip
	if (strncmp (g_szPublicIP, "74.200.6", 8) == 0)
	{
		return;
	}

	return;

	static const size_t CheckServerListSize = 1;
	static const char* CheckServerList[] = { "202.31.178.251"};
	static const int CheckServerPort = 7120;

	socket_t sockConnector = INVALID_SOCKET;

	for (size_t i = 0 ; i < CheckServerListSize ; i++)
	{
		sockConnector = socket_connect( CheckServerList[i], CheckServerPort );

		if (0 < sockConnector)
			break;
	}

	if (0 > sockConnector)
	{
		if (true != LC_IsEurope()) // 유럽은 접속을 하지 못하면 인증된 것으로 간주
			g_isInvalidServer = true;

		return;
	}

	char buf[256] = { 0, };

	socket_read(sockConnector, buf, sizeof(buf) - 1);

	sys_log(0, "recv[%s]", buf);
	
	if (strncmp(buf, "OK", 2) == 0)
		g_isInvalidServer = false;
	else if (strncmp(buf, "CK", 2) == 0)
		g_isInvalidServer = true;

	socket_close(sockConnector);
}

 

 

  • Love 1
Link to comment
Share on other sites

vor 42 Minuten schrieb Shelby:

remove Metin2Server_Check(); from main.cpp

it's useless

  Unsichtbaren Inhalt anzeigen


void Metin2Server_Check()
{
#ifdef _USE_SERVER_KEY_
	if (false == CheckServer::CheckIp(g_szPublicIP))
	{
#ifdef _WIN32
		fprintf(stderr, "check ip failed\n");
#endif
		g_isInvalidServer = true;
	}
	return;
#endif

	if (LC_IsEurope() || test_server)
		return;


	// 브라질 ip
	if (strncmp (g_szPublicIP, "189.112.1", 9) == 0)
	{
		return;
	}

	// 캐나다 ip
	if (strncmp (g_szPublicIP, "74.200.6", 8) == 0)
	{
		return;
	}

	return;

	static const size_t CheckServerListSize = 1;
	static const char* CheckServerList[] = { "202.31.178.251"};
	static const int CheckServerPort = 7120;

	socket_t sockConnector = INVALID_SOCKET;

	for (size_t i = 0 ; i < CheckServerListSize ; i++)
	{
		sockConnector = socket_connect( CheckServerList[i], CheckServerPort );

		if (0 < sockConnector)
			break;
	}

	if (0 > sockConnector)
	{
		if (true != LC_IsEurope()) // 유럽은 접속을 하지 못하면 인증된 것으로 간주
			g_isInvalidServer = true;

		return;
	}

	char buf[256] = { 0, };

	socket_read(sockConnector, buf, sizeof(buf) - 1);

	sys_log(0, "recv[%s]", buf);
	
	if (strncmp(buf, "OK", 2) == 0)
		g_isInvalidServer = false;
	else if (strncmp(buf, "CK", 2) == 0)
		g_isInvalidServer = true;

	socket_close(sockConnector);
}

 

 

I thought I had already done that, but it seems that I've missed a line! That error is now gone, thanks for that :) However a new one comes up when linking (hopefully the last):

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Premium
5 minutes ago, Summex said:

I thought I had already done that, but it seems that I've missed a line! That error is now gone, thanks for that :) However a new one comes up when linking (hopefully the last):

qOWrm95.png remove

test.cpp

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Ofcourse! *facepalm* Alright, I deleted all the references in the makefile. But those don't seem to be the only ones. I already tried deleting the corresponding line on the next error but that just led to more and more errors, deleting etc so I thought it was a better Idea to restore the files and ask you guys.

Edit: Actually this is the error when all the files are restored:

The other image shows what happens when I delete this

TOKEN("server_key")
		{
			CheckServer::AddServerKey(value_string);
			continue;
		}

in config.cpp

Spoiler

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • Premium
4 minutes ago, Summex said:

Ofcourse! *facepalm* Alright, I deleted all the references in the makefile. But those don't seem to be the only ones. I already tried deleting the corresponding line on the next error but that just led to more and more errors, deleting etc so I thought it was a better Idea to restore the files and ask you guys. 

add in makefile

INCDIR += -I../../libserverkey

 

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

vor 17 Minuten schrieb Shelby:

#include "check_server.h" in config.cpp

 

ah yes, i had removed that one at some earlier point. Now it gave me the malloc_options error again which I fixed with what you had posted earlier. Then I could compile the game ! Thanks :)  now when compiling the db I got the malloc_option error aswell. I fixed that one the same way (had to delete 1 line from main.cpp). And was able to execute gmake all with no errors. Thanks a lot for the help.

Link to comment
Share on other sites

  • Premium
58 minut temu, Shelby napisał:

why you deleted the libserverky and checks, if someone says a shit, it means something goes wrong.

Edit: I know, it's useless  on freebsd but on windows not. ?

What do you mean? Metin2 server on Windows is good only because of Visual Studio, but I can't see reason why he should keep useless code that only makes problems happen. I mean he didn't ask for help with compiling anything on Windows. So keep your shit talks for you. 

I don't know if deleting malloc is a good idea, if I were you I would try to fix that 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.