<commit_before># Cross Platform Leaderboard using Firebase Database

_Copyright (c) 2018 Google Inc. All rights reserved._

This solution makes it easy to incorporate a cross-platform leaderboard into your Unity&reg;
projects. You can follow the steps here to add a LeaderboardController to your own project, or take
a look at the [Demo Scene][demo-scene] to see one in action right away!

[demo-scene]: /Firebase_Leaderboard/Demo/DemoScene.unity

# Contents

1. [Requirements](#requirements)
1. [Setup](#setup)
   1. [Optional: Setup editor restricted access](#optional--setup-editor-restricted-access)
1. [Usage](#usage)
   1. [Setting up the LeaderboardController](#setting-up-the-leaderboardcontroller)
   1. [Using LeaderboardController EventHandlers](#using-leaderboardcontroller-eventhandlers)
   1. [Retrieving scores](#retrieving-scores)
   1. [Adding a new user score](#adding-a-new-user-score)
1. [What's Next](#whats-next)
   1. [Security and Authorization](#security-and-authorization)
   1. [Data Validation](#data-validation)

# Requirements

* A Unity&reg; project with at least full .NET 2.0 Api level enabled. To enable .NET 2.0, go to
  Edit -> Project Settings -> Player -> Other Settings and change `Api Compatibility Level` to
  `.NET 2.0.
* A Firebase project. You can create a new Firebase project using the
  [firebase console][firebase-console].

[firebase-console]: https://console.firebase.google.com/

# Setup

* Follow the [Setup steps][firebase-setup] for using Firebase Database with Unity&reg;.
* Set up [public access][public-access] to your database. Note that this leaves your database open
  to the public, so you will want to configure rules before releasing your game.

## Optional: Setup editor restricted access

If you choose to use rules that disallow public access, you will need to [configure the SDK to use
  a service account][restricted-access] to run in the Unity&reg; Editor.
* Copy the rule text found in [firebase-db-rules.txt][firebase-db-rules].
* Go to the [firebase console][firebase-console], select your project, choose `Database` and click
  on the `Rules` tab. Paste the contents of `firebase-db-rules.txt`.

[firebase-setup]: https://firebase.google.com/docs/database/unity/start?authuser=0#setup
[public-access]: https://firebase.google.com/docs/database/unity/start?authuser=0#setting_up_public_access
[restricted-access]: https://firebase.google.com/docs/database/unity/start?authuser=0#optional_editor_setup_for_restricted_access
[firebase-db-rules]: /Firebase_Leaderboard/firebase-db-rules.txt
<commit_msg>Add mechahamster details to README.md<commit_after># Cross Platform Leaderboard using Firebase Database

_Copyright (c) 2018 Google Inc. All rights reserved._

This solution makes it easy to incorporate a cross-platform leaderboard into your Unity&reg;
projects. You can follow the steps here to add a LeaderboardController to your own project, or take
a look at the [Demo Scene][demo-scene] to see one in action right away!

[demo-scene]: /Firebase_Leaderboard/Demo/DemoScene.unity

# Contents

1. [Requirements](#requirements)
1. [Setup](#setup)
   1. [Optional: Setup editor restricted access](#optional--setup-editor-restricted-access)
1. [Overview of Scripts](#Overview of Scripts)
1. [Usage](#usage)
   1. [Setting up the LeaderboardController](#setting-up-the-leaderboardcontroller)
   1. [Using LeaderboardController EventHandlers](#using-leaderboardcontroller-eventhandlers)
   1. [Retrieving scores](#retrieving-scores)
   1. [Adding a new user score](#adding-a-new-user-score)
1. [What's Next](#whats-next)
   1. [Security and Authorization](#security-and-authorization)
   1. [Data Validation](#data-validation)

# Requirements

* A Unity&reg; project with at least full .NET 2.0 Api level enabled. To enable .NET 2.0, go to
  Edit -> Project Settings -> Player -> Other Settings and change `Api Compatibility Level` to
  `.NET 2.0.
* A Firebase project. You can create a new Firebase project using the
  [firebase console][firebase-console].

[firebase-console]: https://console.firebase.google.com/

# Setup

* Follow the [Setup steps][firebase-setup] for using Firebase Database with Unity&reg;.
* Set up [public access][public-access] to your database. Note that this leaves your database open
  to the public, so you will want to configure rules before releasing your game.

## Optional: Setup editor restricted access

If you choose to use rules that disallow public access, you will need to [configure the SDK to use
  a service account][restricted-access] to run in the Unity&reg; Editor.
* Copy the rule text found in [firebase-db-rules.txt][firebase-db-rules].
* Go to the [firebase console][firebase-console], select your project, choose `Database` and click
  on the `Rules` tab. Paste the contents of `firebase-db-rules.txt`.

[firebase-setup]: https://firebase.google.com/docs/database/unity/start?authuser=0#setup
[public-access]: https://firebase.google.com/docs/database/unity/start?authuser=0#setting_up_public_access
[restricted-access]: https://firebase.google.com/docs/database/unity/start?authuser=0#optional_editor_setup_for_restricted_access
[firebase-db-rules]: /Firebase_Leaderboard/firebase-db-rules.txt

# Overview of Scripts
To understand how you might customize these scripts for use in your project, start by exploring each script implemented in the Firebase_Leaderboard>Scripts directory, Firebase_Leaderboard>Demo and Mechahamster. Feel free to read through the code in Unity as you orient yourself to these scripts.
<table>
  <tr>
   <td>Script Name
   </td>
   <td>Script Purpose
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Scripts>FirebaseInitializer
   </td>
   <td>This is a centralized script for initializing FireBase in your project.
<p>
You should not need to modify this script to customize for your game.
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Scripts>LeaderboardController
   </td>
   <td>This script creates the Firebase.Leaderboard namespace, which is called by many of the other scripts. It contains the primary logic for the leaderboard and handles keeping the data from Firebase and Unity Game code synchronized by sending events to Firebase and triggering updates in the game when receiving new data.
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Scripts>TopScoreArgs
   </td>
   <td>Defines the event arguments which are sent when LeaderboardController invokes TopScoresUpdated.
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Scripts>UserScoreArgs
   </td>
   <td>Defines the event arguments which are sent when LeaderboardController invokes UserScoreUpdated.
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Scripts>UserScore
   </td>
   <td>Represents a single user score record kept in FirebaseDatabase. By default a user score contains a timestamp, score value, and the User's unique ID. You may modify this class to add fields, but if you remove or change any of the three default fields, you will need to update the logic in LeaderboardController to match.
   </td>
  </tr>
  <tr>
   <td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Editor>LeaderboardControllerEditor
   </td>
   <td>Creates the LeaderBoard interface, allowing the user to set certain variables and paths in the Unity Inspector window.
<p>
</td>
</tr>
<tr>
<td>Assets>firebase-unity-solutions>Firebase_Leaderboard>Demo>DemoUIController
</td>
<td>In the Firebase_Leaderboard DemoScene, this script controls the Demo Interface.
</td>
</tr>
If you update the LeaderBoardController script for your game, you will need to update this script with any new information.
   </td>
  </tr>
  <tr>
   <td>Assets>Hamster>Scripts>States>UploadTime
   </td>
   <td>In Mechahamster, this script creates a class called UploadTime, which manages the transfer of data to Firebase when the user selects the Submit! button at the end of a maze and logs their score.
   </td>
  </tr>
  <tr>
   <td>Assets>Hamster>Scripts>States>TopTimes
   </td>
   <td>In Mechahamster, this script creates a class called TopTime, which manages the top finish times for a level.
   </td>
  </tr>
  <tr>
   <td>Assets>Hamster>Scripts>Menus>TopTimesGUI
   </td>
   <td>In Mechahamster, this script creates an Interface class for providing code access to the GUI elements in the high score menu.
   </td>
  </tr>
  <tr>
   <td>Assets>Hamster>Scripts>States>LevelFinished
   </td>
   <td>In Mechahamster, this script creates a class called LevelFinished, which manages the logic driving the Level Finished menu page.
   </td>
  </tr>
  <tr>
   <td>Assets>Hamster>Scripts>Menus>LevelFinishedGUI
   </td>
   <td>In Mechahamster, this script creates an Interface class for providing code access to the GUI elements in the Level Finished menu.
   </td>
  </tr>
</table>


{'fraction_non_alphanumeric': 0.09758281110116383, 'fraction_numerical': 0.005483437779767233, 'mean_word_length': 4.66708941027267, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 143, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7563593', 'n_tokens_mistral': 2763, 'n_tokens_neox': 2643, 'n_words': 957}