Added FRD service serialization

This commit is contained in:
Hamish Milne 2019-12-26 19:09:55 +00:00 committed by zhupengfei
parent 4354179156
commit d1096de245
6 changed files with 44 additions and 2 deletions

2
TODO
View File

@ -77,7 +77,7 @@
✔ DLP @done(19-12-26 18:02) ✔ DLP @done(19-12-26 18:02)
✔ DSP @done(19-12-26 18:10) ✔ DSP @done(19-12-26 18:10)
✔ ERR @done(19-12-26 18:14) ✔ ERR @done(19-12-26 18:14)
☐ FRD ✔ FRD @done(19-12-26 19:09)
☐ FS ☐ FS
☐ GSP ☐ GSP
☐ HID ☐ HID

View File

@ -18,10 +18,28 @@ struct FriendKey {
u32 friend_id; u32 friend_id;
u32 unknown; u32 unknown;
u64 friend_code; u64 friend_code;
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int)
{
ar & friend_id;
ar & unknown;
ar & friend_code;
}
friend class boost::serialization::access;
}; };
struct MyPresence { struct MyPresence {
u8 unknown[0x12C]; u8 unknown[0x12C];
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int)
{
ar & unknown;
}
friend class boost::serialization::access;
}; };
struct Profile { struct Profile {
@ -130,13 +148,21 @@ public:
*/ */
void SetClientSdkVersion(Kernel::HLERequestContext& ctx); void SetClientSdkVersion(Kernel::HLERequestContext& ctx);
private: protected:
std::shared_ptr<Module> frd; std::shared_ptr<Module> frd;
}; };
private: private:
FriendKey my_friend_key = {0, 0, 0ull}; FriendKey my_friend_key = {0, 0, 0ull};
MyPresence my_presence = {}; MyPresence my_presence = {};
template <class Archive>
void serialize(Archive& ar, const unsigned int)
{
ar & my_friend_key;
ar & my_presence;
}
friend class boost::serialization::access;
}; };
void InstallInterfaces(Core::System& system); void InstallInterfaces(Core::System& system);

View File

@ -3,6 +3,9 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/frd/frd_a.h" #include "core/hle/service/frd/frd_a.h"
#include "common/archives.h"
SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_A)
namespace Service::FRD { namespace Service::FRD {

View File

@ -11,6 +11,11 @@ namespace Service::FRD {
class FRD_A final : public Module::Interface { class FRD_A final : public Module::Interface {
public: public:
explicit FRD_A(std::shared_ptr<Module> frd); explicit FRD_A(std::shared_ptr<Module> frd);
private:
SERVICE_SERIALIZATION(FRD_A, frd, Module)
}; };
} // namespace Service::FRD } // namespace Service::FRD
BOOST_CLASS_EXPORT_KEY(Service::FRD::FRD_A)
BOOST_SERIALIZATION_CONSTRUCT(Service::FRD::FRD_A)

View File

@ -3,6 +3,9 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/frd/frd_u.h" #include "core/hle/service/frd/frd_u.h"
#include "common/archives.h"
SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_U)
namespace Service::FRD { namespace Service::FRD {

View File

@ -11,6 +11,11 @@ namespace Service::FRD {
class FRD_U final : public Module::Interface { class FRD_U final : public Module::Interface {
public: public:
explicit FRD_U(std::shared_ptr<Module> frd); explicit FRD_U(std::shared_ptr<Module> frd);
private:
SERVICE_SERIALIZATION(FRD_U, frd, Module)
}; };
} // namespace Service::FRD } // namespace Service::FRD
BOOST_CLASS_EXPORT_KEY(Service::FRD::FRD_U)
BOOST_SERIALIZATION_CONSTRUCT(Service::FRD::FRD_U)