public void StartGame(string adress, int port) { _client = new TcpClient(); try { _client.Connect(adress, port); _stream = _client.GetStream(); string message = string.Concat("referee:", _wordProvider.GetRandomWord()); byte[] data = Encoding.Unicode.GetBytes(message); _stream.Write(data, 0, data.Length); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Disconnect(); } }
public ActionResult Reset() { Game = new HangmanGame(_wordProvider.GetRandomWord()); Session["HangmanGame"] = Game; return(View("ShowGame", Game)); }