void SetDataOther(Electrotank.Electroserver5.Api.EsObject obj)
 {
     if (obj.variableExists("isMaster"))
     {
         isMaster = obj.getBoolean("isMaster");
     }
     if (obj.variableExists("slotIndex"))
     {
         slotServer = obj.getInteger("slotIndex");
     }
     if (obj.variableExists("playerState"))
     {
         PlayerState = ConvertPlayerState(obj.getString("playerState"));
     }
     if (obj.variableExists("handSize"))
     {
         handSize = obj.getInteger("handSize");
     }
     if (obj.variableExists("isRobot"))
     {
         isRobot = obj.getBoolean("isRobot");
     }
     if (obj.variableExists("priority"))
     {
         isPriority = obj.getBoolean("priority");
     }
 }
Esempio n. 2
0
    internal void ShowIndividualCard(Electrotank.Electroserver5.Api.EsObject eso)
    {
        esObj = eso;
        DestroyCard();
        if (eso.variableExists("cards"))
        {
            int[] cardIds = eso.getIntegerArray("cards");
            for (int i = 0; i < cardIds.Length; i++)
            {
                if (parent.model != null)
                {
                    if (parent.model.CardId == cardIds[i])
                    {
                        FACardBettingView.Create(cardIds[i], tableCardFA.transform, gameObject.GetComponent <PanelBetting>()).gameObject.SetActive(false);
                        continue;
                    }
                }
                FACardBettingView cars = FACardBettingView.Create(cardIds[i], tableCardFA.transform, gameObject.GetComponent <PanelBetting>());
            }
            tableCardFA.Reposition();
            GameManager.Instance.FunctionDelay(delegate() { tableCardFA.transform.parent.localPosition = Vector3.zero; }, 0.01f);
        }

        GameManager.Instance.FunctionDelay(delegate()
        {
            if (parent.model != null)
            {
                if (parent.model.CardId != -1)
                {
                    ChanCard card = new ChanCard();
                    card.CardId   = parent.model.CardId;
                    card.parent   = cardParent;
                    card.Instantiate();
                    card.cardTexture.texture.width  = CARD_WIDTH;
                    card.cardTexture.texture.height = CARD_HIGHT;
                    GameObject.Destroy(card.gameObject.GetComponent <BoxCollider>());
                    lbCardBet.text = card.ToString();
                    cardId         = parent.model.CardId;
                }
                if (parent.model.ChipBetting == 0)
                {
                    lbChipBet.text = ((LobbyChan)GameManager.Instance.selectedLobby).betting.ToString();
                }
                else
                {
                    lbChipBet.text = parent.model.ChipBetting.ToString();
                }
                HideAllButton();
            }
        }, 0.15f);
    }
Esempio n. 3
0
    /// <summary>
    /// Xử lý khi request lên server để lấy về danh sách những người đang online trong Lobby ngoài
    /// </summary>
    public void OnPluginMessageOnProcess(string command, string action, Electrotank.Electroserver5.Api.EsObject eso)
    {
        if (command == Fields.REQUEST.GET_USER_ONLINE)
        {
            #region Lấy danh sách những người chơi đang online khi vào room
            Electrotank.Electroserver5.Api.EsObject[] children = eso.getEsObjectArray(Fields.PLAYER.USERS);

            lstUser.Clear();
            System.Array.ForEach <Electrotank.Electroserver5.Api.EsObject>(children, u => lstUser.Add(new User(u)));
            createListUserOnline(lstUser);

            #endregion
        }
    }
Esempio n. 4
0
 public void SetDataRoom(Electrotank.Electroserver5.Api.EsObject obj)
 {
     if (obj.variableExists("zoneId"))
     {
         zoneId = obj.getInteger("zoneId");
     }
     if (obj.variableExists("roomId"))
     {
         roomId = obj.getInteger("roomId");
     }
     if (obj.variableExists("zoneName"))
     {
         zoneName = obj.getString("zoneName");
     }
     if (obj.variableExists("roomName"))
     {
         roomName = obj.getString("roomName");
     }
 }
    /// <summary>
    /// Xử lý khi request lên server để lấy về danh sách những người đang online trong Lobby ngoài
    /// </summary>
    private void OnPluginMessageOnProcess(string command, string action, Electrotank.Electroserver5.Api.EsObject eso)
    {
        UITabbarPanel manager = Array.Find <UITabbarPanel>(controller.tabbarPanel, s => s.GetComponent <GPInviteUserView>() != null);

        manager.GetComponent <GPInviteUserView>().OnPluginMessageOnProcess(command, action, eso);
    }
Esempio n. 6
0
 public User(Electrotank.Electroserver5.Api.EsObject obj)
 {
     SetDataUser(obj);
 }
Esempio n. 7
0
    public void SetDataUser(Electrotank.Electroserver5.Api.EsObject obj)
    {
        if (obj.variableExists("id"))
        {
            id = obj.getInteger("id");
        }

        if (obj.variableExists("username"))
        {
            username = obj.getString("username");
        }
        else if (obj.variableExists(Fields.PLAYER.USERNAME))
        {
            username = obj.getString(Fields.PLAYER.USERNAME);
        }

        if (obj.variableExists("email"))
        {
            email = obj.getString("email");
        }
        if (obj.variableExists("first_name"))
        {
            firstName = obj.getString("first_name");
        }
        if (obj.variableExists("middle_name"))
        {
            middleName = obj.getString("middle_name");
        }
        if (obj.variableExists("last_name"))
        {
            lastName = obj.getString("last_name");
        }
        if (obj.variableExists("birthday"))
        {
            System.DateTime.TryParse(obj.getString("birthday").Replace(":", "-"), out brithday);
        }
        if (obj.variableExists("gender"))
        {
            gender = obj.getString("gender");
        }
        if (obj.variableExists("address"))
        {
            address = obj.getString("address");
        }
        if (obj.variableExists("identity_card_number"))
        {
            cmtnd = obj.getString("identity_card_number");
        }
        if (obj.variableExists("mobile"))
        {
            phone = obj.getString("mobile");
        }
        if (obj.variableExists("avatar"))
        {
            if (obj.getDataType("avatar") == DataType.String)
            {
                avatarUrl = obj.getString("avatar");
            }
            else if (obj.getDataType("avatar") == DataType.Integer)
            {
                ServerWeb.GetAvatarFromId(obj.getInteger("avatar"), delegate(Texture _texture) { _avatarTexture = _texture; });
            }
        }

        if (obj.variableExists("create_time"))
        {
            System.DateTime.TryParse(obj.getString("create_time"), out createTime);
        }
        if (obj.variableExists("time_request"))
        {
            System.DateTime.TryParse(obj.getString("time_request"), out timeRequest);
        }
        if (obj.variableExists("numBuddies"))
        {
            numberBuddies = obj.getInteger("numBuddies");
        }
        if (obj.variableExists("role"))
        {
            role = (ERole)obj.getInteger("role");
        }
        if (obj.variableExists("level"))
        {
            level = obj.getInteger("level");
        }
        if (obj.variableExists("experience"))
        {
            experience = obj.getInteger("experience");
        }
        if (obj.variableExists("expMinCurrentLevel"))
        {
            expMinCurrentLevel = obj.getInteger("expMinCurrentLevel");
        }
        if (obj.variableExists("expMinNextLevel"))
        {
            expMinNextLevel = obj.getInteger("expMinNextLevel");
        }

        if (obj.variableExists("buddies"))
        {
            if (buddies != null && buddies.Count > 0)
            {
                buddies.Clear();
            }
            EsObject[] array = obj.getEsObjectArray("buddies");
            Array.ForEach <EsObject>(array, o => { buddies.Add(new User(o)); });
        }
        if (obj.variableExists("pendingBuddies"))
        {
            if (pendingBuddies != null && pendingBuddies.Count > 0)
            {
                pendingBuddies.Clear();
            }
            EsObject[] array = obj.getEsObjectArray("pendingBuddies");
            Array.ForEach <EsObject>(array, o => { pendingBuddies.Add(new User(o)); });
        }
        if (obj.variableExists("requestBuddies"))
        {
            EsObject[] array = obj.getEsObjectArray("requestBuddies");
            Array.ForEach <EsObject>(array, o => { requestBuddies.Add(new User(o)); });
        }

        if (obj.variableExists("chip"))
        {
            if (obj.getDataType("chip") == DataType.String)
            {
                long.TryParse(obj.getString("chip"), out chip);
            }
            else if (obj.getDataType("chip") == DataType.Long)
            {
                chip = obj.getLong("chip");
            }
        }

        if (obj.variableExists("gold"))
        {
            if (obj.getDataType("gold") == DataType.String)
            {
                long.TryParse(obj.getString("gold"), out gold);
            }
            else if (obj.getDataType("gold") == DataType.Long)
            {
                gold = obj.getLong("gold");
            }
        }

        if (obj.variableExists("accessToken"))
        {
            accessToken = obj.getString("accessToken");
        }
    }
Esempio n. 8
0
 public RoomInfo(Electrotank.Electroserver5.Api.EsObject obj)
 {
     SetDataRoom(obj);
 }