2021-10-17 09:00:48 +02:00
|
|
|
#ifndef GUARD_MYSTERY_GIFT_LINK_H
|
|
|
|
#define GUARD_MYSTERY_GIFT_LINK_H
|
2019-04-02 14:43:16 +02:00
|
|
|
|
2021-10-15 18:56:14 +02:00
|
|
|
#define MG_LINK_BUFFER_SIZE 0x400
|
|
|
|
|
|
|
|
// Send/receive ids for the Client/Server to make sure
|
|
|
|
// they're sending/receiving the same thing
|
|
|
|
enum {
|
|
|
|
MG_LINKID_CLIENT_SCRIPT = 16,
|
|
|
|
MG_LINKID_GAME_DATA,
|
|
|
|
MG_LINKID_GAME_STAT,
|
|
|
|
MG_LINKID_RESPONSE,
|
|
|
|
MG_LINKID_READY_END,
|
|
|
|
MG_LINKID_DYNAMIC_MSG,
|
|
|
|
MG_LINKID_CARD,
|
|
|
|
MG_LINKID_NEWS,
|
|
|
|
MG_LINKID_STAMP,
|
|
|
|
MG_LINKID_RAM_SCRIPT,
|
|
|
|
MG_LINKID_EREADER_TRAINER,
|
|
|
|
MG_LINKID_UNK_1,
|
|
|
|
MG_LINKID_UNK_2,
|
|
|
|
};
|
2019-04-02 17:43:29 +02:00
|
|
|
|
2021-10-14 21:36:51 +02:00
|
|
|
struct MysteryGiftLink
|
2019-04-02 17:43:29 +02:00
|
|
|
{
|
2021-10-15 18:56:14 +02:00
|
|
|
s32 state;
|
|
|
|
u8 sendPlayerId;
|
|
|
|
u8 recvPlayerId;
|
2019-04-02 17:43:29 +02:00
|
|
|
u16 recvIdent;
|
|
|
|
u16 recvCounter;
|
|
|
|
u16 recvCRC;
|
|
|
|
u16 recvSize;
|
|
|
|
u16 sendIdent;
|
|
|
|
u16 sendCounter;
|
|
|
|
u16 sendCRC;
|
|
|
|
u16 sendSize;
|
2021-10-17 08:18:24 +02:00
|
|
|
void * recvBuffer;
|
|
|
|
const void * sendBuffer;
|
2021-10-14 21:36:51 +02:00
|
|
|
u32 (*recvFunc)(struct MysteryGiftLink *);
|
|
|
|
u32 (*sendFunc)(struct MysteryGiftLink *);
|
2019-04-02 17:43:29 +02:00
|
|
|
};
|
|
|
|
|
2021-10-17 08:18:24 +02:00
|
|
|
void MysteryGiftLink_Init(struct MysteryGiftLink * link, u32 sendPlayerId, u32 recvPlayerId);
|
|
|
|
void MysteryGiftLink_InitSend(struct MysteryGiftLink * link, u32 ident, const void * src, u32 size);
|
|
|
|
bool32 MysteryGiftLink_Recv(struct MysteryGiftLink * link);
|
|
|
|
bool32 MysteryGiftLink_Send(struct MysteryGiftLink * link);
|
|
|
|
void MysteryGiftLink_InitRecv(struct MysteryGiftLink * link, u32 ident, void * dest);
|
2019-04-02 14:43:16 +02:00
|
|
|
|
2021-10-17 09:00:48 +02:00
|
|
|
#endif //GUARD_MYSTERY_GIFT_LINK_H
|