-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKernel.cs
76 lines (74 loc) · 2.31 KB
/
Kernel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
namespace realos
{
public class Kernel : Sys.Kernel
{
int loggedin = 0;
string pcname = "localhost";
string username = "root";
protected override void BeforeRun()
{
Console.WriteLine("OrangeOS Finished Booting.");
}
protected override void Run()
{
if (loggedin == 0)
{
Console.Clear();
Console.WriteLine("Username:");
string readname = Console.ReadLine();
if (readname == username)
{
Console.WriteLine("Password:");
var password = Console.ReadLine();
if (password == "123456")
{
Console.Clear();
Console.WriteLine("Successfully logged in.");
loggedin = 1;
}
else
{
Console.WriteLine("Invalid Password, try again");
}
}
else
{
Console.WriteLine("Invalid Username, try again.");
}
}
else
{
Console.Write(username + "@" + pcname + ": ");
var input = Console.ReadLine();
if (input == "numgame")
{
Numgame.launch();
}
else if (input == "clear" || input == "cls")
{
Console.Clear();
}
else if (input == "help" || input == "?" || input == "hlp")
{
CmdList.ShowList();
}
else if (input == "programs")
{
ProgramList.ShowList();
}
else if (input == "about")
{
Console.WriteLine("OrangeOS v0.1 ALPHA");
}
else
{
Console.WriteLine("Unknown Command or Program.");
}
}
}
}
}