slaw
Software Developer
I'm trying add commands mc check, but there is compiling error which i cant fix.
Here code:
Compiling errors:
Help
Here code:
Code:
bool Commands::mcCheck(Creature* creature, const std::string& cmd, const std::string& param)
{
std::stringstream info;
unsigned char ip[4];
if(Player* player = creature->getPlayer()){
info << "The following players are multiclienting: \n";
info << "Name IP" << "\n";
for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it){
Player* lol = (*it).second;
for(AutoList<Player>::listiterator cit = Player::listPlayer.list.begin(); cit != Player::listPlayer.list.end(); ++cit){
if((*cit).second != lol && (*cit).second->lastip == lol->lastip){
*(unsigned long*)&ip = (*cit).second->lastip;
info << (*cit).second->getName() << " " << (unsigned int)ip[0] << "." << (unsigned int)ip[1] <<
"." << (unsigned int)ip[2] << "." << (unsigned int)ip[3] << "\n";
}
}
}
player->sendTextMessage(MSG_STATUS_CONSOLE_RED, info.str().c_str());
}
else{
return false;
}
return true;
}
Compiling errors:
Code:
commands.cpp: In member function `bool Commands::mcCheck(Creature*, const std::string&, const std::string&)':
commands.cpp:1362: error: 'class Player' has no member named 'lastip'
commands.cpp:1362: error: 'class Player' has no member named 'lastip'
commands.cpp:1363: error: 'class Player' has no member named 'lastip'
Help