@@ -29,11 +29,23 @@ public ServerInformation(string serverName, string countryImage, string serverAd
2929 this . password = password ;
3030 }
3131 }
32+
33+ class Message
34+ {
35+ public string content { get ; set ; }
36+ public string link { get ; set ; }
37+
38+ public Message ( string content , string link )
39+ {
40+ this . content = content ;
41+ this . link = link ;
42+ }
43+ }
3244
3345 class InvisibleManCore
3446 {
3547 // Initialize
36- public static int bundleIdentifier = 3 ;
48+ public static int bundleIdentifier = 4 ;
3749 public static int index = 0 ;
3850 public static bool isSelectServer = false ;
3951
@@ -290,12 +302,13 @@ public async Task<string> CheckForUpdatesVPN()
290302 /// <summary>
291303 /// Check the server to message
292304 /// </summary>
293- public async Task < string > CheckForMessage ( )
305+ public async Task < Message > CheckForMessage ( )
294306 {
295307 try
296308 {
297309 ServicePointManager . SecurityProtocol = SecurityProtocolType . Ssl3 | SecurityProtocolType . Tls | SecurityProtocolType . Tls11 | SecurityProtocolType . Tls12 ;
298310 var url = "https://invisiblemanvpn.github.io/index.html" ;
311+
299312 HttpClient httpClient = new HttpClient ( ) ;
300313 string html = await httpClient . GetStringAsync ( url ) ;
301314
@@ -306,16 +319,21 @@ public async Task<string> CheckForMessage()
306319 . Equals ( "Message" ) ) . ToList ( ) ;
307320 HtmlAttribute contentHtmlAttribute = htmlNodeList [ 0 ] . Attributes [ "content" ] ;
308321
309- string [ ] message = contentHtmlAttribute . Value . Split ( '|' ) ;
310- int messageTime = Convert . ToInt32 ( message [ 0 ] ) ;
311- string messageContent = message [ 1 ] ;
322+ string [ ] messageString = contentHtmlAttribute . Value . Split ( '|' ) ;
323+ int messageTime = Convert . ToInt32 ( messageString [ 0 ] ) ;
324+ string messageContent = messageString [ 1 ] ;
325+ string messageLink = null ;
326+ if ( messageString . Length == 3 )
327+ messageLink = messageString [ 2 ] ;
328+
329+ Message message = new Message ( messageContent , messageLink ) ;
312330
313331 await Task . Delay ( messageTime * 1000 ) ;
314- return messageContent ;
332+ return message ;
315333 }
316334 catch ( Exception )
317335 {
318- return "FailedToConnect" ;
336+ return new Message ( "FailedToConnect" , null ) ;
319337 }
320338 }
321339 }
0 commit comments