File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,13 @@ internal string GenerateMachineId()
5858 private string FetchMachineIdFromStorage ( )
5959 {
6060 var storedMachineId = PlayerPrefs . GetString ( MachineIdentifierKey ) ;
61+ // in the previous version of the SDK, the stored machine id could be invalid
62+ // to fix the problem, we want to verify if the id is valid and if isn't, fix it.
6163 if ( Guid . TryParse ( storedMachineId , out Guid _ ) )
6264 {
6365 return storedMachineId ;
6466 }
65-
67+
6668 var machineId = ConvertStringToGuid ( storedMachineId ) . ToString ( ) ;
6769 StoreMachineId ( machineId ) ;
6870 return machineId ;
@@ -124,9 +126,13 @@ protected virtual string UseNetworkingIdentifier()
124126
125127 return null ;
126128 }
127-
129+ /// <summary>
130+ /// Converts a string with machine id into guid.
131+ /// </summary>
128132 private Guid ConvertStringToGuid ( string value )
129133 {
134+ // to make sure we're supporting old version of Unity that can use .NET 3.5
135+ // we're using an older API to generate a GUID.
130136 MD5 md5 = new MD5CryptoServiceProvider ( ) ;
131137 return new Guid ( md5 . ComputeHash ( Encoding . UTF8 . GetBytes ( value ) ) ) ;
132138
You can’t perform that action at this time.
0 commit comments