Changed GuestProfile-option on profiles to UserRole. UserRole could now be set from Vocaluxe.
This commit is contained in:
1 parent
d9a2ea8ce0
commit
352b0181fa
10 files changed
+49
-40
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user