How ahcej/simple-game works
This is a small browser-based multiplayer RPG: players use a canvas client, connect over WebSockets, and receive world and personal state while sending movement, action, and chat input. The server session translates those messages into calls on a shared, tick-driven world that maintains players, mobs, NPCs, quests, and chat. The excerpts establish server-side wiring and game-state responsibilities; the client’s complete connection and message flow is not shown, so those links are left unverified.
Main entry points: Program.cs WebSocket route · World.cs World simulation · Session.cs Player session · mmo.js Canvas client
Components 7
Browser client
- Canvas client
Games/wwwroot/mmo.js
WebSocket server
- WebSocket route
Games/Program.cs - Player session
Games/Game/Session.cs
Game runtime
- World simulation
Games/Game/World.cs - Game entities
Games/Game/Entities.cs
Game contracts
- Message contracts
Games/Game/Protocol.cs
Other components
- Player
Connections 8
- Player → Canvas client: plays through
Games/wwwroot/mmo.js - Canvas client → WebSocket route: exchanges messages
- WebSocket route → World simulation: adds player
Games/Program.cs - WebSocket route → Player session: runs session
Games/Program.cs - WebSocket route → World simulation: starts and stops
Games/Program.cs - Player session → World simulation: reads and updates
Games/Game/Session.cs - Player session → Message contracts: serializes messages
Games/Game/Session.cs - World simulation → Game entities: uses game state
Games/Game/World.cs