Fixed ProfileAccess over webserver

This commit is contained in:
lukeIam committed 2013-12-13 17:43:15 +01:00
1 parent c29ae91379
commit eca41bab2f
4 files changed
+139 -61

No files matched your search

+15 -5
View File
@@ -197,7 +197,12 @@ namespace Vocaluxe.Base.Server
}
else if (newProfile.Avatar == null)
{
//TODO:standardAvatar
newProfile.Avatar = CProfiles.GetAvatars().First();
/*CAvatar avatar = new CAvatar(-1);
avatar.LoadFromFile("Profiles\\Avatar_f.png");
CProfiles.AddAvatar(avatar);
newProfile.Avatar = avatar;*/
}
if (profile.PlayerName != null && profile.PlayerName != "")
@@ -214,6 +219,11 @@ namespace Vocaluxe.Base.Server
newProfile.Difficulty = (EGameDifficulty)profile.Difficulty;
}
if (profile.Type >= 0 && profile.Type <= 1)
{
newProfile.GuestProfile = (EOffOn)profile.Type;
}
if (existingProfile != null)
{
CProfiles.EditProfile(newProfile);
@@ -412,7 +422,7 @@ namespace Vocaluxe.Base.Server
else
{
return false;
}
}
}
byte[] salt = profile.PasswordSalt;
@@ -476,7 +486,7 @@ namespace Vocaluxe.Base.Server
if (profile == null)
{
throw new ArgumentException("Invalid profileId");
}
}
profile.UserRoles = userRole;
}
@@ -484,8 +494,8 @@ namespace Vocaluxe.Base.Server
private static int getUserIdFromUsername(string username)
{
var playerIds = (from p in CProfiles.GetProfiles()
where String.Equals(p.PlayerName, username,StringComparison.OrdinalIgnoreCase)
select p.ID);
where String.Equals(p.PlayerName, username, StringComparison.OrdinalIgnoreCase)
select p.ID);
if (playerIds.Count() == 0)
{
throw new ArgumentException("Invalid playername");