Migration services: Difference between revisions

 
(3 intermediate revisions by the same user not shown)
Line 121: Line 121:
== CreateSaveDataMigrationClient ==
== CreateSaveDataMigrationClient ==
Takes an input u32 tmem_size, a type-0x19 input buffer containing a [[#ClientProfile|ClientProfile]], a TransferMemory handle, returns an [[#IClient_2|IClient]].
Takes an input u32 tmem_size, a type-0x19 input buffer containing a [[#ClientProfile|ClientProfile]], a TransferMemory handle, returns an [[#IClient_2|IClient]].
The tmem_size must be at least 0x50EA80.


== ResumeSaveDataMigrationClient ==
== ResumeSaveDataMigrationClient ==
Line 1,018: Line 1,020:
= Protocol =
= Protocol =
Once connected with [[LDN_services|ldn]], the client node connects to the server with TCP port 441.
Once connected with [[LDN_services|ldn]], the client node connects to the server with TCP port 441.
With [20.0.0+] [[LDN_services|ldn]] SetProtocol is used with a state field (Protocol3). It's unknown whether the protocol changes later during S2-only savedata transfer.


== AdvertiseData ==
== AdvertiseData ==
Line 1,579: Line 1,583:
The client sends this via [[#TransferNextAsync|TransferNextAsync]] if a state flag is not set, prior to temporarily disconnecting from the network for using network request [[Network|transfer_events/%lld/save_datas/%lld/generate_key_seed_package]].
The client sends this via [[#TransferNextAsync|TransferNextAsync]] if a state flag is not set, prior to temporarily disconnecting from the network for using network request [[Network|transfer_events/%lld/save_datas/%lld/generate_key_seed_package]].


The request only contains the 0x4-byte header. The bool at header+0x1 (after DataMessageId) is set to <code>statefield==other_statefield</code>. This bool indicates whether the previously mentioned network request is used.
The request only contains the 0x4-byte header. The bool at header+0x1 (after DataMessageId) is set to <code>statefield==other_statefield</code>. This bool indicates whether the previously mentioned network request is used, with false indicating the request is used.


The response only contains the 0x4-byte header.
The response only contains the 0x4-byte header.
Line 1,601: Line 1,605:
! Offset || Size || Description
! Offset || Size || Description
|-
|-
| 0x0 || 0x20 ||  
| 0x0 || 0x20 || Below struct.
|-
|-
| 0x20 || 0x200 || [[Filesystem_services|LocalKeySeedPackage]]
| 0x20 || 0x200 || [[Filesystem_services|LocalKeySeedPackage]]
|}
The 0x20-byte struct has the following layout:
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x8 || 0x8 || InitialDataVersion2 size
|-
| 0x18 || 0x8 || Size
|}
|}


Line 1,622: Line 1,637:
The remaining messages contain the transfer payload.
The remaining messages contain the transfer payload.


With savedata the transfer payload is the output from exporting savedata from [[Filesystem_services|ISaveDataTransferManagerWithDivision]], which the client then imports.
The transfer payload is the output from exporting savedata from [[Filesystem_services|ISaveDataTransferManagerWithDivision]], which the client then imports. This begins with the [[Filesystem_services|InitialDataVersion2]] (with size from [[#PrepareTransfer2|PrepareTransfer2]]), with the rest being the savedata-export.


==== SynchronizeState ====
==== SynchronizeState ====