Command for setting Cash of account
#4


On 12/26/2020 at 2:15 PM, kravens said:




Easy code, but usefull, thanks ?


You miss to write fews line of code and a setup for newstomb.bin, so i will show it here.



GameServer/Server.h




MYSQL m_dbauth; // AuthDatabase


GameServer/Server.cpp




mysql_init(&m_dbauth);


bool CServer::ConnectDB() function




if (!mysql_real_connect(
&m_dbauth,
m_config.Find("Auth DB", "IP"),
m_config.Find("Auth DB", "User"),
m_config.Find("Auth DB", "Password"),
m_config.Find("Auth DB", "DBName"),
0, NULL, 0))
{
LOG_ERROR("Can't connect Auth DB : ip[%s] id[%s] pw[%s] dbname[%s] error[%s]",
m_config.Find("Auth DB", "IP"),
m_config.Find("Auth DB", "User"),
m_config.Find("Auth DB", "Password"),
m_config.Find("Auth DB", "DBName"),
mysql_error(&m_dbauth)
);
return false;
}


Now go to gameserver newstomb.bin and add




[Auth DB]
IP=127.0.0.1
DBName=dbauth
User=root
Password=


 




Or you can just edit


Quote




cmd.Init(&gserver->m_dbauth);




into


Quote




cmd.Init(&gserver->m_dbAuth);





Messages In This Thread
[No subject] - by Veni - 12-25-2020, 06:57 PM
[No subject] - by kravens - 12-26-2020, 01:15 PM
[No subject] - by Veni - 12-26-2020, 04:30 PM
[No subject] - by Desarija - 12-27-2020, 09:41 PM
[No subject] - by Veni - 12-28-2020, 01:19 PM
[No subject] - by Desarija - 12-28-2020, 08:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)