Gamooga module for node.js
Node.js module for Gamooga services.
I recomend realtime.co instead.
Pricing at (18/02/2013)
When you expect A LOT of people on your app better use Gamooga. It's cheaper than all others services available.
$ npm install gamooga-node --save
--save automatically writes to your
package.json file, tell your friends)
Change the keys and run
gc = ;gcconnectToRoom"<YOUR ID>" "<YOUR UUID>";gconconnectconsole.log"connected."setIntervalgcsend"chat""Hi from your SERVER!"2500gconmessage"chat"console.logmsg
Your HTML speaks too:
Using this default Chat Gamlet: ./example/gamlet.zip
On every broadcast you made you have to POST your credentials to gamooga server, get your authentication code, to open a websocket and wait until YOU close it.
This is not a good strategy to scale your server. When you get thousands of simultaneous connections you gonna start to face some difficulties.
Happily Gamooga did solve this problem for us. You could use the sendtosession technique:
On your room.lua gamlet:
gamooga.onmessage("send_to_session_MAKEAHASHKEYHERE", function(conn_id, data)gamooga.sendtosession(tonumber(data["sess_id"]),"server_broadcasting", data["data"])end)
On your session.lua gamlet:
At your server.js:
gc = ;gcconnectToRoom"<YOUR ID>" "<YOUR UUID>";gcondisconnectgcreconnect;;gcsend'send_to_session_MAKEAHASHKEYHERE'"sess_id":session"data":data
Now you can hold one of your connections opened to broadcast for any of your sessions. Using:
At your client you can now listen to:
gconmessage'server_broadcast'//server is broadcasting...console.logdata;
Gamooga uses Integers as channels. But you can emulate the channel behaviour using key-values. At ./example/channels.js you can find a working sample.
At ./example/gamlet/room.lua you can find the necessary codes to make this work on your own gamlet.
State-of-art realtime backend for your apps/games that guarantees under 1ms response time. None of our competitiors can beat us here! Go.
The most important target for Gamooga's engineering. We strive day in and out to achieve that 99.9% consistently month on month. So you don't have to.
Gamooga's horizontally scalable platform is a perfect partner that can augment your marketing efforts to sustain that huge user spike or the gradual user growth.
Developing for multiple platforms to target maximum user base? Great, that's our goal too. We currently support HTML/JS, Flash, iOS, Android, Unity3D and Marmalade.
Gamooga is not just a message broadcaster, its a message processor too. You can upload your own message processing scripts onto our cluster and fully customize our realtime backend as per your needs.
Ever experienced those deployment nightmares? We have. So we made it super easy. Your server side scripts are deployed with just one click into an infrastructure thats highly optimized for realtime message processing.
- Implement connect using SDK!
- More Tests!
- Better, safer syntax.
To run the test suite first invoke the following command within the repo, installing the development dependencies:
$ npm install -d
Change the keys on
then run the tests:
$ npm test
This library is a fork from Gamooga.js, and the partial function remains relatively untouched from there. Gamooga is still updating his library and We will try to maintain this one up-to-date.
The port syntax comes from Tcha-Tcho
(The MIT License)
Copyright (c) 2013 Gamooga <https://github.com/gamooga>
Copyright (c) 2013 Tcha-Tcho <email@example.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.