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

Direct Query Game.Core


Finch

Question

#0  0x082836e9 in mysql_real_query () at atomicity.h:51
51        { return __sync_fetch_and_add(__mem, __val); }
[New Thread 28c04300 (LWP 100099/game)]
(gdb) bt
#0  0x082836e9 in mysql_real_query () at atomicity.h:51
#1  0x0839c8e7 in CAsyncSQL::DirectQuery ()
#2  0x080da850 in __LoadExpTableFromDB () at config.cpp:328
#3  0x080dad87 in config_init ([email protected])
    at config.cpp:375
#4  0x08220418 in start (argc=1, argv=0xbfbfeed8) at main.cpp:630
#5  0x08220dfb in main (argc=1, argv=0xbfbfeed8) at main.cpp:425
(gdb)
static bool __LoadExpTableFromDB(void)
{
	std::auto_ptr<SQLMsg> pMsg(AccountDB::instance().DirectQuery("SELECT level, exp FROM exp_table"));
	if (pMsg->Get()->uiNumRows == 0)
		return false;

	static DWORD new_exp_table[PLAYER_MAX_LEVEL_CONST+1];
	if (exp_table != NULL)
		memcpy(new_exp_table, exp_table, (PLAYER_MAX_LEVEL_CONST+1)*sizeof(DWORD));

	MYSQL_ROW row = NULL;
	while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
	{
		DWORD level = 0;
		DWORD exp = 0;
		str_to_number(level, row[0]);
		str_to_number(exp, row[1]);
		if (level > PLAYER_MAX_LEVEL_CONST)
			continue;
		new_exp_table[level] = exp;
		// printf("new_exp_table[%u] = %u;\n", level, exp);
	}
	exp_table = new_exp_table;
	return true;
}

 

Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

1 answer to this question

Recommended Posts

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 1

      Metin2 TitleBar Move Frezze

    2. 1

      Metin2 TitleBar Move Frezze

    3. 0

      Navicat "Trial" Reset

    4. 13

      Item ToolTip Width Fix

    5. 0

      Guild icon wrong position

    6. 3

      Monster health

    7. 4

      Luffy Pet

    8. 38

      Core X → Top Metin2 & Metin2 Download → Changelogs

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.