mirror of
https://github.com/islehorse/HISP.git
synced 2025-05-09 04:54:50 +12:00
Begin work on Unit Tests
This commit is contained in:
parent
cf7605c6c9
commit
eaf1db1ee1
51 changed files with 3883 additions and 2101 deletions
HorseIsleServer/MPN00BS
|
@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.8.23.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.23.0")]
|
||||
[assembly: AssemblyVersion("1.8.30.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.30.0")]
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -127,20 +127,19 @@ namespace MPN00BS
|
|||
|
||||
private void CreateAccount(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int newUserId = Database.GetNextFreeUserId();
|
||||
|
||||
// Generate random salt
|
||||
byte[] salt = new byte[64];
|
||||
new Random(Guid.NewGuid().GetHashCode()).NextBytes(salt);
|
||||
|
||||
// Hash password
|
||||
string saltText = BitConverter.ToString(salt).Replace("-", "");
|
||||
string hashsalt = BitConverter.ToString(Authentication.HashAndSalt(passwordBox.Text, salt)).Replace("-", "");
|
||||
|
||||
|
||||
// GENDer? I hardly knew THEM!
|
||||
string gender = ((ComboBoxItem)genderSelectionBox.SelectedItem).Content.ToString();
|
||||
|
||||
// Permissions
|
||||
bool admin = (bool)adminCheckbox.IsChecked;
|
||||
bool mod = (bool)modCheckbox.IsChecked;
|
||||
|
||||
// Credentials
|
||||
string password = passwordBox.Text;
|
||||
string username = usernameBox.Text;
|
||||
|
||||
Database.CreateUser(newUserId, usernameBox.Text, hashsalt, saltText, gender, (bool)adminCheckbox.IsChecked, (bool)modCheckbox.IsChecked);
|
||||
Authentication.CreateAccount(username, password, gender, admin, mod);
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
|
|
@ -122,11 +122,6 @@ namespace MPN00BS
|
|||
ProgressCallback();
|
||||
|
||||
|
||||
if (Database.GetUsers().Length <= 0)
|
||||
{
|
||||
UserCreationCallback();
|
||||
}
|
||||
|
||||
|
||||
// Start HI1 Server
|
||||
ProgressCallback();
|
||||
|
@ -184,6 +179,11 @@ namespace MPN00BS
|
|||
ProgressCallback();
|
||||
HasServerStarted = true;
|
||||
ServerStartedCallback();
|
||||
|
||||
|
||||
|
||||
if (Database.GetUsers().Length <= 0)
|
||||
UserCreationCallback();
|
||||
}
|
||||
|
||||
public static void ModifyConfig(string okey, string value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue