memset((char*)&data[3], 0, PLAYERNAME_SIZE);
snprintf((char*)&data[3], PLAYERNAME_SIZE, "%s", myplayer->getName());
- /*dstream<<"Client: password hash is \""<<m_password<<"\""
+ /*dstream<<"Client: sending initial password hash: \""<<m_password<<"\""
<<std::endl;*/
memset((char*)&data[23], 0, PASSWORD_SIZE);
password = translatePassword(playername, menudata.password);
+ //dstream<<"Main: password hash: '"<<password<<"'"<<std::endl;
+
address = wide_to_narrow(menudata.address);
int newport = stoi(wide_to_narrow(menudata.port));
if(newport != 0)
// Get password
char password[PASSWORD_SIZE];
- if(datasize >= 2+1+PLAYERNAME_SIZE)
+ if(datasize < 2+1+PLAYERNAME_SIZE+PASSWORD_SIZE)
{
// old version - assume blank password
password[0] = 0;
checkpwd = g_settings.get("default_password");
}
- if(password != checkpwd && checkpwd != "")
+ /*dstream<<"Server: Client gave password '"<<password
+ <<"', the correct one is '"<<checkpwd<<"'"<<std::endl;*/
+
+ if(password != checkpwd)
{
derr_server<<DTIME<<"Server: peer_id="<<peer_id
<<": supplied invalid password for "
newpwd += c;
}
+ dstream<<"Server: Client requests a password change from "
+ <<"'"<<oldpwd<<"' to '"<<newpwd<<"'"<<std::endl;
+
std::string playername = player->getName();
if(m_authmanager.exists(playername) == false)
}
std::string checkpwd = m_authmanager.getPassword(playername);
-
+
if(oldpwd != checkpwd)
{
dstream<<"Server: invalid old password"<<std::endl;