private void testButton_Click(object sender, RoutedEventArgs e)
        {
            //player testData = playerAchievements.getPlayerAchievements(appData.getKey("steam"), "76561198000713602", "211420", "EN");

            //testTextBox.Text += testData.playertsats.steamID + "\n";
            //testTextBox.Text += testData.playertsats.game + "\n";
            //foreach (achievement i in testData.playertsats.achievements)
            //{
            //    testTextBox.Text += "   " + i.apiname + "\n";
            //    testTextBox.Text += "   " + i.achieved + "\n";
            //    testTextBox.Text += "   " + i.unlockedTime + "\n";
            //    testTextBox.Text += "   " + i.name + "\n";
            //    testTextBox.Text += "   " + i.description + "\n";
            //}

            gameInfo testData2 = schemaForGame.getSchemaForGame(appData.getKey("steam"), "211420", "EN");

            testTextBox.Text += testData2.game.gameName + "\n";
            testTextBox.Text += testData2.game.version + "\n";
            foreach (achievementInfo i in testData2.game.gameStats.achievements)
            {
                testTextBox.Text += "   " + i.name + "\n";
                testTextBox.Text += "   " + i.defaultvalue + "\n";
                testTextBox.Text += "   " + i.displayName + "\n";
                testTextBox.Text += "   " + i.hidden + "\n";
                testTextBox.Text += "   " + i.description + "\n";
                testTextBox.Text += "   " + i.iconURL + "\n";
                testTextBox.Text += "   " + i.icongreyURL + "\n";
            }
        }
Beispiel #2
0
    private void handlePacket(string message)
    {
        codePacket data = (codePacket)JsonUtility.FromJson(message, typeof(codePacket));


        if (data.code == 200)
        {
            startServer = true;
        }



        if (data.code == 1000)
        {
            gameList games = JsonUtility.FromJson <gameList>(message);
            Debug.Log(JsonUtility.ToJson(games));

            int j;
            currentGames = games.games;

            /*
             * for( j = 0; j < games.games.Count; j++) {
             *      Debug.Log(games.games[j].game_name);
             * }
             */
        }

        if (data.code == 301)
        {
            gameInfo _data = (gameInfo)JsonUtility.FromJson(message, typeof(gameInfo));
            connectToPort = _data.game_port;
            shouldConnect = true;
        }
    }
        public async Task TellGameEventAsync(gameInfo evt)
        {
            var resp = $"For {_gameId} :: INN {evt.inning}  COUNT {evt.balls}-{evt.strikes}-{evt.outs}  {evt.home_team} {evt.home_score} - {evt.visiting_team} {evt.visitor_score}";

            Console.WriteLine(resp);

            await Helpers.DaprClient.PublishEventAsync <gameInfo>("pubsub", "gameEvent", evt);

            if (evt.is_end_game == "T")
            {
                var homeTeamProxy     = ActorProxy.Create <ITeam>(new ActorId(evt.home_team), "Team");
                var visitingTeamProxy = ActorProxy.Create <ITeam>(new ActorId(evt.visiting_team), "Team");

                var homeMsg = new completedGame
                {
                    game_count = 1,
                    team       = evt.home_team,
                    is_win     = (evt.home_score > evt.visitor_score)
                };

                var visitMsg = new completedGame
                {
                    game_count = 1,
                    team       = evt.visiting_team,
                    is_win     = evt.visitor_score > evt.home_score
                };

                await homeTeamProxy.TellHandleGameCompleted(homeMsg);

                await visitingTeamProxy.TellHandleGameCompleted(visitMsg);
            }
        }
Beispiel #4
0
 void saveData()
 {
     gameInfo temp = new gameInfo();
     temp.volume = AudioManager._instance.getVolume();
     Debug.Log(temp.volume);
     IOHelper.setData(filename, temp);
 }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        ginfo = GameObject.FindGameObjectWithTag("GameInfo");
        gameInfo GI = ginfo.GetComponent <gameInfo>();

        CScore      = GetComponent <Text>();
        CScore.text = "" + GI.coins;
    }
Beispiel #6
0
        public async Task <IActionResult> Game([FromBody] gameInfo msg)
        {
            var resp = $"For {msg.gameid} :: INN {msg.inning}  COUNT {msg.balls}-{msg.strikes}-{msg.outs}  {msg.home_team} {msg.home_score} - {msg.visiting_team} {msg.visitor_score}";

            Console.WriteLine(resp);

            await _hub.Clients.All.SendCoreAsync("Receive", new object[] { "Game Actor", resp });

            return(Ok());
        }
Beispiel #7
0
    // Update is called once per frame
    void Update()
    {
        ginfo = GameObject.FindGameObjectWithTag("GameInfo");
        gameInfo GI = ginfo.GetComponent <gameInfo>();

        if (playerTouch == true)

        {
            Destroy(gameObject);
            GI.coins = GI.coins + 1;
        }
    }
Beispiel #8
0
 void readData() {
     if (!IOHelper.IsFileExists(filename))
     {
         Debug.Log("文件不存在");
         gameInfo temp = new gameInfo();
         IOHelper.setData(filename, temp);
     }
     else {
         gameInfo temp = (gameInfo)IOHelper.GetData(filename, typeof(gameInfo));
         AudioManager._instance.setVolume(temp.volume);
     }
     //float t1 = (float)IOHelper.GetData(filename, typeof(float));
     //if(t1.Equals(""))
     //    Debug.Log("fasdfsad");
 }
Beispiel #9
0
    void Awake()
    {
        // Application.targetFrameRate=60;
        instance = this;

        curGameState = gameState.mainUI;

        curGameinfo = new gameInfo();

        diamondNum   = PlayerPrefs.GetInt("diamondNum", 0);
        totalPlayNum = PlayerPrefs.GetInt("totalPlayNum", 0);

        levelData = new LevelData();

        //   Resolution[] resolutions = Screen.resolutions;
        // foreach (Resolution res in resolutions) {
        //     print(res.width + "x" + res.height);
        // }


        AppsFlyer.setAppsFlyerKey("JS4D7K6orQauKANLStD2nb");
        /* For detailed logging */
        /* AppsFlyer.setIsDebug (true); */
                #if UNITY_IOS
        /* Mandatory - set your apple app ID
         *      NOTE: You should enter the number only and not the "ID" prefix */
        AppsFlyer.setAppID("1402938766");
        AppsFlyer.trackAppLaunch();
                #elif UNITY_ANDROID
        /* Mandatory - set your Android package name */
        AppsFlyer.setAppID("com.fy.ProductName");
        /* For getting the conversion data in Android, you need to add the "AppsFlyerTrackerCallbacks" listener.*/
        AppsFlyer.init("JS4D7K6orQauKANLStD2nb", "AppsFlyerTrackerCallbacks");
                #endif

        enterGameTimeStamp = getTimeStampUnix();
    }
Beispiel #10
0
 void resetData() {
     gameInfo temp = new gameInfo();
     IOHelper.setData(filename, temp);
 }