Jump to content
  • 0

Max Yang - compile problem


Syron

Question

Hello metin2dev, i'm having some trouble compiling my db with max gold edited. ( unsigned long long )

Let's explain this:

- i have changed everything from int to unsigned long long. ( hope so , you can "list a list" of files where i should edit , i'm pretty sure i do it all. )

- binary has Unsigned Long Long Elk Function.

 

Problem:

If i compile it with long long ( tables.h only ! ) it will compile ( it won't work because everywhere else is unsigned long long )

ziTmmhD.png

If i compile it with unsigned long long ( tables.h and everything else ) it will NOT COMPILE the DB. ( game will be compiled succesfully. ) u5yjTYy.png

 

Here is the ErrorLog generated by the DB Build. ( i already checked everything , i have really no ideea. ) 

In file included from ClientManager.cpp:6:
../../common/VnumHelper.h:59:32: warning: no newline at end of file
Cache.cpp:365:7: warning: no newline at end of file
In file included from ClientManagerBoot.cpp:8:
ProtoReader.h:36:7: warning: no newline at end of file
ItemAwardManager.cpp:129:2: warning: no newline at end of file
ClientManagerPlayer.cpp: In member function 'char* CClientManager::GetCommand(char*)':
ClientManagerPlayer.cpp:433: warning: address of local variable 'command' returned
ClientManagerPlayer.cpp: In function 'bool CreatePlayerTableFromRes(MYSQL_RES*, TPlayerTable*)':
ClientManagerPlayer.cpp:478: error: no matching function for call to 'str_to_number(long long unsigned int&, char*&)'
../../common/utils.h:2: note: candidates are: bool str_to_number(bool&, const char*)
../../common/utils.h:10: note:                 bool str_to_number(char&, const char*)
../../common/utils.h:18: note:                 bool str_to_number(unsigned char&, const char*)
../../common/utils.h:26: note:                 bool str_to_number(short int&, const char*)
../../common/utils.h:34: note:                 bool str_to_number(short unsigned int&, const char*)
../../common/utils.h:42: note:                 bool str_to_number(int&, const char*)
../../common/utils.h:50: note:                 bool str_to_number(unsigned int&, const char*)
../../common/utils.h:58: note:                 bool str_to_number(long int&, const char*)
../../common/utils.h:66: note:                 bool str_to_number(long unsigned int&, const char*)
../../common/utils.h:74: note:                 bool str_to_number(long long int&, const char*)
../../common/utils.h:82: note:                 bool str_to_number(float&, const char*)
../../common/utils.h:90: note:                 bool str_to_number(double&, const char*)
../../common/utils.h:99: note:                 bool str_to_number(long double&, const char*)
gmake: *** [.obj/ClientManagerPlayer.o] Error 1
gmake: *** Waiting for unfinished jobs....

 
Link to comment

10 answers to this question

Recommended Posts

  • 0

 

Hello metin2dev, i'm having some trouble compiling my db with max gold edited. ( unsigned long long )

Let's explain this:

- i have changed everything from int to unsigned long long. ( hope so , you can "list a list" of files where i should edit , i'm pretty sure i do it all. )

- binary has Unsigned Long Long Elk Function.

 

Problem:

If i compile it with long long ( tables.h only ! ) it will compile ( it won't work because everywhere else is unsigned long long )

ziTmmhD.png

If i compile it with unsigned long long ( tables.h and everything else ) it will NOT COMPILE the DB. ( game will be compiled succesfully. ) u5yjTYy.png

 

Here is the ErrorLog generated by the DB Build. ( i already checked everything , i have really no ideea. ) 

In file included from ClientManager.cpp:6:
../../common/VnumHelper.h:59:32: warning: no newline at end of file
Cache.cpp:365:7: warning: no newline at end of file
In file included from ClientManagerBoot.cpp:8:
ProtoReader.h:36:7: warning: no newline at end of file
ItemAwardManager.cpp:129:2: warning: no newline at end of file
ClientManagerPlayer.cpp: In member function 'char* CClientManager::GetCommand(char*)':
ClientManagerPlayer.cpp:433: warning: address of local variable 'command' returned
ClientManagerPlayer.cpp: In function 'bool CreatePlayerTableFromRes(MYSQL_RES*, TPlayerTable*)':
ClientManagerPlayer.cpp:478: error: no matching function for call to 'str_to_number(long long unsigned int&, char*&)'
../../common/utils.h:2: note: candidates are: bool str_to_number(bool&, const char*)
../../common/utils.h:10: note:                 bool str_to_number(char&, const char*)
../../common/utils.h:18: note:                 bool str_to_number(unsigned char&, const char*)
../../common/utils.h:26: note:                 bool str_to_number(short int&, const char*)
../../common/utils.h:34: note:                 bool str_to_number(short unsigned int&, const char*)
../../common/utils.h:42: note:                 bool str_to_number(int&, const char*)
../../common/utils.h:50: note:                 bool str_to_number(unsigned int&, const char*)
../../common/utils.h:58: note:                 bool str_to_number(long int&, const char*)
../../common/utils.h:66: note:                 bool str_to_number(long unsigned int&, const char*)
../../common/utils.h:74: note:                 bool str_to_number(long long int&, const char*)
../../common/utils.h:82: note:                 bool str_to_number(float&, const char*)
../../common/utils.h:90: note:                 bool str_to_number(double&, const char*)
../../common/utils.h:99: note:                 bool str_to_number(long double&, const char*)
gmake: *** [.obj/ClientManagerPlayer.o] Error 1
gmake: *** Waiting for unfinished jobs....

 

clientmanagerplayer.cpp 

line 102:

"gold = %d, "

change to

"gold = %llu, "

or

"gold = %ull, "

 

common:

uttils.cpp

add

inline bool str_to_number (unsigned long long& out, const char *in)
{
	if (0==in || 0==in[0])	return false;

	out = (unsigned long long) strtoull(in, NULL, 10);
	return true;
}
  • Love 1
Link to comment
  • 0
add

inline bool str_to_number (unsigned long long& out, const char *in)
{
    if (0==in || 0==in[0])    return false;

    out = (unsigned long long) strtoull(in, NULL, 10);
    return true;
}

Testing right now in game , it has compiled.

iwxGW7E.png

I think it's something wrong under binary... Do i have to edit uicommon ? There are my lines:

money = 0
if text and text.isdigit():
try:
money = int(text)
except ValueError:
money = 199999999

GetElk:

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}
Link to comment
  • 0
add

inline bool str_to_number (unsigned long long& out, const char *in)
{
    if (0==in || 0==in[0])    return false;

    out = (unsigned long long) strtoull(in, NULL, 10);
    return true;
}

Testing right now in game , it has compiled.

iwxGW7E.png

I think it's something wrong under binary... Do i have to edit uicommon ? There are my lines:

money = 0
if text and text.isdigit():
try:
money = int(text)
except ValueError:
money = 199999999

GetElk:

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

 

change int to int64

Link to comment
  • 0

 

change int to int64

 

 

 

No effect. Same error.

 

maybe here you need more change

uipickmoney.py

 

def OnAccept(self):

		text = self.pickValueEditLine.GetText()

		if len(text) > 0 and text.isdigit():

			money = int(text)
			money = min(money, self.maxValue)

			if money > 0:
				if self.eventAccept:
					self.eventAccept(money)

		self.Close()

Link to comment
  • 0

 

 

change int to int64

 

 

 

No effect. Same error.

 

maybe here you need more change

uipickmoney.py

 

def OnAccept(self):

		text = self.pickValueEditLine.GetText()

		if len(text) > 0 and text.isdigit():

			money = int(text)
			money = min(money, self.maxValue)

			if money > 0:
				if self.eventAccept:
					self.eventAccept(money)

		self.Close()

 

Same error , after value exceeds 2kkk -> it transform into 912319231231231923

Link to comment
  • 0

You have to additionally edit some packets clientside.

A list of what I found now in searching for 5 Minutes: command_item_drop, command_item_drop2, packet_shop_update_price and most important: packet_points and packet_point_change. In packet_point_changeyou have to modify long amount to long long amount I think, in packet_points you have to edit long points to long long points.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.