mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Allow admin telnet connections from localhost without requiring credentials to world
This commit is contained in:
parent
57d75572b2
commit
a81212e1b4
@ -224,9 +224,27 @@ bool Console::Process() {
|
||||
}
|
||||
//if we have not gotten the special markers after this timer, send login prompt
|
||||
if(prompt_timer.Check()) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
|
||||
std::string connecting_ip = inet_ntoa(in);
|
||||
|
||||
SendMessage(2, StringFormat("Establishing connection from IP: %s Port: %d", inet_ntoa(in), GetPort()).c_str());
|
||||
|
||||
if (connecting_ip.find("127.0.0.1") != std::string::npos) {
|
||||
SendMessage(2, StringFormat("Connecting established from local host, auto assuming admin").c_str());
|
||||
state = CONSOLE_STATE_CONNECTED;
|
||||
tcpc->SetEcho(false);
|
||||
admin = 255;
|
||||
SendPrompt();
|
||||
}
|
||||
else {
|
||||
if (tcpc->GetMode() == EmuTCPConnection::modeConsole)
|
||||
tcpc->Send((const uchar*) "Username: ", strlen("Username: "));
|
||||
}
|
||||
|
||||
prompt_timer.Disable();
|
||||
if(tcpc->GetMode() == EmuTCPConnection::modeConsole)
|
||||
tcpc->Send((const uchar*) "Username: ", strlen("Username: "));
|
||||
|
||||
}
|
||||
|
||||
if (timeout_timer.Check()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user