File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,26 @@ private void DrawGameSettings()
91
91
if ( EditorGUI . EndChangeCheck ( ) )
92
92
{
93
93
gameSettings . domainKey = m_CustomSettings . FindProperty ( "domainKey" ) . stringValue ;
94
+
95
+ string domainkey = m_CustomSettings . FindProperty ( "domainKey" ) . stringValue ;
96
+
97
+ string pattern = @"(?<=https://)\w+(?=\.api\.lootlocker\.io/)" ;
98
+ Regex regex = new Regex ( pattern ) ;
99
+ Match match = regex . Match ( domainkey ) ;
100
+
101
+ if ( match . Success )
102
+ {
103
+ string regexKey = match . Value ;
104
+ Debug . LogWarning ( "You accidentally used the domain url instead of the domain key,\n We took the domain key from the url.: " + regexKey ) ;
105
+ gameSettings . domainKey = regexKey ;
106
+ m_CustomSettings . FindProperty ( "domainKey" ) . stringValue = regexKey ;
107
+ }
108
+ else
109
+ {
110
+ gameSettings . domainKey = domainkey ;
111
+ m_CustomSettings . FindProperty ( "domainKey" ) . stringValue = domainkey ;
112
+ }
113
+
94
114
}
95
115
var domainContent = new GUIContent ( ) ;
96
116
domainContent . text = "Domain key can be found in `Settings > API Keys` in the Web Console: https://console.lootlocker.com/settings/api-keys" ;
You can’t perform that action at this time.
0 commit comments