mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 21:06:58 -05:00
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.
This commit is contained in:
parent
1bde5a3c6a
commit
102db206e0
1 changed files with 23 additions and 1 deletions
|
@ -157,7 +157,7 @@ public:
|
|||
{30203, nullptr, "UnblockDeliveryTask"},
|
||||
{90100, nullptr, "EnumerateBackgroundDeliveryTask"},
|
||||
{90200, nullptr, "GetDeliveryList"},
|
||||
{90201, nullptr, "ClearDeliveryCacheStorage"},
|
||||
{90201, &IBcatService::ClearDeliveryCacheStorage, "ClearDeliveryCacheStorage"},
|
||||
{90300, nullptr, "GetPushNotificationLog"},
|
||||
};
|
||||
// clang-format on
|
||||
|
@ -252,6 +252,28 @@ private:
|
|||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id);
|
||||
|
||||
if (title_id == 0) {
|
||||
LOG_ERROR(Service_BCAT, "Invalid title ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERROR_INVALID_ARGUMENT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!backend.Clear(title_id)) {
|
||||
LOG_ERROR(Service_BCAT, "Could not clear the directory successfully!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERROR_FAILED_CLEAR_CACHE);
|
||||
return;
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
Backend& backend;
|
||||
|
|
Loading…
Reference in a new issue