weew new boot sequence

This commit is contained in:
william341 2017-05-06 16:48:08 -07:00
parent b82dfc16ed
commit 7d744a64d0

View file

@ -98,13 +98,25 @@ namespace ShiftOS.Engine
}
Thread.Sleep(350);
Console.WriteLine("Initiating kernel...");
Console.WriteLine("ShiftKernel v0.4.2");
Console.WriteLine("(MIT) DevX 2017, Very Little Rights Reserved");
Console.WriteLine("");
Console.WriteLine("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR");
Console.WriteLine("IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,");
Console.WriteLine("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE");
Console.WriteLine("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER");
Console.WriteLine("LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,");
Console.WriteLine("OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE");
Console.WriteLine("SOFTWARE.");
Console.WriteLine("");
Thread.Sleep(250);
Console.WriteLine("Reading filesystem...");
Console.WriteLine("[init] Kernel boot complete.");
Console.WriteLine("[sfs] Loading SFS driver v3");
Thread.Sleep(100);
Console.WriteLine("Reading configuration...");
Console.WriteLine("[sfs] 4096 blocks read.");
Console.WriteLine("[simpl-conf] Reading configuration files (global-3.conf)");
Console.WriteLine("{CONNECTING_TO_MUD}");
Console.WriteLine("[inetd] Connecting to network...");
if (defaultConf.ConnectToMud == true)
{
@ -113,7 +125,7 @@ namespace ShiftOS.Engine
{
//Connection successful! Stop waiting!
guidReceived = true;
Console.WriteLine("Connection successful.");
Console.WriteLine("[inetd] Connection successful.");
};
try
@ -125,20 +137,20 @@ namespace ShiftOS.Engine
{
Thread.Sleep(10);
}
Console.WriteLine("GUID received - bootstrapping complete.");
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
FinishBootstrap();
}
catch (Exception ex)
{
//No errors, this never gets called.
Console.WriteLine("{ERROR}: " + ex.Message);
Console.WriteLine("[inetd] SEVERE: " + ex.Message);
Thread.Sleep(3000);
ServerManager.StartLANServer();
while (ServerManager.thisGuid == new Guid())
{
Thread.Sleep(10);
}
Console.WriteLine("GUID received - bootstrapping complete.");
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
FinishBootstrap();
}
}
@ -196,7 +208,7 @@ namespace ShiftOS.Engine
Thread.Sleep(75);
Thread.Sleep(50);
Console.WriteLine("{SYSTEM_INITIATED}");
Console.WriteLine("[usr-man] Accepting logins on local tty 1.");
Sysname:
bool waitingForNewSysName = false;
@ -257,7 +269,7 @@ namespace ShiftOS.Engine
Password = "",
Permissions = UserPermissions.Root
});
Console.WriteLine("No users found. Creating new user with username \"root\", with no password.");
Console.WriteLine("[usr-man] WARN: No users found. Creating new user with username \"root\", with no password.");
}
TerminalBackend.InStory = false;
@ -274,7 +286,9 @@ namespace ShiftOS.Engine
{
if (!string.IsNullOrWhiteSpace(text))
{
if (CurrentSave.Users.FirstOrDefault(x => x.Username == text) == null)
string loginstr = CurrentSave.SystemName + " login: ";
string getuser = text.Remove(0, loginstr.Length);
if (CurrentSave.Users.FirstOrDefault(x => x.Username == getuser) == null)
{
Console.WriteLine("User not found.");
goback = true;
@ -282,7 +296,7 @@ namespace ShiftOS.Engine
TerminalBackend.TextSent -= ev;
return;
}
username = text;
username = getuser;
progress++;
}
else
@ -295,8 +309,10 @@ namespace ShiftOS.Engine
}
else if (progress == 1)
{
string passwordstr = "password: ";
string getpass = text.Remove(0, passwordstr.Length);
var user = CurrentSave.Users.FirstOrDefault(x => x.Username == username);
if (user.Password == text)
if (user.Password == getpass)
{
Console.WriteLine("Welcome to ShiftOS.");
CurrentUser = user;
@ -313,14 +329,15 @@ namespace ShiftOS.Engine
}
};
TerminalBackend.TextSent += ev;
Console.WriteLine(CurrentSave.SystemName + " login:");
Console.Write(CurrentSave.SystemName + " login: ");
while(progress == 0)
{
Thread.Sleep(10);
}
if (goback)
goto Login;
Console.WriteLine("password:");
Console.Write("password: ");
while (progress == 1)
Thread.Sleep(10);
if (goback)