Add FRD::IsOnline

This commit is contained in:
wheremyfoodat 2023-09-24 18:09:33 +03:00
parent 7d55193087
commit 77fb6d8f0a
2 changed files with 12 additions and 0 deletions

View file

@ -32,6 +32,7 @@ class FRDService {
void getMyProfile(u32 messagePointer);
void getMyScreenName(u32 messsagePointer);
void hasLoggedIn(u32 messagePointer);
void isOnline(u32 messagePointer);
void logout(u32 messagePointer);
void setClientSDKVersion(u32 messagePointer);
void setNotificationMask(u32 messagePointer);

View file

@ -8,6 +8,7 @@
namespace FRDCommands {
enum : u32 {
HasLoggedIn = 0x00010000,
IsOnline = 0x00020000,
AttachToEventNotification = 0x00200002,
SetNotificationMask = 0x00210040,
SetClientSdkVersion = 0x00320042,
@ -41,6 +42,7 @@ void FRDService::handleSyncRequest(u32 messagePointer, FRDService::Type type) {
case FRDCommands::GetMyProfile: getMyProfile(messagePointer); break;
case FRDCommands::GetMyScreenName: getMyScreenName(messagePointer); break;
case FRDCommands::HasLoggedIn: hasLoggedIn(messagePointer); break;
case FRDCommands::IsOnline: isOnline(messagePointer); break;
case FRDCommands::Logout: logout(messagePointer); break;
case FRDCommands::SetClientSdkVersion: setClientSDKVersion(messagePointer); break;
case FRDCommands::SetNotificationMask: setNotificationMask(messagePointer); break;
@ -209,6 +211,15 @@ void FRDService::hasLoggedIn(u32 messagePointer) {
mem.write8(messagePointer + 8, loggedIn ? 1 : 0);
}
void FRDService::isOnline(u32 messagePointer) {
log("FRD::IsOnline\n");
mem.write32(messagePointer, IPC::responseHeader(0x2, 2, 0));
mem.write32(messagePointer + 4, Result::Success);
// TODO: When is this 0?
mem.write8(messagePointer + 8, 1);
}
void FRDService::logout(u32 messagePointer) {
log("FRD::Logout\n");
loggedIn = false;