Re: [persistence.js] Using persistence.js with Socket.io / any other node websocket library?

181 views
Skip to first unread message

Zef Hemel

unread,
Nov 29, 2012, 5:44:52 AM11/29/12
to persis...@googlegroups.com
It does not currently support that, but it should be easy to adapt to support it. The way it works by default is via POSTing and GETing JSON data using the persistence.sync.getJSON and persistence.sync.postJSON functions. If you replace those calls with socket.io stuff, that should workd: https://github.com/zefhemel/persistencejs/blob/master/lib/persistence.sync.js

-- Zef


On Wed, Nov 28, 2012 at 9:02 PM, Joe Ryan <tallge...@gmail.com> wrote:
Hello,

I'm using persistence.js to develop multiplayer browser game framework on node (a hobby project of mine). I'm quite happy with the way persistence works so far. However, I've been thinking about trying to improve performance by using websockets (probably via Socket.io) to do data synchronization instead of POST requests, as the database may need to be re-synced as frequent as every game turn. Is this currently possible with persistence? If not, could anyone give me some pointers as to what I'd need to do to write a plugin for that myself?

Thanks,
Joe

Reply all
Reply to author
Forward
0 new messages