public static void Reset()
 {
     lock (Client.eventLock)
     {
         singleton = new LockSystem();
     }
 }
Exemple #2
0
 public DMPGame(Settings dmpSettings, UniverseSyncCache universeSyncCache, ModWorker modWorker, ConnectionWindow connectionWindow, DMPModInterface dmpModInterface, ToolbarSupport toolbarSupport, OptionsWindow optionsWindow)
 {
     this.dmpSettings          = dmpSettings;
     this.universeSyncCache    = universeSyncCache;
     this.modWorker            = modWorker;
     this.connectionWindow     = connectionWindow;
     this.dmpModInterface      = dmpModInterface;
     this.configNodeSerializer = new ConfigNodeSerializer();
     this.posistionStatistics  = new PosistionStatistics();
     this.networkWorker        = new NetworkWorker(this, dmpSettings, connectionWindow, modWorker, configNodeSerializer);
     this.adminSystem          = new AdminSystem(dmpSettings);
     this.flagSyncer           = new FlagSyncer(this, dmpSettings, networkWorker);
     this.lockSystem           = new LockSystem(dmpSettings, networkWorker);
     this.partKiller           = new PartKiller(lockSystem);
     this.dynamicTickWorker    = new DynamicTickWorker(this, networkWorker);
     this.kerbalReassigner     = new KerbalReassigner();
     this.vesselPackedUpdater  = new VesselInterFrameUpdater(lockSystem, posistionStatistics, dmpSettings);
     this.vesselWorker         = new VesselWorker(this, dmpSettings, modWorker, lockSystem, networkWorker, configNodeSerializer, dynamicTickWorker, kerbalReassigner, partKiller, posistionStatistics, vesselPackedUpdater);
     this.scenarioWorker       = new ScenarioWorker(this, vesselWorker, configNodeSerializer, networkWorker);
     this.playerStatusWorker   = new PlayerStatusWorker(this, dmpSettings, vesselWorker, lockSystem, networkWorker);
     this.timeSyncer           = new TimeSyncer(this, networkWorker, vesselWorker);
     this.warpWorker           = new WarpWorker(this, dmpSettings, timeSyncer, networkWorker, playerStatusWorker);
     this.chatWorker           = new ChatWorker(this, dmpSettings, networkWorker, adminSystem, playerStatusWorker);
     this.screenshotWorker     = new ScreenshotWorker(this, dmpSettings, chatWorker, networkWorker, playerStatusWorker);
     this.vesselRecorder       = new VesselRecorder(this, warpWorker, vesselWorker);
     this.debugWindow          = new DebugWindow(this, dmpSettings, timeSyncer, networkWorker, vesselWorker, dynamicTickWorker, warpWorker, vesselRecorder, posistionStatistics);
     this.craftLibraryWorker   = new CraftLibraryWorker(this, dmpSettings, networkWorker);
     this.hackyInAtmoLoader    = new HackyInAtmoLoader(this, lockSystem, vesselWorker);
     this.asteroidWorker       = new AsteroidWorker(this, lockSystem, networkWorker, vesselWorker);
     this.playerColorWorker    = new PlayerColorWorker(dmpSettings, lockSystem, networkWorker);
     this.playerStatusWindow   = new PlayerStatusWindow(this, dmpSettings, warpWorker, chatWorker, craftLibraryWorker, debugWindow, screenshotWorker, timeSyncer, playerStatusWorker, optionsWindow, playerColorWorker);
     this.playerColorWorker.SetDependencies(playerStatusWindow);
     this.vesselWorker.SetDependencies(hackyInAtmoLoader, timeSyncer, asteroidWorker, chatWorker, playerStatusWorker);
     this.networkWorker.SetDependencies(timeSyncer, warpWorker, chatWorker, playerColorWorker, flagSyncer, partKiller, kerbalReassigner, asteroidWorker, vesselWorker, hackyInAtmoLoader, playerStatusWorker, scenarioWorker, dynamicTickWorker, craftLibraryWorker, screenshotWorker, toolbarSupport, adminSystem, lockSystem, dmpModInterface, universeSyncCache, vesselRecorder);
     optionsWindow.SetDependencies(this, networkWorker, playerColorWorker);
     this.dmpModInterface.DMPRun(networkWorker);
     this.stopEvent.Add(this.chatWorker.Stop);
     this.stopEvent.Add(this.craftLibraryWorker.Stop);
     this.stopEvent.Add(this.debugWindow.Stop);
     this.stopEvent.Add(this.dynamicTickWorker.Stop);
     this.stopEvent.Add(this.flagSyncer.Stop);
     this.stopEvent.Add(this.hackyInAtmoLoader.Stop);
     this.stopEvent.Add(this.kerbalReassigner.Stop);
     this.stopEvent.Add(this.playerColorWorker.Stop);
     this.stopEvent.Add(this.playerStatusWindow.Stop);
     this.stopEvent.Add(this.playerStatusWorker.Stop);
     this.stopEvent.Add(this.partKiller.Stop);
     this.stopEvent.Add(this.scenarioWorker.Stop);
     this.stopEvent.Add(this.screenshotWorker.Stop);
     this.stopEvent.Add(this.timeSyncer.Stop);
     this.stopEvent.Add(toolbarSupport.Stop);
     this.stopEvent.Add(optionsWindow.Stop);
     this.stopEvent.Add(this.vesselWorker.Stop);
     this.stopEvent.Add(this.warpWorker.Stop);
     this.stopEvent.Add(this.asteroidWorker.Stop);
     this.stopEvent.Add(this.vesselRecorder.Stop);
 }
 public AsteroidWorker(DMPGame dmpGame, LockSystem lockSystem, NetworkWorker networkWorker, VesselWorker vesselWorker)
 {
     this.dmpGame       = dmpGame;
     this.lockSystem    = lockSystem;
     this.networkWorker = networkWorker;
     this.vesselWorker  = vesselWorker;
     this.dmpGame.updateEvent.Add(Update);
     GameEvents.onVesselCreate.Add(OnVesselCreate);
 }
 public ScenarioWorker(DMPGame dmpGame, VesselWorker vesselWorker, ConfigNodeSerializer configNodeSerializer, NetworkWorker networkWorker, LockSystem lockSystem)
 {
     this.dmpGame              = dmpGame;
     this.vesselWorker         = vesselWorker;
     this.configNodeSerializer = configNodeSerializer;
     this.networkWorker        = networkWorker;
     this.lockSystem           = lockSystem;
     dmpGame.updateEvent.Add(Update);
 }
 public PermissionsWindow(DMPGame dmpGame, Settings dmpSettings, Groups groups, Permissions permissions, LockSystem lockSystem)
 {
     this.dmpGame     = dmpGame;
     this.dmpSettings = dmpSettings;
     this.groups      = groups;
     this.permissions = permissions;
     this.lockSystem  = lockSystem;
     dmpGame.drawEvent.Add(Draw);
 }
Exemple #6
0
 public PlayerColorWorker(DMPGame dmpGame, Settings dmpSettings, LockSystem lockSystem, NetworkWorker networkWorker)
 {
     this.dmpGame       = dmpGame;
     this.dmpSettings   = dmpSettings;
     this.lockSystem    = lockSystem;
     this.networkWorker = networkWorker;
     updateEvent        = new NamedAction(Update);
     dmpGame.updateEvent.Add(updateEvent);
 }
Exemple #7
0
 public PlayerStatusWorker(DMPGame dmpGame, Settings dmpSettings, VesselWorker vesselWorker, LockSystem lockSystem, NetworkWorker networkWorker)
 {
     this.dmpGame              = dmpGame;
     this.vesselWorker         = vesselWorker;
     this.lockSystem           = lockSystem;
     this.networkWorker        = networkWorker;
     myPlayerStatus            = new PlayerStatus();
     myPlayerStatus.playerName = dmpSettings.playerName;
     myPlayerStatus.statusText = "Syncing";
     dmpGame.updateEvent.Add(Update);
 }
 public PlayerStatusWorker(DMPGame dmpGame, Settings dmpSettings, VesselWorker vesselWorker, LockSystem lockSystem, NetworkWorker networkWorker, Permissions permissions)
 {
     this.dmpGame              = dmpGame;
     this.vesselWorker         = vesselWorker;
     this.lockSystem           = lockSystem;
     this.networkWorker        = networkWorker;
     this.permissions          = permissions;
     myPlayerStatus            = new PlayerStatus();
     myPlayerStatus.playerName = dmpSettings.playerName;
     myPlayerStatus.statusText = "Syncing";
     updateAction              = new NamedAction(Update);
     dmpGame.updateEvent.Add(updateAction);
 }
 public PlayerColorWorker(Settings dmpSettings, LockSystem lockSystem, NetworkWorker networkWorker)
 {
     this.dmpSettings   = dmpSettings;
     this.lockSystem    = lockSystem;
     this.networkWorker = networkWorker;
 }
Exemple #10
0
 public VesselInterFrameUpdater(LockSystem lockSystem, PosistionStatistics posistionStatistics, Settings dmpSettings)
 {
     this.lockSystem          = lockSystem;
     this.posistionStatistics = posistionStatistics;
     this.dmpSettings         = dmpSettings;
 }
 public PartKiller(LockSystem lockSystem)
 {
     this.lockSystem = lockSystem;
 }
Exemple #12
0
 public VesselPackedUpdater(LockSystem lockSystem, PosistionStatistics posistionStatistics)
 {
     this.lockSystem          = lockSystem;
     this.posistionStatistics = posistionStatistics;
 }