alvyxaz / barebones-masterserver

Master Server framework for Unity
475 stars 106 forks source link

FillProfileValues always retrieves nothing #201

Closed Sorgon closed 6 years ago

Sorgon commented 6 years ago
var profile = new ObservableServerProfile(Username)
{
            new ObservableFloat(OozePlayerProfileCreator.OozeProfileKeys.LastPosX, -1f)
};

Msf.Server.Profiles.FillProfileValues(profile, (successful, error) =>
        {
            if (!successful)
            {
                Debug.LogError("Failed to retrieve profile values: " + error, Color.red);
                return;
            }
            else
            {
                Debug.Log("1)Retrieved profile for " + Username + ", lastPosX: " + lastPosX.Value);
}
}

Even though in database my float value is saved correctly, my game server cannot retrieve it. I always get lastPosX as the default -1. When I get the property and set it, it changes in the database. I merely cannot retrieve it.

Sorgon commented 6 years ago

Reason for this issue: bug in ProfilesModule on line 136, instead of if (!user.AccountData.IsGuest) should be user.AccountData.IsGuest.

// Restore profile data from database (only if not a guest)
            if (!user.AccountData.IsGuest)
            {