2022-06-16 21:33:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sead/math/seadVector.h"
|
|
|
|
#include "sead/math/seadQuat.h"
|
|
|
|
|
|
|
|
#include "nn/account.h"
|
|
|
|
|
2022-06-22 17:16:08 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
2022-06-16 21:33:18 +00:00
|
|
|
#define PACKBUFSIZE 0x30
|
|
|
|
#define COSTUMEBUFSIZE 0x20
|
|
|
|
|
2022-10-27 10:22:01 +00:00
|
|
|
#define MAXPACKSIZE 0x100
|
2022-06-16 21:33:18 +00:00
|
|
|
|
|
|
|
enum PacketType : short {
|
|
|
|
UNKNOWN,
|
|
|
|
CLIENTINIT,
|
|
|
|
PLAYERINF,
|
|
|
|
HACKCAPINF,
|
|
|
|
GAMEINF,
|
|
|
|
TAGINF,
|
|
|
|
PLAYERCON,
|
|
|
|
PLAYERDC,
|
|
|
|
COSTUMEINF,
|
|
|
|
SHINECOLL,
|
|
|
|
CAPTUREINF,
|
|
|
|
CHANGESTAGE,
|
2022-08-10 21:11:52 +00:00
|
|
|
CMD,
|
2022-09-03 08:57:57 +00:00
|
|
|
UDPINIT,
|
2022-09-05 10:19:33 +00:00
|
|
|
HOLEPUNCH,
|
2022-08-10 21:11:52 +00:00
|
|
|
End // end of enum for bounds checking
|
2022-06-16 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// attribute otherwise the build log is spammed with unused warnings
|
2022-06-22 17:16:08 +00:00
|
|
|
USED static const char *packetNames[] = {
|
2022-06-16 21:33:18 +00:00
|
|
|
"Unknown",
|
2022-06-22 17:16:34 +00:00
|
|
|
"Client Initialization",
|
2022-06-16 21:33:18 +00:00
|
|
|
"Player Info",
|
|
|
|
"Player Cap Info",
|
|
|
|
"Game Info",
|
|
|
|
"Tag Info",
|
|
|
|
"Player Connect",
|
|
|
|
"Player Disconnect",
|
|
|
|
"Costume Info",
|
|
|
|
"Moon Collection",
|
|
|
|
"Capture Info",
|
2022-06-22 17:16:34 +00:00
|
|
|
"Change Stage",
|
2022-09-05 10:19:33 +00:00
|
|
|
"Server Command",
|
|
|
|
"Udp Initialization",
|
|
|
|
"Hole punch",
|
2022-06-16 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum SenderType {
|
|
|
|
SERVER,
|
|
|
|
CLIENT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ConnectionTypes {
|
|
|
|
INIT,
|
|
|
|
RECONNECT
|
|
|
|
};
|
|
|
|
|
|
|
|
// unused
|
|
|
|
/*
|
|
|
|
static const char *senderNames[] = {
|
|
|
|
"Server",
|
|
|
|
"Client"
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
|
2022-06-22 17:16:08 +00:00
|
|
|
struct PACKED Packet {
|
2022-06-16 21:33:18 +00:00
|
|
|
nn::account::Uid mUserID; // User ID of the packet owner
|
|
|
|
PacketType mType = PacketType::UNKNOWN;
|
|
|
|
short mPacketSize = 0; // represents packet size without size of header
|
|
|
|
};
|
|
|
|
|
|
|
|
// all packet types
|
|
|
|
|
|
|
|
#include "packets/PlayerInfPacket.h"
|
|
|
|
#include "packets/PlayerConnect.h"
|
|
|
|
#include "packets/PlayerDC.h"
|
|
|
|
#include "packets/GameInf.h"
|
|
|
|
#include "packets/TagInf.h"
|
|
|
|
#include "packets/CostumeInf.h"
|
|
|
|
#include "packets/ServerCommand.h"
|
|
|
|
#include "packets/ShineCollect.h"
|
|
|
|
#include "packets/CaptureInf.h"
|
|
|
|
#include "packets/HackCapInf.h"
|
|
|
|
#include "packets/ChangeStagePacket.h"
|
2022-09-03 08:57:57 +00:00
|
|
|
#include "packets/InitPacket.h"
|
|
|
|
#include "packets/UdpPacket.h"
|
2022-09-05 10:19:33 +00:00
|
|
|
#include "packets/HolePunchPacket.h"
|