How sspeev/beloteengine works
BeloteEngine is a real-time multiplayer Belote game. Players join or create lobbies through HTTP or the SignalR hub; the hub routes gameplay actions to lobby and game services, which manage bidding, card play, validation, trick resolution and scoring over domain state. The README documents broadcasts and the major game phases; the source index supports service and model dependencies. Some listed subsystems were not excerpted, so their internal links are omitted where evidence is unavailable.
Main entry points: Game.cs Game State · BeloteHub.cs Belote Hub · GameService.cs Game Service · LobbyService.cs Lobby Service
Components 29
API and Sessions
- Lobby Endpoints
src/BeloteEngine.Api/Controllers/LobbyController.cs - Session Endpoints
src/BeloteEngine.Api/Controllers/SessionController.cs - Session Service
src/BeloteEngine.Api/Services/SessionService.cs - Session Contract
src/BeloteEngine.Api/Contracts/ISessionService.cs
Realtime Play
- Belote Hub
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Client Callbacks
src/BeloteEngine.Api/Hubs/IBeloteClient.cs - AFK Timer
src/BeloteEngine.Api/Services/AfkTimerService.cs
Lobby and Game Services
- Lobby Service
src/BeloteEngine.Services/Services/LobbyService.cs - Game Service
src/BeloteEngine.Services/Services/GameService.cs - Lobby Contract
src/BeloteEngine.Services/Contracts/ILobbyService.cs - Game Contract
src/BeloteEngine.Services/Contracts/IGameService.cs - In-memory Cache
src/BeloteEngine.Services/Services/CacheService.cs - Connection Limiter
src/BeloteEngine.Services/Services/ConnectionLimiter.cs
Game Rules
- Input Validator
src/BeloteEngine.Services/Security/InputValidator.cs - Play Validator
src/BeloteEngine.Services/Rules/PlayValidator.cs - Trick Evaluator
src/BeloteEngine.Services/Rules/TrickEvaluator.cs - Score Calculator
src/BeloteEngine.Services/Rules/ScoreCalculator.cs
Game Domain
- Lobby State
src/BeloteEngine.Data/Entities/Models/Lobby.cs - Game State
src/BeloteEngine.Data/Entities/Models/Game.cs - Player State
src/BeloteEngine.Data/Entities/Models/Player.cs - Round State
src/BeloteEngine.Data/Entities/Models/Round.cs - Trick State
src/BeloteEngine.Data/Entities/Models/Trick.cs - Card Deck
src/BeloteEngine.Data/Entities/Models/Deck.cs - Card
src/BeloteEngine.Data/Entities/Models/Card.cs - Team
src/BeloteEngine.Data/Entities/Models/Team.cs - Played Card
src/BeloteEngine.Data/Entities/Models/PlayedCard.cs - Announce Types
src/BeloteEngine.Data/Entities/Enums/Announces.cs - Suit Types
src/BeloteEngine.Data/Entities/Enums/Suit.cs
Other components
- Browser Player
Connections 31
- Browser Player → Lobby Endpoints: requests lobby
- Browser Player → Session Endpoints: manages session
src/BeloteEngine.Api/Controllers/SessionController.cs - Session Endpoints → Session Service: uses session
src/BeloteEngine.Api/Controllers/SessionController.cs - Session Service → Session Contract: implements
src/BeloteEngine.Api/Services/SessionService.cs - Session Endpoints → Input Validator: validates input
src/BeloteEngine.Api/Controllers/SessionController.cs - Browser Player → Belote Hub: plays in realtime
- Lobby Endpoints → Lobby Service: manages lobby
src/BeloteEngine.Api/Controllers/LobbyController.cs - Belote Hub → Lobby Service: routes lobby actions
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Belote Hub → Game Service: routes game actions
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Belote Hub → Connection Limiter: checks connections
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Belote Hub → AFK Timer: uses AFK timer
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Belote Hub → Session Service: checks sessions
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Belote Hub → Client Callbacks: broadcasts updates
src/BeloteEngine.Api/Hubs/BeloteHub.cs - Lobby Service → Game Service: starts games
src/BeloteEngine.Services/Services/LobbyService.cs - Lobby Service → Input Validator: sanitizes names
src/BeloteEngine.Services/Services/LobbyService.cs - Game Service → Play Validator: validates plays
src/BeloteEngine.Services/Services/GameService.cs - Game Service → Trick Evaluator: evaluates tricks
src/BeloteEngine.Services/Services/GameService.cs - Game Service → Score Calculator: calculates scores
src/BeloteEngine.Services/Services/GameService.cs - Lobby Service → Lobby State: updates state
src/BeloteEngine.Services/Services/LobbyService.cs - Game Service → Game State: updates state
src/BeloteEngine.Services/Services/GameService.cs - Lobby State → Player State: contains players
src/BeloteEngine.Data/Entities/Models/Lobby.cs - Lobby State → Game State: holds game
src/BeloteEngine.Data/Entities/Models/Lobby.cs - Game State → Player State: tracks players
src/BeloteEngine.Data/Entities/Models/Game.cs - Game State → Card Deck: holds deck
src/BeloteEngine.Data/Entities/Models/Game.cs - Game State → Round State: tracks round
src/BeloteEngine.Data/Entities/Models/Game.cs - Game State → Trick State: tracks trick
src/BeloteEngine.Data/Entities/Models/Game.cs - Game State → Team: tracks teams
src/BeloteEngine.Data/Entities/Models/Game.cs - Card Deck → Card: creates cards
src/BeloteEngine.Data/Entities/Models/Deck.cs - Card → Suit Types: uses suit
src/BeloteEngine.Data/Entities/Models/Card.cs - Game State → Announce Types: uses bids
src/BeloteEngine.Data/Entities/Models/Game.cs - Game State → Suit Types: uses suits
src/BeloteEngine.Data/Entities/Models/Game.cs