diff options
| author | 2019-04-28 19:00:36 -0400 | |
|---|---|---|
| committer | 2019-09-30 17:23:26 -0400 | |
| commit | 102db206e0cf8c0332e6ec0c2c6f4fa8c7d4f05c (patch) | |
| tree | a8d974d37843f274cca1284a114b23b59edf669a | |
| parent | bcat: Implement cmd 30100 SetPassphrase (diff) | |
| download | yuzu-102db206e0cf8c0332e6ec0c2c6f4fa8c7d4f05c.tar.gz yuzu-102db206e0cf8c0332e6ec0c2c6f4fa8c7d4f05c.tar.xz yuzu-102db206e0cf8c0332e6ec0c2c6f4fa8c7d4f05c.zip | |
bcat: Implement cmd 90201 ClearDeliveryCacheStorage
Takes a title ID and simply deletes all the data for that title ID's bcat. Invokes the respective backend command.
| -rw-r--r-- | src/core/hle/service/bcat/module.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index cbda8e0d3..9244c265a 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp | |||
| @@ -157,7 +157,7 @@ public: | |||
| 157 | {30203, nullptr, "UnblockDeliveryTask"}, | 157 | {30203, nullptr, "UnblockDeliveryTask"}, |
| 158 | {90100, nullptr, "EnumerateBackgroundDeliveryTask"}, | 158 | {90100, nullptr, "EnumerateBackgroundDeliveryTask"}, |
| 159 | {90200, nullptr, "GetDeliveryList"}, | 159 | {90200, nullptr, "GetDeliveryList"}, |
| 160 | {90201, nullptr, "ClearDeliveryCacheStorage"}, | 160 | {90201, &IBcatService::ClearDeliveryCacheStorage, "ClearDeliveryCacheStorage"}, |
| 161 | {90300, nullptr, "GetPushNotificationLog"}, | 161 | {90300, nullptr, "GetPushNotificationLog"}, |
| 162 | }; | 162 | }; |
| 163 | // clang-format on | 163 | // clang-format on |
| @@ -252,6 +252,28 @@ private: | |||
| 252 | rb.Push(RESULT_SUCCESS); | 252 | rb.Push(RESULT_SUCCESS); |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) { | ||
| 256 | IPC::RequestParser rp{ctx}; | ||
| 257 | const auto title_id = rp.PopRaw<u64>(); | ||
| 258 | |||
| 259 | LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id); | ||
| 260 | |||
| 261 | if (title_id == 0) { | ||
| 262 | LOG_ERROR(Service_BCAT, "Invalid title ID!"); | ||
| 263 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 264 | rb.Push(ERROR_INVALID_ARGUMENT); | ||
| 265 | return; | ||
| 266 | } | ||
| 267 | |||
| 268 | if (!backend.Clear(title_id)) { | ||
| 269 | LOG_ERROR(Service_BCAT, "Could not clear the directory successfully!"); | ||
| 270 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 271 | rb.Push(ERROR_FAILED_CLEAR_CACHE); | ||
| 272 | return; | ||
| 273 | } | ||
| 274 | |||
| 275 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 276 | rb.Push(RESULT_SUCCESS); | ||
| 255 | } | 277 | } |
| 256 | 278 | ||
| 257 | Backend& backend; | 279 | Backend& backend; |