How bannerlord-coop-team/bannerlordcoop works
Bannerlord Coop is a Bannerlord mod that turns the single-player campaign into a shared multiplayer campaign. The principal workflow is players joining a hosted session, synchronizing campaign state, and participating together in map activities and battles. Client and server services handle the multiplayer sides; GameInterface provides the game-integration layer, while Common supplies shared messaging and networking primitives. The README documents broad campaign capabilities, but most implementation excerpts concern siege-engine synchronization, so unverified subsystem links are omitted rather than inferred.
Main entry points: INetwork.cs Network contracts · ClientSiegeEngineHandler.cs Client siege handler · CoopServer.cs Server runtime · ServerSiegeEngineHandler.cs Server siege handler
Components 20
Session and connections
- Session hosting
source/Coop.Core/Common/Session - Join and connection
source/Coop.Core/Client/Services/Session - Server connections
source/Coop.Core/Server/Connections/ConnectionLogic.cs
Shared campaign
- Client runtime
source/Coop.Core/Client/CoopClient.cs - Campaign synchronization
source/Coop.Core/Client/Services - Campaign world
- Server runtime
source/Coop.Core/Server/CoopServer.cs - Server campaign services
source/Coop.Core/Server/Services - Client siege handler
source/Coop.Core/Client/Services/SiegeEngines/Handlers/ClientSiegeEngineHandler.cs - Server siege handler
source/Coop.Core/Server/Services/SiegeEngines/Handlers/ServerSiegeEngineHandler.cs
Battles and missions
- Battle synchronization
source/Missions/Battles/SiegeEngineDeploymentReplicator.cs - Naval battles
source/Missions.Naval/NavalShipEngine.cs - Tournament spectators
source/Missions/Tournaments/Spectators/TournamentSpectatorAgentManager.cs
Game integration
- Game patches
source/GameInterface/Services/SiegeEngines/Patches/SiegeEnginesContainerPatches.cs - Object identity
source/GameInterface/Services/ObjectManager/ObjectManager.cs - Patch lifecycle
source/GameInterface/GameInterface.cs
Shared runtime
- Message broker
source/Common/Messaging/MessageBroker.cs - Network contracts
source/Common/Network/INetwork.cs - Logging
source/Common/Logging/LogManager.cs
Other components
- Players
Connections 20
- Players → Join and connection: joins
README.md - Session hosting → Server runtime: hosts
README.md - Join and connection → Client runtime: starts
- Client runtime → Campaign synchronization: synchronizes
README.md - Campaign synchronization → Campaign world: updates
README.md - Server runtime → Server connections: manages
- Server runtime → Server campaign services: coordinates
README.md - Server campaign services → Campaign world: shares
README.md - Campaign world → Battle synchronization: supports
README.md - Campaign world → Naval battles: supports
README.md - Patch lifecycle → Game patches: installs
source/GameInterface/GameInterface.cs - Game patches → Message broker: publishes
source/GameInterface/Services/SiegeEngines/Patches/SiegeEnginesContainerPatches.cs - Client siege handler → Message broker: publishes
source/Coop.Core/Client/Services/SiegeEngines/Handlers/ClientSiegeEngineHandler.cs - Client siege handler → Network contracts: sends requests
source/Coop.Core/Client/Services/SiegeEngines/Handlers/ClientSiegeEngineHandler.cs - Server siege handler → Network contracts: broadcasts updates
source/Coop.Core/Server/Services/SiegeEngines/Handlers/ServerSiegeEngineHandler.cs - Server siege handler → Object identity: resolves objects
source/Coop.Core/Server/Services/SiegeEngines/Handlers/ServerSiegeEngineHandler.cs - Battle synchronization → Network contracts: broadcasts placements
source/Missions/Battles/SiegeEngineDeploymentReplicator.cs - Tournament spectators → Network contracts: sends join info
source/Missions/Tournaments/Spectators/TournamentSpectatorAgentManager.cs - Naval battles → Object identity: uses object access
source/Missions.Naval/NavalShipEngine.cs - Client siege handler → Logging: logs
source/Coop.Core/Client/Services/SiegeEngines/Handlers/ClientSiegeEngineHandler.cs