Пример #1
0
 internal void StartSocialEntity(SocialEntity item)
 {
     switch (item.Technology)
     {
         case 91: Water.gameObject.GetComponent<TechnologyItemGameObject>().StartAction(); break;
     }
 }
Пример #2
0
 internal void StopSocialEntity(SocialEntity item)
 {
     switch (item.Technology)
     {
         //case 25: Roof.gameObject.GetComponent<TechnologyItemGameObject>().StopAction(); break;
     }
 }
Пример #3
0
    internal void StopSocialEntity(SocialEntity item)
    {
        var tigo = Pipe1.gameObject.GetComponent<TechnologyItemGameObject>();

        if (tigo == null)
        {
            tigo = Pipe1.gameObject.AddComponent<TechnologyItemGameObject>();
        }

        tigo.StopAction();
    }
Пример #4
0
        public async Task <bool> UpdateSocialAsync(SocialEntity social)
        {
            var socialDb = await _contextAccount.SocialEntities.FirstOrDefaultAsync(x => x.ExternalId == social.ExternalId && x.SocialType == social.SocialType);

            if (socialDb == null)
            {
                return(false);
            }

            socialDb.Email         = socialDb.Email == social.Email ? socialDb.Email : social.Email;
            socialDb.PhoneNumber   = socialDb.PhoneNumber == social.PhoneNumber ? socialDb.PhoneNumber : social.PhoneNumber;
            socialDb.ExternalToken = socialDb.ExternalToken == social.ExternalToken ? socialDb.ExternalToken : social.ExternalToken;
            socialDb.ExpiresIn     = socialDb.ExpiresIn == social.ExpiresIn ? socialDb.ExpiresIn : social.ExpiresIn;
            _contextAccount.Entry(social).State = EntityState.Modified;
            return(await _contextAccount.SaveChangesAsync() > 0);
        }
Пример #5
0
        public async Task <bool> AddUserSocialAsync(int internalId, SocialType socialType,
                                                    NormalizedSocialUserData socialUserData)
        {
            Logger.LogInformation($"{nameof(ExternalAuthService)}.{nameof(AddUserSocialAsync)}.Start");
            var social = new SocialEntity
            {
                InternalId    = internalId,
                SocialType    = socialType,
                ExternalId    = socialUserData.ExternalId,
                Email         = socialUserData.ExternalEmail,
                ExternalToken = socialUserData.ExternalToken,
                ExpiresIn     = socialUserData.ExpiresIn
            };
            var result = await Db.Socials.AddUserSocialAsync(social);

            Logger.LogInformation($"{nameof(ExternalAuthService)}.{nameof(AddUserSocialAsync)}.End");
            return(result);
        }
Пример #6
0
    private IEnumerator StartRandomSocial(SocialEntity social, PhoneEntity pes)
    {
        yield return new WaitForSeconds(5);

        if (isRunSocial)
        {
            GameControllerLevel2.Instance.PhoneEntities.Remove(pes);
            BaseGUI.instance.ClosePhone();
            if (!BaseGUI.instance.IsTrainingNow)
            {
                GameControllerLevel2.Instance.HouseActionSocial.StartSocialEntity(social);
            }

            switch (social.Room)
            {
                case RoomType.OutHouse: { if (GameControllerLevel2.Instance.Outhouse.gameObject.activeSelf) { GameControllerLevel2.Instance.Outhouse.StartSocialEntity(social); } } break;
            }
        }
    }
    public void StartSocialEntity(SocialEntity item)
    {
        Debug.Log("Social item" + item.Id);
        var oldSE = ListSocialEntity.Find(se => se.Id == item.Id);
        if (oldSE != null)
        {
            return;
        }

        ListSocialEntity.Add(item);
        StartMapAction(item);
        GameControllerLevel2.Instance.StartSocialEntity(item);

        ListTime.Add(new Tuple<SocialEntity, DateTime>(item, DateTime.Now));

        //var pn = new PhoneEntity
        //{
        //    Price = 3000,
        //    Type = TypePhoneEntity.Engineer,
        //    IdObj = item.Id,
        //    Text = item.Text
        //};
    }
Пример #8
0
 private void HouseActionSocial_StopSocialEntityEvent1(SocialEntity obj)
 {
     gui.jekaleftBubble.gameObject.SetActive(true);
     GameControllerLevel2.Instance.HouseActionSocial.StopSocialEntityEvent -= HouseActionSocial_StopSocialEntityEvent1;
     gui.jekaleftBubble.ClickButton += jekaleftBubble_ClickButton212;
     gui.jekaleftBubble.Open(Boubles3, true);
 }
Пример #9
0
    //Вместе мы справимся с любыми трудностями!" };
    void HouseActionSocial_StopSocialEntityEvent(SocialEntity obj)
    {
        CloseArrow();
        GameControllerLevel2.Instance.HouseActionSocial.StopSocialEntityEvent -= HouseActionSocial_StopSocialEntityEvent;
        NGUIMap.inst.ButtonBasementClick(null);

        gui.jekaleftBubble.Open(Boubles21, true);
        gui.jekaleftBubble.ClickButton += jekaleftBubble_ClickButton21;
    }
Пример #10
0
 private void OnStopSocialEntityEvent(SocialEntity item)
 {
     if (StopSocialEntityEvent != null)
     {
         StopSocialEntityEvent(item);
     }
 }
Пример #11
0
    internal void StopSocialEntity(SocialEntity item)
    {
        MoodCharacter.MoodPeoples += 0.05f;
        Achievements.AddStopSocialCount();
        UIScript.Instance.PhoneCount = GameControllerLevel2.Instance.PhoneEntities.Count;

        switch (item.Room)
        {
            case RoomType.OutHouse: Outhouse.StopSocialEntity(item); break;

            case RoomType.Car: carPlaceLocation.StopSocialEntity(item); break;
            case RoomType.Porch: porchLocation.StopSocialEntity(item); break;
            case RoomType.Tech: techLocation.StopSocialEntity(item); break;
            case RoomType.Roof: roofLocation.StopSocialEntity(item); break;
        }
    }
Пример #12
0
    internal void StartSocialEntity(SocialEntity item)
    {
        CountSocialMonth++;

        if (!IdSocialRun.Any(id => id == item.Id))
        {
            IdSocialRun.Add(item.Id);
            BaseGUI.instance.OnSocialPopup(item);
        }

        UIScript.Instance.PhoneCount = GameControllerLevel2.Instance.PhoneEntities.Count;

        switch (item.Room)
        {
            case RoomType.OutHouse: Outhouse.StartSocialEntity(item); break;

            case RoomType.Car: carPlaceLocation.StartSocialEntity(item); break;
            case RoomType.Porch: porchLocation.StartSocialEntity(item); break;
            case RoomType.Tech: techLocation.StartSocialEntity(item); break;
            case RoomType.Roof: roofLocation.StartSocialEntity(item); break;
            case RoomType.Basement: basementLocation.StartSocialEntity(item); break;
        }
    }
Пример #13
0
        public async Task <bool> AddUserSocialAsync(int userId, string code, SocialType socialType)
        {
            Logger.LogInformation($"{nameof(AccountService)}.{nameof(AddUserSocialAsync)}.Start");
            NormalizedSocialUserData user;

            switch (socialType)
            {
            case SocialType.Facebook:
                user = await FbService.GetUserInfoAsync(code);

                break;

            case SocialType.Vk:
                user = await VkService.GetUserInfoAsync(code);

                break;

            case SocialType.Twiter:
            case SocialType.GooglePlus:
            case SocialType.Telegram:
            case SocialType.Badoo:
            case SocialType.Nothing:
            default: throw new Exception("We do not support this social network.");
            }
            var social = new SocialEntity
            {
                InternalId    = userId,
                ExternalId    = user.ExternalId,
                SocialType    = socialType,
                Email         = user.ExternalEmail,
                ExternalToken = user.ExternalToken,
                ExpiresIn     = user.ExpiresIn
            };

            if (!await Db.Users.AddUserSocialAsync(social))
            {
                return(false);
            }

            var userInfo = await Db.UsersInfo.FindUserInfoAsync(userId, userId);

            if (userInfo.OriginalAvatarUrl.IsNullOrEmpty() ||
                MediaConverter.IsStandardBackground(userInfo.OriginalAvatarUrl) && !user.OriginalPhotoUrl.IsNullOrEmpty())
            {
                userInfo.OriginalAvatarUrl = await UploadAvatarUrlOrGetStandard(user.OriginalPhotoUrl);
            }

            var updateUser = new UpdateUserInfoDto
            {
                UserId      = userInfo.UserId,
                FristName   = userInfo.FirstName,
                LastName    = userInfo.LastName,
                BirthDate   = userInfo.BirthDate,
                SexType     = userInfo.SexType,
                City        = userInfo.City,
                Description = userInfo.Description
            };

            try
            {
                await UpdateUserInfoAsync(updateUser);
            }
            catch (Exception e)
            {
                Logger.LogError(e, $"{nameof(AccountService)}.{nameof(AddUserSocialAsync)} Error");
            }
            Logger.LogInformation($"{nameof(AccountService)}.{nameof(AddUserSocialAsync)}.End");
            return(true);
        }
Пример #14
0
    public void StopSocialEntity(SocialEntity item)
    {
        var tech = GameControllerLevel2.Instance.HouseTechnology.TechnologyList.Find(t => t.Id - 100 == item.Technology || t.Id - 200 == item.Technology || t.Id == item.Technology);

        GameControllerLevel2.Instance.PhoneEntities.Remove(GameControllerLevel2.Instance.PhoneEntities.Find(p => p.IdObj == item.Id));
        UIScript.Instance.PhoneCount = GameControllerLevel2.Instance.PhoneEntities.Count;

        if (tech != null)
        {
            ListSocialEntity.Remove(item);

            StopMapAction(item);
            GameControllerLevel2.Instance.StopSocialEntity(item);

            OnStopSocialEntityEvent(item);

            var oldSocial = ListTime.Find(s => s.Item1.Id == item.Id);

            if (oldSocial != null)
            {
                if ((DateTime.Now - oldSocial.Item2).TotalSeconds <= 1)
                {
                    GameControllerLevel2.Instance.Score += GameConst.ScoreEndSocial1sec;
                    ListTime.Remove(oldSocial);
                    return;
                }

                if ((DateTime.Now - oldSocial.Item2).TotalSeconds <= 2)
                {
                    GameControllerLevel2.Instance.Score += GameConst.ScoreEndSocial2sec;
                    ListTime.Remove(oldSocial);
                    return;
                }

                if ((DateTime.Now - oldSocial.Item2).TotalSeconds <= 3)
                {
                    GameControllerLevel2.Instance.Score += GameConst.ScoreEndSocial3sec;
                    ListTime.Remove(oldSocial);
                    return;
                }
            }
        }
    }
Пример #15
0
    public void StopMapAction(SocialEntity social)
    {
        if (ListSocialActionRoom != null)
        {
            ListSocialActionRoom.Remove(social);
        }

        switch (social.Room)
        {
            case RoomType.OutHouse:
                {
                    var icon = listIcon.Find(i => i.Social.Id == social.Id);
                    if (icon)
                    {
                        AnimationLogic.Instance.StopAnimSocial(icon.AnimationObj);
                        listIcon.Remove(icon);
                        GameObject.Destroy(icon.gameObject);
                    }
                }
                break;
            case RoomType.Roof:
                {
                    CountRoof--;
                }
                break;
            case RoomType.Basement:
                {
                    CountBasement--;
                }
                break;
            case RoomType.Porch:
                {
                    CountPorch--;
                }
                break;
        }
    }
Пример #16
0
    public void StartMapAction(SocialEntity social)
    {
        if (ListSocialActionRoom == null)
        {
            ListSocialActionRoom = new List<SocialEntity>();
        }
        ListSocialActionRoom.Add(social);

        switch (social.Room)
        {
            case RoomType.OutHouse:
                {
                    var iconObj = GameObject.Instantiate(PrefabIcon) as GameObject;
                    var icon = iconObj.GetComponent<SocialIcon>();
                    icon.Social = social;
                    icon.Flatroom = Flatroom;
                    icon.transform.parent = ParentIcon;
                    iconObj.transform.localScale = Vector3.one;

                    icon.AnimationObj = AnimationLogic.Instance.StartAnimSocial(social.Id);

                    listIcon.Add(icon);
                }
                break;
            case RoomType.Roof: { CountRoof++; } break;
            case RoomType.Basement: { CountBasement++; } break;
            case RoomType.Porch: { CountPorch++; } break;
        }
    }
Пример #17
0
 private void StopMapAction(SocialEntity item)
 {
     if (Map != null)
     {
         Map.StopMapAction(item);
     }
 }
Пример #18
0
 public async Task <bool> AddUserSocialAsync(SocialEntity social)
 {
     _contextAccount.SocialEntities.Add(social);
     return(await _contextAccount.SaveChangesAsync() > 0);
 }
Пример #19
0
    internal void OnSocialPopup(SocialEntity item)
    {
        if (socialPopup.gameObject.activeSelf)
        {
            socialPopup.Close();
            return;
        }

        if (!socialPopup.gameObject.activeSelf && !GuiWindow.AnyTaskFor(socialPopup))
        {
            GuiWindow.Add(socialPopup, new object[] { item.Text, item.TextBubble });
            IsOpenWindows = true;
        }
    }