Database Error when disconnecting game

06/19/2018 09:50 Minotaurr#1
Hey Elitepvpers,

I'm currently getting an error when logging out and I don't know why. Server is working perfectly, but not saving in database anymore.

Error log:
Code:
2018/ 6/19 09:45:31
SavePlayer(Minotaurr) - Exec RETURN FALSE, ThreadID : 30784
CQuery log:
Code:
2018/06/19	09:45:31
query:{call CHARACTER_STR('U1','0000001','01','',?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,      0,      0,      0,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
SQLSTATE:42000 error:[Microsoft][SQL Server Native Client 11.0][SQL Server]Error converting data type varchar to int.
Anyone who knows? I've tried several things to fix the problem, but without result.

Thanks!
06/19/2018 12:45 alfredico#2
That's the problem of using ? on long stored procedures, when you have an error like that takes lot of time to find it.
Compare the stored procedure CHARACTER_STR to match with the BindParameter on CDbManager::SavePlayer, the order must be same.
06/19/2018 15:53 Minotaurr#3
Quote:
Originally Posted by alfredico View Post
" the order must be same "
Omg it works :O Never thought of that, thank you !

Changed:

Code:
#ifdef __USER_OWN_TITLE
	bOK[++j] = qry->BindParameter(++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, MAX_CUSTOM_TITLE, 0, pMover->m_szOwnTitle, 0, &cbLen);
#endif //__USER_OWN_TITLE

#ifdef __HIDE_CS
	int nHideCoat = 0;
	for (int z = 0; z < 5; ++z)
	{
		int c = (pMover->m_abHideCoat[z] ? 1 : 0);
		nHideCoat |= (c << z);
	}
	bOK[++j] = qry->BindParameter(++i, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &nHideCoat, 0, 0);
#endif // __HIDE_CS
TO

Code:
#ifdef __HIDE_CS
	int nHideCoat = 0;
	for (int z = 0; z < 5; ++z)
	{
		int c = (pMover->m_abHideCoat[z] ? 1 : 0);
		nHideCoat |= (c << z);
	}
	bOK[++j] = qry->BindParameter(++i, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, &nHideCoat, 0, 0);
#endif // __HIDE_CS

#ifdef __USER_OWN_TITLE
	bOK[++j] = qry->BindParameter(++i, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, MAX_CUSTOM_TITLE, 0, pMover->m_szOwnTitle, 0, &cbLen);
#endif //__USER_OWN_TITLE
~ Edit, Closerequest