コード例 #1
0
        private void FlushStatsToUserProfile()
        {
            if (!NetworkClient.active)
            {
                Debug.LogWarning("[Client] function 'System.Void RoR2.Stats.PlayerStatsComponent::FlushStatsToUserProfile()' called on server");
                return;
            }
            StatSheet.GetDelta(this.clientDeltaStatsBuffer, this.currentStats, this.recordedStats);
            StatSheet.Copy(this.currentStats, this.recordedStats);
            NetworkUser networkUser = this.playerCharacterMasterController.networkUser;
            LocalUser   localUser   = (networkUser != null) ? networkUser.localUser : null;

            if (localUser == null)
            {
                return;
            }
            UserProfile userProfile = localUser.userProfile;

            if (userProfile == null)
            {
                return;
            }
            userProfile.ApplyDeltaStatSheet(this.clientDeltaStatsBuffer);
        }