diff --git a/ClientServerLib/ClientServerLib/UserRoles.cs b/ClientServerLib/ClientServerLib/UserRoles.cs
index b352317c..31bdfa95 100644
--- a/ClientServerLib/ClientServerLib/UserRoles.cs
+++ b/ClientServerLib/ClientServerLib/UserRoles.cs
@@ -5,7 +5,8 @@ namespace ServerLib
[Flags]
internal enum EUserRoles
{
- AuthenticatedUser = 0,
- Administrator = 1
+ GuestUser = 0,
+ AuthenticatedUser = 1,
+ Administrator = 2
}
}
diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml
index 03dfddc2..128e9dd4 100644
--- a/Output/Languages/English.xml
+++ b/Output/Languages/English.xml
@@ -26,6 +26,9 @@
Wannabe
Amateur
Tone Deaf
+ Guest
+ Normal User
+ Administrator
Software
OpenGL
Direct3D
@@ -147,7 +150,7 @@
Player Name
Game Difficulty
Avatar
- Guest Profile
+ User Role
Active
New
Delete
diff --git a/Output/Themes/Ambient/Screens/ScreenProfiles.xml b/Output/Themes/Ambient/Screens/ScreenProfiles.xml
index 919a580d..1fb4ce6f 100644
--- a/Output/Themes/Ambient/Screens/ScreenProfiles.xml
+++ b/Output/Themes/Ambient/Screens/ScreenProfiles.xml
@@ -1,7 +1,7 @@
- 2
+ 3
Video
@@ -265,7 +265,7 @@
Outline
- TR_SCREENPROFILES_GUESTPROFILE
+ TR_SCREENPROFILES_USERROLE
@@ -989,7 +989,7 @@
3
-
+
Invisible
@@ -1055,7 +1055,7 @@
Bold
2
-
+
Invisible
diff --git a/Output/Themes/Changelog/Changelog_ScreenProfiles.txt b/Output/Themes/Changelog/Changelog_ScreenProfiles.txt
index 65dae6e8..3c741fc1 100644
--- a/Output/Themes/Changelog/Changelog_ScreenProfiles.txt
+++ b/Output/Themes/Changelog/Changelog_ScreenProfiles.txt
@@ -1,4 +1,7 @@
ScreenProfiles
+++++++++++
+Version 3:
+Rename: to
++++++++++
Version 2:
diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs
index 44f996fe..dd683f3c 100644
--- a/Vocaluxe/Base/CProfiles.cs
+++ b/Vocaluxe/Base/CProfiles.cs
@@ -433,17 +433,17 @@ namespace Vocaluxe.Base
_Profiles[profileID].Difficulty = difficulty;
}
- public static EOffOn GetGuestProfile(int profileID)
+ public static EUserRole GetUserRoleProfile(int profileID)
{
- return IsProfileIDValid(profileID) ? _Profiles[profileID].GuestProfile : EOffOn.TR_CONFIG_OFF;
+ return IsProfileIDValid(profileID) ? _Profiles[profileID].UserRole : EUserRole.TR_USERROLE_GUEST;
}
- public static void SetGuestProfile(int profileID, EOffOn option)
+ public static void SetUserRoleProfile(int profileID, EUserRole option)
{
if (!IsProfileIDValid(profileID))
return;
- _Profiles[profileID].GuestProfile = option;
+ _Profiles[profileID].UserRole = option;
}
public static EOffOn GetActive(int profileID)
@@ -464,7 +464,7 @@ namespace Vocaluxe.Base
if (!IsProfileIDValid(profileID))
return true; // this will prevent from saving dummy profiles to highscore db
- return _Profiles[profileID].GuestProfile == EOffOn.TR_CONFIG_ON;
+ return _Profiles[profileID].UserRole == EUserRole.TR_USERROLE_GUEST;
}
public static bool IsActive(int profileID)
diff --git a/Vocaluxe/Base/Server/CVocaluxeServer.cs b/Vocaluxe/Base/Server/CVocaluxeServer.cs
index d64bbf4d..f4470328 100644
--- a/Vocaluxe/Base/Server/CVocaluxeServer.cs
+++ b/Vocaluxe/Base/Server/CVocaluxeServer.cs
@@ -184,7 +184,7 @@ namespace Vocaluxe.Base.Server
AvatarFileName = existingProfile.AvatarFileName,
Avatar = existingProfile.Avatar,
Difficulty = existingProfile.Difficulty,
- GuestProfile = existingProfile.GuestProfile,
+ UserRole = existingProfile.UserRole,
PlayerName = existingProfile.PlayerName
};
}
@@ -193,7 +193,7 @@ namespace Vocaluxe.Base.Server
newProfile = new CProfile
{
Active = EOffOn.TR_CONFIG_ON,
- GuestProfile = EOffOn.TR_CONFIG_OFF
+ UserRole = EUserRole.TR_USERROLE_NORMAL
};
}
@@ -228,7 +228,7 @@ namespace Vocaluxe.Base.Server
if (profile.Type >= 0 && profile.Type <= 1)
{
- newProfile.GuestProfile = (EOffOn)profile.Type;
+ newProfile.UserRole = (EUserRole)profile.Type;
}
if (!string.IsNullOrEmpty(profile.Password))
@@ -281,7 +281,7 @@ namespace Vocaluxe.Base.Server
IsEditable = !isReadonly,
ProfileId = profile.ID,
PlayerName = profile.PlayerName,
- Type = (int)profile.GuestProfile,
+ Type = (int)profile.UserRole,
Difficulty = (int)profile.Difficulty
};
@@ -673,7 +673,7 @@ namespace Vocaluxe.Base.Server
throw new ArgumentException("Invalid profileId");
}
- return profile.UserRoles;
+ return (int)profile.UserRole;
}
private static void _SetUserRole(int profileId, int userRole)
@@ -684,7 +684,7 @@ namespace Vocaluxe.Base.Server
throw new ArgumentException("Invalid profileId");
}
- profile.UserRoles = userRole;
+ profile.UserRole = (EUserRole)userRole;
CProfiles.EditProfile(profile);
CProfiles.Update();
diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs
index 24aef79b..7e567a38 100644
--- a/Vocaluxe/Screens/CScreenProfiles.cs
+++ b/Vocaluxe/Screens/CScreenProfiles.cs
@@ -40,13 +40,13 @@ namespace Vocaluxe.Screens
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
- get { return 2; }
+ get { return 3; }
}
private const string _SelectSlideProfiles = "SelectSlideProfiles";
private const string _SelectSlideDifficulty = "SelectSlideDifficulty";
private const string _SelectSlideAvatars = "SelectSlideAvatars";
- private const string _SelectSlideGuestProfile = "SelectSlideGuestProfile";
+ private const string _SelectSlideUserRole = "SelectSlideUserRole";
private const string _SelectSlideActive = "SelectSlideActive";
private const string _ButtonPlayerName = "ButtonPlayerName";
private const string _ButtonExit = "ButtonExit";
@@ -73,7 +73,7 @@ namespace Vocaluxe.Screens
_ThemeButtons = new string[]
{_ButtonPlayerName, _ButtonExit, _ButtonSave, _ButtonNew, _ButtonDelete, _ButtonWebcam, _ButtonSaveSnapshot, _ButtonDiscardSnapshot, _ButtonTakeSnapshot};
- _ThemeSelectSlides = new string[] {_SelectSlideProfiles, _SelectSlideDifficulty, _SelectSlideAvatars, _SelectSlideGuestProfile, _SelectSlideActive};
+ _ThemeSelectSlides = new string[] {_SelectSlideProfiles, _SelectSlideDifficulty, _SelectSlideAvatars, _SelectSlideUserRole, _SelectSlideActive};
_ThemeStatics = new string[] {_StaticAvatar};
_EditMode = EEditMode.None;
@@ -91,7 +91,7 @@ namespace Vocaluxe.Screens
_Buttons[_ButtonTakeSnapshot].Visible = false;
_Buttons[_ButtonWebcam].Visible = CWebcam.IsDeviceAvailable();
_SelectSlides[_SelectSlideDifficulty].SetValues(0);
- _SelectSlides[_SelectSlideGuestProfile].SetValues(0);
+ _SelectSlides[_SelectSlideUserRole].SetValues(0);
_SelectSlides[_SelectSlideActive].SetValues(0);
_Statics[_StaticAvatar].Aspect = EAspect.Crop;
}
@@ -176,10 +176,10 @@ namespace Vocaluxe.Screens
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].ValueIndex,
_SelectSlides[_SelectSlideAvatars].ValueIndex);
}
- else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
+ else if (_SelectSlides[_SelectSlideUserRole].Selected)
{
- CProfiles.SetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
- (EOffOn)_SelectSlides[_SelectSlideGuestProfile].Selection);
+ CProfiles.SetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
+ (EUserRole)_SelectSlides[_SelectSlideUserRole].Selection);
}
else if (_SelectSlides[_SelectSlideActive].Selected)
{
@@ -225,10 +225,10 @@ namespace Vocaluxe.Screens
if (CWebcam.IsDeviceAvailable() && _WebcamTexture != null)
_OnDiscardSnapshot();
}
- else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
+ else if (_SelectSlides[_SelectSlideUserRole].Selected)
{
- CProfiles.SetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
- (EOffOn)_SelectSlides[_SelectSlideGuestProfile].Selection);
+ CProfiles.SetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
+ (EUserRole)_SelectSlides[_SelectSlideUserRole].Selection);
}
else if (_SelectSlides[_SelectSlideActive].Selected)
{
@@ -265,7 +265,7 @@ namespace Vocaluxe.Screens
_Buttons[_ButtonPlayerName].Text.Text += "|";
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_SelectSlides[_SelectSlideProfiles].ValueIndex);
- _SelectSlides[_SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex);
+ _SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex);
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(_SelectSlides[_SelectSlideProfiles].ValueIndex);
int avatarID = CProfiles.GetAvatarID(_SelectSlides[_SelectSlideProfiles].ValueIndex);
@@ -428,7 +428,7 @@ namespace Vocaluxe.Screens
if (!keep)
{
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
- _SelectSlides[_SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(selectedProfileID);
+ _SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(selectedProfileID);
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(selectedProfileID);
_SelectSlides[_SelectSlideAvatars].SetSelectionByValueIndex(CProfiles.GetAvatarID(selectedProfileID));
}
diff --git a/VocaluxeLib/Enums.cs b/VocaluxeLib/Enums.cs
index ca33f94e..cabbe88e 100644
--- a/VocaluxeLib/Enums.cs
+++ b/VocaluxeLib/Enums.cs
@@ -349,4 +349,11 @@ namespace VocaluxeLib
NoPopup = -1
}
+
+ public enum EUserRole
+ {
+ TR_USERROLE_GUEST = 0,
+ TR_USERROLE_NORMAL = 1,
+ TR_USERROLE_ADMIN = 2
+ }
}
\ No newline at end of file
diff --git a/VocaluxeLib/Menu/CNameSelection.cs b/VocaluxeLib/Menu/CNameSelection.cs
index d162d539..c3e2501f 100644
--- a/VocaluxeLib/Menu/CNameSelection.cs
+++ b/VocaluxeLib/Menu/CNameSelection.cs
@@ -508,7 +508,7 @@ namespace VocaluxeLib.Menu
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
{
//Don't show profile if is selected, but if selected and guest
- if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID && profile.GuestProfile == EOffOn.TR_CONFIG_OFF)
+ if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID && profile.UserRole == EUserRole.TR_USERROLE_GUEST)
visible = false;
}
}
diff --git a/VocaluxeLib/Profile/CProfile.cs b/VocaluxeLib/Profile/CProfile.cs
index 466de93f..21b10e03 100644
--- a/VocaluxeLib/Profile/CProfile.cs
+++ b/VocaluxeLib/Profile/CProfile.cs
@@ -32,7 +32,6 @@ namespace VocaluxeLib.Profile
public string AvatarFileName;
public byte[] PasswordHash;
public byte[] PasswordSalt;
- public int UserRoles;
public EGameDifficulty Difficulty;
@@ -47,7 +46,7 @@ namespace VocaluxeLib.Profile
}
}
- public EOffOn GuestProfile;
+ public EUserRole UserRole;
public EOffOn Active;
public CProfile()
@@ -55,7 +54,7 @@ namespace VocaluxeLib.Profile
PlayerName = String.Empty;
Difficulty = EGameDifficulty.TR_CONFIG_EASY;
Avatar = new CAvatar(-1);
- GuestProfile = EOffOn.TR_CONFIG_OFF;
+ UserRole = EUserRole.TR_USERROLE_NORMAL;
Active = EOffOn.TR_CONFIG_ON;
AvatarFileName = String.Empty;
@@ -88,7 +87,7 @@ namespace VocaluxeLib.Profile
xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
xmlReader.GetValue("//root/Info/Avatar", out AvatarFileName, String.Empty);
- xmlReader.TryGetEnumValue("//root/Info/GuestProfile", ref GuestProfile);
+ xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
string passwordHash;
xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash, "");
@@ -96,9 +95,6 @@ namespace VocaluxeLib.Profile
string passwordSalt;
xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt, "");
PasswordSalt = !string.IsNullOrEmpty(passwordSalt) ? Convert.FromBase64String(passwordSalt) : null;
- string userRoles;
- xmlReader.GetValue("//root/Info/UserRoles", out userRoles, "0");
- Int32.TryParse(userRoles, out UserRoles);
return true;
}
@@ -157,7 +153,7 @@ namespace VocaluxeLib.Profile
writer.WriteElementString("PlayerName", PlayerName);
writer.WriteElementString("Difficulty", Enum.GetName(typeof(EGameDifficulty), Difficulty));
writer.WriteElementString("Avatar", Path.GetFileName(Avatar.FileName));
- writer.WriteElementString("GuestProfile", Enum.GetName(typeof(EOffOn), GuestProfile));
+ writer.WriteElementString("UserRole", Enum.GetName(typeof(EUserRole), UserRole));
writer.WriteElementString("Active", Enum.GetName(typeof(EOffOn), Active));
if (PasswordHash != null)
{
@@ -167,7 +163,6 @@ namespace VocaluxeLib.Profile
{
writer.WriteElementString("PasswordSalt", Convert.ToBase64String(PasswordSalt));
}
- writer.WriteElementString("UserRoles", UserRoles.ToString());
writer.WriteEndElement();
writer.WriteEndElement(); //end of root