Ejemplo n.º 1
0
        /// <summary>
        /// Sends the surrender message
        /// </summary>
        /// <returns><c>true</c>, if surrender was sent, <c>false</c> otherwise.</returns>
        /// <param name="message">Message.</param>
        public bool SendSurrender(SurrenderMessage message)
        {
            EnsureUsername(message);

            if (client.IsConnected && client.IsSubscribed(Channel))
            {
                string data = System.Web.HttpUtility.UrlEncode(JsonConvert.SerializeObject(message));
                client.Send(Channel, data);
                client.Unsubscribe(Channel);
            }
            else
            {
                throw new Exception("not connected. Call Join Game first");
            }

            return(true);
        }
Ejemplo n.º 2
0
        private void btnUnsubscribe_Click(object sender, EventArgs e)
        {
            Log(String.Format("Unsubscribing from: {0}...", txtClientChannel.Text));

            _ortc.Unsubscribe(txtClientChannel.Text);
        }
Ejemplo n.º 3
0
 public void DoUnsubscribe(object sender, RoutedEventArgs e)
 {
     ortcClient.Unsubscribe(Channel);
 }
 public void DoUnsubscribe(object s, EventArgs e)
 {
     Log("Unsubscribing...");
     client.Unsubscribe(Channel);
 }
Ejemplo n.º 5
0
 public void LeaveGame(string gameId, string userName)
 {
     ortcClient.Unsubscribe(GameId);
     GameId = null;
 }
Ejemplo n.º 6
0
        void Unsubscribe()
        {
            Log(String.Format("Unsubscribing from: {0}...", Channel));

            _ortc.Unsubscribe(Channel);
        }