[PLUGIN] Firebase

0 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • hi its is possible to store passowrd, for example a user buy my app, then when he start the app the app give him a "licence password" for the app, the password have to be stored on a server.

    also i dont know if its possible to check if the password exist, and how to check if the app is runing on 1 computer only, i ned to make an app who can be used in one computer by one user only (like almost every steam game)

    thanks

  • sorry to miss this. I am busy developing the server side technology extensively to build anti-cheating transactions (here)

    I think your question is answered here

    and kinda here

    I think you need to work out a client solution of generating a key for the device and putting that in the user credentials. But that will be up to the technology platform you serve the game from to work out. Firebase will be no help at all, as it does not even collect meta-data like IP.

    Tom

  • Hi I am getting an error trying to login with Facebook:

    You know what is causing this?

    Thank you!

    Edit: Nevermind I got it, had to change to my Firebase URL

    And how do I get the access token of the Facebook user using Firebase? And what if the access token changes during runtime? Could I get the new one?

    I like the firebase plugin, but it kinda is a blow to have to pay for the service if you go over certain limits, and certain amount of people logged in... :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So in the wrapper, I have not exposed the auth token of the facebook user, but its in there. There is a login object that has all the details like id, as well as the authentication specific stuff. You would have to add a function to the plugin to retrieve the facebook auth token.

    I am not an expert on how Facebook works. The link above seems to suggest this token has some limitations but I don't understand what those are.

    I love Firebase, its considerably faster than any self hosted solution, and does clever client side caching. You only have to pay once your app becomes popular, so I think its a really good deal that you get to play with it first. I have developed with Google App Engine too and it is SLOW!!! (and also you have to pay once usage increases). So if you know of any other solution I would love to hear.

  • I got asked about how you maintain live data connections to many opponents at the same time. What is the looping stratergy to iterate over multiple records and setup everything in construct 2? Here is the best solution I came up with:

    place each JSON player record as a child of "/users/" in your Firebase e.g.

    /users/fred/

    /users/john/

    Create a container object in construct two that associates all the separate graphical elements together (like the label that displays the name). Mine is ui_card, and ui_name, ui_status etc. This example was for a lobby, hence the construct 2 GUI elements were fairly boring sounding objects.

    We will use RexRainbow's HashTable (https://www.scirra.com/forum/viewtopic.php?t=65765&start=0) to parse JSON objects coming back from Firebase.

    Now to keep all players game objects synced we maintain a list of player data by:

    1. register a *child_added* callback to Firebase ref("/users"). This will get called every time a new record is available (including for initialization)

    2. create the child_added callback.

    2a Create the construct 2 container and register its UID into a player_list dictionary (handy for name lookups later).

    2b register a *value* callback on the specific player's record

    3. create the callback for when the value of a specific player's record changes. When a networked player's data changes you can load the new data into your graphical representation so it affects the game world immediately.

  • Hey tlarkworthy, I started with your firebase plugin and I figured out that there is not a function to register a user with new email and password. It is possible to add it ?

  • May I ask why this plugin could not run at cocoonJS?

  • Hi, sorry about delay. I don't have a windows computer anymore

    armaldio

    One of the motivations of me putting everything on github is that someone can add missing features fairly easily via a pull request. I don't have a developer setup at the moment to add the feature myself, sorry.

    rexrainbow

    Dunno. I don't know what cocoonJS does under the hood. Maybe its a websocket issue, although Firebase should fall back to long polling if that were the case. You can "Firebase.enableLogging(true);" in JS which might explain what the issue is.

  • tlarkworthy

    armaldio

    I start to develop my firebase plugin here. The authentication is at here.

    I still try to add more plugins to help users easy to use firebase by encapsulating more logic into plugin. For example, here is a plugin to save game status (or said webstorage-like structure) on (firebase) cloud.

    My team member only had tested them worked in phonegap (excluded authentication). CocoonJs was failed too.

    Edit:

    I had released some of my firebase plugins at this thread.

  • FIrebase is pretty cool, sure I agree, but why isn't anyone mentioning how incredibly expensive the non-"Hacker" Firebase plans are for most of us normal game coders?

  • locohost

    Hire programmers and own a server all need money, too.

  • locohost

    Hire programmers and own a server all need money, too.

    Change your handle to mo-money-rainbow!

    No seriously, Firebase is really cool, I said that, however it's just not worth the excessive fees. It's overpriced. You can setup/host your very own full VPS with your very own full MongoDb or CouchDb on a public hosting service for less per month than the just the entry level "Candle" Firebase plan. This all assuming you need more than the "Hacker" plan of course.

    Speaking of MongoDb, has anyone wrote a MongoDb C2 plugin? I'll do a search. Maybe that's my next mini project

  • locohost - +1 to mongodb! There are a number of providers like MongoHQ and MongoLabs that provide free use for up to 512MB db capacities if you don't want to deploy your own MongoDB server. Then it's $15 - $20 a month per GB complete with the Oplog capabilities (real-time, redundant MongoDB). And not only that, if you connect your data to Mongodb, you can easily use something like Meteor.js to create something to manage your game's backend data if not for something else like a scoreboard, user account management, and such!

  • A self hosted Mongo is not really the same as Firebase, even with Meteor attached.

    Firebase has:

    • inbuilt lag compensation so local writes look fresh.
    • concurrency synchronization so that writes at the same time get sorted out properly, without db corruption.
    • offline support so the app keeps working even when you are playing in a tunnel
    • a rich rule language so you can enforce your game constraints.
    • authentication with 3rd party providers like Facebook
    • static secure *SSL* file hosting
    • support for native and server platforms as well as web
    • fallback from websockets in case the device is old or the firewall is fussy
    • backups
    • support
    • + a team of people keeping the service running 24/7 and keeping the system up-to date

    You can use the SSL and auth for free. The real time database is free for under 50 simultaneous users. That's a lot of users per month as people are not usually online at the same time. If you value your time, you will realize you would spend many, many full time months of labour developing a similar feature set. And it would still take yet more time (in production) to tune it and patch it, to make it reliable for all the internet's random configurations. And all these things are not important, *its the game that is important*, the networking and storage is a distraction, an unwanted time sink.

  • tlarkworthy MongoHQ and MongoLabs are both services, not self hosted. So most of your points are not relevant.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)