Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis driver support #412

Closed
wants to merge 3 commits into from
Closed

Redis driver support #412

wants to merge 3 commits into from

Conversation

vitalyrotari
Copy link

Hello comrades,

Here is Redis driver implementation for roomcaches, the main reason was to support a big number of CCU in our project. MongoDB and MySql are not so good for this, so we decide to create this driver.

We are glad to share it with the Colyseus community because you make a great job :)

How to use:

import { Server, RedisPresence } from "colyseus";
import { RedisDriver } from "colyseus/lib/matchmaker/drivers/RedisDriver"

const redisConfig = {
  url: process.env.REDIS_URL || 'redis://127.0.0.1:6379/0',
  prefix: process.env.REDIS_PREFIX || 'colyseus:',
};

const gameServer = new Server({
  // ...
  presence: new RedisPresence(redisConfig),
  driver: new RedisDriver(redisConfig),
});

endel added a commit that referenced this pull request Jun 29, 2021
endel added a commit that referenced this pull request Jul 7, 2021
endel added a commit that referenced this pull request Jul 12, 2021
* wip experimenting with uWebSockets.js

* uws: fix parsing incoming messages

* uws: fix getAvailableRooms request

* breaking up colyseus into smaller packages. kickstarting lerna/monorepo structure.

* WIP extracting transports and drivers from @colyseus/core

* rename drivers -> driver

* fixes generating .d.ts files final builds

* extract fossil-delta serializer into its own package

* wip: test suite

* remove transport-related options from ServerOptions

* remove pingInterval/pingMaxRetries from uWebSockets transport.

* move tests to 'colyseus' bundle. fix ws-transport build.

* remove unused dependencies from @colyseus/core module

* extract RedisPresence into @colyseus/redis-presence

* improve TransportOptions for uWebSocketsTransport

* make 'server' optional for Transport implementations

* uWebSockets.js: use onAbort() during GET /matchmake

* uWebSockets.js: prevent dropping 2 connections during _forciblyCloseClient

* rename uws-transport to uwebsockets-transport

* add @colyseus/arena package as part of the monorepo

* remove unused code

* @colyseus/arena: now exposes a getTransport() method

* @colyseus/arena: support async/await on initialize callbacks

* @colyseus/arena: update example

* add redis driver support

* matchmaking driver: rename quit() to shutdown() #412

* soft deprecate transport options

* use version 0.14.17

* update current package version

* remove package-lock from core

* remove unused files. copy README and LICENSE files to package folders.

* update README. preparing for prerelease

* v0.14.17-alpha.1

* update version

* preparing for publish

* preparing for publish

* configure all scoped packages as access=public

* bump alpha version

* update 'publish-alpha' script

* fix bundle published files

* skip copying README + LICENSE for submodules

* push version change when bumping version

* bump alpha version

* fixes publishing @colyseus/arena files

* set lerna version as 'independent'

* Publish

 - colyseus@0.14.17-alpha.5
 - @colyseus/arena@0.14.17-alpha.5
 - @colyseus/core@0.14.17-alpha.5
 - @colyseus/example@0.14.17-alpha.5
 - @colyseus/mikro-orm-driver@0.14.17-alpha.5
 - @colyseus/mongoose-driver@0.14.17-alpha.5
 - @colyseus/redis-driver@0.14.17-alpha.5
 - @colyseus/redis-presence@0.14.17-alpha.5
 - @colyseus/fossil-delta-serializer@0.14.17-alpha.5
 - @colyseus/tcp-transport@0.14.17-alpha.5
 - @colyseus/uwebsockets-transport@0.14.17-alpha.5
 - @colyseus/ws-transport@0.14.17-alpha.5

* fix: @colyseus/arena warning when uwebsockets-express could not be enabled

* fix: @colyseus/arena app name icon

* fix: @colyseus/uwebsockets-transport remove express compatibility package by default

* add @colyseus/monitor to the monorepo. update CONTRIBUTING file

* fix: @colyseus/ws-transport fix 'server' option

* fix: @colyseus/uwebsockets-transport support closing websocket with custom code

* rename driver folder names

* avoid deprecated assert APIs on tests

* add MatchMakerDriver#clear() for testing purposes

* add test scenario specifically for LocalDriver/RedisDriver/MongooseDriver

* wip: testing RedisDriver #412

* make sure driver is cleared after each test. RedisDriver tests passing. #412

* test local + redis by default

* client.send() afterNextPatch tests passing. closes #416 #330

* uWebSocketTransport: avoid error when connection is closed. fixes afterNextPatch #330

* test for custom leave/close code

* @colyseus/uwebsockets-transport: support for .readyState

* @colyseus/uwebsockets-transport: minimal compatibility to retrieving IP address as documentation suggests

* uWebSockets.js: fix simulating latency

* bump version

* @colyseus/monitor: fixes build path

* bump alpha version

* bump alpha version

* @colyseus/monitor: ensure to remove trailing slash from frontend api requests

* bump version

* bump alpha version

* bump version

* bump 0.14.18

Co-authored-by: CKY <cky@admins-iMac-2.local>
@endel endel closed this Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants