Exemplo n.º 1
0
    private void WriteNewScore(int kamikaze_red, int kill_red, int kamikaze_blue, int kill_blue, int team_lose)
    {
        // Create new entry at /user-scores/$userid/$scoreid and at
        // /leaderboard/$scoreid simultaneously
        string    key   = mDatabase.Child("MatchInfo").Push().Key;
        MatchStat entry = new MatchStat(kamikaze_red, kill_red, kamikaze_blue, kill_blue, team_lose);
        Dictionary <string, System.Object> entryValues = entry.ToDictionary();

        Dictionary <string, System.Object> childUpdates = new Dictionary <string, System.Object>();

        childUpdates["/matchInfo/" + key] = entryValues;

        mDatabase.UpdateChildrenAsync(childUpdates);
    }