예제 #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);
        }
예제 #2
0
        private void btnUnsubscribe_Click(object sender, EventArgs e)
        {
            Log(String.Format("Unsubscribing from: {0}...", txtClientChannel.Text));

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

            _ortc.Unsubscribe(Channel);
        }