It's an old cold of mine, but since i'm using a "remote control" to the dedicated server, its kinda handy, cuz i connect via IP, wich the players can use the very own of the server...
it's simple just put it anywhere in otserv.cpp between the "loading echos" or before, wtver suits u:
i left some usefull notes in the code
i made it with lots of ifs cuz i don't really care about placing elses and saving memory...well its possible crack it with HEX editor, but u can make it virtually crack proof if u change the pass variables to stuff like "playerattackthicks", thinks that "hackers" won't ever think to do an hex search with
it can be reduced to half of it...just not in the mood
cya
it's simple just put it anywhere in otserv.cpp between the "loading echos" or before, wtver suits u:
i left some usefull notes in the code
Code:
//OTpass by ravock
int uid;
std::string pass;
int pv = 0;
if(pv == 0) // tottaly useless just for kicks ^^ *remove start*
{
std::cout << "OTserv Password Protection loading..." << std::endl;
pv += 1;
} // *remove end, in case no debug else*
if(pv == 1)
{
std::cout << "Please enter Your User ID:" << std::endl;
std::cin >> uid;
}
if(uid != 1) // note: u can add IF CLAUSES to new users...
{
std::cout << "No Id Found!" << std::endl;
return -1;
}
if(uid == 1)
{
std::cout << "Welcome Ravock! Please Type Your Password:" << std::endl;
std::cin >> pass;
}
if(pass != "a1b2c3")// I KNOW I CAN DO IT WITH ELSE, i just don't want
{
std::cout << "Nice Try Mother Fucker" << std::endl;
ErrorMessage("****Wrong Password****");
return -1;
}
if(pass == "a1b2c3") // ur pass...change it above aswell
{
std::cout << "Checking Pass..." << std::endl << std::endl;
std::cout << "-Right Password-" << std::endl << std::endl;
std::cout << "Now Loading..." << std::endl << std::endl;
}
i made it with lots of ifs cuz i don't really care about placing elses and saving memory...well its possible crack it with HEX editor, but u can make it virtually crack proof if u change the pass variables to stuff like "playerattackthicks", thinks that "hackers" won't ever think to do an hex search with
it can be reduced to half of it...just not in the mood
cya