Skip to content

bonsaibauer/CSM.TmpeSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Repository License Visitors Report Bug Request Feature Version Mismatch GitHub Stars GitHub Forks

🚧 CSM TM:PE Sync (Beta)

CSM TM:PE Sync keeps Cities: Skylines Multiplayer (CSM) host-authoritative while players edit Traffic Manager: President Edition (TM:PE) features. After the latest restructuring the synchronization layer has been rewritten feature by feature: every TM:PE tool now owns its own command handlers, network payloads, and harmony patches.

Beta disclaimer

The rewrite is still stabilising. Multiplayer sessions should treat this build as experimental and report issues with logs. Use the mod in controlled test games before deploying it to long-running cities.

Feature documentation

Detailed docs live alongside the code. Every feature description is bilingual (German first, English second) and explains file layout, message flow, and known limitations.

Feature Documentation Supported
Clear Traffic docs/ClearTraffic.md βœ…
Junction Restrictions docs/JunctionRestrictions.md βœ…
Lane Arrows docs/LaneArrows.md βœ…
Lane Connector docs/LaneConnector.md βœ…
Manual Traffic Lights docs/ManualTrafficLights.md βœ…
Parking Restrictions docs/ParkingRestrictions.md βœ…
Priority Signs docs/PrioritySigns.md βœ…
Speed Limits docs/SpeedLimits.md βœ…
Timed Traffic Lights docs/TimedTrafficLights.md βœ…
Toggle Traffic Lights docs/ToggleTrafficLights.md βœ…
Vehicle Restrictions docs/VehicleRestrictions.md βœ…

The Lane Connector guide has been refreshed to cover the lane-ID apply pipeline rewrite - revisit docs/LaneConnector.md for the new retry/backoff flow and message format details.

Check the corresponding src/CSM.TmpeSync.<FeatureName>/ project when you extend or debug a specific tool. Each project ships its own bootstrapper and harmony integration and can be iterated in isolation.

Repository layout

Path Description
src/CSM.TmpeSync/ Core mod: dependency detection, logging, feature registration, and shared services.
src/CSM.TmpeSync.<Feature>/ Independent feature modules created by the restructure. Each module owns handlers, messages, services, and tests where applicable.
docs/ Bilingual feature manuals and architectural notes generated during the rewrite.
scripts/ PowerShell helpers to configure, build, install, and update dependencies.
submodule/ Git submodules for TM:PE, CSM, and CitiesHarmony.

Prerequisites

The automation targets Windows with PowerShell 7. Install the following tools:

Tool Purpose
PowerShell 7 All helper scripts target pwsh.
Visual Studio Build Tools 2019+ (MSBuild) Provides MSBuild, the default compiler used by the build script.
.NET SDK 6.0+ (optional) Supplies the dotnet CLI fallback when MSBuild is unavailable.
Visual Studio Code Primary editor and task runner for the project.
Steam edition of Cities: Skylines Supplies the base game assemblies.

Steam Workshop subscriptions

The build script mirrors dependencies from Steam Workshop downloads. Make sure the following items are subscribed and fully downloaded in Steam before running the setup wizard:

During configuration the script explicitly asks you to confirm these subscriptions. Answering No aborts the process so you can subscribe and retry.

Initial setup

  1. Clone the repository (submodules will be initialized by the update script):

    git clone https://github.com/bonsaibauer/CSM.TmpeSync.git
    cd CSM.TmpeSync
  2. Launch the configuration wizard:

    pwsh ./scripts/build.ps1 -Configure

    The wizard guides you through:

    • Selecting the Steam profile (currently the only option).
    • Confirming that Harmony, TM:PE, and CSM are subscribed in Steam.
    • Entering the Cities: Skylines installation directory (default: C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines).
    • Entering the local mod installation root (default: %LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods).

    Defaults for the Steam Workshop cache and dependency mirrors are pre-populated and stored alongside the paths you provide in scripts/build-settings.json.

Build workflow

scripts/build.ps1 drives the entire process:

pwsh ./scripts/build.ps1 -Update -Build -Install -Configuration Debug   # refresh dependencies, build the mod, build debug version and install to the configured directory
pwsh ./scripts/build.ps1 -Update -Build -Install                        # refresh dependencies, build the mod, install to the configured directory
pwsh ./scripts/build.ps1 -Build -Install                                # build the mod, install to the configured directory
pwsh ./scripts/build.ps1 -Build                                         # build only (assumes dependencies are already mirrored)
pwsh ./scripts/build.ps1 -Install                                       # copy the latest build output into your mods folder

Key parameters:

  • -Configuration <Release|Debug> – build configuration (Release by default).
  • -Profile Steam – explicitly target the Steam profile when multiple profiles become available.
  • -ModDirectory <path> – override the installation target for a single run.
  • -GameDirectory, -SteamModsDir, -HarmonySourceDir, -CsmSourceDir, -TmpeSourceDir – override paths captured in the profile when needed.

Dependency updates copy the latest Harmony, TM:PE, and CSM libraries from Steam into the working cache. Remove those directories to force a clean refresh. The build prefers MSBuild from Visual Studio Build Tools and automatically falls back to the dotnet CLI only when MSBuild is unavailable.

Manual installation

Package the contents of src/CSM.TmpeSync/bin/<Configuration>/net35/ together with scripts/install.ps1. On the target machine run:

pwsh ./scripts/install.ps1

The installer clears any existing copy of the mod and copies the DLL (and optional PDB files) into the default Cities: Skylines mods directory. Use -ModDirectory to override the destination.

Using the add-on in-game

  1. Enable Harmony, CSM, TM:PE, and CSM.TmpeSync (Beta) in the Cities: Skylines Content Manager.
  2. Start or join a CSM session. Once connected, every TM:PE edit made by the host is validated, applied through the feature-specific bridge, and broadcast to all clients.
  3. Monitor the daily log files (%LOCALAPPDATA%\Colossal Order\Cities_Skylines\CSM.TmpeSync\log-<YYYY-MM-DD>.log) for warnings while the Beta stabilises.

Logging

Operational logs are written to daily rolling files:

%LOCALAPPDATA%\Colossal Order\Cities_Skylines\CSM.TmpeSync\log-<YYYY-MM-DD>.log

Debug-level entries are always written, so you get full bridge traces without additional setup.

Contributing feedback

File issues with reproduction steps, the latest log-<YYYY-MM-DD>.log, and the feature name that triggered the problem. The modular architecture lets us iterate on one feature at a time, so accurate reports keep the Beta moving forward.

Buy Me A Coffee

If this project has helped you in any way, do buy me a coffee so I can continue to build more of such projects in the future and share them with the community!

Buy Me A Coffee