How otland/forgottenserver works
The Forgotten Server is a C++ MMORPG server emulator; OTClient is the documented client. The principal workflow is client connection and protocol handling, followed by server-side game and world activity, with persistence for account and world state. Lua-driven gameplay systems provide configurable actions and events. An optional HTTP interface handles login and cache-info requests. The sampled sources confirm service dispatch, HTTP routing, script-system loading, and database-management behavior; wiring between several unsampled gameplay and persistence modules is therefore shown only where supported by their clear runtime roles.
Main entry points: scriptmanager.cpp Script systems · router.cpp HTTP router · server.cpp Service ports · database.cpp Database
Components 21
Network access
- Service ports
src/server.cpp - Game protocol
src/protocolgame.cpp
Game runtime
- Game engine
src/game.cpp - Map and tiles
src/map.cpp - Player and creatures
src/player.cpp - Movement
src/movement.cpp - Combat and spells
src/combat.cpp - Items and actions
src/item.cpp
Gameplay systems
- Chat and commands
src/chat.cpp - Script systems
src/scriptmanager.cpp - Gameplay events
src/events.cpp - Lua runtime
src/luascript.cpp
Configuration and persistence
- Server configuration
src/configmanager.cpp - Login data
src/iologindata.cpp - Database
src/database.cpp - Database manager
src/databasemanager.cpp
HTTP interface
- HTTP sessions
src/http/session.cpp - HTTP router
src/http/router.cpp - HTTP login
src/http/login.cpp - Cache info
src/http/cacheinfo.cpp
Other components
- OTClient
Connections 10
- OTClient → Service ports: connects
- Service ports → Game protocol: creates protocol
- Script systems → Lua runtime: loads scripts
- Script systems → Chat and commands: loads systems
- Script systems → Gameplay events: loads systems
- Database manager → Database: queries and updates
- Login data → Database: persists login data
- HTTP sessions → HTTP router: dispatches request
- HTTP router → HTTP login: routes login
- HTTP router → Cache info: routes cache info