Page 1 of 1

Pusher API - Real Time with LOVE!

Posted: Sun Oct 12, 2014 6:21 pm
by krankzinnig
Hello, I am working on something that informs my web server of connections to my love project. Since my web application already utilizes Pusher's javascript client API, I figured it would be a breeze to use. Although, the only existing Lua binding for Pusher depends on CoronaSDK. This obviously didn't suit my needs when using LOVE, so hence luapusher. MIT licensed, feel free to use without credit. Any comments/criticism is welcome, thanks.
Pusher is a simple hosted API for quickly, easily and securely adding realtime bi-directional functionality via WebSockets to web and mobile apps, or any other Internet connected device.
Supported:
POST event (trigger an event)
GET channels (fetch info for multiple channels) w/ filter_by_prefix and attributes
GET channel (fetch info for one channel) w/ attributes
GET users

TODO:
optional socket_id for POST event
support for POST event on multiple channels at once

Usage Ideas:
1. Push leader board scores to a web application in real time
2. Track connections and online users and push to a web application in real time
3. Track player achievements and push to a web application in real time
4. Create a web based game server in javascript and communicate over pusher in real time
5. Accept in app payments over web based payment gateway
6. Create an analytics panel tracking average game play duration and conversion goals in real time

https://pusher.com
https://github.com/hookglobal/luapusher

Re: Pusher API - Real Time with LOVE!

Posted: Mon Oct 13, 2014 8:57 pm
by SiENcE
It's a nice idea. I prefer to use my own webserver, but a good solution for gamejam games.

Do you have a working example? A highscore :) ?

Re: Pusher API - Real Time with LOVE!

Posted: Tue Oct 14, 2014 3:13 am
by krankzinnig
Pusher doesn't really replace your web server, it just simply acts as a communication layer between your Lua app and a web server. The key difference is that it uses sockets to communicate in realtime (think of a leaderboard or game map that updates with player data without refreshing). I will do a leaderboard example if I get time later this week. I have some travel over the next few days for work.

Also this got added to the pusher.com library download page under community libraries. :)