Ejemplo n.º 1
0
 public AlbumCommands(Logger.Logger logger,
                      ILastfmApi lastfmApi,
                      IPrefixService prefixService,
                      UserService userService,
                      LastFMService lastFmService,
                      WhoKnowsAlbumService whoKnowsAlbumService,
                      PlayService playService,
                      IIndexService indexService,
                      IUpdateService updateService)
 {
     this._logger               = logger;
     this._lastfmApi            = lastfmApi;
     this._lastFmService        = lastFmService;
     this._whoKnowsAlbumService = whoKnowsAlbumService;
     this._playService          = playService;
     this._indexService         = indexService;
     this._updateService        = updateService;
     this._prefixService        = prefixService;
     this._guildService         = new GuildService();
     this._userService          = userService;
     this._embed = new EmbedBuilder()
                   .WithColor(DiscordConstants.LastFMColorRed);
     this._embedAuthor = new EmbedAuthorBuilder();
     this._embedFooter = new EmbedFooterBuilder();
 }
Ejemplo n.º 2
0
        public void record(uint session, SprotoTypeBase responseObj, object ud)
        {
            PlayService service = _ctx.QueryService <PlayService>(PlayService.Name);

            UnityEngine.Debug.Assert(service != null);
            service.OnRspRecord(responseObj);
        }
Ejemplo n.º 3
0
 public TrackCommands(Logger.Logger logger,
                      IPrefixService prefixService,
                      GuildService guildService,
                      UserService userService,
                      LastFMService lastFmService,
                      SpotifyService spotifyService,
                      WhoKnowsTrackService whoKnowsTrackService,
                      PlayService playService,
                      IUpdateService updateService,
                      IIndexService indexService)
 {
     this._logger               = logger;
     this._prefixService        = prefixService;
     this._guildService         = guildService;
     this._userService          = userService;
     this._lastFmService        = lastFmService;
     this._spotifyService       = spotifyService;
     this._whoKnowsTrackService = whoKnowsTrackService;
     this._playService          = playService;
     this._updateService        = updateService;
     this._indexService         = indexService;
     this._embed = new EmbedBuilder()
                   .WithColor(DiscordConstants.LastFMColorRed);
     this._embedAuthor = new EmbedAuthorBuilder();
     this._embedFooter = new EmbedFooterBuilder();
 }
Ejemplo n.º 4
0
 private void InitPlayControl()
 {
     _initPlayLeft     = trackBar1.Left;
     playPanel.Visible = true;
     _playService      = new PlayService(this);
     playStopBar.RegisterService(_playService);
 }
        private async void StartWaiting()
        {
            // if (Social.Active.localUser.authenticated)
            // {
            //     IsSuccesfullyAuthentificated(true);
            //     return;
            // }
            // await Task.Delay(System.TimeSpan.FromSeconds(10f));

            while (_playServiceStatus == PlayService.Uninitialized)
            {
                await Task.Delay(System.TimeSpan.FromSeconds(0.1f));

#if UNITY_EDITOR && UNITY_ANDROID
                _playServiceStatus = PlayService.Success;
#endif
            }
            Debug.Log(" Is Activated Play Games? : " + _playServiceStatus.ToString());

            if (Social.Active.localUser.authenticated)
            {
                IsSuccesfullyAuthentificated(Social.Active.localUser.authenticated);
            }
            else
            {
                Social.Active.localUser.Authenticate(IsSuccesfullyAuthentificated);
            }
        }
Ejemplo n.º 6
0
 public PlayController(ILogger <PlayController> log,
                       PlayService playService,
                       PlayerService playerService)
 {
     _log           = log;
     _playService   = playService;
     _playerService = playerService;
 }
Ejemplo n.º 7
0
 private void InitPlayControl()
 {
     orgiPlayLeft            = trackBar1.Left;
     playPanel.Visible       = false;
     _playService            = new PlayService(this);
     playStopBar.SupportNext = false;
     playStopBar.RegisterService(_playService);
 }
Ejemplo n.º 8
0
 public void showLeaderboard()
 {
     if (!PlayGamesPlatform.Instance.IsAuthenticated())
     {
         PlayService.SignInToGooglePlayService();
     }
     else
     {
         StartCoroutine(LoadAsynchronously());
     }
 }
Ejemplo n.º 9
0
        // GET: Play
        public ActionResult Index(int IDQuestion)
        {
            Questions question = new PlayService().getQuestionByIDQuestion(IDQuestion);

            if (question != null)
            {
                return(View(question));
            }
            else
            {
                return(Redirect("/Home/Index?error"));
            }
        }
Ejemplo n.º 10
0
    public void showSummary()
    {
        myScore.text    = GameInfo.instance.score.ToString();
        bestScore.text  = SaveAndLoad.getBestScore().ToString();
        starsCount.text = GameInfo.instance.stars.ToString();

        if (GameInfo.instance.score > SaveAndLoad.getBestScore())
        {
            SaveAndLoad.setBestScore(GameInfo.instance.score);
        }

        PlayService.PostToLeaderboard(GameInfo.instance.score);

        summartyBoard.SetActive(true);
        GetComponent <Animator>().Play("showSummary");
        StartCoroutine(showAdButton());
    }
Ejemplo n.º 11
0
        public ActionResult Done(Questions questions, int Status)
        {
            int point = 0;

            if (Status == 1)
            {
                questions.AnsweredBy = (int)Session["IDUser"];

                // SUDAH DIJAWAB
                questions.Status = 2;


                switch (questions.Difficulty)
                {
                case 1:
                    point = (int)Session["Point"] + 10;
                    break;

                case 2:
                    point = (int)Session["Point"] + 30;
                    break;

                case 3:
                    point = (int)Session["Point"] + 50;
                    break;
                }

                // UPDATE SESSION POINT
                Session["Point"] = point;

                bool result  = new PlayService().UpdateQuestion(questions);
                bool result2 = new PlayService().UpdateUser((int)questions.AnsweredBy, point);
                if (result == true && result2 == true)
                {
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    return(Redirect("/Home/Index?updateQuestionFailed"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
Ejemplo n.º 12
0
 public PlayCommands(
     IPrefixService prefixService,
     GuildService guildService,
     UserService userService,
     LastFMService lastFmService,
     PlayService playService,
     IUpdateService updateService,
     IIndexService indexService)
 {
     this._prefixService = prefixService;
     this._guildService  = guildService;
     this._userService   = userService;
     this._lastFmService = lastFmService;
     this._playService   = playService;
     this._updateService = updateService;
     this._indexService  = indexService;
     this._embed         = new EmbedBuilder()
                           .WithColor(DiscordConstants.LastFMColorRed);
     this._embedAuthor = new EmbedAuthorBuilder();
     this._embedFooter = new EmbedFooterBuilder();
 }
        private void CheckerForPlayServiceActivation()
        {
#if UNITY_ANDROID && UNITY_ANDROID_PLAY_GAMES
            // Debug.Log("Initialize GooglePlayGames.BasicApi.PlayGamesClientConfiguration.Builder");
            var config = new GooglePlayGames.BasicApi.PlayGamesClientConfiguration.Builder()
                         // requests a server auth code be generated so it can be passed to an
                         //  associated back end server application and exchanged for an OAuth token.
                         // .RequestServerAuthCode(false)
                         // requests an ID token be generated.  This OAuth token can be used to
                         //  identify the player to other services such as Firebase.
                         // .RequestIdToken()
                         .Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();
            // PlayGamesPlatform.Instance.Authenticate(IsSuccesfullyAuthentificated);
#endif
#if UNITY_ANDROID && !UNITY_EDITOR && UNITY_ANDROID_PLAY_GAMES
            // // based on https://github.com/playgameservices/play-games-plugin-for-unity/issues/715
            const string googleApiAvailabilityClassname =
                "com.google.android.gms.common.GoogleApiAvailability";
            AndroidJavaClass clazz =
                new AndroidJavaClass(googleApiAvailabilityClassname);
            AndroidJavaObject obj =
                clazz.CallStatic <AndroidJavaObject>("getInstance");
            var androidJc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            var activity  = androidJc.GetStatic <AndroidJavaObject>("currentActivity");
            _playServiceStatus = (PlayService)obj.Call <int>("isGooglePlayServicesAvailable", activity);


            // // 0 == success
            // // 1 == service_missing
            // // 2 == update service required
            // // 3 == service disabled
            // // 18 == service updating
            // // 9 == service invalid
#endif
            StartWaiting();
        }
Ejemplo n.º 14
0
        public void When_Computer_against_Computer_Select_Shape_Test(int counter)
        {
            // act
            var playerOne = new Player
            {
                PlayerType = PlayerType.Computer
            };

            var playerTwo = new Player
            {
                PlayerType = PlayerType.Computer
            };

            IPlayService playService = new PlayService();

            // actual
            var playerOneActual = playService.Play(playerOne, counter);
            var playerTwoActual = playService.Play(playerTwo, counter);

            // assert
            Assert.IsNotNull(playerOneActual);
            Assert.IsNotNull(playerTwoActual);
        }
Ejemplo n.º 15
0
 public void showLeaderboard()
 {
     PlayService.ShowLeaderboardUI();
 }
Ejemplo n.º 16
0
 public PlayRequestHandler(PlayService playService)
 {
     this._PlayService = playService;
 }
Ejemplo n.º 17
0
 void Start()
 {
     PlayService.SignInToGooglePlayService();
 }
 public MusicController(DatabaseService databaseService, Mapper mapper, PlayService playService)
 {
     dbservice   = databaseService;
     this.mapper = mapper;
     play        = playService;
 }
Ejemplo n.º 19
0
 public PlayServiceTest()
 {
     _testPlayRepository = new TestPlayRepository();
     _playService        = new PlayService();
     _playIds            = new List <int>();
 }
Ejemplo n.º 20
0
 public BookApiController(BookService bookService, VideoService videoService, PlayService playService, UserManager <ApplicationUser> userManager) : base(userManager)
 {
     m_VideoService = videoService ?? throw new ArgumentNullException(nameof(videoService));
     m_BookService  = bookService ?? throw new ArgumentNullException(nameof(bookService));
     m_PlayService  = playService ?? throw new ArgumentNullException(nameof(playService));
 }