melonvpn-original-cs/MelonVPNCore/Messages.cs

39 lines
1.9 KiB
C#
Raw Normal View History

2020-09-22 23:10:16 +01:00
namespace MelonVPNCore
{
public static class Messages
{
public static string EOF = "<EOF>";
public static string Code = "80d168e76f6bd40efe897881f35bcd895459e42a";
public static string StatusMsg = "STATUS::" + Code + EOF;
public static string OnlineMsg = "ONLINE::" + Code + EOF;
public static string OfflineMsg = "OFFLINE::" + Code + EOF;
public static string StartMsg = "START::" + Code + EOF;
public static string StopMsg = "STOP::" + Code + EOF;
public static string ErrorMsg = "ERROR::" + Code + EOF;
public static string ClientListStartMsg = "CLIENTLIST::" + Code + "::";
2020-09-23 20:24:30 +01:00
public static string ClientListEmptyMsg = ClientListStartMsg + "[]" + EOF;
2021-03-19 09:13:32 +00:00
public static string StartingMsg = "STARTING::" + Code + EOF;
public static string RestartingMsg = "RESTARTING::" + Code + EOF;
public static string RestartOnMsg = "RESTART::ON::" + Code + EOF;
public static string RestartOffMsg = "RESTART::OFF::" + Code + EOF;
2020-09-22 23:10:16 +01:00
public static string GetMessage(DataMessage a)
{
if (a == DataMessage.Status) return StatusMsg;
if (a == DataMessage.Online) return OnlineMsg;
if (a == DataMessage.Offline) return OfflineMsg;
if (a == DataMessage.Start) return StartMsg;
if (a == DataMessage.Stop) return StopMsg;
if (a == DataMessage.Error) return ErrorMsg;
2021-03-19 09:13:32 +00:00
if (a == DataMessage.Starting) return StartingMsg;
if (a == DataMessage.Restarting) return RestartingMsg;
if (a == DataMessage.RestartOn) return RestartOnMsg;
if (a == DataMessage.RestartOff) return RestartOffMsg;
2020-09-22 23:10:16 +01:00
if (a == DataMessage.Blank) return EOF;
return EOF;
}
public static string GetClientListMessage(string a) => ClientListStartMsg + a + EOF;
}
}