/// <summary> /// Manually causes the buffers to update /// </summary> public void Update() { lock (this) { if (IsBusy) { return; } IsBusy = true; } ServerFrameWork.QUWI($"SwMa<{typeof(T).Name}>::Update", Thread); }
/// <summary> /// Shorthand for a few prompt setup tasks /// </summary> private void PostPreparePrompt() { printed = false; queryModeActive = true; if (InCommand) { ServerFrameWork.QUWI("Prompt", InteractiveThread); } if (!printed) { Console.Write($"\r{GetTypedText()}"); } }
/// <summary> /// Handles the wait log creation page. /// Ensures that all information is valid, then creates a new waitlog. /// </summary> private string Wait(HttpListenerRequest request, HttpListenerResponse response) { var targetID = request.QueryString.Get("target"); var session = DB.FindSession(request.QueryString.Get("sid")); if (targetID == null || session == null || !int.TryParse(targetID, out var ID) || session.IsExpired()) { response.StatusCode = 401; } else { if (!DB.FindUser(ID, out var target)) { response.StatusCode = 404; } else { ServerFrameWork.QUWI("Wait", () => DB.CreateNewWaitLog(DB.FindUser(session.UserId), target)); } } return(""); }
/// <summary> /// play the notification sound /// </summary> public static void Notify() => ServerFrameWork.QUWI("Beep", () => Console.Write((byte)7));
/// <summary> /// Play the beep via the console interface /// </summary> public static void Beep() => ServerFrameWork.QUWI("Beep", () => Console.Beep());