C# Class KMP.KMPManager

Inheritance: UnityEngine.MonoBehaviour
Show file Open project: TehGimp/KerbalMultiPlayer Class Usage Examples

Public Properties

Property Type Description
GameObjectInstance UnityEngine.GameObject
LoadedModfiles List
ShaFinishedEvent ManualResetEvent
activeVesselPosition Vector3
delayForceQuit bool
displayNTP bool
dockingRelVel Vector3d>.Dictionary
encoder System.Text.UnicodeEncoding
forceQuit bool
gameArrr bool
gameCheatsEnabled bool
gameMode int
gameRunning bool
gameStart bool
inactiveVesselsPerUpdate byte
interopInQueue Queue
interopInQueueLock object
ksc UnityEngine.GameObject
kscPosition UnityEngine.Vector3d
lastSubspaceLockChange float
lastTick double
listClientTimeWarpAverage float
newFlags float>.Dictionary
numberOfFilesToCheck int
numberOfShips int
pauseMenu PauseMenu
planetariumCam PlanetariumCamera
playerName String
playerStatus VesselStatusInfo>.SortedDictionary
renderManager RenderingManager
safetyBubbleRadius double
sentVessels_Situations Vessel.Situations>.Dictionary
serverKerbals_AssignedKerbals string>.Dictionary
serverParts_CrewCapacity int>.Dictionary
serverVessels_InPresent bool>.Dictionary
serverVessels_InUse bool>.Dictionary
serverVessels_IsMine bool>.Dictionary
serverVessels_IsPrivate bool>.Dictionary
serverVessels_LastUpdateDistanceTime Dictionary>
serverVessels_LoadDelay float>.Dictionary
serverVessels_ObtSyncDelay float>.Dictionary
serverVessels_PartCounts int>.Dictionary
serverVessels_Parts List>.Dictionary
serverVessels_ProtoVessels ConfigNode>.Dictionary
serverVessels_RemoteID Guid>.Dictionary
serverVessels_RendezvousSmoothPos Dictionary>
serverVessels_RendezvousSmoothVel Dictionary>
serverVessels_SkippedRendezvousUpdates int>.Dictionary
showConnectionWindow bool
skewServerTime long
skewSubspaceSpeed float
skewTargetTick double
terminateConnection bool
updateInterval float
vessels VesselEntry>.Dictionary

Public Methods

Method Description
Awake ( ) : void
HandleSyncCompleted ( ) : void
HandleSyncTimeCompleted ( byte data ) : void
KMPManager ( ) : System
OnGUI ( ) : void
Update ( ) : void
acceptClientInterop ( byte bytes ) : void
disconnect ( string message = "" ) : void
drawGUI ( ) : void
getAnyKeyDown ( KeyCode &key ) : bool
horizontalDistanceToSafetyBubbleEdge ( ) : double
updateStep ( ) : void
verticalDistanceToSafetyBubbleEdge ( ) : double

Private Methods

Method Description
CheckCrewMemberExists ( int kerbalID ) : void
CheckEditorLock ( ) : void
ClearFlagLock ( ) : void
HasModule ( string modName ) : bool

Determines if a scenario module with the specified name exists already. Only checks the name. This is used to determine when the scenarios list was not cleared properly (creating a new game does not seem to clear the list - it only sets the modules' moduleRefs to null, which caused failure to sync on career servers, by creating another two modules and then attempting to write data into all four, and might have caused career mode on non-career servers if you weren't restarting KSP after exiting career servers).

LogScience ( ) : void

Log current game science, and log some debug information. Logs the science amount, or -1 if there is no current game, or no scenarios, or no R&D proto scenario module. This was used for debugging to figure out what and where things were going wrong with connecting after disconnecting (#578, #579).

OnCrewBoardVessel ( Part>.GameEvents data ) : void
OnCrewOnEva ( Part>.GameEvents data ) : void
OnFirstFlightReady ( ) : void
OnFlightReady ( ) : void
OnGUIRnDComplexDespawn ( ) : void
OnGameSceneLoadRequested ( GameScenes data ) : void
OnKnowledgeChanged ( DiscoveryLevels>.GameEvents data ) : void
OnNewVesselCreated ( Vessel vessel ) : void
OnPartCouple ( Part>.GameEvents data ) : void
OnPartUndock ( Part data ) : void
OnProgressComplete ( ProgressNode data ) : void
OnProgressReached ( ProgressNode data ) : void
OnTechnologyResearched ( RDTech.OperationResult>.GameEvents data ) : void
OnTimeWarpRateChanged ( ) : void
OnVesselDestroy ( Vessel data ) : void
OnVesselLoaded ( Vessel data ) : void
OnVesselRecovered ( ProtoVessel data ) : void
OnVesselTerminated ( ProtoVessel data ) : void
SkewTime ( ) : void
Start ( ) : void
SyncTime ( ) : void
addRemoteVessel ( ProtoVessel protovessel, System.Guid vessel_id, KMPVessel kvessel = null, KMPVesselUpdate update = null, double distance = 501d ) : void
applyScenarioUpdate ( KMP.KMPScenarioUpdate update ) : void
applyScreenshotTexture ( byte image_data ) : IEnumerator
applyVesselUpdate ( KMPVesselUpdate vessel_update, KMPVessel vessel ) : void
beginFinishSync ( ) : void
chatWindow ( int windowID ) : void
chatWindowDX ( int windowID ) : void
checkOrbitForCollision ( Orbit orbit, double tick, double fromTick ) : bool
checkProtoNodeCrew ( ConfigNode protoNode ) : void
checkRemoteVesselIntegrity ( ) : void
checkVesselPrivacy ( Vessel vessel ) : void
clearCrewGUI ( ) : void
connectionButton ( String name ) : void
connectionWindow ( int windowID ) : void
dockedKickToTrackingStation ( ) : void
enforceWindowBoundaries ( Rect window ) : Rect
enqueueChatOutMessage ( String message ) : void
enqueuePluginInteropMessage ( KMPCommon id, byte data ) : void
finishInGameSync ( ) : void
finishSync ( ) : void
getKrakensbane ( ) : Krakensbane
getVesselDetail ( Vessel vessel ) : KMPVesselDetail
getVesselUpdate ( Vessel vessel, bool forceFullUpdate = false, bool idOnlyUpdate = false ) : KMPVesselUpdate
handleInteropMessage ( KMPCommon id, byte data ) : void
handleScenarioUpdate ( object obj ) : void
handleSyncTimeout ( ) : void
handleUpdate ( object obj ) : void
handleVesselUpdate ( KMPVesselUpdate vessel_update ) : void
infoDisplayWindow ( int windowID ) : void
isInSafetyBubble ( UnityEngine.Vector3d pos, CelestialBody body, double altitude ) : bool
isProtoVesselInSafetyBubble ( ProtoVessel protovessel ) : bool
kickToTrackingStation ( ) : void
killVessel ( Vessel vessel ) : void
killVesselOnNextUpdate ( Vessel vessel ) : IEnumerator
krakensBaneWarp ( double krakensTick ) : void
loadGlobalSettings ( ) : void
loadProtovessel ( Vessel oldVessel, Vector3 newWorldPos, Vector3 newOrbitVel, bool wasLoaded, bool wasActive, bool setTarget, ProtoVessel protovessel, System.Guid vessel_id, KMPVessel kvessel, KMPVesselUpdate update, double distance ) : IEnumerator
lockCrewGUI ( ) : void
lockWindow ( int windowID ) : void
processClientInterop ( ) : void
readIntFromStream ( KSP stream ) : Int32
removeDockedVessel ( Vessel vessel ) : void
removeKMPControlLocks ( ) : void
restoreVesselState ( Vessel vessel, Vector3 newWorldPos, Vector3 newOrbitVel ) : IEnumerator
returnToSpaceCenter ( ) : IEnumerator
returnToTrackingStation ( ) : IEnumerator
safeDelete ( String filename ) : void
saveGlobalSettings ( ) : void
screenshotWatchButton ( String name ) : void
screenshotWindow ( int windowID ) : void
sendInitialSyncRequest ( ) : void
sendRemoveVesselMessage ( Vessel vessel, bool isDocking = false ) : void
sendScenarios ( ) : void
sendSubspaceSyncRequest ( int subspace = -1, bool docking = false ) : IEnumerator
sendVesselMessage ( Vessel vessel, bool isDocking = false, int giveUp, bool forceActive = false ) : void
sendVesselMessageOnNextFixedUpdate ( Vessel vessel, bool isDocking = false, int giveUp ) : IEnumerator
setActiveVessel ( Vessel vessel, Vessel oldVessel ) : IEnumerator
setDockingTarget ( Vessel vessel ) : IEnumerator
setFinishDocking ( ) : void
setMidDocking ( ) : void
setNewVesselNotInPresent ( Vessel vessel ) : IEnumerator
setNotWarping ( ) : void
setPartOpacity ( Part part, float opacity ) : void
shareScreenshot ( ) : IEnumerator
statusArrayToInfo ( String status_array ) : VesselStatusInfo
syncExtantVesselOrbit ( KMPVessel kvessel, double fromTick, Vessel extant_vessel, double LAN ) : bool
syncOrbit ( KMPVessel kvessel, double fromTick, ProtoVessel protovessel, double LAN ) : ProtoVessel
unlockCrewGUI ( ) : void
vesselStatusLabels ( VesselStatusInfo status, bool big ) : void
writeIntToStream ( KSP stream, Int32 val ) : void
writePluginData ( ) : void
writePluginUpdate ( ) : void
writePrimaryUpdate ( ) : void
writeSecondaryUpdates ( ) : void
writeUpdates ( ) : void

Method Details

Awake() public method

public Awake ( ) : void
return void

HandleSyncCompleted() public method

public HandleSyncCompleted ( ) : void
return void

HandleSyncTimeCompleted() public method

public HandleSyncTimeCompleted ( byte data ) : void
data byte
return void

KMPManager() public method

public KMPManager ( ) : System
return System

OnGUI() public method

public OnGUI ( ) : void
return void

Update() public method

public Update ( ) : void
return void

acceptClientInterop() public method

public acceptClientInterop ( byte bytes ) : void
bytes byte
return void

disconnect() public method

public disconnect ( string message = "" ) : void
message string
return void

drawGUI() public method

public drawGUI ( ) : void
return void

getAnyKeyDown() public method

public getAnyKeyDown ( KeyCode &key ) : bool
key KeyCode
return bool

horizontalDistanceToSafetyBubbleEdge() public method

public horizontalDistanceToSafetyBubbleEdge ( ) : double
return double

updateStep() public method

public updateStep ( ) : void
return void

verticalDistanceToSafetyBubbleEdge() public method

public verticalDistanceToSafetyBubbleEdge ( ) : double
return double

Property Details

GameObjectInstance public static property

public static GameObject,UnityEngine GameObjectInstance
return UnityEngine.GameObject

LoadedModfiles public static property

public static List LoadedModfiles
return List

ShaFinishedEvent public static property

public static ManualResetEvent ShaFinishedEvent
return ManualResetEvent

activeVesselPosition public property

public Vector3 activeVesselPosition
return Vector3

delayForceQuit public property

public bool delayForceQuit
return bool

displayNTP public property

public bool displayNTP
return bool

dockingRelVel public property

public Dictionary dockingRelVel
return Vector3d>.Dictionary

encoder public property

public UnicodeEncoding,System.Text encoder
return System.Text.UnicodeEncoding

forceQuit public property

public bool forceQuit
return bool

gameArrr public property

public bool gameArrr
return bool

gameCheatsEnabled public property

public bool gameCheatsEnabled
return bool

gameMode public property

public int gameMode
return int

gameRunning public property

public bool gameRunning
return bool

gameStart public property

public bool gameStart
return bool

inactiveVesselsPerUpdate public property

public byte inactiveVesselsPerUpdate
return byte

interopInQueue public property

public Queue interopInQueue
return Queue

interopInQueueLock public static property

public static object interopInQueueLock
return object

ksc public property

public GameObject,UnityEngine ksc
return UnityEngine.GameObject

kscPosition public property

public Vector3d,UnityEngine kscPosition
return UnityEngine.Vector3d

lastSubspaceLockChange public property

public float lastSubspaceLockChange
return float

lastTick public property

public double lastTick
return double

listClientTimeWarpAverage public property

public float listClientTimeWarpAverage
return float

newFlags public property

public Dictionary newFlags
return float>.Dictionary

numberOfFilesToCheck public static property

public static int numberOfFilesToCheck
return int

numberOfShips public property

public int numberOfShips
return int

pauseMenu public property

public PauseMenu pauseMenu
return PauseMenu

planetariumCam public property

public PlanetariumCamera planetariumCam
return PlanetariumCamera

playerName public property

public String playerName
return String

playerStatus public property

public SortedDictionary playerStatus
return VesselStatusInfo>.SortedDictionary

renderManager public property

public RenderingManager renderManager
return RenderingManager

safetyBubbleRadius public property

public double safetyBubbleRadius
return double

sentVessels_Situations public property

public Dictionary sentVessels_Situations
return Vessel.Situations>.Dictionary

serverKerbals_AssignedKerbals public property

public Dictionary serverKerbals_AssignedKerbals
return string>.Dictionary

serverParts_CrewCapacity public property

public Dictionary serverParts_CrewCapacity
return int>.Dictionary

serverVessels_InPresent public property

public Dictionary serverVessels_InPresent
return bool>.Dictionary

serverVessels_InUse public property

public Dictionary serverVessels_InUse
return bool>.Dictionary

serverVessels_IsMine public property

public Dictionary serverVessels_IsMine
return bool>.Dictionary

serverVessels_IsPrivate public property

public Dictionary serverVessels_IsPrivate
return bool>.Dictionary

serverVessels_LastUpdateDistanceTime public property

public Dictionary> serverVessels_LastUpdateDistanceTime
return Dictionary>

serverVessels_LoadDelay public property

public Dictionary serverVessels_LoadDelay
return float>.Dictionary

serverVessels_ObtSyncDelay public property

public Dictionary serverVessels_ObtSyncDelay
return float>.Dictionary

serverVessels_PartCounts public property

public Dictionary serverVessels_PartCounts
return int>.Dictionary

serverVessels_Parts public property

public Dictionary> serverVessels_Parts
return List>.Dictionary

serverVessels_ProtoVessels public property

public Dictionary serverVessels_ProtoVessels
return ConfigNode>.Dictionary

serverVessels_RemoteID public property

public Dictionary serverVessels_RemoteID
return Guid>.Dictionary

serverVessels_RendezvousSmoothPos public property

public Dictionary> serverVessels_RendezvousSmoothPos
return Dictionary>

serverVessels_RendezvousSmoothVel public property

public Dictionary> serverVessels_RendezvousSmoothVel
return Dictionary>

serverVessels_SkippedRendezvousUpdates public property

public Dictionary serverVessels_SkippedRendezvousUpdates
return int>.Dictionary

showConnectionWindow public static property

public static bool showConnectionWindow
return bool

skewServerTime public property

public long skewServerTime
return long

skewSubspaceSpeed public property

public float skewSubspaceSpeed
return float

skewTargetTick public property

public double skewTargetTick
return double

terminateConnection public property

public bool terminateConnection
return bool

updateInterval public property

public float updateInterval
return float

vessels public property

public Dictionary vessels
return VesselEntry>.Dictionary