/// <summary> /// Called when a key is pressed in the command box /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void textBoxCommand_KeyPress(object sender, KeyPressEventArgs e) { if ((ConsoleKey)e.KeyChar == ConsoleKey.Enter) { WebSocketsWrapper.SendCommand(textBoxCommand.Text); } }
public static void UpdatePlayers() { while (WebSocketsWrapper.IsConnected()) { WebSocketsWrapper.SendCommand("playerlist"); Thread.Sleep(TimeSpan.FromSeconds(10)); } }
/// <summary> /// Called when "Send" (command) button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonCommand_Click(object sender, EventArgs e) { WebSocketsWrapper.SendCommand(textBoxCommand.Text); }