├── .gitattributes ├── lib ├── DV.Utils.dll ├── DarkRift.dll ├── 0Harmony.dll ├── DV.PointSet.dll ├── PassengerJobs.dll ├── UnityEngine.dll ├── Assembly-CSharp.dll ├── DV.BrakeSystem.dll ├── DV.TerrainSystem.dll ├── DVCustomCarLoader.dll ├── DarkRift.Client.dll ├── DarkRift.Server.dll ├── Newtonsoft.Json.dll ├── Unity.TextMeshPro.dll ├── UnityEngine.UI.dll ├── UnityModManager.dll ├── net.smkd.vector3d.dll ├── UnityEngine.AudioModule.dll ├── UnityEngine.InputModule.dll ├── UnityEngine.UIModule.dll ├── UnityEngine.AnimationModule.dll ├── UnityEngine.CoreModule.dll ├── UnityEngine.IMGUIModule.dll ├── UnityEngine.PhysicsModule.dll ├── UnityEngine.ImageConversionModule.dll ├── UnityEngine.InputLegacyModule.dll ├── UnityEngine.ParticleSystemModule.dll ├── UnityEngine.SharedInternalsModule.dll ├── UnityEngine.TextRenderingModule.dll └── UnityEngine.UIElementsModule.dll ├── DVServer ├── packages.config ├── DVServer.sln ├── Resources │ └── Server.config ├── Properties │ └── AssemblyInfo.cs └── ServerManager.cs ├── DVMultiplayerContinued ├── Resources │ ├── Textures │ │ ├── UI_Bin.png │ │ ├── UI_Close.png │ │ ├── UI_ArrowLeft.png │ │ ├── UI_Favorited.png │ │ ├── UI_Multiplayer.png │ │ ├── UI_Unfavorited.png │ │ └── UI_Button_disabled.png │ └── config.xml ├── packages.config ├── Unity │ ├── Player │ │ ├── RotateTowardsPlayer.cs │ │ └── NetworkPlayerSync.cs │ ├── UI │ │ ├── ButtonFeatures.cs │ │ ├── TextField.cs │ │ ├── InputButton.cs │ │ └── InputScreen.cs │ ├── Junction │ │ └── NetworkJunctionSync.cs │ ├── Jobs │ │ └── NetworkJobsSync.cs │ └── Train │ │ └── NetworkTrainCouplerSync.cs ├── Patches │ ├── UI │ │ ├── StopClosingUIIfNotAllowed.cs │ │ ├── EnableMovementOutsidePauseMenus.cs │ │ ├── StopGamePauseInMenus.cs │ │ └── UpdateImgControllersCanvasSpawner.cs │ ├── Train │ │ ├── StopTrainsToPoolWhenClient.cs │ │ ├── FixBogiesForceSleepNRE.cs │ │ ├── FixDrivingForceUpdateWheelSlipNRE.cs │ │ ├── CarDamageModelPatch.cs │ │ ├── ChangeSpeedCalculationWhenPhysicsAreOff.cs │ │ ├── CargoDamageModelPatch.cs │ │ ├── DisallowDeleteIfPlayerInTrain.cs │ │ ├── RemoveScriptsBeforeCarDeletion.cs │ │ ├── AllowUpdateWhenBogieKinematic.cs │ │ ├── Shunter │ │ │ └── LocoControllerShunterSetNeutralStatePatch.cs │ │ ├── StopRemovingTrainsWhenClient.cs │ │ ├── LocoSimulationPatch.cs │ │ ├── AllowUpdateWhenKinematic.cs │ │ ├── HoseSeperationCheck.cs │ │ └── ControlImplBasePatch.cs │ ├── Save │ │ └── DontLoadSaveFileIfDataIsSet.cs │ ├── Turntable │ │ └── StopTurntablePushWhenClient.cs │ ├── Jobs │ │ ├── StaticJobDefinitionPatch.cs │ │ ├── JobValidatorStopAcceptingJobIfNotAllowed.cs │ │ ├── StopGeneratingJobsAsClientAfterChain.cs │ │ └── StopGeneratingJobsAsClient.cs │ ├── Player │ │ └── ShopPatch.cs │ ├── Debt │ │ ├── LocoDebtControllerPatch.cs │ │ └── JobDebtControllerPatch.cs │ └── Spawning │ │ ├── StopCreatingLocosAsClient.cs │ │ └── StopCreatingCarsAsClient.cs ├── Info.json ├── Utils │ ├── ColorTT.cs │ ├── UGameObject.cs │ ├── Game │ │ └── SavedPositions.cs │ └── UUI.cs ├── DTO │ └── Savegame │ │ └── OfflineSave.cs ├── Darkrift │ ├── Server │ │ ├── UnityConsoleWriter.cs │ │ ├── UnityModManagerWriter.cs │ │ └── UnityServerHelper.cs │ ├── BufferQueue.cs │ ├── Client │ │ └── SerializableObjectCacheSettings.cs │ └── WriterExtends.cs ├── Properties │ └── AssemblyInfo.cs ├── Settings.cs └── Networking │ └── FavoritesManager.cs ├── DVServerPlugins ├── JobsPlugin │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── JobsPlugin.csproj ├── PlayerPlugin │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── PlayerPlugin.csproj ├── TrainPlugin │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── TrainPlugin.csproj ├── JunctionPlugin │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── JunctionPlugin.csproj │ └── JunctionPlugin.cs ├── TurntablePlugin │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── TurntablePlugin.csproj └── DebtPlugin │ ├── Properties │ └── AssemblyInfo.cs │ ├── DebtPlugin.cs │ └── DebtPlugin.csproj ├── DVMP.DTO ├── Saving.cs ├── Player │ ├── PlayerLoaded.cs │ ├── Disconnect.cs │ ├── SetSpawn.cs │ ├── ChatMessage.cs │ ├── License.cs │ ├── Location.cs │ ├── Mod.cs │ └── NPlayer.cs ├── Train │ ├── CarRemoval.cs │ ├── CarsAuthChange.cs │ ├── TrainCarChange.cs │ ├── TrainLever.cs │ ├── TrainCouplerCockChange.cs │ ├── MultipleUnit.cs │ ├── CarDamage.cs │ ├── TrainCouplerHoseChange.cs │ ├── TrainCouplingChange.cs │ ├── CarMUChange.cs │ ├── TrainCargoChanged.cs │ ├── TrainDerail.cs │ ├── TrainRerail.cs │ ├── LocoStuff.cs │ └── TrainLocation.cs ├── Turntable │ ├── ReleaseAuthority.cs │ ├── RequestAuthority.cs │ └── Turntable.cs ├── Debt │ └── DebtPaid.cs ├── Junction │ └── Switch.cs ├── DVMP.DTO.shproj ├── Job │ ├── Chain.cs │ └── Job.cs ├── NetworkTags.cs ├── SerializableDictionary.cs └── DVMP.DTO.projitems ├── LICENSE ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── repository.json └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.dll filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /lib/DV.Utils.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09b297f70ac6fe717465a5b1db79e423d704ef490bc01a6b337c4eb822f698a1 3 | size 30720 4 | -------------------------------------------------------------------------------- /lib/DarkRift.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dba93b6a576143e731e192561ba3ec75d1613c11bf6e19865a0b60b303a1f780 3 | size 50688 4 | -------------------------------------------------------------------------------- /lib/0Harmony.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9611251f080e4855cd9d5fa54b5e56034df25b70b374c49ba09550b08a1bf875 3 | size 909824 4 | -------------------------------------------------------------------------------- /lib/DV.PointSet.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf7c1059fc4ab891e83d78533b23fd596dfaa782c96a3a4a8e68db7f3b0f5d3e 3 | size 14336 4 | -------------------------------------------------------------------------------- /lib/PassengerJobs.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dc43c857795b20b78435a36a044395f562ab6787a8286adb433eb72cfe37468b 3 | size 90112 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78014c03a6dedc1ebe7f4699afc1a3662c3c05ce557910392ccec304d82497a8 3 | size 84992 4 | -------------------------------------------------------------------------------- /lib/Assembly-CSharp.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4cb9c944d02d3d43c7b43f24e2a611e4fef521974f0b081aecc5e9d5ba0c326d 3 | size 3732992 4 | -------------------------------------------------------------------------------- /lib/DV.BrakeSystem.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c31cb0b55159b61d14b8db5cdc54eec24fa077d81c0a3bf7a483af8816a4024a 3 | size 12288 4 | -------------------------------------------------------------------------------- /lib/DV.TerrainSystem.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8acedf25e4d8a149ae15641f27e8467019b1f3a31719c98ba314c8496729df86 3 | size 26112 4 | -------------------------------------------------------------------------------- /lib/DVCustomCarLoader.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a10a890ac06a3a86cc01b5d7994dd432ceaf9e8dcc541409e9c11f578ab3a1a 3 | size 242688 4 | -------------------------------------------------------------------------------- /lib/DarkRift.Client.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:194d100742c9aa7935fa2d8cad00096d46adfc8bdb994d5e88657cb685707098 3 | size 22528 4 | -------------------------------------------------------------------------------- /lib/DarkRift.Server.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f7925c655618d9c1bfb6493a75ead175c789deb127eba1cf537c4463a7b16fc 3 | size 140288 4 | -------------------------------------------------------------------------------- /lib/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:759accaa5fb7bddb54a2ceab92a3d8ab50750333ec73b62605aea6165d1ca6dd 3 | size 683008 4 | -------------------------------------------------------------------------------- /lib/Unity.TextMeshPro.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cfd26410ee86638c218297e3531b9cf12aabd95cc4adb4edc26fb707db6b2468 3 | size 369664 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.UI.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09c2bd1f9a80f973124a294341d7ef10e2f2039038c6692ebca82f683c8f0206 3 | size 226304 4 | -------------------------------------------------------------------------------- /lib/UnityModManager.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4aebb5b80871cf0ccca00f2b42a16a260be305bd48fec07e61eb465e8c803ab5 3 | size 169984 4 | -------------------------------------------------------------------------------- /lib/net.smkd.vector3d.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ac93081dcd0620a0e9fd7f65e64eaecd088f611c07aae9905062cdeeddc25d6d 3 | size 15872 4 | -------------------------------------------------------------------------------- /DVServer/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.AudioModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:84ac3c9691c2d489dbf37cda9240a48208ffcb159089bd204ca175c14f6e77dc 3 | size 57344 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.InputModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:35d39beb7136f2a3bc56e82e4ebdddb56a37ec000315bfe8165ebf8a6cb53bcb 3 | size 12288 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.UIModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:10f8ae74364144f6be34cd234deaf4027c23f23ae8901421fd8c8aae9c9313d9 3 | size 23552 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Bin.png -------------------------------------------------------------------------------- /lib/UnityEngine.AnimationModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ba0d06153d840fba2812d83cbcc4eb788d06d9c85ff2840acc4215cb2a004c44 3 | size 145920 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.CoreModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d23f617d790a909991acd19efe1afa0f6888d1756115a711f815219585ef5899 3 | size 1006592 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.IMGUIModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4475362bc223772cb4dd524a5585f6638c7d1a5db154ed7698c15509c8a4ee09 3 | size 156160 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.PhysicsModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9554e5b8c17d50ba942a028424674c2356668fea4f5e5f2c71238c271f236d8 3 | size 87040 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Close.png -------------------------------------------------------------------------------- /lib/UnityEngine.ImageConversionModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12eca2b2813cd9cf439190ae8997eba138b87b437828a50f84f7a78b962f6b1d 3 | size 12800 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.InputLegacyModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e563b1dbe9ea5cb46c4052ac5f51b191fa5f0377e9f9853967f07c54871f652f 3 | size 25600 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.ParticleSystemModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7619b5d776a37422110011cdc00fdc162753fd684e224638b5b0ee07f07952b4 3 | size 135168 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.SharedInternalsModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:455002154e1793e8a1e711a41a0c63af2a3218c52f07fb6ca341abe46e5455a0 3 | size 19456 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.TextRenderingModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:255e3793a6638cfa572e671b5cef67bb6b141702b0b6dc1cb8a7eb8fcc6c7e6c 3 | size 27648 4 | -------------------------------------------------------------------------------- /lib/UnityEngine.UIElementsModule.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0ffdb8a46b426901837bf687efaaa1aac4d0b03b7a60a365e173b608d8d91d4a 3 | size 726016 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_ArrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_ArrowLeft.png -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Favorited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Favorited.png -------------------------------------------------------------------------------- /DVServerPlugins/JobsPlugin/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVServerPlugins/PlayerPlugin/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVServerPlugins/TrainPlugin/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Multiplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Multiplayer.png -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Unfavorited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Unfavorited.png -------------------------------------------------------------------------------- /DVServerPlugins/JunctionPlugin/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVServerPlugins/TurntablePlugin/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Resources/Textures/UI_Button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/HEAD/DVMultiplayerContinued/Resources/Textures/UI_Button_disabled.png -------------------------------------------------------------------------------- /DVMP.DTO/Saving.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DVMP.DTO.ServerSave 4 | { 5 | public interface IPluginSave 6 | { 7 | string Name { get; } 8 | string SaveData(); 9 | void LoadData(string data); 10 | } 11 | 12 | public interface ISaveManager 13 | { 14 | void Save(List plugins, bool force = false); 15 | void Load(List plugins); 16 | } 17 | } -------------------------------------------------------------------------------- /DVMP.DTO/Player/PlayerLoaded.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Player 4 | { 5 | public class PlayerLoaded : IDarkRiftSerializable 6 | { 7 | public ushort Id { get; set; } 8 | 9 | public void Deserialize(DeserializeEvent e) 10 | { 11 | Id = e.Reader.ReadUInt16(); 12 | } 13 | 14 | public void Serialize(SerializeEvent e) 15 | { 16 | e.Writer.Write(Id); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /DVMP.DTO/Train/CarRemoval.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Train 4 | { 5 | public class CarRemoval : IDarkRiftSerializable 6 | { 7 | public string Guid { get; set; } 8 | 9 | public void Deserialize(DeserializeEvent e) 10 | { 11 | Guid = e.Reader.ReadString(); 12 | } 13 | 14 | public void Serialize(SerializeEvent e) 15 | { 16 | e.Writer.Write(Guid); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DVMP.DTO/Player/Disconnect.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Player 4 | { 5 | public class Disconnect : IDarkRiftSerializable 6 | { 7 | public ushort PlayerId { get; set; } 8 | 9 | public void Deserialize(DeserializeEvent e) 10 | { 11 | PlayerId = e.Reader.ReadUInt16(); 12 | } 13 | 14 | public void Serialize(SerializeEvent e) 15 | { 16 | e.Writer.Write(PlayerId); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Unity/Player/RotateTowardsPlayer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | internal class RotateTowardsPlayer : MonoBehaviour 4 | { 5 | #pragma warning disable IDE0051 // Remove unused private members 6 | private Camera camera; 7 | private void Awake() 8 | { 9 | camera = PlayerManager.PlayerCamera; 10 | } 11 | 12 | private void Update() 13 | { 14 | transform.LookAt(transform.position + camera.transform.rotation * Vector3.forward, camera.transform.rotation * Vector3.up); 15 | } 16 | } -------------------------------------------------------------------------------- /DVMP.DTO/Player/SetSpawn.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMultiplayer.Darkrift; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.DTO.Player 6 | { 7 | public class SetSpawn : IDarkRiftSerializable 8 | { 9 | public Vector3 Position { get; set; } 10 | 11 | public void Deserialize(DeserializeEvent e) 12 | { 13 | Position = e.Reader.ReadVector3(); 14 | } 15 | 16 | public void Serialize(SerializeEvent e) 17 | { 18 | e.Writer.Write(Position); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/UI/StopClosingUIIfNotAllowed.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(CanvasSpawner), "Update")] 9 | internal class StopClosingUIIfNotAllowed 10 | { 11 | private static bool Prefix() 12 | { 13 | return CustomUI.isAllowedToBeClosedByPlayer; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DVMP.DTO/Player/ChatMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using DarkRift; 5 | 6 | namespace DVMP.DTO.Player 7 | { 8 | public class ChatMessage : IDarkRiftSerializable 9 | { 10 | public string Message { get; set; } 11 | 12 | public void Deserialize(DeserializeEvent e) 13 | { 14 | Message = e.Reader.ReadString(); 15 | } 16 | 17 | public void Serialize(SerializeEvent e) 18 | { 19 | e.Writer.Write(Message); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DVMP.DTO/Turntable/ReleaseAuthority.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMultiplayer.Darkrift; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.DTO.Turntable 6 | { 7 | public class ReleaseAuthority : IDarkRiftSerializable 8 | { 9 | public Vector3 Position { get; set; } 10 | 11 | public void Deserialize(DeserializeEvent e) 12 | { 13 | Position = e.Reader.ReadVector3(); 14 | } 15 | 16 | public void Serialize(SerializeEvent e) 17 | { 18 | e.Writer.Write(Position); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Info.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "DVMultiplayerContinued", 3 | "DisplayName": "Derail Valley Multiplayer Continued", 4 | "Author": "Patrick van Halm & GamingCoookie", 5 | "Version": "1.5.0.2", 6 | "LoadAfter": [ "PassengerJobs", "DVCustomCarLoader", "HandBrake" ], 7 | "AssemblyName": "DVMultiplayerContinued.dll", 8 | "EntryMethod": "DVMultiplayer.Main.Load", 9 | "HomePage": "https://www.nexusmods.com/derailvalley/mods/406", 10 | "Repository": "https://raw.githubusercontent.com/GamingCoookie/dv-multiplayer-continued/main/repository.json" 11 | } 12 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/StopTrainsToPoolWhenClient.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(TrainCar), "ReturnCarToPool")] 9 | internal class StopTrainsToPoolWhenClient 10 | { 11 | private static bool Prefix() 12 | { 13 | if (NetworkManager.IsClient()) 14 | return false; 15 | 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/CarsAuthChange.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Train 4 | { 5 | public class CarsAuthChange : IDarkRiftSerializable 6 | { 7 | public string[] Guids { get; set; } 8 | public ushort PlayerId { get; set; } 9 | 10 | public void Deserialize(DeserializeEvent e) 11 | { 12 | Guids = e.Reader.ReadStrings(); 13 | PlayerId = e.Reader.ReadUInt16(); 14 | } 15 | 16 | public void Serialize(SerializeEvent e) 17 | { 18 | e.Writer.Write(Guids); 19 | e.Writer.Write(PlayerId); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/FixBogiesForceSleepNRE.cs: -------------------------------------------------------------------------------- 1 | using DV; 2 | using DV.Logic.Job; 3 | using DVMultiplayer.Networking; 4 | using HarmonyLib; 5 | using System; 6 | using System.Reflection; 7 | using UnityEngine; 8 | 9 | namespace DVMultiplayer.Patches 10 | { 11 | #pragma warning disable IDE0060 // Remove unused parameter 12 | #pragma warning disable IDE0051 // Remove unused private members 13 | [HarmonyPatch(typeof(Bogie), "ForceSleep")] 14 | internal class FixBogiesForceSleepNRE 15 | { 16 | private static bool Prefix(Bogie __instance) 17 | { 18 | return __instance.rb; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/TrainCarChange.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Train 4 | { 5 | public class TrainCarChange : IDarkRiftSerializable 6 | { 7 | public ushort PlayerId { get; set; } 8 | public string TrainId { get; set; } = ""; 9 | 10 | 11 | public void Deserialize(DeserializeEvent e) 12 | { 13 | PlayerId = e.Reader.ReadUInt16(); 14 | TrainId = e.Reader.ReadString(); 15 | } 16 | 17 | public void Serialize(SerializeEvent e) 18 | { 19 | e.Writer.Write(PlayerId); 20 | e.Writer.Write(TrainId); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/UI/EnableMovementOutsidePauseMenus.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(CanvasSpawner), "Close")] 9 | internal class EnableMovementOutsidePauseMenus 10 | { 11 | private static void Postfix() 12 | { 13 | if (!TutorialController.movementAllowed && NetworkManager.IsClient()) 14 | TutorialController.movementAllowed = true; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Save/DontLoadSaveFileIfDataIsSet.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(SaveGameManager), "Load")] 9 | internal class DontLoadSaveFileIfDataIsSet 10 | { 11 | private static bool Prefix(bool loadBackup = false) 12 | { 13 | if (SaveGameManager.data != null && NetworkManager.IsClient()) 14 | return false; 15 | 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Turntable/StopTurntablePushWhenClient.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.Patches 6 | { 7 | #pragma warning disable IDE0060 // Remove unused parameter 8 | #pragma warning disable IDE0051 // Remove unused private members 9 | [HarmonyPatch(typeof(TurntableController), "GetPushingInput")] 10 | internal class StopTurntablePushWhenClient 11 | { 12 | private static bool Prefix(Transform handle) 13 | { 14 | if (NetworkManager.IsClient()) 15 | return false; 16 | 17 | return true; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021-2022 Patrick van Halm 2 | Copyright 2022 GamingCoookie 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Utils/ColorTT.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace DVMultiplayer.Utils 4 | { 5 | public static class ColorTT 6 | { 7 | public static uint Pack(this Color32 color) 8 | { 9 | return ((uint)color.r << 24) | ((uint)color.g << 16) | ((uint)color.b << 8) | color.a; 10 | } 11 | 12 | public static Color32 Unpack(uint packedColor) 13 | { 14 | byte r = (byte)(packedColor >> 24); 15 | byte g = (byte)(packedColor >> 16); 16 | byte b = (byte)(packedColor >> 8); 17 | byte a = (byte)packedColor; 18 | return new Color32(r, g, b, a); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DVMP.DTO/Turntable/RequestAuthority.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMultiplayer.Darkrift; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.DTO.Turntable 6 | { 7 | public class RequestAuthority : IDarkRiftSerializable 8 | { 9 | public Vector3 Position { get; set; } 10 | public ushort PlayerId { get; set; } 11 | 12 | public void Deserialize(DeserializeEvent e) 13 | { 14 | Position = e.Reader.ReadVector3(); 15 | PlayerId = e.Reader.ReadUInt16(); 16 | } 17 | 18 | public void Serialize(SerializeEvent e) 19 | { 20 | e.Writer.Write(Position); 21 | e.Writer.Write(PlayerId); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/FixDrivingForceUpdateWheelSlipNRE.cs: -------------------------------------------------------------------------------- 1 | using DV; 2 | using DV.Logic.Job; 3 | using DVMultiplayer.Networking; 4 | using HarmonyLib; 5 | using System; 6 | using System.Reflection; 7 | using UnityEngine; 8 | 9 | namespace DVMultiplayer.Patches 10 | { 11 | #pragma warning disable IDE0060 // Remove unused parameter 12 | #pragma warning disable IDE0051 // Remove unused private members 13 | [HarmonyPatch(typeof(DrivingForce), "UpdateWheelslip")] 14 | internal class DrivingForcePatch 15 | { 16 | private static bool Prefix(float inputForce, Bogie bogie, float maxTractionForcePossible) 17 | { 18 | return bogie && bogie.Car && bogie.rb; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe what the feature is that you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /DVMP.DTO/Debt/DebtPaid.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DVMultiplayer.DTO.Debt 9 | { 10 | class DebtPaid : IDarkRiftSerializable 11 | { 12 | public string Id { get; set; } 13 | public bool isDestroyed { get; set; } 14 | 15 | public void Deserialize(DeserializeEvent e) 16 | { 17 | Id = e.Reader.ReadString(); 18 | isDestroyed = e.Reader.ReadBoolean(); 19 | } 20 | 21 | public void Serialize(SerializeEvent e) 22 | { 23 | e.Writer.Write(Id); 24 | e.Writer.Write(isDestroyed); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/UI/StopGamePauseInMenus.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(CanvasSpawner), "Open", new[] { typeof(MenuScreen), typeof(bool) })] 9 | internal class StopGamePauseInMenus 10 | { 11 | private static void Prefix(MenuScreen screenToOpen, ref bool pauseGame) 12 | { 13 | if (NetworkManager.IsClient()) 14 | { 15 | pauseGame = false; 16 | TutorialController.movementAllowed = false; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Jobs/StaticJobDefinitionPatch.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Networking; 2 | using HarmonyLib; 3 | 4 | namespace DVMultiplayer.Patches.Jobs 5 | { 6 | #pragma warning disable IDE0060 // Remove unused parameter 7 | #pragma warning disable IDE0051 // Remove unused private members 8 | [HarmonyPatch(typeof(StaticJobDefinition), "TryToGenerateJob")] 9 | internal class StaticJobDefinitionPatch_DisableIfClientAndNoJobId 10 | { 11 | private static bool Prefix(string ___forcedJobId) 12 | { 13 | if(NetworkManager.IsClient() && !NetworkManager.IsHost()) 14 | { 15 | return !string.IsNullOrEmpty(___forcedJobId); 16 | } 17 | return true; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/TrainLever.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMP.DTO; 3 | 4 | namespace DVMultiplayer.DTO.Train 5 | { 6 | public class TrainLever : IDarkRiftSerializable 7 | { 8 | public string TrainId { get; set; } 9 | public float Value { get; set; } 10 | public string Name { get; set; } = ""; 11 | 12 | public void Deserialize(DeserializeEvent e) 13 | { 14 | TrainId = e.Reader.ReadString(); 15 | Value = e.Reader.ReadSingle(); 16 | Name = e.Reader.ReadString(); 17 | } 18 | 19 | public void Serialize(SerializeEvent e) 20 | { 21 | e.Writer.Write(TrainId); 22 | e.Writer.Write(Value); 23 | e.Writer.Write(Name); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: Patrick-van-Halm 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Mod Version [e.g. 22] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/TrainCouplerCockChange.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Train 4 | { 5 | public class TrainCouplerCockChange : IDarkRiftSerializable 6 | { 7 | public string TrainIdCoupler { get; set; } 8 | public bool IsCouplerFront { get; set; } 9 | public bool IsOpen { get; set; } 10 | 11 | public void Deserialize(DeserializeEvent e) 12 | { 13 | TrainIdCoupler = e.Reader.ReadString(); 14 | IsCouplerFront = e.Reader.ReadBoolean(); 15 | IsOpen = e.Reader.ReadBoolean(); 16 | } 17 | 18 | public void Serialize(SerializeEvent e) 19 | { 20 | e.Writer.Write(TrainIdCoupler); 21 | e.Writer.Write(IsCouplerFront); 22 | e.Writer.Write(IsOpen); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/MultipleUnit.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DVMultiplayer.DTO.Train 9 | { 10 | public class MultipleUnit : IDarkRiftSerializable 11 | { 12 | public string IsFrontMUConnectedTo { get; set; } = ""; 13 | public string IsRearMUConnectedTo { get; set; } = ""; 14 | 15 | public void Deserialize(DeserializeEvent e) 16 | { 17 | IsFrontMUConnectedTo = e.Reader.ReadString(); 18 | IsRearMUConnectedTo = e.Reader.ReadString(); 19 | } 20 | 21 | public void Serialize(SerializeEvent e) 22 | { 23 | e.Writer.Write(IsFrontMUConnectedTo); 24 | e.Writer.Write(IsRearMUConnectedTo); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DVMP.DTO/Turntable/Turntable.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMultiplayer.Darkrift; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.DTO.Turntable 6 | { 7 | public class Turntable : IDarkRiftSerializable 8 | { 9 | public Vector3 Position { get; set; } 10 | public float Rotation { get; set; } 11 | public ushort playerAuthId { get; set; } = 0; 12 | 13 | public void Deserialize(DeserializeEvent e) 14 | { 15 | Position = e.Reader.ReadVector3(); 16 | Rotation = e.Reader.ReadSingle(); 17 | playerAuthId = e.Reader.ReadUInt16(); 18 | } 19 | 20 | public void Serialize(SerializeEvent e) 21 | { 22 | e.Writer.Write(Position); 23 | e.Writer.Write(Rotation); 24 | e.Writer.Write(playerAuthId); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/DTO/Savegame/OfflineSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using UnityEngine; 7 | 8 | namespace DVMultiplayer.DTO.Savegame 9 | { 10 | class OfflineSaveGame 11 | { 12 | public string SaveDataCars { get; set; } 13 | public JobsSaveGameData SaveDataJobs { get; set; } 14 | public string SaveDataSwitches { get; set; } = ""; 15 | public string SaveDataTurntables { get; set; } = ""; 16 | public string SaveDataDestroyedLocoDebt { get; internal set; } 17 | public string SaveDataStagedJobDebt { get; internal set; } 18 | public string SaveDataDeletedJoblessCarsDebt { get; internal set; } 19 | public string SaveDataInsuranceDebt { get; internal set; } 20 | public Vector3 SaveDataPosition { get; internal set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DVMP.DTO/Junction/Switch.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | using DVMultiplayer.Darkrift; 3 | using UnityEngine; 4 | 5 | namespace DVMultiplayer.DTO.Junction 6 | { 7 | public class Switch : IDarkRiftSerializable 8 | { 9 | public uint Id { get; set; } 10 | public SwitchMode Mode { get; set; } 11 | public bool SwitchToLeft { get; set; } 12 | 13 | public void Deserialize(DeserializeEvent e) 14 | { 15 | Id = e.Reader.ReadUInt32(); 16 | Mode = (SwitchMode)e.Reader.ReadInt32(); 17 | SwitchToLeft = e.Reader.ReadBoolean(); 18 | } 19 | 20 | public void Serialize(SerializeEvent e) 21 | { 22 | e.Writer.Write(Id); 23 | e.Writer.Write((int)Mode); 24 | e.Writer.Write(SwitchToLeft); 25 | } 26 | } 27 | 28 | public enum SwitchMode 29 | { 30 | REGULAR, 31 | FORCED, 32 | NO_SOUND, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/CarDamageModelPatch.cs: -------------------------------------------------------------------------------- 1 | using DV; 2 | using DV.Logic.Job; 3 | using DVMultiplayer.Networking; 4 | using HarmonyLib; 5 | using System; 6 | using System.Reflection; 7 | using UnityEngine; 8 | 9 | namespace DVMultiplayer.Patches 10 | { 11 | #pragma warning disable IDE0060 // Remove unused parameter 12 | #pragma warning disable IDE0051 // Remove unused private members 13 | [HarmonyPatch(typeof(CarDamageModel), "IgnoreDamage")] 14 | internal class CarDamageModelPatch 15 | { 16 | private static void Prefix(CarDamageModel __instance, bool set) 17 | { 18 | if (NetworkManager.IsClient()) 19 | { 20 | NetworkTrainPosSync posSync = __instance.trainCar.GetComponent(); 21 | if (posSync) 22 | { 23 | posSync.IsCarDamageEnabled = !set; 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/ChangeSpeedCalculationWhenPhysicsAreOff.cs: -------------------------------------------------------------------------------- 1 | using DV; 2 | using DV.Logic.Job; 3 | using DVMultiplayer.Networking; 4 | using HarmonyLib; 5 | using System; 6 | using UnityEngine; 7 | 8 | namespace DVMultiplayer.Patches 9 | { 10 | #pragma warning disable IDE0060 // Remove unused parameter 11 | #pragma warning disable IDE0051 // Remove unused private members 12 | [HarmonyPatch(typeof(LocoControllerBase), "GetSpeedKmH")] 13 | internal class ChangeSpeedCalculationWhenPhysicsAreOff 14 | { 15 | private static void Postfix(LocoControllerBase __instance, ref float __result) 16 | { 17 | if (NetworkManager.IsClient() && __instance.train.rb.isKinematic) 18 | { 19 | NetworkTrainPosSync networking = __instance.GetComponent(); 20 | if (networking) 21 | { 22 | __result = networking.velocity.magnitude * 3.6f; 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DVMP.DTO/Train/CarDamage.cs: -------------------------------------------------------------------------------- 1 | using DarkRift; 2 | 3 | namespace DVMultiplayer.DTO.Train 4 | { 5 | public class CarDamage : IDarkRiftSerializable 6 | { 7 | public string Guid { get; set; } 8 | public DamageType DamageType { get; set; } 9 | public float NewHealth { get; set; } 10 | public string Data { get; set; } = ""; 11 | 12 | public void Deserialize(DeserializeEvent e) 13 | { 14 | Guid = e.Reader.ReadString(); 15 | DamageType = (DamageType)e.Reader.ReadUInt16(); 16 | NewHealth = e.Reader.ReadSingle(); 17 | Data = e.Reader.ReadString(); 18 | } 19 | 20 | public void Serialize(SerializeEvent e) 21 | { 22 | e.Writer.Write(Guid); 23 | e.Writer.Write((ushort)DamageType); 24 | e.Writer.Write(NewHealth); 25 | e.Writer.Write(Data); 26 | } 27 | } 28 | 29 | public enum DamageType 30 | { 31 | Car, 32 | Cargo 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Train/CargoDamageModelPatch.cs: -------------------------------------------------------------------------------- 1 | using DV; 2 | using DV.Logic.Job; 3 | using DVMultiplayer.Networking; 4 | using HarmonyLib; 5 | using System; 6 | using System.Reflection; 7 | using UnityEngine; 8 | 9 | namespace DVMultiplayer.Patches 10 | { 11 | #pragma warning disable IDE0060 // Remove unused parameter 12 | #pragma warning disable IDE0051 // Remove unused private members 13 | [HarmonyPatch(typeof(CargoDamageModel), "ApplyDamageToCargo")] 14 | internal class CargoDamageModelPatch 15 | { 16 | private static bool Prefix(CargoDamageModel __instance, TrainCar ___trainCar, float damage) 17 | { 18 | if (NetworkManager.IsClient()) 19 | { 20 | NetworkTrainPosSync posSync = ___trainCar.GetComponent(); 21 | if (posSync && !posSync.IsCarDamageEnabled) 22 | { 23 | return false; 24 | } 25 | } 26 | return true; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Patches/Player/ShopPatch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DVMultiplayer.Networking; 7 | using DV.Shops; 8 | using DV.CashRegister; 9 | using HarmonyLib; 10 | using UnityEngine; 11 | 12 | namespace DVMultiplayerContinued.Patches.Player 13 | { 14 | internal static class ShopPatch 15 | { 16 | [HarmonyPatch(typeof(ScanItemResourceModule), nameof(ScanItemResourceModule.AddItemsToBuy))] 17 | internal static class AddItemsToBuyPatch 18 | { 19 | internal static bool Prefix(ScanItemResourceModule __instance, ref bool __result) 20 | { 21 | if (NetworkManager.IsClient() && int.Parse(__instance.itemPriceText.text.TrimStart('$')) > 250) 22 | { 23 | __result = false; 24 | return false; 25 | } 26 | return true; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DVMP.DTO/Player/License.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using DarkRift; 5 | using DarkRift.Server; 6 | 7 | namespace DVMP.DTO.Player 8 | { 9 | public class License : IDarkRiftSerializable 10 | { 11 | public ushort PlayerID { get; set; } = 65535; 12 | public string LicenseName { get; set; } = ""; 13 | public double Price { get; set; } = 0; 14 | public int PurchaseAllowed { get; set; } = 0; 15 | 16 | public void Deserialize(DeserializeEvent e) 17 | { 18 | PlayerID = e.Reader.ReadUInt16(); 19 | LicenseName = e.Reader.ReadString(); 20 | Price = e.Reader.ReadDouble(); 21 | PurchaseAllowed = e.Reader.ReadInt32(); 22 | } 23 | 24 | public void Serialize(SerializeEvent e) 25 | { 26 | e.Writer.Write(PlayerID); 27 | e.Writer.Write(LicenseName); 28 | e.Writer.Write(Price); 29 | e.Writer.Write(PurchaseAllowed); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DVMultiplayerContinued/Unity/UI/ButtonFeatures.cs: -------------------------------------------------------------------------------- 1 | using DVMultiplayer.Utils; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | internal class ButtonFeatures : MonoBehaviour 6 | { 7 | private Button btn; 8 | private Image btnImage; 9 | private Sprite enabledSprite; 10 | private Sprite disabledSprite; 11 | 12 | private void Awake() 13 | { 14 | btn = GetComponent