How do I use Firebase to Save ingame data like coins?

Get help using Construct 2

Post » Fri Jul 15, 2016 8:55 am

Hi!

I'm using @rexrainbow 's firebase plugins. But I only can save data global in the database. But I want to save them individually for each player (combined with Auth Login)

For Example

Database
USER1
- COINS: 235; INVENTORY: JSON
USER2
- COINS: 265135; INVENTORY: JSON

is there any example file?

thanks :)
Image Image iTunes: Match3 | Google Play: Match3
B
102
S
37
G
31
Posts: 1,162
Reputation: 28,879

Post » Fri Jul 15, 2016 9:01 am

Use rex_firebase_savedata if you want to save private data for each user.
Or rex_firebase_itembook for more complex data structure.
B
109
S
27
G
277
Posts: 4,481
Reputation: 154,922

Post » Fri Jul 15, 2016 9:05 am

Or you could put all data of a user into a JSON structure, then save it by rex_firebase plugin.
B
109
S
27
G
277
Posts: 4,481
Reputation: 154,922

Post » Fri Jul 15, 2016 9:44 am

rexrainbow wrote:Or you could put all data of a user into a JSON structure, then save it by rex_firebase plugin.


Hi,

Thanks for the hints ;)

I'm using the Firebase plugin, Authentifaction plugin, Query Plugin and the Firebase API 3 plugin. I try to access the Database after the login was successfully.

Code: Select all
{
  "rules": {
    "users": {
      "$user_id": {
        // grants write access to the owner of this user account
        // whose uid must exactly match the key ($user_id)
        ".write": "$user_id === auth.uid",
        ".read": "auth != null && auth.uid == $user_id"
      }
    }
  }
}

This are my rules, but with this rules the access will be denied.
https://firebase.google.com/docs/databa ... r-security

Any idea why this happens?

Thank you!
Image Image iTunes: Match3 | Google Play: Match3
B
102
S
37
G
31
Posts: 1,162
Reputation: 28,879

Post » Fri Jul 15, 2016 9:50 am

Nevermind, got it working ;)
Image Image iTunes: Match3 | Google Play: Match3
B
102
S
37
G
31
Posts: 1,162
Reputation: 28,879


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests