Beispiel #1
0
 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");
     }
 }
Beispiel #2
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");
     }
 }
Beispiel #3
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);
    }
Beispiel #4
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");
        }
    }