Ejemplo n.º 1
0
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     if (ActivePage == 1)
     {
         //  ROOM SELECTION
         if (eventObj.getResult() == 0)
         {
             RoomSelectionMenu.AddRoom(eventObj);
         }
         else
         {
             RoomSelectionMenu.RoomCount--;
         }
     }
     else if (ActivePage == 2)
     {
         if (eventObj.getResult() == 0)
         {
             //  JOIN ROOM
             LobbyPlayerStats.BindRoomData(eventObj.getData(), eventObj.getProperties());
             JoinRoomResultScreen.Hide();
             LobbyPlayerStats.Show();
         }
     }
     Log("onGetLiveRoomInfoDone : " + eventObj.getResult());
 }
Ejemplo n.º 2
0
    public void OnGetLiveRoomInfo(LiveRoomInfoEvent eventObj)
    {
        Debug.Log("OnGetLiveRoomInfo " + eventObj.getData().getId() + " " + eventObj.getResult() + " " + eventObj.getJoinedUsers().Length);
        Dictionary <string, object> _temp = eventObj.getProperties();

        print("bet = " + SC_DefiendVariables.bet);
        Debug.Log(_temp.Count + " " + _temp["bet"] + " " + SC_DefiendVariables.bet["bet"].ToString());

        if (eventObj.getResult() == 0 && eventObj.getJoinedUsers().Length == 1 &&
            _temp["bet"].ToString() == SC_DefiendVariables.bet["bet"].ToString())
        {
            print("entering the room!");
            currentTurn = SC_DefiendVariables.Turn.RedTurn;
            print("Enemy start the game!");
            isMyTurn    = false;                            //added now
            currentTurn = SC_DefiendVariables.Turn.RedTurn; //added now
            WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());
            WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());
        }

        if (_temp["bet"].ToString() == SC_DefiendVariables.bet["bet"].ToString())
        {
            roomMatch = true;
        }
    }
Ejemplo n.º 3
0
    public void OnGetLiveRoomInfo(LiveRoomInfoEvent eventObj)
    {
        Debug.Log("OnGetLiveRoomInfo " + eventObj.getData().getId() + " " + eventObj.getResult() + " " + eventObj.getJoinedUsers().Length);
        Dictionary <string, object> _temp = eventObj.getProperties();

        print("bet = " + SC_DefiendVariables.bet);
        Debug.Log(_temp.Count + " " + _temp["bet"] + " " + SC_DefiendVariables.bet["bet"].ToString());
        if (eventObj.getResult() == 0 && eventObj.getJoinedUsers().Length == 1 &&
            _temp["bet"].ToString() == SC_DefiendVariables.bet["bet"].ToString())
        {
            print("entering the room!");
            currentTurn = SC_DefiendVariables.Turn.RedTurn;
            print("Enemy start the game!");
            WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());
            WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());
        }
        else
        {
            currentTurn = SC_DefiendVariables.Turn.blueTurn;
            print("I start the game!");
            isMyTurn = true;
            Debug.Log("No rooms were availible, create a room");
            WarpClient.GetInstance().CreateTurnRoom("Room Name", SC_MultiPlayer_Globals.userName, 2, SC_DefiendVariables.bet, 60);
        }

        if (_temp["bet"].ToString() == SC_DefiendVariables.bet["bet"].ToString())
        {
            roomMatch = true;
        }
    }
Ejemplo n.º 4
0
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     Log("onGetLiveRoomInfoDone : ", eventObj.getResult());
     if ((ResultCode)eventObj.getResult() == ResultCode.SUCCESS)
     {
         if (roomFoundEvent != null)
         {
             roomFoundEvent(eventObj.getProperties());
         }
     }
 }
Ejemplo n.º 5
0
 public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
 {
     if (WarpResponseResultCode.SUCCESS == eventObj.getResult())
     {
         Log("UpdateProperty event received with success status");
     }
     else
     {
         Log("Update Propert event received with fail status. Status is :" + eventObj.getResult().ToString());
     }
 }
 public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
 {
     if (WarpResponseResultCode.SUCCESS == eventObj.getResult())
     {
         _page.showResult("UpdateProperty event received with success status");
     }
     else
     {
         _page.showResult("Update Propert event received with fail status. Status is :" + eventObj.getResult().ToString());
     }
 }
Ejemplo n.º 7
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent liveRoomInfoEvent)
        {
            //	Debug.Log ("onGetLiveRoomInfoDone " + liveRoomInfoEvent.getResult ()+"... "+liveRoomInfoEvent.getData().getId()+".. "+liveRoomInfoEvent.getData().getName());
//			MenuHandler menuHandler = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<MenuHandler> ();
//			if (menuHandler.roomListPanel == false)
//			{
//				Debug.Log("2");
//				menuHandler.roomListPanel.SetActive(true);
//			}
//			if (menuHandler.createRoomPanel == true)
//			{
//				Debug.Log("1");
//				menuHandler.createRoomPanel.SetActive(false);
//			}


            if (liveRoomInfoEvent.getResult() == 0)
            {
                if (GameObject.FindGameObjectWithTag("RoomListPanel") != null)
                {
                    Debug.Log("On room list panel");
                    UIManager.Instance.roomsPanel.loadAvailableRoomsOnZone(liveRoomInfoEvent);
                }
                else
                {
                    Debug.Log("On room panel");
                    //					GamePlayScript roomScript = GameObject.FindGameObjectWithTag ("GamePlayPanel").GetComponent<GamePlayScript> ();
                    //					roomScript.onRoomDetails (liveRoomInfoEvent);
                }
            }
        }
    public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
    {
        if (eventObj.getResult() == 0)
        {
            if (GameControllerTeenPatti.PrivateGameType.Equals(TagsTeenpatti.JOIN_PRIVATE_TABLE))
            {
                Dictionary <string, object> dic = eventObj.getProperties();
                string boolAmount = "" + dic[TagsTeenpatti.MAX_BET_AMOUNT];
                Debug.Log("boolAmount " + boolAmount);
                PlayerPrefs.SetString("InHand", boolAmount);
                appwrapTeenpatti.gameRequest();
            }


            try
            {
                int playersName = eventObj.getJoinedUsers().Length;
                Debug.Log("onGetLiveRoomInfoDone " + playersName);
                GameDelegateTeenPatti.ShowTotalGameUser(playersName);
            }
            catch (System.Exception ex)
            {
                Debug.Log("Working new");
            }
            //			foreach (String n in playersName) {
            //				print ("player name  is " + n);
            //				GameController.newPlayer (n);
            //			}
        }
    }
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
     {
         if (GlobalContext.localUsername.Equals(eventObj.getJoinedUsers()[0]))
         {
             // user who created the room is the first player
             GlobalContext.PlayerIsFirstOnAppWarp = true;
             GlobalContext.IsMyTurn = true;
         }
         else
         {
             // user who joined later is second player
             GlobalContext.PlayerIsFirstOnAppWarp = false;
             GlobalContext.IsMyTurn = false;
         }
         GlobalContext.tableProperties = eventObj.getProperties();
         for (int i = 0; i < eventObj.getJoinedUsers().Length; i++)
         {
             if (!GlobalContext.localUsername.Equals(eventObj.getJoinedUsers()[i]))
             {
                 GlobalContext.opponentName = eventObj.getJoinedUsers()[i];
                 break;
             }
         }
         GlobalContext.joinedUsers = eventObj.getJoinedUsers();
         Deployment.Current.Dispatcher.BeginInvoke(new MoveToPlayCallback(mMoveToPlay));
     }
 }
Ejemplo n.º 10
0
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
     {
         if (GlobalContext.localUsername.Equals(eventObj.getJoinedUsers()[0]))
         {
             // user who created the room is the first player
             GlobalContext.PlayerIsFirstOnAppWarp = true;
         }
         else
         {
             // user who joined later is second player
             GlobalContext.PlayerIsFirstOnAppWarp = false;
         }
         GlobalContext.tableProperties = eventObj.getProperties();
         for (int i = 0; i < eventObj.getJoinedUsers().Length; i++)
         {
             if (!GlobalContext.localUsername.Equals(eventObj.getJoinedUsers()[i]))
             {
                 GlobalContext.opponentName = eventObj.getJoinedUsers()[i];
                 break;
             }
         }
         GlobalContext.joinedUsers = eventObj.getJoinedUsers();
         Deployment.Current.Dispatcher.BeginInvoke(new MoveToPlayCallback(mMoveToPlay));
     }
 }
 public void onUpdatePropertyDone(LiveRoomInfoEvent lifeLiveRoomInfoEvent)
 {
     if (lifeLiveRoomInfoEvent.getResult() == WarpResponseResultCode.SUCCESS)
     {
         GlobalContext.tableProperties = lifeLiveRoomInfoEvent.getProperties();
     }
 }
Ejemplo n.º 12
0
 public void onUpdatePropertyDone(LiveRoomInfoEvent lifeLiveRoomInfoEvent)
 {
     if (lifeLiveRoomInfoEvent.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Dictionary <string, object> d = lifeLiveRoomInfoEvent.getProperties();
         System.Diagnostics.Debug.WriteLine("property successfully updated by you");
     }
 }
Ejemplo n.º 13
0
    public void onGetLiveRoomInfoDone(LiveRoomInfoEvent liveRoomInfoEvent)
    {
        if (liveRoomInfoEvent.getResult() == WarpResponseResultCode.SUCCESS)
        {
            FireRoomInfoReceived(liveRoomInfoEvent);
//			DebugLog.LogWarning (liveRoomInfoEvent.getProperties()[Constants.TURN_TIME_ROOM_PROPERTY]);
        }
    }
Ejemplo n.º 14
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            System.Diagnostics.Debug.WriteLine("getliveinfodone");

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
            {
                System.Diagnostics.Debug.WriteLine("found room .. reading properties");

                for (int i = 0; i < 5; i++)
                {
                    if (eventObj.getProperties().ContainsKey("q" + (i + 1)))
                    {
                        Global.ques[i] = eventObj.getProperties()["q" + (i + 1)].ToString();
                    }
                }
                if (eventObj.getJoinedUsers().Length == 1)
                {
                    System.Diagnostics.Debug.WriteLine("is player 1");

                    Global.PlayerIsFirst = true;
                    Global.warpClient.UpdateRoomProperties(Global.DynRoomId, new Dictionary <string, object>()
                    {
                        { "availUsers", 1 }
                    }, null);
                    System.Diagnostics.Debug.WriteLine("AVAIL  = 1");
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("is player 2\n AVAIL = 2");

                    // Global.warpClient.UpdateRoomProperties(eventObj.getData().getId());
                    Global.PlayerIsFirst = false;
                    Global.warpClient.UpdateRoomProperties(Global.DynRoomId, new Dictionary <string, object>()
                    {
                        { "availUsers", 2 }
                    }, null);
                }

                if (flag)
                {
                    for (int zz = 0; zz < 5; zz++)
                    {
                        _page.sel[zz] = Convert.ToInt16(Global.ques[zz]);
                    }
                    System.Diagnostics.Debug.WriteLine("retrieved all questions -  sent to sel - going to g and f");

                    _page.g();
                    _page.f();
                    flag = false;
                }


                // navigate to game play screen
                // _page.moveToPlayScreen();
            }
        }
 public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
 {
     if (WarpResponseResultCode.SUCCESS == eventObj.getResult())
     {
     }
     else
     {
     }
 }
Ejemplo n.º 16
0
    public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
    {
        //Twist.AppController.showToast ("onUpdatePropertyDone");

        if (WarpResponseResultCode.SUCCESS == eventObj.getResult())
        {
        }
        else
        {
        }
    }
    private void OnGetLiveRoomInfoOccured(LiveRoomInfoEvent eventObj)
    {
        Debug.Log("OnGetLiveRoomInfo " + eventObj.getData().getId() + " " + eventObj.getResult() + " " + eventObj.getJoinedUsers().Length);
        GameView.SetText("StatusTxt", "Room Information: " + eventObj.getData().getId() + " " + eventObj.getJoinedUsers().Length);
        Dictionary <string, object> _temp = eventObj.getProperties();

        Debug.Log(_temp.Count + " " + _temp["Password"] + " " + data["Password"].ToString());

        if (eventObj.getResult() == 0 && eventObj.getJoinedUsers().Length == 1 &&
            _temp["Password"].ToString() == data["Password"].ToString())
        {
            WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());
            WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());

            data["AwayPlayer"] = MiniJSON.Json.Serialize(GetLocalSoldiers().ToArray());

            WarpClient.GetInstance().UpdateRoomProperties(eventObj.getData().getId(), data, null);

            GameView.SetText("StatusTxt", "Joining Room...");
        }
        else
        {
            index++;
            if (index < rooms.Count)
            {
                Debug.Log("Getting Live Info on room: " + rooms[index]);
                WarpClient.GetInstance().GetLiveRoomInfo(rooms[index]);
            }
            else
            {
                Debug.Log("No rooms were availible, create a room");

                WarpClient.GetInstance().CreateTurnRoom("Room Name", username, 2, null, 30);

                data["HomePlayer" + username] = MiniJSON.Json.Serialize(GetLocalSoldiers().ToArray());
                WarpClient.GetInstance().UpdateRoomProperties(rooms[index], data, null);
            }
        }
    }
Ejemplo n.º 18
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
        {
            Log ("onGetLiveRoomInfoDone : " + eventObj.getResult());

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
            {
                AppWarp.InitializeNotification ();

                if (eventObj.getJoinedUsers().Length == 1)
                {
                    AppWarp.isFirstPlayer = true;
                    // Decide what string is for first player and what is for second player
                }
                else
                {
                    AppWarp.isFirstPlayer = false;

                    // Tell both players in room to load gameplay scene
                    AppWarp.warpClient.SendUpdatePeers(OnlineMessage.BuildBytes_NewMatch());
                }

                AppWarp.interval = 8.0f;
            }
        }
Ejemplo n.º 19
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
        {
            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
            {
                if (eventObj.getJoinedUsers().Length == 1)
                {

                    GlobalContext.PlayerIsFirst = true;
                }

                else
                {
                    GlobalContext.PlayerIsFirst = false;
                }

                // navigate to game play screen
                _page.moveToPlayScreen();

            }
        }
Ejemplo n.º 20
0
 public void onGetLiveLobbyInfoDone(LiveRoomInfoEvent eventObj)
 {
     Log("onGetLiveLobbyInfoDone : " + eventObj.getResult());
 }
Ejemplo n.º 21
0
    public void onGetLiveLobbyInfoDone(LiveRoomInfoEvent eventObj)
    {
        string result = "";
        if (eventObj.getResult () == WarpResponseResultCode.SUCCESS) {
            string[] users = eventObj.getJoinedUsers();
            for (int i = 0; i < users.Length; i++) {
                result += " " + users [i];
            }
        }
        appWarpResponse+="onJoinLobbyDone : " + eventObj.getResult()  + ", Name : " + eventObj.getData().getName() + ", Id : " + eventObj.getData().getId()+" Users "+result+"\n";

        Debug.Log ("onGetLiveLobbyInfoDone : " + eventObj.getResult()  + ", RoomName : " + eventObj.getData().getName() + ", RoomID : " + eventObj.getData().getId());
    }
Ejemplo n.º 22
0
 public void onSetCustomRoomDataDone(LiveRoomInfoEvent eventObj)
 {
     Log("onSetCustomRoomDataDone : " + eventObj.getResult());
 }
 public void OnGetLiveRoomInfo(LiveRoomInfoEvent eventObj)
 {
     if (isUserConnected) {
         Debug.Log ("OnGetLiveRoomInfo " + eventObj.getResult () + " " + eventObj.getData ().getId () + " " + eventObj.getJoinedUsers ().Length);
         if (eventObj.getResult () == 0 && eventObj.getJoinedUsers ().Length == 1)
         {
             Debug.Log("Joined room " + eventObj.getData ().getId ());
             roomId = eventObj.getData ().getId ();
             SC_AppWarpKit.JoinToRoom (eventObj.getData ().getId ());
             SC_AppWarpKit.RegisterToRoom (eventObj.getData ().getId ());
         }
         else
         {
             Debug.Log("Still Looking");
             index++;
             if (index < rooms.Count)
                 SC_AppWarpKit.GetLiveRoomInfo (rooms [index]);
             else {
                 Debug.Log ("No More Rooms");
                 SC_AppWarpKit.CreateTurnBaseRoom ("ROOM" + Time.time, userName, 2, null, turnTime);
             }
         }
     }
 }
Ejemplo n.º 24
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
        {
            Dictionary<string, object> dict = new Dictionary<string, object>();
            System.Diagnostics.Debug.WriteLine("getliveinfodone");
            
            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS && (eventObj.getJoinedUsers() != null))
            {
                System.Diagnostics.Debug.WriteLine("found room .. reading properties");
            
                for (int i = 0; i < 5; i++)
                {
                    if (eventObj.getProperties().ContainsKey("q" + (i + 1)))
                        Global.ques[i] = eventObj.getProperties()["q" + (i + 1)].ToString();
                }
                if (eventObj.getJoinedUsers().Length == 1)
                {
                    System.Diagnostics.Debug.WriteLine("is player 1");
            
                    Global.PlayerIsFirst = true;
                    Global.warpClient.UpdateRoomProperties(Global.DynRoomId, new Dictionary<string, object>() { { "availUsers", 1 } }, null);
                    System.Diagnostics.Debug.WriteLine("AVAIL  = 1");
            
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("is player 2\n AVAIL = 2");
            
                    // Global.warpClient.UpdateRoomProperties(eventObj.getData().getId());
                    Global.PlayerIsFirst = false;
                    Global.warpClient.UpdateRoomProperties(Global.DynRoomId, new Dictionary<string, object>() { { "availUsers", 2 } }, null);
                }

                if(flag)
                {
                     for (int zz = 0; zz < 5; zz++)
                     {
                         _page.sel[zz] = Convert.ToInt16(Global.ques[zz]);
                     }
                     System.Diagnostics.Debug.WriteLine("retrieved all questions -  sent to sel - going to g and f");
            
                     _page.g();
                     _page.f();
                     flag = false;
                }
                

                // navigate to game play screen  
                // _page.moveToPlayScreen();
            }
        }
 public void onUpdatePropertyDone(LiveRoomInfoEvent liveRoomInfoEvent)
 {
     Log ("Result :" + liveRoomInfoEvent.getResult () + "Count :" + liveRoomInfoEvent.getProperties ().Count);
 }
 public void onSetCustomRoomDataDone(LiveRoomInfoEvent eventObj)
 {
     Log ("onSetCustomRoomDataDone : " + eventObj.getResult());
 }
Ejemplo n.º 27
0
 public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
 {
     Log("OnUpdatePropertyDone :", eventObj.getResult());
 }
Ejemplo n.º 28
0
 public void onUpdatePropertyDone(LiveRoomInfoEvent eventObj)
 {
     appWarpResponse+=" onUpdatePropertyDone "+eventObj.getResult()+"\n";
 }
 public void onUpdatePropertyDone(LiveRoomInfoEvent lifeLiveRoomInfoEvent)
 {
     if (lifeLiveRoomInfoEvent.getResult() == WarpResponseResultCode.SUCCESS)
     {
         GlobalContext.tableProperties = lifeLiveRoomInfoEvent.getProperties();
     }
 }
Ejemplo n.º 30
0
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     appWarpResponse+="onGetLiveRoomInfoDone : " + eventObj.getResult()  + ", RoomName : " + eventObj.getData().getName() + ", RoomID : " + eventObj.getData().getId() + ", RoomOwner : " + eventObj.getData().getRoomOwner() + ", MaxUsers : " + eventObj.getData().getMaxUsers()+"\n";
     Debug.Log ("onGetLiveRoomInfoDone : " + eventObj.getResult()  + ", RoomName : " + eventObj.getData().getName() + ", RoomID : " + eventObj.getData().getId() + ", RoomOwner : " + eventObj.getData().getRoomOwner() + ", MaxUsers : " + eventObj.getData().getMaxUsers());
 }
Ejemplo n.º 31
0
 public void onUpdatePropertyDone(LiveRoomInfoEvent lifeLiveRoomInfoEvent)
 {
     if (lifeLiveRoomInfoEvent.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Dictionary<string, object> d = lifeLiveRoomInfoEvent.getProperties();
         System.Diagnostics.Debug.WriteLine("property successfully updated by you");
     
         
     }
 }
 public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
 {
     Log ("onGetLiveRoomInfoDone : " + eventObj.getResult());
 }
Ejemplo n.º 33
0
        public void onGetLiveRoomInfoDone(LiveRoomInfoEvent eventObj)
        {
            string[] users;
            users = eventObj.getJoinedUsers ();
            if (users.Length == 2) {
                WarpClient.GetInstance ().startGame();
                Debug.Log("Start Game");
            }

            Log ("onGetLiveRoomInfoDone : " + eventObj.getResult());
        }