示例#1
0
 /// <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);
     }
 }
示例#2
0
 public static void UpdatePlayers()
 {
     while (WebSocketsWrapper.IsConnected())
     {
         WebSocketsWrapper.SendCommand("playerlist");
         Thread.Sleep(TimeSpan.FromSeconds(10));
     }
 }
示例#3
0
 /// <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);
 }