• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Password protection :D

ravockz

New Member
Joined
Jan 23, 2009
Messages
19
Reaction score
0
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 :p just put it anywhere in otserv.cpp between the "loading echos" or before, wtver suits u:
i left some usefull notes in the code :p

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 :D
it can be reduced to half of it...just not in the mood
cya :D
 
Back
Top