CitiesSkylinesMultiplayer / CSM

Source code for the Cities: Skylines Multiplayer mod (CSM)
https://citiesskylinesmultiplayer.com/
MIT License
725 stars 97 forks source link

Order of mods seems to break compatibility #288

Closed shadowfoxish closed 1 year ago

shadowfoxish commented 2 years ago

Describe the bug A friend an I were playing with a handful of mods, and we discovered a maybe bug in this multiplayer mod. Seems to be related to the order in which you subscribe to assets.

To Reproduce Create a collection of mods in Steam. And then have one person subscribe to the collection (unsub from everything else first) by clicking "subscribe to all", then have player 2 subscribe to the mods in a different order. If both players unsub and then resub the same way, multiplayer then works.

Expected behavior Feels like subscription order is kinda too sensitive(?) to block a client from joining.

Here is a link to our collection. https://steamcommunity.com/sharedfiles/filedetails/?id=2864612045

Here is the relevant section of the log. I italicized the client list. Chopping this up and in excel the list is identical, just out of order.

[16:57:33.6755] [Info] Connection rejected: List of mods [_1x1 Electric Vehicle Parking, 1x1 Accessible Parking, 1x1 Parking Lot, 1x1 Single Space Parking, 22m Parking Lot, 3x2 Parking Lot, 40m Parking Lot, 4x1 Parking Row, 4x2 Parking Lot, 58m Parking Lot, 8x2 Parking Lot, 16m Parking Lot Service Road, Recycling Center, Large Recycling Center, Ability to Read, 1x1 Parking Lot - RHD, 1x1 End Side Left - RHD, 1x1 Parking Right End - RHD, 1x1 Accessible Parking - RHD, 1x1 Single Parking Space - RHD, 3x2 Parking Lot 60 degree - RHD, 4x1 Parking Lot 60 Degree - RHD, Standard Parking Garage_sub_building_0, Standard Parking Garage_sub_building_1, Standard Parking Garage_sub_building2, Standard Parking Garage, Photovoltaic solar energy park, Modular Solar Panel 1x1 v2, Oil truck prop, Water Treatment Plant v3, Bridge Abutment, 60°/90° Parking Road 2L Suburban, 60°/90° Parking Road 2L Urban] (client) and [Recycling Center, Large Recycling Center, Ability to Read, 60°/90° Parking Road 2L Suburban, 60°/90° Parking Road 2L Urban, Bridge Abutment, Modular Solar Panel 1x1 v2, Water Treatment Plant v3, Standard Parking Garage_sub_building_0, Standard Parking Garage_sub_building_1, Standard Parking Garage_sub_building_2, Standard Parking Garage, Photovoltaic solar energy park, 1x1 Parking Lot - RHD, 1x1 End Side Left - RHD, 1x1 Parking Right End - RHD, 1x1 Accessible Parking - RHD, 1x1 Single Parking Space - RHD, 3x2 Parking Lot 60 degree - RHD, 4x1 Parking Lot 60 Degree - RHD, Oil truck prop, 1x1 Electric Vehicle Parking, 1x1 Accessible Parking, 1x1 Parking Lot, 1x1 Single Space Parking, 22m Parking Lot, 3x2 Parking Lot, 40m Parking Lot, 4x1 Parking Row, 4x2 Parking Lot, 58m Parking Lot, 8x2 Parking Lot, 16m Parking Lot Service Road] (server) differ.

DominicMaas commented 2 years ago

Interesting! @kaenganxt we could order the list of mods by name (via LINQ) and then SequenceEqual them?

Eld0r commented 2 years ago

Or just steam workshop ID? Local settings may or may not have an impact as well. Comparing two sorted lists sounds great from my external view.

kaenganxt commented 2 years ago

Thanks for the report, I didn't think this could be a problem.

Interesting! @kaenganxt we could order the list of mods by name (via LINQ) and then SequenceEqual them?

Yep, that seems to be the solution. We might need to watch closely if assets in different order can break something.

Or just steam workshop ID? Local settings may or may not have an impact as well. Comparing two sorted lists sounds great from my external view.

Steam workshop ID doesn't work because we also need to support different platforms (Epic, etc.) and people can always install mods manually (then the workshop ID is not set).

DominicMaas commented 1 year ago

@shadowfoxish This fix has now been released to the steam workshop