How to fix
Open up your MySQLM.cpp and add this function:
Now open MySQLM.h and add this line:
Now open Characters.cpp and replace your "Characters::connectGame" function with mine:
Thats all.
Credits to rEakW0n
This will stop all the Login Hackers (That thing of login in other Character and it isnt yours)
GMDanny (i Wish... xD) jk..
Sincerity,
Danny
Srry for my english i cant talk 100% english
Open up your MySQLM.cpp and add this function:
- Code:
int MySQL::checkChar(int charid){
MYSQL_RES *mres;
MYSQL_ROW mrow;
char query[255];
sprintf_s(query, 255, "select userid from characters where ID='%d';", charid);
mysql_real_query(&maple_db, query, strlen(query));
printf(mysql_error(&maple_db));
mres = mysql_store_result(&MySQL::maple_db);
mrow = mysql_fetch_row(mres);
printf(mysql_error(&maple_db));
int ret = 0;
printf(mysql_error(&maple_db));
if(mysql_num_fields(mres) > 0){
string mr = string((char*)mrow[0]);
istringstream buffer(mr);
buffer >> ret;
}
return ret;
}
Now open MySQLM.h and add this line:
- Code:
static int checkChar(int charid);
Now open Characters.cpp and replace your "Characters::connectGame" function with mine:
- Code:
void Characters::connectGame(PlayerLogin* player, unsigned char *packet){
int charid = getInt(packet);
if(MySQL::checkChar(charid) != player->getUserid())
return;
bool check=false;
int ids[3];
int num = player->getIDs(ids);
for(int i=0; i<num; i++){
if(ids[i] == charid){
check=true;
break;
}
}
if(!check){
// hacking
return;
}
LoginPacket::connectIP(player, charid);
}
Thats all.
Credits to rEakW0n
This will stop all the Login Hackers (That thing of login in other Character and it isnt yours)
GMDanny (i Wish... xD) jk..
Sincerity,
Danny
Srry for my english i cant talk 100% english