コード例 #1
0
    public static void LogStartOfGame()
    {
        if (!GameManagerScript.logging)
        {
            return;
        }

        //Debug.Log("Logging beginning of game");

        // Log beginning of game
        MetaLogEntry entry = new MetaLogEntry();

        entry.SetValues("BNW_GameStart", "BNW_Meta", new MetaLogEntry.MetaPayload("start"));
        Log(entry);

        //Debug.Log("logging game info");

        // insert new game entry into database
        var reference           = FirebaseDatabase.DefaultInstance.GetReference(GameManagerScript.LOGGING_VERSION + "_games");
        DatabaseReference child = reference.Child(GameManagerScript.gameId);

        // Log the game details and type of game
        child.Child("obstructionProductive").SetValueAsync(GameManagerScript.obstructionProductive);
        child.Child("obstructionUnproductive").SetValueAsync(GameManagerScript.obstructionUnproductive);
        child.Child("juiceProductive").SetValueAsync(GameManagerScript.juiceProductive);
        child.Child("juiceUnproductive").SetValueAsync(GameManagerScript.juiceUnproductive);
        child.Child("username").SetValueAsync(GameManagerScript.username);
        child.Child("gameID").SetValueAsync(GameManagerScript.gameId);
        child.Child("userID").SetValueAsync(GameManagerScript.userId);
        child.Child("loggingVersion").SetValueAsync(GameManagerScript.LOGGING_VERSION);
        child.Child("appVersion").SetValueAsync(GameManagerScript.APP_VERSION);
        child.Child("gameNumber").SetValueAsync(GameManagerScript.gameNumber);
    }
コード例 #2
0
    public static void LogGameUnpause()
    {
        if (!GameManagerScript.logging)
        {
            return;
        }

        // log the unpause
        MetaLogEntry metaEntry = new MetaLogEntry();

        metaEntry.SetValues("BNW_GameUnpaused", "BNW_Meta", new MetaLogEntry.MetaPayload("unpause"));
        Log(metaEntry);
    }
コード例 #3
0
    /**
     * User or the OS force quits the application
     */
    public static void LogGamePause()
    {
        if (!GameManagerScript.logging)
        {
            return;
        }
        //Debug.Log("Application pausing after " + Time.time + " seconds");

        // log the game state before game pauses
        LogKeyFrame("gamePause");

        // log the pause
        MetaLogEntry metaEntry = new MetaLogEntry();

        metaEntry.SetValues("BNW_GamePaused", "BNW_Meta", new MetaLogEntry.MetaPayload("pause"));
        Log(metaEntry);
    }
コード例 #4
0
    public static void LogEndOfGame()
    {
        if (!GameManagerScript.logging)
        {
            return;
        }

        //Debug.Log("Logging end of game");

        // log the end game state when the player finished the round
        LogKeyFrame("gameEnd");

        // log the end of the game
        MetaLogEntry metaEntry = new MetaLogEntry();

        metaEntry.SetValues("BNW_GameEnd", "BNW_Meta", new MetaLogEntry.MetaPayload("end"));
        Log(metaEntry);
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        // Turn off the instructions panel in the next scene
        GameManagerScript.displayInstructions = false;

        _menu = gameObject.GetComponent <ConsentMenuScript>();

        // Log the start of the Tutorial
        MetaLogEntry entry = new MetaLogEntry();

        entry.SetValues("BNW_TutorialOpened", "BNW_Meta", new MetaLogEntry.MetaPayload("tutorial"));
        string            json      = JsonUtility.ToJson(entry);
        DatabaseReference reference = FirebaseDatabase.DefaultInstance.GetReference(GameManagerScript.LOGGING_VERSION);

        reference.Push().SetRawJsonValueAsync(json);

        //Debug.Log("logging tutorial");
    }