Ejemplo n.º 1
0
 public void onPrivateChatReceived(string sender, string message)
 {
     if (!sender.Equals(GlobalContext.localUsername))
     {
         MoveMessage.HandlePrivateMessage(message);
     }
 }
 public void onJoinRoomDone(RoomEvent roomEventObj)
 {
     if (roomEventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         // reset the local global properties as we are starting a new game play session
         GlobalContext.GameRoomId = roomEventObj.getData().getId();
         Debug.WriteLine("Room Joined !!");
         WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
         // get live information to fetch the name of the opponent if already inside
         WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);
         Deployment.Current.Dispatcher.BeginInvoke(delegate()
         {
             Debug.WriteLine("On Joined Room");
             if (GlobalContext.tableProperties["IsPrivateRoom"].Equals("true") && GlobalContext.AmIOwner)
             {
                 GlobalContext.AmIOwner = false;
                 Debug.WriteLine("Send Invitation");
                 MoveMessage.SendInvitation();
             }
             else
             {
                 App.g_HomePageListener.StartQuiz();
             }
         });
     }
     else
     {
         try
         {
             Deployment.Current.Dispatcher.BeginInvoke(delegate() {
                 Debug.WriteLine("Room Joined Failed " + roomEventObj);
                 WarpClient.GetInstance().CreateRoom("QuizRoom", "QuizRoom", GlobalContext.MaxUsersInRoom, GlobalContext.tableProperties);
             });
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message);
         }
     }
 }
Ejemplo n.º 3
0
 private void btnInvite_Click(object sender, RoutedEventArgs e)
 {
     GlobalContext.RemoteFacebookId = (sender as Button).Tag.ToString();
     for (int i = 0; i < m_FbFriendList.Count; i++)
     {
         if (m_FbFriendList[i].facebookId.Equals(GlobalContext.RemoteFacebookId))
         {
             GlobalContext.RemoteFacebookName = m_FbFriendList[i].username;
         }
     }
     if (GlobalContext.GameRoomId.Equals(""))
     {
         GlobalContext.AmIOwner = true;
         GlobalContext.tableProperties["IsPrivateRoom"] = "true";
         WarpClient.GetInstance().CreateRoom("QuizRoom", "QuizRoom", GlobalContext.MaxUsersInRoom, GlobalContext.tableProperties);
     }
     else
     {
         MoveMessage.SendInvitation();
     }
     messageGrid.Visibility = Visibility.Visible;
 }
Ejemplo n.º 4
0
 public void onUpdatePeersReceived(UpdateEvent eventObj)
 {
     Debug.WriteLine("Update peer received");
     MoveMessage.buildMessage(eventObj.getUpdate());
 }