Esempio n. 1
0
        public void onCreateRoomDone(RoomEvent eventObj)
        {
            Log ("onCreateRoomDone : " + eventObj.getResult());
            if (eventObj.getResult () == 0) {
                WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());

            }
        }
Esempio n. 2
0
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     Console.WriteLine("onJoinRoomDone as "+eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Console.WriteLine("Subscribing Room "+Constants.CHAT_ROOM_ID);
         WarpClient.GetInstance().SubscribeRoom(Constants.CHAT_ROOM_ID);
     }
 }
Esempio n. 3
0
 public void OnCreateRoomDone(RoomEvent eventObj)
 {
     Debug.Log("OnCreateRoomDone " + eventObj.getResult() + " room Owner " + eventObj.getData().getRoomOwner() + " " + eventObj.getData().getRoomOwner());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         roomId = eventObj.getData().getId();
         SC_AppWarpKit.JoinToRoom(eventObj.getData().getId());
     }
 }
 public void OnCreateRoomDone(RoomEvent eventObj)
 {
     Debug.Log("OnCreateRoomDone " + eventObj.getResult() + " room Owner " + eventObj.getData().getRoomOwner() + " " + eventObj.getData().getRoomOwner());
     if(eventObj.getResult() == 	WarpResponseResultCode.SUCCESS)
     {
         roomId = eventObj.getData ().getId ();
         guiText.text += "Room created! " +  eventObj.getData ().getId () + System.Environment.NewLine;
         SC_AppWarpKit.JoinToRoom(eventObj.getData().getId());
     }
 }
Esempio n. 5
0
 public void onCreateRoomDone(RoomEvent eventObj)
 {
     Log("onCreateRoomDone : ", eventObj.getResult());
     if (eventObj.getResult() == 0)
     {
         AppWarp.roomID = eventObj.getData().getId();
         Log(AppWarp.roomID);
         WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());
     }
 }
Esempio n. 6
0
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if(eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SubscribeRoom(AppWarp.roomid);
     }
     else {
         Debug.Log("There are alredy 2 user wait for some time");
     }
     Log ("onJoinRoomDone : " + eventObj.getResult());
 }
Esempio n. 7
0
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == 0 && OnJoinRoom != null)
     {
         OnJoinRoom(true, eventObj.getData().getId());
     }
     else if (eventObj.getResult() == 0 && OnJoinRoom != null)
     {
         OnJoinRoom(false, string.Empty);
     }
 }
Esempio n. 8
0
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     Debug.Log("Join Room " + eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());
     }
     else
     {
         createTable();
     }
 }
Esempio n. 9
0
 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     Console.WriteLine("onSubscribeRoomDone as "+eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         InvokeOnMainThread (delegate {
             nameTextField.ResignFirstResponder();
             ChatController cc = new ChatController();
             this.NavigationController.PushViewController(cc, true);
         });
     }
 }
Esempio n. 10
0
 public void onCreateRoomDone(RoomEvent eventObj)
 {
     Debug.Log("Room Creation " + eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         this.roomCreation = true;
         this.roomID       = int.Parse(eventObj.getData().getId());
         WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());
     }
     else
     {
         createTable();
     }
 }
Esempio n. 11
0
        //RoomRequestListener
        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            Debug.Log("onSubscribeRoomDone : " + eventObj.getResult());
            string roomid = "";

            if (eventObj.getResult() == 0)
            {
                roomid = eventObj.getData().getId();
//				WarpClient.GetInstance().startGame();
//				string json = "{\"start\":\""+roomid+"\"}";
//				WarpClient.GetInstance().SendChat(json);
                //WarpClient.GetInstance().JoinRoom("1170889653");
            }
        }
 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         //WarpClient.GetInstance().SendChat("hello");
     }
 }
Esempio n. 13
0
 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult () == WarpResponseResultCode.SUCCESS) {
         StartActivity(typeof(ChatActivity));
         this.Finish();
     }
 }
 public void onLeaveRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         _page.showResult("Yay! Leave room :)");
     }
 }
Esempio n. 15
0
 public void onUnSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
       //  _page.showresult("Yay! UnSubscribe room :)");
     }
 }
Esempio n. 16
0
 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     System.Diagnostics.Debug.WriteLine("subscribe room");
     
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Global.warpClient.GetLiveRoomInfo(Global.DynRoomId);
     }
 }
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         _page.showResult("joined room!");
         //WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());
     }
     else
     {
         _page.showResult("failed to join room!");
     }
 }
Esempio n. 18
0
        public void onJoinRoomDone(RoomEvent eventObj)
        {

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                Global.roomJoined = true;

                System.Diagnostics.Debug.WriteLine("joined room");
            
                Global.DynRoomId = eventObj.getData().getId();
                Global.warpClient.SubscribeRoom(Global.DynRoomId);
                
                if(!Global.PlayerIsFirst)
                    Global.opponentUsername = eventObj.getData().getRoomOwner();
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    _page.ready.Text = Global.localUsername + " \nvs\n" + Global.opponentUsername;
                });

            }
            else if (eventObj.getResult() == WarpResponseResultCode.RESOURCE_NOT_FOUND)
            {
                System.Diagnostics.Debug.WriteLine("room not found .. hence creating");
                Global.PlayerIsFirst = true;
                Global.dictionary = new Dictionary<string,object>();
                Global.dictionary.Add("category", Global.itemName[(int)settings["trigger"]]);
                Global.dictionary.Add("availUsers", 0);
                Global.dictionary.Add("score0", 0);
                Global.dictionary.Add("score1", 0);
                Global.dictionary.Add("status", "notyetstarted");
                
                Global.dictionary.Add("ready0", false);
                Global.dictionary.Add("ready1", false);
                
                // first for buffering - later per question

                Global.dictionary.Add("endgame0", false);
                Global.dictionary.Add("endgame1", false);

                int[] temp = randomize(Global.maxClips[(int)settings["trigger"]]);

                for (int i = 0; i < 5; i++ )
                {
                    Global.dictionary.Add("q" + (i+1), temp[i]);
                }


                Global.warpClient.CreateRoom(Global.localUsername, Global.localUsername, 2, Global.dictionary);
                System.Diagnostics.Debug.WriteLine("request to create room");
            
            }
            // Global.warpClient.LeaveRoom(eventObj.getData().getId());
        }
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("There are alredy 2 user wait for some time");
         });
     }
 }
Esempio n. 20
0
        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            if(eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                /*string json = "{\"start\":\""+id+"\"}";
                WarpClient.GetInstance().SendChat(json);
                state = 1;*/
            //				WarpClient.GetInstance().JoinRoom(AppWarp.roomid);
                AppWarp.isConnected = true;
                WarpClient.GetInstance().GetLiveRoomInfo(AppWarp.roomid);
            }

            Log ("onSubscribeRoomDone : " + eventObj.getResult());
        }
        /// Invoked when a response for DeleteRoom request is receieved.
        /// <param name="eventObj"></param>
        public void onDeleteRoomDone(RoomEvent eventObj)
        {
            Global.deleteSuccess = true;

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {

                System.Diagnostics.Debug.WriteLine("zone listener - room deleted");
            
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show("Yay! Deleted room :)");
                });
            }
        }
        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);
                }
            }
        }
        public void onJoinRoomDone(RoomEvent eventObj)
        {
            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                // reset the local global properties as we are starting a new game play session
                GlobalContext.tableProperties["Player1Score"] = 0;
                GlobalContext.tableProperties["Player1Score"]=0;
                GlobalContext.tableProperties["Player2Score"]=0;
                GlobalContext.tableProperties["WindX"]=0;
                GlobalContext.tableProperties["WindY"]=0;
                GlobalContext.tableProperties["fireNumber"]=1;
                GlobalContext.GameRoomId = eventObj.getData().getId();
                WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
                // get live information to fetch the name of the opponent if already inside
                WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);
            }
            else
            {
                try
                {
                    if (GlobalContext.tableProperties["IsPrivateRoom"].ToString().Equals("true",StringComparison.InvariantCultureIgnoreCase))
                    {
                        // failed to join a private room
                        Deployment.Current.Dispatcher.BeginInvoke(new ShowResultCallback(mShowResultCallback), "Sorry,Remote has already got the partner!!");
                    }
                    else
                    {
                        // failed to join a random room, create a new one
                        WarpClient.GetInstance().CreateTurnRoom("TurnBasedRoom", GlobalContext.localUsername, 2, GlobalContext.tableProperties,GlobalContext.turnTime);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);

                }
            }
        }
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if(eventObj.getResult() == 0)
     {
         //state = 1;
     }
     Log ("onJoinRoomDone : " + eventObj.getResult());
 }
        //RoomRequestListener
        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            if(eventObj.getResult() == 0)
            {
                /*string json = "{\"start\":\""+id+"\"}";
                WarpClient.GetInstance().SendChat(json);
                state = 1;*/
                //WarpClient.GetInstance().JoinRoom(m_apppwarp.roomid);
            }

            Log ("onSubscribeRoomDone : " + eventObj.getResult());
        }
 //ZoneRequestListener
 public void onDeleteRoomDone(RoomEvent eventObj)
 {
     Log ("onDeleteRoomDone : " + eventObj.getResult());
 }
Esempio n. 27
0
 public void onCreateRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SetCustomRoomData(eventObj.getData().getId(), "This is a sample room");
         _page.showResult("name " + eventObj.getData().getName() + " and Id " + eventObj.getData().getId());
     }
 }
 public void onLeaveRoomDone(RoomEvent eventObj)
 {
     Debug.WriteLine("On Leave Room Done"+eventObj.getResult());
     WarpClient.GetInstance().Disconnect();
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         GlobalContext.opponentName = "No Opponent";
     }
 }
 public void onUnSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         //Deployment.Current.Dispatcher.BeginInvoke(new ShowResultCallback(mShowResultCallback), "Yay! UnSubscribe room");
     }
 }
 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         //WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);
     }
 }
 public void onLeaveRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         //Deployment.Current.Dispatcher.BeginInvoke(new ShowResultCallback(mShowResultCallback), "Yay! Leave room :");
         GlobalContext.tableProperties["Player1Score"] = 0;
         GlobalContext.tableProperties["Player2Score"] = 0;
         GlobalContext.tableProperties["WindX"] = 0;
         GlobalContext.tableProperties["WindY"] = 0;
         GlobalContext.tableProperties["fireNumber"]=1;
         GlobalContext.opponentName = "No Opponent";
         GlobalContext.messageFromOpponent = "Please wait for Opponent to join!";
         GlobalContext.joinedUsers = null;
     }
 }
 public void onUnSubscribeRoomDone(RoomEvent eventObj)
 {
     Log ("onUnSubscribeRoomDone : " + eventObj.getResult());
 }
Esempio n. 33
0
 //only room creator will get the notification
 public void OnDeleteRoomDone(RoomEvent eventObj)
 {
     Debug.Log("OnDeleteRoomDone " + eventObj.getResult());
 }
Esempio n. 34
0
		public void onJoinRoomDone(RoomEvent eventObj){
			Log("join room result: " + (eventObj.getResult()== 0) + "(" + eventObj.getResult() + ")");
		}
 /// Invoked when the response for joinRoom request is received.
 /// <param name="eventObj"></param>
 public void onJoinRoomDone(RoomEvent eventObj)
 {
     Log ("on JoinRoomDone " + eventObj.getResult ());
 }