public WorldManagerPlayerInformation(WorldManagerMenu parent)
 {
     InitializeComponent();
     //Reference this form as a child of Menu on form load to enable button
     //activation in menu from this form
     this.parent = parent;
 }
Exemplo n.º 2
0
 private void BtnLogIn_Click(object sender, EventArgs e)
 {
     //If either of the text boxes on form are empty, then alert user of issue
     if (string.IsNullOrEmpty(TbUserName.Text) || string.IsNullOrEmpty(TbPassword.Text))
     {
         toolStripStatusLabel1.Text = "Please Enter Both your Username and Password Before Login!";
     }
     //If both text boxes are not empty, then create string. hash and match to hardcoded string
     else if (!string.IsNullOrEmpty(TbUserName.Text) && !string.IsNullOrEmpty(TbPassword.Text))
     {
         //Update user (unlikely user will ever see this message)
         toolStripStatusLabel1.Text = "Checking for log-in validity...";
         //Create log in string which will be converted to SHA256
         string checkLogIn = TbUserName.Text + "," + TbPassword.Text;
         //Compute hashing
         string hashedLogIn = ComputeSHA256(checkLogIn);
         //Equality check on SHA 256 for correct log-in information
         if (hashedLogIn.Equals("D6234DAF47D9A155CDF5FA8149928219DCFC442648B8007323C3675472EA4616"))
         {
             toolStripStatusLabel1.Text = "Access Allowed";
             WorldManagerMenu worldManagerMenu = new WorldManagerMenu(this);
             this.Hide();
             worldManagerMenu.ShowDialog();
         }
         else
         {
             toolStripStatusLabel1.Text = "Access Denied, Please Try Again";
         }
     }
 }
 public WorldManagerSpellCompendium(WorldManagerMenu parent)
 {
     InitializeComponent();
     this.parent = parent;
 }