C# Class KMP.KMPClientMain

显示文件 Open project: TehGimp/KerbalMultiPlayer

Public Properties

Property Type Description
GAMEDATAPATH string
autoReconnect bool
chatThread Thread
clientDataLock object
clientID int
connectionThread Thread
currentBytesToReceive int
currentGameTitle String
currentMessage byte[]
currentMessageHeaderRecieved bool
currentMessageID KMPCommon.ServerMessageID
debugging bool
encoder UnicodeEncoding
endSession bool
favorites String[]>.Dictionary
gameManager KMPManager
handlingMessageType KMPCommon.ServerMessageID
handshakeCompleted bool
hostname String
inactiveShipsPerUpdate byte
intentionalConnectionEnd bool
interopInQueue Queue
interopOutQueueLock object
interopThread Thread
kmpModControl_bytes byte[]
lastClientDataChangeTime long
lastClientDataWriteTime long
lastKeepAliveSendTime long
lastScreenshotShareTime long
lastSharedScreenshot byte[]
lastTCPMessageSendTime long
lastUDPAckReceiveTime long
lastUDPMessageSendTime long
lastUDPProbeTime long
message String
modFileChecked bool
modFileList SHAMod>.Dictionary
modMismatchError string
partList List
pluginUpdateInQueue Queue
queuedOutScreenshot byte[]
quitHelperMessageShow bool
receivedMessageQueue Queue
receivedSettings bool
reconnectAttempts int
requiredModList List
resourceControlMode string
resourceList List
screenshotInterval int
screenshotOutLock object
screenshotSettings ScreenshotSettings
screenshotsWaiting List
sendOutgoingMessagesLock object
sendOutgoingUDPMessagesLock object
serverSettingsLock object
serverThread Thread
stopwatch Stopwatch
tcpClient TcpClient
textMessageQueue Queue
threadException Exception
threadExceptionLock object
threadExceptionStackTrace String
udpClient UdpClient
udpConnected bool
udpTimestampLock object
updateInterval int
watchPlayerName String

Public Methods

Method Description
Connect ( ) : void
GetFavorites ( ) : String[]>.Dictionary
GetUsername ( ) : String
InitMPClient ( KMPManager manager ) : void
SetAutoReconnect ( bool newAutoReconnect ) : void
SetFavorites ( String[]>.Dictionary newFavorites ) : void
SetMessage ( String newMessage ) : void
SetServer ( String newHostname ) : void
SetUsername ( String newUsername ) : void
acceptPluginInterop ( byte bytes ) : void
clearConnectionState ( ) : void
handleSplitMessage ( byte data ) : void
readConfigFile ( ) : void

Private Methods

Method Description
FileCheck ( ) : bool
ReceiveCallback ( IAsyncResult ar ) : void
asyncTCPSend ( IAsyncResult result ) : void
asyncUDPSend ( IAsyncResult result ) : void
beginAsyncRead ( ) : void
beginConnect ( ) : void
buildMessageByteArray ( KMPCommon id, byte data, byte prefix = null ) : byte[]
buildNewXML ( ) : string
connectionLoop ( ) : bool

Connect to the server and run a session until the connection ends

enqueueClientInteropMessage ( KMPCommon id, byte data ) : void
enqueuePluginChatMessage ( String message, bool print = false ) : void
enqueueTextMessage ( InTextMessage message, bool to_plugin = true ) : void
enqueueTextMessage ( String message, bool from_server = false, bool to_plugin = true, bool isMOTD = false ) : void
findCraftFilename ( String craft_name, KMPCommon &craft_type ) : String
getCraftFilename ( String craft_name, KMPCommon craft_type ) : String
getKMPDirectory ( ) : String
handleChat ( ) : void
handleChatInput ( String line ) : void
handleConnection ( ) : void
handleInteropMessage ( KMPCommon id, byte data ) : void
handleMessage ( KMPCommon id, byte data ) : void
handlePluginInterop ( ) : void
handlePluginUpdates ( ) : void
messageReceived ( KMPCommon id, byte data ) : void
modCheck ( byte kmpModControl_bytes ) : bool
parseModFile ( string ModFileContent ) : void
passExceptionToMain ( Exception e ) : void
processPluginInterop ( ) : void
queueOutgoingMessage ( KMPCommon id, byte data ) : void
queueOutgoingUDPMessage ( KMPCommon id, byte data ) : void
readTokenFile ( ) : void
resourceCheck ( ) : bool
safeAbort ( Thread thread, bool join = false ) : void
safeDelete ( String filename ) : void
sendConnectionEndMessage ( String message ) : void
sendHandshakeMessage ( ) : void
sendOutgoingMessages ( ) : void
sendOutgoingUDPMessages ( ) : void
sendPluginUpdate ( byte data, bool primary ) : void
sendScenarioUpdate ( byte data ) : void
sendScreenshotWatchPlayerMessage ( String name ) : void
sendShareCraftMessage ( String craft_name, byte data, KMPCommon type ) : void
sendShareScreenshotMessage ( byte data ) : void
sendTextMessage ( String message ) : void
sendUDPProbeMessage ( bool forceUDP ) : void
splitOutgoingMessage ( byte &next_message ) : void
startSaveExists ( ) : bool
syncTimeRewrite ( byte &next_message ) : void
verifyShipsDirectory ( ) : void
writeClientData ( ) : void
writeConfigFile ( ) : void

Method Details

Connect() public static method

public static Connect ( ) : void
return void

GetFavorites() public static method

public static GetFavorites ( ) : String[]>.Dictionary
return String[]>.Dictionary

GetUsername() public static method

public static GetUsername ( ) : String
return String

InitMPClient() public static method

public static InitMPClient ( KMPManager manager ) : void
manager KMPManager
return void

SetAutoReconnect() public static method

public static SetAutoReconnect ( bool newAutoReconnect ) : void
newAutoReconnect bool
return void

SetFavorites() public static method

public static SetFavorites ( String[]>.Dictionary newFavorites ) : void
newFavorites String[]>.Dictionary
return void

SetMessage() public static method

public static SetMessage ( String newMessage ) : void
newMessage String
return void

SetServer() public static method

public static SetServer ( String newHostname ) : void
newHostname String
return void

SetUsername() public static method

public static SetUsername ( String newUsername ) : void
newUsername String
return void

acceptPluginInterop() public static method

public static acceptPluginInterop ( byte bytes ) : void
bytes byte
return void

clearConnectionState() public static method

public static clearConnectionState ( ) : void
return void

handleSplitMessage() public static method

public static handleSplitMessage ( byte data ) : void
data byte
return void

readConfigFile() public static method

public static readConfigFile ( ) : void
return void

Property Details

GAMEDATAPATH public_oe static_oe property

public static string GAMEDATAPATH
return string

autoReconnect public_oe static_oe property

public static bool autoReconnect
return bool

chatThread public_oe static_oe property

public static Thread chatThread
return Thread

clientDataLock public_oe static_oe property

public static object clientDataLock
return object

clientID public_oe static_oe property

public static int clientID
return int

connectionThread public_oe static_oe property

public static Thread connectionThread
return Thread

currentBytesToReceive public_oe static_oe property

public static int currentBytesToReceive
return int

currentGameTitle public_oe static_oe property

public static String currentGameTitle
return String

currentMessage public_oe static_oe property

public static byte[] currentMessage
return byte[]

currentMessageHeaderRecieved public_oe static_oe property

public static bool currentMessageHeaderRecieved
return bool

currentMessageID public_oe static_oe property

public static KMPCommon.ServerMessageID currentMessageID
return KMPCommon.ServerMessageID

debugging public_oe static_oe property

public static bool debugging
return bool

encoder public_oe static_oe property

public static UnicodeEncoding encoder
return UnicodeEncoding

endSession public_oe static_oe property

public static bool endSession
return bool

favorites public_oe static_oe property

public static Dictionary favorites
return String[]>.Dictionary

gameManager public_oe static_oe property

public static KMPManager gameManager
return KMPManager

handlingMessageType public_oe static_oe property

public static KMPCommon.ServerMessageID handlingMessageType
return KMPCommon.ServerMessageID

handshakeCompleted public_oe static_oe property

public static bool handshakeCompleted
return bool

hostname public_oe static_oe property

public static String hostname
return String

inactiveShipsPerUpdate public_oe static_oe property

public static byte inactiveShipsPerUpdate
return byte

intentionalConnectionEnd public_oe static_oe property

public static bool intentionalConnectionEnd
return bool

interopInQueue public_oe static_oe property

public static Queue interopInQueue
return Queue

interopOutQueueLock public_oe static_oe property

public static object interopOutQueueLock
return object

interopThread public_oe static_oe property

public static Thread interopThread
return Thread

kmpModControl_bytes public_oe static_oe property

public static byte[] kmpModControl_bytes
return byte[]

lastClientDataChangeTime public_oe static_oe property

public static long lastClientDataChangeTime
return long

lastClientDataWriteTime public_oe static_oe property

public static long lastClientDataWriteTime
return long

lastKeepAliveSendTime public_oe static_oe property

public static long lastKeepAliveSendTime
return long

lastScreenshotShareTime public_oe static_oe property

public static long lastScreenshotShareTime
return long

lastSharedScreenshot public_oe static_oe property

public static byte[] lastSharedScreenshot
return byte[]

lastTCPMessageSendTime public_oe static_oe property

public static long lastTCPMessageSendTime
return long

lastUDPAckReceiveTime public_oe static_oe property

public static long lastUDPAckReceiveTime
return long

lastUDPMessageSendTime public_oe static_oe property

public static long lastUDPMessageSendTime
return long

lastUDPProbeTime public_oe static_oe property

public static long lastUDPProbeTime
return long

message public_oe static_oe property

public static String message
return String

modFileChecked public_oe static_oe property

public static bool modFileChecked
return bool

modFileList public_oe static_oe property

public static Dictionary modFileList
return SHAMod>.Dictionary

modMismatchError public_oe static_oe property

public static string modMismatchError
return string

partList public_oe static_oe property

public static List partList
return List

pluginUpdateInQueue public_oe static_oe property

public static Queue pluginUpdateInQueue
return Queue

queuedOutScreenshot public_oe static_oe property

public static byte[] queuedOutScreenshot
return byte[]

quitHelperMessageShow public_oe static_oe property

public static bool quitHelperMessageShow
return bool

receivedMessageQueue public_oe static_oe property

public static Queue receivedMessageQueue
return Queue

receivedSettings public_oe static_oe property

public static bool receivedSettings
return bool

reconnectAttempts public_oe static_oe property

public static int reconnectAttempts
return int

requiredModList public_oe static_oe property

public static List requiredModList
return List

resourceControlMode public_oe static_oe property

public static string resourceControlMode
return string

resourceList public_oe static_oe property

public static List resourceList
return List

screenshotInterval public_oe static_oe property

public static int screenshotInterval
return int

screenshotOutLock public_oe static_oe property

public static object screenshotOutLock
return object

screenshotSettings public_oe static_oe property

public static ScreenshotSettings screenshotSettings
return ScreenshotSettings

screenshotsWaiting public_oe static_oe property

public static List screenshotsWaiting
return List

sendOutgoingMessagesLock public_oe static_oe property

public static object sendOutgoingMessagesLock
return object

sendOutgoingUDPMessagesLock public_oe static_oe property

public static object sendOutgoingUDPMessagesLock
return object

serverSettingsLock public_oe static_oe property

public static object serverSettingsLock
return object

serverThread public_oe static_oe property

public static Thread serverThread
return Thread

stopwatch public_oe static_oe property

public static Stopwatch stopwatch
return Stopwatch

tcpClient public_oe static_oe property

public static TcpClient tcpClient
return TcpClient

textMessageQueue public_oe static_oe property

public static Queue textMessageQueue
return Queue

threadException public_oe static_oe property

public static Exception threadException
return Exception

threadExceptionLock public_oe static_oe property

public static object threadExceptionLock
return object

threadExceptionStackTrace public_oe static_oe property

public static String threadExceptionStackTrace
return String

udpClient public_oe static_oe property

public static UdpClient udpClient
return UdpClient

udpConnected public_oe static_oe property

public static bool udpConnected
return bool

udpTimestampLock public_oe static_oe property

public static object udpTimestampLock
return object

updateInterval public_oe static_oe property

public static int updateInterval
return int

watchPlayerName public_oe static_oe property

public static String watchPlayerName
return String