clojure-gamedev

oconn 2021-02-20T00:25:01.031200Z

Code is not open source but more than happy to look at anything you’re entertaining and can share specifics from my codebase if there is something useful to you there. to be honest, the way we’re storing data in our db is optimized to solve problems you may not run into. 100% agree with paul - your use case should drive your decision. Do you plan on querying the JSON in the db? If so it may make sense to store it as jsonb.

Fabim 2021-02-20T08:32:48.000100Z

Thanks. Not planing to query that data, just need to be able to persist it through code deploys and then load it into memory again.

Fabim 2021-02-20T14:10:27.005500Z

@oconn could you show me how you manage the web sockets and allocate a connection to a specific user/match? I’m reworking the networking code because I’m introducing authentication, login ect. Glad to have found someone who uses sockets as well ~

oconn 2021-02-20T17:31:48.005800Z

This is just the way we’re doing it - hope some of this helps; 1. There is an unauthenticated ws connection that gets upgraded upon authentication 2. On an upgrade connection event, a row is created in our DB that maintains the connection details for that user 3. When a game is created, references to all the users (who in turn have references to their current connection identifiers) are stored in the DB for that game 4. When an event occurs within that game that needs to be broadcasted to all the participants, it has access to all the connection-ids.

oconn 2021-02-20T17:34:23.006Z

When it comes to managing the connection pools, we don’t do that. We rely on a 3rd party service for that.