예제 #1
0
 /*
  * private void subscribe()
  * {
  *   _ortc.Subscribe("devices:1", true, OnMessageCallback);
  *   _ortc.Subscribe("devices:admin", true, OnMessageCallback);
  * }
  */
 // CALLING SUBSCRIBE FROM ORTC_OnConnected ** ENSURES WE HAVE CONNECTION BEFORE SUBSCRIBING
 private void ortc_OnConnected(object sender)
 {
     //CREATE A FOR LOOP HERE TO SUB TO CHANNELS IN A CHANNEL LIST (String list)
     _ortc.Subscribe("devices:" + deviceId, true, OnMessageCallback);
     _ortc.Subscribe("devices:admin", true, OnMessageCallback);
     _ortc.Subscribe("devices:100", true, OnMessageCallback);
 }
예제 #2
0
 void ortcClient_OnConnected(object sender)
 {
     ortcClient.Subscribe(Channel, true, OnMessageCallback);
     ActionName = "Disconnect";
     NotifyPropertyChanged("ActionName");
     //  WriteLog("Connected to: " + ortcClient.Url);
 }
        private void OnConnected()
        {
            IsConnecting = false;

            // subscribe pending channels
            foreach (var pendingSubscription in PendingSubscriptions)
            {
                SubscribingChannels.Add(pendingSubscription.Key);
                Client.Subscribe(pendingSubscription.Key, pendingSubscription.Value);
            }

            PendingSubscriptions.Clear();
        }
예제 #4
0
        void OnConnected(object sender)
        {
            Log("Connected to Mr Bootloop\n", true);

            // Subscribe the Realtime channel
            ortcClient.Subscribe("chat", true, OnMessageCallback);
        }
예제 #5
0
 public void JoinGame(string gameId, string userName)
 {
     if (ortcClient.IsConnected)
     {
         GameId = "GeoGames-Fugitive-" + gameId;
         ortcClient.Subscribe(GameId, true, OnMessageCallback);
     }
 }
예제 #6
0
 /// <summary>
 /// Sends the join game message that adds the user into the game and joins the appropiate channels
 /// </summary>
 /// <returns><c>true</c>, if join game was sent, <c>false</c> otherwise.</returns>
 /// <param name="message">Message.</param>
 public bool SendJoinGame(JoinGameMessage message)
 {
     EnsureUsername(message);
     if (client.IsSubscribed(Channel))
     {
         SendHello(new HelloMessage());
     }
     else
     {
         client.Subscribe(Channel, true, OnMessageCallback);
     }
     return(true);
 }
예제 #7
0
        private void btnSubscribe_Click(object sender, EventArgs e)
        {
            Log(String.Format("Subscribing to: {0}...", txtClientChannel.Text));

            _ortc.Subscribe(txtClientChannel.Text, true, OnMessageCallback);
        }
예제 #8
0
 public void DoSubscribe(object sender, RoutedEventArgs e)
 {
     ortcClient.Subscribe(Channel, true, OnMessageCallback);
 }
 public void DoSubscribe(object s, EventArgs e)
 {
     Log("Subscribing...");
     client.Subscribe(Channel, true, OnMessage);
 }
예제 #10
0
 void OnConnected(object sender)
 {
     // Subscribe the Realtime channel
     ortcClient.Subscribe(chatcode, true, OnMessageCallback);
     Debug.WriteLine(chatcode);
 }
예제 #11
0
        void Subscribe()
        {
            Log(String.Format("Subscribing to: {0}...", Channel));

            _ortc.Subscribe(Channel, OnMessageCallback);
        }