public async Task <IActionResult> CreateAnalyticsUserVisitAsync([FromBody] Dictionary <string, string> requestData)
        {
            string message = "Problem Custom Analytics not created";

            if (requestData["user_ip"] != null || requestData["request_uri"] != null)
            {
                JObject locationInfoJson = await unitOfWork.GetLocationAsync();

                if (locationInfoJson != null && locationInfoJson["country_name"] != null)
                {
                    var analytics_data = new
                    {
                        visited_page_link = requestData["request_uri"].ToString(),
                        user_ip           = locationInfoJson["ip"].ToString(),
                        country           = locationInfoJson["country_name"].ToString(),
                        http_referer      = unitOfWork.httpContextAccessor.HttpContext.Request.GetTypedHeaders().Referer.ToString(),
                        ip_data           = locationInfoJson.ToString()
                    };
                    var newCustomAnalytics = new CustomAnalytics()
                    {
                        analytics_type = "link_click",
                        analytics_data = JObject.FromObject(analytics_data).ToString()
                    };
                    unitOfWork.CustomAnalyticsRepository.Insert(newCustomAnalytics);
                    await unitOfWork.SaveAsync();

                    message = "Custom Analytics created";
                    var ca_user_visit = newCustomAnalytics;
                    return(Ok(new { jwt = new { message, ca_user_visit } }));
                }
            }
            return(Ok(new { jwt = new { message } }));
        }
Example #2
0
    public void Next()
    {
        if (state == 0)
        {
            ballPointer.SetActive(false);
        }
        state++;
//		if (state > 1) {
        states [state - 1].SetActive(false);
//		}
//		if (state == 3 || state == 4) {
//			StartCoroutine (NextAfterDelay ());
//		}
        if (state == states.Length)
        {
            foreach (Transform child in tutorialClouds.transform)
            {
                if (!child.GetComponent <SpriteRenderer> ().isVisible)
                {
                    Destroy(child.gameObject);
                }
            }
            Player.instance.isTutorialOver = true;
            Player.instance.Reset();
            UIManager.instance.OnTutorialCompleted();
            GameManager.instance.OnTutorialCompleted();
            PlayerPrefs.SetInt("Tutorial", 1);
            CustomAnalytics.Event("TutorialCompleted");
            End();
        }
        else
        {
            states [state].SetActive(true);
        }
    }
Example #3
0
    public void LevelComplete()
    {
        _currentLevel++;
        Achievements.AchievementCheck();
        asteroidInfo.SetCurrentAsteroidCount();
        UIScript.SetLevelSettings(asteroidInfo.targetAsteroidCount, (int)asteroidInfo.targetChildCount);
        if (_currentLevel > 10)
        {
            RestartAfterTime(0);
            return;
        }
        CustomAnalytics.SendLevelStart(_currentLevel);
        onLevelComplete.Invoke();
        string tag = "Bullet";

        if (gameObject.DoesTagExist(tag))
        {
            foreach (GameObject bullet in GameObject.FindGameObjectsWithTag(tag))
            {
                Destroy(bullet);
            }
        }
        CreateAsteroids();

        _levelCompleteOneShot = false;
    }
Example #4
0
    IEnumerator GameOver(GameObject player)
    {
        Destroy(player.GetComponent <PlayerShip>().shipExhaustEffectPrefab);
        Destroy(player);

        finalScoreBoard.text += score.ToString();
        finalLevelBoard.text += curLevel.ToString();

        if (getHighScore)
        {
            finalScreenTitle.text = "New Highscore";
        }
        else
        {
            finalScreenTitle.text = "Game Over";
        }

        GAME_STATE = eGameState.gameOver;

        SaveGameManager.CheckHighScore(score);
        SaveGameManager.Save();

        CustomAnalytics.SendFinalShipPartChoice();
        CustomAnalytics.SendGameOver();

        yield return(new WaitForSeconds(timeUntilRestart));

        SceneManager.LoadScene(levelToRestart);
    }
Example #5
0
    public void ContinueScreen()
    {
        gameScreen.SetActive(false);
        Time.timeScale = 0f;
        if (!Player.instance.isTutorialOver)
        {
            tutorial.End();
            GameOver();
            return;
        }
//		#if UNITY_EDITOR
//		if (restartAttempts == maxRestartAttempts) {
//			GameOver();
//			return;
//		}
//		#else
//		if (restartAttempts == maxRestartAttempts || !SkyRiseAds.instance.IsRewarededInterLoaded ()) {
//			GameOver();
//			return;
//		}
//		#endif
//		restartAttempts++;
//		#if !UNITY_EDITOR
//		SkyRiseAds.instance.Init ();
//		#endif
        CustomAnalytics.Event("LevelQuit" + level);
        continueScreen.SetActive(true);
    }
Example #6
0
    /// <summary>
    /// Increments one of the StepRecords that can unlock Achievements.
    /// </summary>
    /// <param name="stepType">The eStepType to increment.</param>
    /// <param name="num">The amount to increment (default = 1).</param>
    static public void AchievementStep(Achievement.eStepType stepType, int num = 1)
    {
        StepRecord sRec = STEP_REC_DICT[stepType];

        if (sRec != null)
        {
            sRec.Progress(num);

            // Iterate through all of the possible Achievements and see if the step
            //  completes the Achievement
            foreach (Achievement ach in S.achievements)
            {
                if (!ach.complete)
                {
                    // Pass the step information to the Achievement, to see if it is completed
                    if (ach.CheckCompletion(stepType, sRec.num))
                    {
                        // The result is true if the Achievement was newly completed
                        AnnounceAchievementCompletion(ach);

                        // Tell Unity Analytics that the Achievement has been completed
                        CustomAnalytics.SendAchievementUnlocked(ach);

                        // Also save the game any time we complete an Achievement
                        SaveGameManager.Save();
                    }
                }
            }
        }
        else
        {
            Debug.LogWarning("AchievementManager:AchievementStep( " + stepType + ", " + num + " )"
                             + "was passed a stepType that is not in STEP_REC_DICT.");
        }
    }
 static public void GameOver()
 {
     SaveGameManager.CheckHighScore(SCORE);
     SaveGameManager.Save();
     CustomAnalytics.SendFinalShipPartChoice();
     CustomAnalytics.SendGameOver();
     _S.EndGame();
 }
Example #8
0
        public void CustomAnalytics_HasCustomAnalyticsType()
        {
            // Act
            CustomAnalytics ca = new CustomAnalytics("https://analytics.com");

            // Assert
            ca.Type.Should().BeEquivalentTo(AnalyticsTypes.Custom);
        }
Example #9
0
    void Awake()
    {
        rateUsState = (RateUsState)PlayerPrefs.GetInt("RateUs", 0);
        level       = 1;
        CustomAnalytics.Event("Level" + level);
        instance = this;
//		restartAttempts = 0;
        UpdateDiamondsText();
    }
Example #10
0
 public void Continue()
 {
     CustomAnalytics.Event("ContinueVideo");
     continueScreenMono.videoWatchCount++;
     continueScreen.SetActive(false);
             #if UNITY_EDITOR
     ContinueSuccess();
             #else
     SkyRiseAds.instance.ShowRewardedInterstitial(ContinueSuccess, GameOver);
             #endif
 }
Example #11
0
 private void DoneCurrentLevel()
 {
     levelsDict[currentLevel] = true;
     CustomAnalytics.LevelDone();
     if (SoundManager._I.audioSource.isActiveAndEnabled)
     {
         SoundManager._I.audioSource.PlayOneShot(SoundManager._I.Win);
     }
     LevelInformationManager._I.LevelDoneEvent.Invoke();
     SaveSystem.SaveData(levelsDict);
 }
Example #12
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #13
0
    public IEnumerator TryJump()
    {
        if (_currentJumps > 0)
        {
            OnJump.Invoke();
            _playerCollider.enabled = false;
            yield return(new WaitForSeconds(respawnTime));

            Vector3         randomPosition = ScreenBounds.RANDOM_ON_SCREEN_LOC_HALF;
            List <Asteroid> asteroids      = AsteraX.ASTEROIDS;
            int             infLoopSave    = 0;
            int             distance       = 5;
            for (int i = 0; i < asteroids.Count;)
            {
                infLoopSave++;
                if (Vector3.Distance(randomPosition, asteroids[i].transform.position) > distance)
                {
                    i++;
                }
                else
                {
                    //one was in the way so trying again
                    i = 0;
                    randomPosition = ScreenBounds.RANDOM_ON_SCREEN_LOC_HALF;
                }

                //in case it doesn't work I reduce the distance so it will spawn eventually.

                if (infLoopSave > asteroids.Count * 100)
                {
                    distance = distance >= 1 ? distance / 2 : 0;
                    Debug.Log("Distance set too high, reduced to: " + distance);
                    infLoopSave = 0;
                }
            }
            RemoveJumps(1);
            UIScript.UpdateJumps(_currentJumps);
            transform.position = randomPosition;
            OnRespawn.Invoke();
            _playerCollider.enabled = true;
            jumping = false;
        }
        else
        {
            dead = true;
            _playerCollider.enabled = false;
            SaveGameManager.CheckHighScore(_score);
            UIScript.SetFinalScore(_score, AsteraX.GetLevel());
            CustomAnalytics.SendGameOver();
            CustomAnalytics.SendFinalShipPartChoice();
            OnDeath.Invoke();
        }
    }
Example #14
0
 public void UpdateLevelText()
 {
     if (level == PatternManager.instance.patterns.Length)
     {
         return;
     }
     else
     {
         level++;
         CustomAnalytics.Event("Level" + level);
     }
     levelText.text = level.ToString();
 }
Example #15
0
 public void ContinueViaDiamonds()
 {
     if (Shop.Instance.diamonds >= continueScreenMono.diamonds)
     {
         CustomAnalytics.Event("ContinueDiamonds" + continueScreenMono.diamonds);
         Shop.Instance.UpdateDiamonds(-continueScreenMono.diamonds);
         continueScreenMono.diamonds += 5;
         ContinueSuccess();
     }
     else
     {
         notEnoughDiamonds.SetActive(true);
     }
 }
Example #16
0
        public void ToXElement_ReturnsCorrectXElement()
        {
            // Arrange
            const string    CustomAnalyticsUrl = "https://analytics.com";
            CustomAnalytics ca = new CustomAnalytics(CustomAnalyticsUrl);

            // Act
            XElement result = ca.ToXElement();

            // Assert
            result.Should().NotBeNull();
            result.Name.LocalName.Should().BeEquivalentTo("analytics");
            result.Name.Namespace.Should().BeEquivalentTo(TurboYandexNamespace);
            result.Should().HaveAttribute("type", AnalyticsTypes.Custom)
            .And.HaveAttribute("url", CustomAnalyticsUrl);
        }
Example #17
0
    public void StartLevel()
    {
        asteroidsSO.numSmallerAsteroidsToSpawn = levelsConfiguration[curLevel][4] - '0'; //get this from remote settings

        // Spawn the parent Asteroids, child Asteroids are taken care of by them
        for (int i = 0; i < levelsConfiguration[curLevel][2] - '0'; i++)
        {
            SpawnParentAsteroid(i);
        }

        curLevel++;
        if (curLevel >= AchievementManager.levelToReachSkillfullDodger && !AchievementManager.S.Achievements[5].complete)
        {
            HIGH_LEVEL_DELEGATE();
        }
        CustomAnalytics.SendLevelStart(curLevel);
    }
 void UnlockAchievement(int achievementNumberInList)
 {
     if (achievementNumberInList == -1)
     {
         achievementNameDisplay.text        = "HIGH SCORE";
         achievementDescriptionDisplay.text = "You've achieved a new high score.";
     }
     else
     {
         achievementNameDisplay.text        = Achievements[achievementNumberInList].name;
         achievementDescriptionDisplay.text = Achievements[achievementNumberInList].description;
         ShipCustomizationPanel.UnlockPart(Achievements[achievementNumberInList].partType, Achievements[achievementNumberInList].partNum);
         CustomAnalytics.SendAchievementUnlocked(Achievements[achievementNumberInList]);
     }
     anim.SetBool("Achievement appear", true);
     Invoke("AchievementDisappear", durationOfShowingAchievement);
     SaveGameManager.Save();
 }
    void StartLevel(int levelNum)
    {
#if DEBUG_AsteraX_LogMethods
        Debug.Log("AsteraX:StartLevel(" + levelNum + ")");
#endif
        if (LEVEL_LIST.Count == 0)
        {
            Debug.LogError("AsteraX:StartLevel(" + levelNum + ") - LEVEL_LIST is empty!");
            return;
        }
        if (levelNum >= LEVEL_LIST.Count)
        {
            levelNum = 1; // Just loop the levels for now. In a real game, this would be different.
        }

        GAME_STATE = eGameState.preLevel;
        GAME_LEVEL = levelNum;
        LevelInfo info = LEVEL_LIST[levelNum - 1];

        // Destroy any remaining Asteroids, Bullets, etc. (including particle effects)
        ClearAsteroids();
        ClearBullets();
        foreach (GameObject go in GameObject.FindGameObjectsWithTag("DestroyWithLevelChange"))
        {
            Destroy(go);
        }

        // Set up the asteroidsSO
        asteroidsSO.numSmallerAsteroidsToSpawn = info.numSubAsteroids;

        // Spawn the parent Asteroids, child Asteroids are taken care of by them
        for (int i = 0; i < info.numInitialAsteroids; i++)
        {
            SpawnParentAsteroid(i);
        }

        CustomAnalytics.SendLevelStart(GAME_LEVEL);
        AchievementManager.AchievementStep(Achievement.eStepType.levelUp, levelNum);
    }
Example #20
0
    //decided I'd try to only run this on an event(aka when the value changed) so after I add the value
    //I just call it on the script I added it from. plan on making methods later to make it simpler.
    /// <summary>
    /// make sure to call this after changing variables
    /// </summary>
    public static void AchievementCheck()
    {
        if (SaveGameManager.CheckHighScore(SCORE) && !_S._newHighScore)
        {
            _S._newHighScore = true;
            AchievementSettings highScoreSettings = new AchievementSettings();
            highScoreSettings.title       = _S.highScoreTitle;
            highScoreSettings.description = _S.highScoreDescription;
            highScoreSettings.count       = SCORE;
            _S._settingsQueue.Enqueue(highScoreSettings);
            UIScript.SetGameOverText("HIGH SCORE!");
        }
        foreach (AchievementSettings setting in _S.settings)
        {
            switch ((int)setting.achievementType)
            {
            case 0:                    //LuckyShot
                if (BULLET_WRAP_COUNT >= setting.count && !setting.complete)
                {
                    setting.complete = true;
                    _S._settingsQueue.Enqueue(setting);
                    CustomAnalytics.SendAchievementUnlocked(setting);
                }
                break;

            case 1:                    //AsteroidHitCount
                if (ASTEROIDS_HIT >= setting.count && !setting.complete)
                {
                    setting.complete = true;
                    _S._settingsQueue.Enqueue(setting);
                    CustomAnalytics.SendAchievementUnlocked(setting);
                }
                break;

            case 2:                    //BulletsFired
                if (BULLETS_FIRED >= setting.count && !setting.complete)
                {
                    setting.complete = true;
                    _S._settingsQueue.Enqueue(setting);
                    CustomAnalytics.SendAchievementUnlocked(setting);
                }
                break;

            case 3:                    //Points
                if (SCORE >= setting.count && !setting.complete)
                {
                    setting.complete = true;
                    _S._settingsQueue.Enqueue(setting);
                    CustomAnalytics.SendAchievementUnlocked(setting);
                }
                break;

            case 4:                    //LevelsComplete
                if (AsteraX.GetLevel() >= setting.count && !setting.complete)
                {
                    setting.complete = true;
                    _S._settingsQueue.Enqueue(setting);
                    CustomAnalytics.SendAchievementUnlocked(setting);
                }
                break;

            default:
                break;
            }

            UIScript.UnlockToggleFromAchievement(setting);
        }
        SaveGameManager.Save();
    }
Example #21
0
        public bool CreateDefaults()
        {
            bool aboutIsEmpty = AboutRepository.IsEmpty().GetAwaiter().GetResult();

            if (aboutIsEmpty)
            {
                try
                {
                    var newAbout = new About
                    {
                        date_add = DateTime.Now,
                        date_upd = DateTime.Now,
                        content  = $@"<div class='section-row' style ='margin -bottom: 40px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;' ><p style ='margin -bottom: 20px;' > Lorem ipsum dolor sit amet, ea eos tibique expetendis, tollit viderer ne nam.No ponderum accommodare eam, purto nominavi cum ea, sit no dolores tractatos.Scripta principes quaerendum ex has, ea mei omnes eruditi. Nec ex nulla mandamus, quot omnesque mel et. Amet habemus ancillae id eum, justo dignissim mei ea, vix ei tantas aliquid. Cu laudem impetus conclusionemque nec, velit erant persius te mel.Ut eum verterem perpetua scribentur.</p><figure class='figure -img' style ='margin -bottom: 20px;' ><img alt ='' class='img-responsive' src ='{this.BaseUrl}/assets/img/about-1.jpg' ></figure><p style ='margin -bottom: 20px;' > Vix mollis admodum ei, vis legimus voluptatum ut, vis reprimique efficiendi sadipscing ut.Eam ex animal assueverit consectetuer, et nominati maluisset repudiare nec.Rebum aperiam vis ne, ex summo aliquando dissentiunt vim.Quo ut cibo docendi.Suscipit indoctum ne quo, ne solet offendit hendrerit nec.Case malorum evertitur ei vel.</p></div><div class='row section-row' style='margin-bottom: 40px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'><div class='col-md-6' style='float: left; width: 390px;'><figure class='figure-img' style='margin-bottom: 20px;'><img alt='' class='img-responsive' src='{this.BaseUrl}/assets/img/about-2.jpg'></figure></div><div class='col-md-6' style='float: left; width: 390px;'><h3 style='font-family: &quot;Nunito Sans&quot;, sans-serif; font-weight: 700; color: rgb(33, 38, 49); margin: 0px 0px 15px; font-size: 23px;'>Our Mission</h3><p style= 'margin-bottom: 20px;' > Id usu mutat debet tempor, fugit omnesque posidonium nec ei.An assum labitur ocurreret qui, eam aliquid ornatus tibique ut.</p><ul class='list-style' style='margin-right: 0px; margin-left: 0px; padding: 0px 0px 0px 15px; list-style-position: initial; list-style-image: initial;'><li><p style='margin-bottom: 20px;'>Vix mollis admodum ei, vis legimus voluptatum ut.</p></li><li><p style='margin-bottom: 20px;'>Cu cum alia vide malis.Vel aliquid facilis adolescens.</p></li><li><p style= 'margin-bottom: 20px;' > Laudem rationibus vim id.Te per illum ornatus.</p></li></ul></div></div>"
                    };
                    AboutRepository.Insert(newAbout);
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }
            bool pageIsEmpty = PageRepository.IsEmpty().GetAwaiter().GetResult();

            if (pageIsEmpty)
            {
                try
                {
                    string[] pagesTitles = new string[] { "News", "Popular", "Web Design", "JavaScript", "Css", "Jquery" };
                    for (int i = 0; i < pagesTitles.Length; i++)
                    {
                        Page newPage = new Page
                        {
                            date_add       = DateTime.Now,
                            date_upd       = DateTime.Now,
                            category_color = this.RandomColor(),
                            name           = pagesTitles[i],
                            posts_count    = 0,
                            show_at_home   = true,
                            showing_order  = i + 1
                        };
                        PageRepository.Insert(newPage);
                    }
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }
            bool postsIsEmpty = PostRepository.IsEmpty().GetAwaiter().GetResult();

            if (postsIsEmpty)
            {
                try
                {
                    string[] pages = new string[] { "News", "Popular", "Web Design", "JavaScript", "Css", "Jquery" };
                    //string postTitle = "Ask HN: Does Anybody Still Use JQuery?";
                    string[] postTitles = new string[] {
                        "Tell-A-Tool: Guide To Web Design And Development Tools",
                        "Why Node.js Is The Coolest Kid On The Backend Development Block!",
                        "Pagedraw UI Builder Turns Your Website Design Mockup Into Code Automatically",
                        "Chrome Extension Protects Against JavaScript-Based CPU Side-Channel Attacks",
                        "CSS Float: A Tutorial",
                        "Ask HN: Does Anybody Still Use JQuery?"
                    };
                    string     postDescription = @"
                    Do you like Cheese Whiz? Spray tan? Fake eyelashes? That's what is Lorem Ipsum to many—it rubs them the wrong way, all the way. It's unreal, uncanny
                ";
                    string[][] postTags        = new string[][] { new string[] { "Chrome", "CSS", "Tutorial" }, new string[] { "Backend", "JQuery", "Design" },
                                                                  new string[] { "Development", "JavaScript", "Website" }, new string[] { "CSS", "Tutorial", "Backend" },
                                                                  new string[] { "Design", "Development", "JavaScript" }, new string[] { "Chrome", "JQuery", "Website" } };



                    string[] postPictures = new string[6];
                    for (int i = 0; i < 6; i++)
                    {
                        // frontend/dist/frontend/
                        postPictures[i] = this.BaseUrl + "/assets/img/post-" + (i + 1) + ".jpg";
                    }

                    string defaultContent = ($@"
                    <h3 style = 'font-family: &quot;Nunito Sans&quot;, sans-serif; font-weight: 700; color: rgb(33, 38, 49); margin: 0px 0px 15px; font-size: 23px;' > Lorem Ipsum: when, and when not to use it</ h3 ><p style = 'margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;' > Do you like Cheese Whiz? Spray tan? Fake eyelashes? That's what is Lorem Ipsum to many—it rubs them the wrong way, all the way. It's unreal, uncanny, makes you wonder if something is wrong, it seems to seek your attention for all the wrong reasons. Usually, we prefer the real thing, wine without sulfur based preservatives, real butter, not margarine, and so we'd like our layouts and designs to be filled with real words, with thoughts that count, information that has value.</p><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>The toppings you may chose for that TV dinner pizza slice when you forgot to shop for foods, the paint you may slap on your face to impress the new boss is your business. But what about your daily bread? Design comps, layouts, wireframes—will your clients accept that you go about things the facile way? Authorities in our business will tell in no uncertain terms that Lorem Ipsum is that huge, huge no no to forswear forever. Not so fast, I'd say, there are some redeeming factors in favor of greeking text, as its use is merely the symptom of a worse problem to take into consideration.</p><figure class='figure-img' style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'><img alt='' class='img-responsive' src='{this.BaseUrl}/assets/img/post-4.jpg'><figcaption style='padding-top: 5px; font-size: 13px; font-weight: 600;'>So Lorem Ipsum is bad (not necessarily)</figcaption></figure><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>You begin with a text, you sculpt information, you chisel away what's not needed, you come to the point, make things clear, add value, you're a content person, you like words. Design is no afterthought, far from it, but it comes in a deserved second. Anyway, you still use Lorem Ipsum and rightly so, as it will always have a place in the web workers toolbox, as things happen, not always the way you like it, not always in the preferred order. Even if your less into design and more into content strategy you may find some redeeming value with, wait for it, dummy copy, no less.</p><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>There's lot of hate out there for a text that amounts to little more than garbled words in an old language. The villagers are out there with a vengeance to get that Frankenstein, wielding torches and pitchforks, wanting to tar and feather it at the least, running it out of town in shame.</p><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>One of the villagers, Kristina Halvorson from Adaptive Path, holds steadfastly to the notion that design can’t be tested without real content:</p><blockquote class='blockquote' style='padding-top: 20px; padding-bottom: 20px; margin-bottom: 10px; border-left: 0px; position: relative; font-weight: 600; color: rgb(61, 69, 92); font-family: Nunito, sans-serif;'>I’ve heard the argument that “lorem ipsum” is effective in wireframing or design because it helps people focus on the actual layout, or color scheme, or whatever. What kills me here is that we’re talking about creating a user experience that will (whether we like it or not) be DRIVEN by words. The entire structure of the page or app flow is FOR THE WORDS.</blockquote><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>If that's what you think how bout the other way around? How can you evaluate content without design? No typography, no colors, no layout, no styles, all those things that convey the important signals that go beyond the mere textual, hierarchies of information, weight, emphasis, oblique stresses, priorities, all those subtle cues that also have visual and emotional appeal to the reader. Rigid proponents of content strategy may shun the use of dummy copy but then designers might want to ask them to provide style sheets with the copy decks they supply that are in tune with the design direction they require.</p><h3 style='font-family: &quot;Nunito Sans&quot;, sans-serif; font-weight: 700; color: rgb(33, 38, 49); margin: 0px 0px 15px; font-size: 23px;'>Summing up, if the copy is diverting attention from the design it’s because it’s not up to task.</h3><p style='margin-bottom: 20px; color: rgb(61, 69, 92); font-family: Nunito, sans-serif; font-size: 16px;'>Typographers of yore didn\'t come up with the concept of dummy copy because people thought that content is inconsequential window dressing, only there to be used by designers who can’t be bothered to read. Lorem Ipsum is needed because words matter, a lot. Just fill up a page with draft copy about the client’s business and they will actually read it and comment on it. They will be drawn to it, fiercely. Do it the wrong way and draft copy can derail your design review.</p>                
                ");
                    // frontend/dist/frontend/
                    var author = new
                    {
                        author_name    = "John Doe",
                        author_picture = $"{this.BaseUrl}/assets/img/author.png",
                        author_desc    = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
                    };
                    var authorSocialLinks = new { facebook = "facebook", twitter = "twitter", instagram = "instagram" };
                    for (int index = 0; index < 8; index++)
                    {
                        for (int i = 0; i < pages.Length; i++)
                        {
                            List <Page> pageList = ((List <Page>)PageRepository.GetAsync(e => e.name == pages[i]).GetAwaiter().GetResult());
                            Page        page     = pageList[0];
                            page.posts_count += 1;
                            PageRepository.Update(page);
                            //await SaveAsync();

                            Post newPost = new Post
                            {
                                post_category       = postTitles[i],
                                post_title          = postTitles[i],
                                post_tags           = postTags[i].ToString(),
                                post_picture        = postPictures[i],
                                content             = defaultContent,
                                post_desc           = postDescription,
                                author_name         = author.author_name,
                                author_desc         = author.author_desc,
                                author_picture      = author.author_picture,
                                author_social_links = JObject.FromObject(authorSocialLinks).ToString()
                            };
                            PostRepository.Insert(newPost);
                            //await SaveAsync();
                        }
                    }
                    //await SaveAsync();
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }
            bool commentsIsEmpty = CommentRepository.IsEmpty().GetAwaiter().GetResult();

            if (commentsIsEmpty)
            {
                try
                {
                    string comment_message = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
                    var    posts           = (List <Post>)PostRepository.GetAllAsync().GetAwaiter().GetResult();
                    for (int i = 0; i < posts.Count(); i++)
                    {
                        Comment newComment = new Comment
                        {
                            name              = "John Doe",
                            email             = "*****@*****.**",
                            message           = comment_message,
                            post_id           = posts[i].id,
                            parent_comment_id = null,
                            child_comment_ids = new List <string>()
                        };

                        CommentRepository.Insert(newComment);
                        SaveAsync().GetAwaiter().GetResult();

                        Comment childComment = new Comment
                        {
                            name              = "John Doe",
                            email             = "*****@*****.**",
                            message           = comment_message,
                            post_id           = posts[i].id,
                            parent_comment_id = newComment.id.ToString(),
                            child_comment_ids = new List <string>()
                        };

                        CommentRepository.Insert(childComment);
                        SaveAsync().GetAwaiter().GetResult();

                        newComment.child_comment_ids.Add(childComment.id.ToString());
                        CommentRepository.Update(newComment);
                        SaveAsync().GetAwaiter().GetResult();

                        Comment newComment2 = new Comment
                        {
                            name              = "John Doe",
                            email             = "*****@*****.**",
                            message           = comment_message,
                            post_id           = posts[i].id,
                            parent_comment_id = null,
                            child_comment_ids = new List <string>()
                        };

                        CommentRepository.Insert(newComment2);
                        SaveAsync().GetAwaiter().GetResult();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }

            bool advertisementIsEmpty = AdvertisementRepository.IsEmpty().GetAwaiter().GetResult();

            if (advertisementIsEmpty)
            {
                try
                {
                    var ads1 = new { name = "ad1", picture_url = this.BaseUrl + "/assets/img/ad-1.jpg" };
                    var ads2 = new { name = "ad2", picture_url = this.BaseUrl + "/assets/img/ad-2.jpg" };

                    var newAdvertisement = new Advertisement()
                    {
                        ads_name_1    = ads1.name,
                        ads_name_2    = ads2.name,
                        ads_picture_1 = ads1.picture_url,
                        ads_picture_2 = ads2.picture_url
                    };

                    AdvertisementRepository.Insert(newAdvertisement);
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }

                //$baseUrl = 'https://'.$_SERVER['SERVER_NAME'].'/';
                //$adds =[];
                //for ($i = 0; $i < 2 ; $i++) {
                //    $adds[]=['name'=>'ad'.($i + 1), 'picture_url'=>$baseUrl.'assets/img/ad-'.($i + 1).'.jpg'];
                //    // evvel buda elave prefix idi: frontend/dist/frontend/
                //}
            }

            bool contactsIsEmpty = ContactRepository.IsEmpty().GetAwaiter().GetResult();

            if (contactsIsEmpty)
            {
                try
                {
                    var newContact = new Contact()
                    {
                        content = @"
                    <h3>Contact Information</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</ p ><ul class='list-style'><li><p><strong>Email:</strong><a href='#'>Webmag @email.com</a></p></li><li><p><strong> Phone:</strong> 213-520-7376</p></li><li><p><strong> Address:</strong> 3770 Oliver Street</p></li></ul>
                    "
                    };

                    ContactRepository.Insert(newContact);
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }

            bool socialLinksIsEmpty = SocialLinksRepository.IsEmpty().GetAwaiter().GetResult();

            if (socialLinksIsEmpty)
            {
                try
                {
                    var social_links = new string[] { "facebook", "twitter", "telegram" };
                    for (int i = 0; i < social_links.Length; i++)
                    {
                        var newSocialLink = new SocialLinks()
                        {
                            link_type = social_links[i],
                            content   = "https://default-profile"
                        };
                        SocialLinksRepository.Insert(newSocialLink);
                    }
                    SaveAsync().GetAwaiter().GetResult();
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }

            bool customAnalyticsIsEmpty = CustomAnalyticsRepository.IsEmpty().GetAwaiter().GetResult();

            if (customAnalyticsIsEmpty)
            {
                try
                {
                    string user_ip          = ClientIpAddress();
                    var    locationInfoJson = GetLocationAsync().GetAwaiter().GetResult();
                    if (locationInfoJson != null && locationInfoJson["country_name"] != null)
                    {
                        var analytics_data = new
                        {
                            visited_page_link = UriHelper.GetDisplayUrl(httpContextAccessor.HttpContext.Request),
                            user_ip           = locationInfoJson["ip"].ToString(),
                            country           = locationInfoJson["country_name"].ToString(),
                            http_referer      = httpContextAccessor.HttpContext.Request.GetTypedHeaders().Referer.ToString(),
                            ip_data           = locationInfoJson
                        };

                        var newCustomAnalytics = new CustomAnalytics()
                        {
                            analytics_type = "link_click",
                            analytics_data = JObject.FromObject(analytics_data).ToString()
                        };

                        CustomAnalyticsRepository.Insert(newCustomAnalytics);
                        SaveAsync().GetAwaiter().GetResult();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("{0} Exception caught.", e);
                }
            }

            if (advertisementIsEmpty || contactsIsEmpty || socialLinksIsEmpty || customAnalyticsIsEmpty || commentsIsEmpty || postsIsEmpty || pageIsEmpty || aboutIsEmpty)
            {
                return(true);
            }
            else
            {
                return(false);
            }
            //bool userIsEmpty = UserManager.Users.ToArray().Length == 0;
            //if (userIsEmpty)
            //{
            //    var user = new ApplicationUser {
            //        ApiToken = "some",
            //        UserName = "******",
            //        Email = "*****@*****.**",
            //        EmailConfirmed = true,
            //        DateAdd = DateTime.Now,
            //        DateUpd = DateTime.Now
            //    };
            //    await UserManager.CreateAsync(user, "admin");
            //    //await SaveAsync();
            //    //new SignInManager<User>().SignInAsync
            //    //UserManager.Users.ToList().ForEach( async(user)=> {
            //    //    await _userManager.DeleteAsync(user);
            //    //});
            //}
        }
Example #22
0
 void AddDiamonds()
 {
     CustomAnalytics.Event("ShopVideo");
     shop.UpdateDiamonds(2);
     diamonds.text = shop.diamonds.ToString();
 }
Example #23
0
 public void BuyBall(int value)
 {
     CustomAnalytics.Event("BuyBall" + value);
     ballStates [value] = true;
 }