sharp-chat/SharpChat/Flashii/FlashiiUrls.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2022-08-30 15:42:03 +00:00
using System.IO;
namespace SharpChat.Flashii {
2022-08-30 15:00:58 +00:00
public static class FlashiiUrls {
2022-08-30 15:42:03 +00:00
private const string BASE_URL_FILE = @"msz_url.txt";
private const string BASE_URL = @"https://flashii.net";
private const string AUTH = BASE_URL + @"/_sockchat/verify";
private const string BANS = BASE_URL + @"/_sockchat/bans";
private const string BUMP = BASE_URL + @"/_sockchat/bump";
public static string AuthURL { get; }
public static string BansURL { get; }
public static string BumpURL { get; }
static FlashiiUrls() {
AuthURL = GetURL(AUTH);
BansURL = GetURL(BANS);
BumpURL = GetURL(BUMP);
}
public static string GetBaseURL() {
if(!File.Exists(BASE_URL_FILE))
return BASE_URL;
string url = File.ReadAllText(BASE_URL_FILE).Trim().Trim('/');
if(string.IsNullOrEmpty(url))
return BASE_URL;
return url;
}
public static string GetURL(string path) {
return GetBaseURL() + path;
}
2022-08-30 15:00:58 +00:00
}
}