55using System . Collections . Generic ;
66using System . Globalization ;
77using System . IO ;
8+ using System . Linq ;
89using System . Text . RegularExpressions ;
910using System . Threading ;
1011using ServiceStack . Text ;
@@ -159,20 +160,26 @@ public static void AssertEvaluationLicense()
159160 "See https://servicestack.net to upgrade to a valid license." ) . Trace ( ) ;
160161 }
161162
163+ private static readonly int [ ] revokedSubs = new [ ] { 4018 , 4019 , 4041 } ;
164+
162165 private static LicenseKey __activatedLicense ;
163166 public static void RegisterLicense ( string licenseKeyText )
164167 {
165168 JsConfig . InitStatics ( ) ;
166169
167- string cutomerId = null ;
170+ string subId = null ;
168171#if ! PCL
169172 var hold = Thread . CurrentThread . CurrentCulture ;
170173 Thread . CurrentThread . CurrentCulture = CultureInfo . InvariantCulture ;
171174#endif
172175 try
173176 {
174177 var parts = licenseKeyText . SplitOnFirst ( '-' ) ;
175- cutomerId = parts [ 0 ] ;
178+ subId = parts [ 0 ] ;
179+
180+ int subIdInt ;
181+ if ( int . TryParse ( subId , out subIdInt ) && revokedSubs . Contains ( subIdInt ) )
182+ throw new LicenseException ( "This subscription has been revoked. " + ContactDetails ) ;
176183
177184 var key = PclExport . Instance . VerifyLicenseKeyText ( licenseKeyText ) ;
178185
@@ -193,8 +200,8 @@ public static void RegisterLicense(string licenseKeyText)
193200 throw ;
194201
195202 var msg = "This license is invalid." + ContactDetails ;
196- if ( ! string . IsNullOrEmpty ( cutomerId ) )
197- msg += " The id for this license is '{0}'" . Fmt ( cutomerId ) ;
203+ if ( ! string . IsNullOrEmpty ( subId ) )
204+ msg += " The id for this license is '{0}'" . Fmt ( subId ) ;
198205
199206 throw new LicenseException ( msg ) . Trace ( ) ;
200207 }
0 commit comments