shoehive
Version:
WebSocket-based multiplayer game framework for real-time, event-driven gameplay
74 lines (49 loc) โข 3.68 kB
Markdown
Shoehive is an **extensible, WebSocket-based multiplayer game framework** designed with the goal of providing a simple and easy to understand framework for building multiplayer card games. It boasts a modular design that allows you to extend the game server with a number of different game types.
Shoehive is built with TypeScript and is designed to be used with Node.js. **It is currently in active development and is not yet ready for production use.**
[](https://github.com/jtay/shoehive/actions/workflows/test.yml) [](https://github.com/jtay/shoehive/actions/workflows/versioning.yml) [](https://github.com/jtay/shoehive/actions/workflows/docs-deploy.yml)
โ
**Powered by WebSockets** โ Real-time, low-latency communication.
โ
**Modular Backend Connectivity** โ Implement your own authentication system and register any kind of backend transport protocol.
โ
**Extensible Game Modules** โ Build games like blackjack, baccarat and poker while focusing on just the game logic.
โ
**Multi-Game Server** โ When creating a new game, the player can choose from the registered game modules.
โ
**Designed for Card Games** โ Natively supports card games with a flexible card deck system.
โ
**Built-In Command System** โ Register namespaced commands to send data between the client and server.
โ
**Event-Driven Architecture** โ React to events in the game server with ease using the event bus.
โ
**Free Forever** โ Licensed under the Unlicense, you are free to use it as you please. Commercial or otherwise.
```typescript
import * as http from 'http';
import { createGameServer } from 'shoehive';
import { BlackjackGameModule } from "./modules/blackjack";
// Create an HTTP server
const server = http.createServer();
// Create the game server
const gameServer = createGameServer(server);
// Register the game module
gameServer.registerGameModule(BlackjackGameModule);
// Start the server
server.listen(3000, () => {
console.log(`Shoehive server running on port 3000`);
});
```
The framework includes comprehensive test suites to ensure reliability and correctness.
```bash
npm test
npx jest tests/events/EventBus.test.ts
npm test -- --coverage
```
- `tests/core/` - Tests for core components (Player, Table, etc.)
- `tests/events/` - Tests for event handling and message routing
- `tests/transport/` - Tests for transport modules
- `tests/integration/` - Integration tests for component interactions
To add new tests, follow the existing patterns in the test directories.
## ๐ License
This project is licensed under the [The Unlicense](https://unlicense.org/). See the [LICENSE](LICENSE) file for details.