User Tools

Site Tools


gamedev:remotelaunching:networkprotocol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gamedev:remotelaunching:networkprotocol [2024/11/19 15:22] – [File Data Received] dragonlordgamedev:remotelaunching:networkprotocol [2024/12/09 13:30] (current) dragonlord
Line 52: Line 52:
 ===== Response File Layout ===== ===== Response File Layout =====
  
-Send by the client in response to a [[#request_file_layout|Request File Layout]] message containing the scanned file layout. For each file one message is sent. The message is send reliable and has this format:+Send by the client in response to a [[#request_file_layout|Request File Layout]] message containing the scanned file layout. The message is send reliable and has this format:
  
 ^  Type  ^  Name  ^  Description  ^ ^  Type  ^  Name  ^  Description  ^
 | [[gamedev:dnp#data_types|Byte]] | Code  | Message code. Is value ''4'' | | [[gamedev:dnp#data_types|Byte]] | Code  | Message code. Is value ''4'' |
-| [[gamedev:dnp#data_types|Byte]] | Flags <WRAP>Flags. Can be a combination of one or more of these bits: +| [[gamedev:dnp#data_types|UInt]] | Count Count of file entries| 
-  * ''1'': Finish file layout+| FileInfo | Files[Count] | File information. | 
-  * ''2'': File layout is empty. The file information contained in this message is invalidUsed together with ''1''. +|  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. 
-</WRAP> |+ 
 +Where ''FileInfo'' is: 
 +^  Type  ^  Name  ^  Description  ^
 | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. | | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. |
 | [[gamedev:dnp#data_types|ULong]] | Size | File size in bytes. | | [[gamedev:dnp#data_types|ULong]] | Size | File size in bytes. |
 | [[gamedev:dnp#data_types|String8]] | Hash | Hash of file (SHA-256). | | [[gamedev:dnp#data_types|String8]] | Hash | Hash of file (SHA-256). |
-|  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | 
  
 ===== Request File Block Hashes ===== ===== Request File Block Hashes =====
Line 78: Line 79:
 ===== Response File Block Hashes ===== ===== Response File Block Hashes =====
  
-Send by the client in response to a [[#request_file_block_hashes|Request File Block Hashes]] message containing the file block hashes. Each message contains one block. The blocks are send in order from first to last. The message is send reliable and has this format:+Send by the client in response to a [[#request_file_block_hashes|Request File Block Hashes]] message containing the file block hashes. The message is send reliable and has this format:
  
 ^  Type  ^  Name  ^  Description  ^ ^  Type  ^  Name  ^  Description  ^
 | [[gamedev:dnp#data_types|Byte]] | Code  | Message code. Is value ''6'' | | [[gamedev:dnp#data_types|Byte]] | Code  | Message code. Is value ''6'' |
 | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. | | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. |
-| [[gamedev:dnp#data_types|Byte]] | Flags <WRAP>Flags. Can be a combination of one or more of these bits: +| [[gamedev:dnp#data_types|UInt]] | Count Count of blocks. | 
-  * 1: Finish block hashes. +BlockInfo Blocks[Count] | Blocks in file order. |
-  * 2: No blocks. The block information contained in this message is invalid. Used together with 1. +
-</WRAP> +
-[[gamedev:dnp#data_types|UInt]] | Index | Index of block. | +
-| [[gamedev:dnp#data_types|String8]] | Hash | Block hash (SHA-256). |+
 |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
 +
 +Where ''BlockInfo'' is:
 +^  Type  ^  Name  ^  Description  ^
 +| [[gamedev:dnp#data_types|String8]] | Hash | Block hash (SHA-256). |
  
 ===== Request Delete File ===== ===== Request Delete File =====
Line 127: Line 128:
 |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
  
-The client has to mark the file as in progress for writing. If the file size is shorter than the existing file the file has to be truncated. File writing has to be done in overwrite mode hence the file content is retained. This allows updating only ranges of data inside large files. Data to write is send using unreliable [[#send_file_data|Send File Data]] messages.+The client has to mark the file as in progress for writing. If the file size is shorter than the existing file the file has to be truncated. File writing has to be done in overwrite mode hence the file content is retained. This allows updating only ranges of data inside large files. Data to write is send using reliable [[#send_file_data|Send File Data]] messages.
  
 Once ready the client has to send back a [[#response_write_file|Response Write File]]. Once ready the client has to send back a [[#response_write_file|Response Write File]].
Line 146: Line 147:
 ===== Send File Data ===== ===== Send File Data =====
  
-Message send by the server to client with data to write to a file. For each part of the block a message is send. Parts are send in order from first to last. The message is send reliable and has this format:+Message send by the server to client with data to write to a file. For each block a message is send. Blocks are send in order from first to last. The message is send reliable and has this format:
  
 ^  Type ^  Name  ^  Description  ^ ^  Type ^  Name  ^  Description  ^
Line 152: Line 153:
 | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. | | [[gamedev:dnp#data_types|String16]] | Path | File path relative to root of data directory. |
 | [[gamedev:dnp#data_types|UInt]] | Block | Index of block to write the data to. | | [[gamedev:dnp#data_types|UInt]] | Block | Index of block to write the data to. |
-| [[gamedev:dnp#data_types|UInt]] | Part | Index of part to write the data to. | +| [[gamedev:dnp#data_types|Byte]][*] | Data | Remaining bytes in the message is the data to write to the block. |
-| [[gamedev:dnp#data_types|Byte]] | Flags | <WRAP>Flags. Can be a combination of one or more of these bits: +
-  * 1: Finish block. +
-  * 2: Notify server about receiving this part. Used by server to know when it can send the next batch of parts to not saturate the client receive buffer. +
-</WRAP>+
-| [[gamedev:dnp#data_types|Byte]][*] | Data | Remaining bytes in the message is the data to write to the part. |+
  
 Receiving and processing the message (successful or not) requires the client to send a [[#file_data_received|File Data Received]] message. Receiving and processing the message (successful or not) requires the client to send a [[#file_data_received|File Data Received]] message.
- 
-Sending file data is split into multiple parts per block. This allows sending smaller messages without fragmentation for faster delivery. The default part size is 1357 (ConnectionPartSize). The actual offset to write the data too is then ''File[Path].Blocks[Block].Offset + PartIndex * ConnectionPartSize''. 
 ===== File Data Received ===== ===== File Data Received =====
  
-Send by the client after receiving a [[#send_file_data|Send File Data]] message with the finish or batch flag set. Using this message the server knows which ''Send File Data'' messages have arrive and which have been successfully been written. The message is send reliable and has this format:+Send by the client after receiving a [[#send_file_data|Send File Data]] message. The message is send reliable and has this format:
  
 ^  Type  ^  Name  ^  Description  ^ ^  Type  ^  Name  ^  Description  ^
Line 183: Line 177:
 | [[gamedev:dnp#data_types|Byte]] | Code | Message code. Is value ''13'' | | [[gamedev:dnp#data_types|Byte]] | Code | Message code. Is value ''13'' |
 | [[gamedev:dnp#data_types|String16]] | Path | Path relative to root of data directory to finish writing. | | [[gamedev:dnp#data_types|String16]] | Path | Path relative to root of data directory to finish writing. |
 +| [[gamedev:dnp#data_types|String8]] | Hash | Hash of file (SHA-256) to verify file synchronized correctly. |
 |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
  
Line 199: Line 194:
   * ''0'': File has been successfully written.   * ''0'': File has been successfully written.
   * ''1'': Writing file failed.   * ''1'': Writing file failed.
 +  * ''2'': After write file hash verification failed.
 Additional result codes can be added in the future. Servers have to consider all values except ''0'' as a failure.</WRAP> | Additional result codes can be added in the future. Servers have to consider all values except ''0'' as a failure.</WRAP> |
 |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
Line 239: Line 235:
 | [[gamedev:dnp#data_types|String8]] | Timestamp | Timestamp in text form. | | [[gamedev:dnp#data_types|String8]] | Timestamp | Timestamp in text form. |
 | [[gamedev:dnp#data_types|String16]] | Message | Log message. | | [[gamedev:dnp#data_types|String16]] | Message | Log message. |
 +|  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
 +
 +
 +===== Request System Property =====
 +
 +Send by the server to request information about the system the client is running on. The server indicates which property to query. The client has to return the requested property value if it is supported and the value can be determined. Otherwise the client has to return an empty response. The message is send reliable and has this format:
 +
 +^  Type ^  Name  ^  Description  ^
 +| [[gamedev:dnp#data_types|Byte]] | Code | Message code. Is value ''18'' |
 +| [[gamedev:dnp#data_types|String8]] | Property | <WRAP>Name of property to query. Can be one of these values:
 +  * ''properties.names'': List of all properties supported by the client. The server can safely query any of these properties. This is the only property name the client has to support.
 +  * ''profiles.names'': List of launcher profile names. 
 +  * ''profiles.default'': Name of default profile or empty string if there is none.
 +Additional property names can be added in the future. Applications can define custom property names. Clients have to return empty value for unknown properties.</WRAP> |
 +|  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
 +
 +The client sends back a [[#response_system_property|Response System Property]] message.
 +
 +===== Response System Property =====
 +
 +Send by the client in response to a [[#request_system_property|Request System Property]] message. The response contains the property value if the client supports the property and can determine the value. Otherwise the client sends an response with empty data. The message is send reliable and has this format:
 +
 +^  Type  ^  Name  ^  Description  ^
 +| [[gamedev:dnp#data_types|Byte]] | Code  | Message code. Is value ''19'' |
 +| [[gamedev:dnp#data_types|String8]] | Property | Same value as ''Property'' in request. |
 +| [[gamedev:dnp#data_types|Strgin16]] | PropertyData | <WRAP>Value of property depending of type or empty if not supported.
 +The length and format of ''PropertyData'' depends on the property type.
 +  * ''properties.names'': Newline separated list of property names. For example ''Profile A\nProfile B''.
 +  * ''profiles.names'': Newline separated list of profile names. For example ''Profile A\nProfile B''.
 +  * ''profiles.default'': Name of default profile or empty string if there is none.
 +Additional property names can be added in the future. Applications can define custom property names. Clients have to return empty value for unknown properties.</WRAP> |
 +|  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
 +
 +===== Keep-Alive =====
 +
 +Send by the server and the client to verify the other side is still alive. This catches situations where the other side crashed or the network connection between the two sides ruptured. This messages requires no response since it is send reliable. Failure to receive it closes the connection. The message has this format:
 +
 +^  Type ^  Name  ^  Description  ^
 +| [[gamedev:dnp#data_types|Byte]] | Code | Message code. Is value ''20'' |
 |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. | |  -  | Reserved | Reserved for future expansion. Ignore any additional bytes in the message. |
  
gamedev/remotelaunching/networkprotocol.1732029748.txt.gz · Last modified: 2024/11/19 15:22 by dragonlord