Avionics
Dropship Simulator
RakNetUserPackets.h
Go to the documentation of this file.
1
#include "D:/Rise Base/RakNet/Source/PacketPriority.h"
2
#include "D:/Rise Base/RakNet/Source/RakPeerInterface.h"
3
#include "D:/Rise Base/RakNet/Source/MessageIdentifiers.h"
4
5
// so base class which has unsigned char userEnum + whatever, reliability rules?
6
//... then extend class to include the crap I want, it all fits in a vector, it can be passed to "send"?
7
// SBasePacket
8
// unsigned char type;
9
// SControlSurfaces : SBasePacket
10
// all the other crap I want to send
11
// what maps it back for quick lookup?
12
// where can I store the rules for reliability, ordering, broadcasting
13
14
struct
SPacketSetting
15
{
16
size_t
bytes
;
17
PacketReliability
reliability
;
18
PacketPriority
priority
;
19
};
20
21
// data[0] matches ordinal index of packet layouts and settings (two arrays)
22
struct
SBasePacket
23
{
24
unsigned
char
type
;
// ID_USER_PACKET_ENUM + ordinal
25
26
void
Send
(RakNet::RakPeerInterface* rak4Peers,
SPacketSetting
setting)
const
27
{
28
char
ordinal =
type
- ID_USER_PACKET_ENUM;
29
rak4Peers->Send(reinterpret_cast<const char*>(
this
), setting.
bytes
, setting.
priority
, setting.
reliability
, ordinal, RakNet::UNASSIGNED_SYSTEM_ADDRESS,
true
);
30
}
31
};
32
34
struct
SControlSurfaces
:
SBasePacket
35
{
36
float
discreet
[4];
37
float
engineThrustPounds
[2];
38
float
weight
;
39
};
40
42
struct
SInitialData
:
SBasePacket
43
{
45
bool
reset
=
true
;
46
};
47
49
struct
SFromDisplay
:
SBasePacket
50
{
51
//D3DXQUATERNION orientation; // needed for server anyway, other ships...
52
//D3DXVECTOR3 velocity; // again, would be nice to send to server, other ships
53
// or
54
float
heading
,
pitchAttitude
,
rollAttitude
;
// attitude indicator, heading indicator
55
float
ias
,
aoa
,
fpa
;
56
57
D3DXVECTOR3
location
;
// determine altitude, lat/lng, difference in location is groundspeed
58
59
D3DXVECTOR3
sumOfForces
;
// used for motion platform, damage, accelleration/decelleration
60
61
float
fps
;
63
};
64
66
struct
SEvents
:
SBasePacket
67
{
68
int
eventType
= 0;
69
// 0 releases from platform
70
// 1 arms the hard deck
71
// 2 starts the music
72
// 3 stops the music
73
// 4-14 are turbulence levels (4 is off, 4 is level 10) +/- 3G from normal vertically and laterally ... frequency between 0.3 and 3 Hz?
74
};
SFromDisplay
ID_USER_PACKET_ENUM + 2.
Definition:
RakNetUserPackets.h:49
SFromDisplay::rollAttitude
float rollAttitude
Definition:
RakNetUserPackets.h:54
SControlSurfaces::weight
float weight
Definition:
RakNetUserPackets.h:38
SFromDisplay::sumOfForces
D3DXVECTOR3 sumOfForces
Definition:
RakNetUserPackets.h:59
SInitialData::reset
bool reset
eventually this will be location, orientation, etc
Definition:
RakNetUserPackets.h:45
SEvents
ID_USER_PACKET_ENUM + 3.
Definition:
RakNetUserPackets.h:66
SBasePacket
Definition:
RakNetUserPackets.h:22
SFromDisplay::fpa
float fpa
Definition:
RakNetUserPackets.h:55
SBasePacket::type
unsigned char type
Definition:
RakNetUserPackets.h:24
SBasePacket::Send
void Send(RakNet::RakPeerInterface *rak4Peers, SPacketSetting setting) const
Definition:
RakNetUserPackets.h:26
SInitialData
ID_USER_PACKET_ENUM + 1.
Definition:
RakNetUserPackets.h:42
SEvents::eventType
int eventType
Definition:
RakNetUserPackets.h:68
SControlSurfaces::discreet
float discreet[4]
Definition:
RakNetUserPackets.h:36
SControlSurfaces
ID_USER_PACKET_ENUM + 0.
Definition:
RakNetUserPackets.h:34
SControlSurfaces::engineThrustPounds
float engineThrustPounds[2]
Definition:
RakNetUserPackets.h:37
SFromDisplay::location
D3DXVECTOR3 location
Definition:
RakNetUserPackets.h:57
SFromDisplay::fps
float fps
Definition:
RakNetUserPackets.h:61
SFromDisplay::heading
float heading
Definition:
RakNetUserPackets.h:54
SPacketSetting::bytes
size_t bytes
Definition:
RakNetUserPackets.h:16
SPacketSetting::reliability
PacketReliability reliability
Definition:
RakNetUserPackets.h:17
SFromDisplay::ias
float ias
Definition:
RakNetUserPackets.h:55
SPacketSetting
Definition:
RakNetUserPackets.h:14
SFromDisplay::aoa
float aoa
Definition:
RakNetUserPackets.h:55
SPacketSetting::priority
PacketPriority priority
Definition:
RakNetUserPackets.h:18
SFromDisplay::pitchAttitude
float pitchAttitude
Definition:
RakNetUserPackets.h:54
RakNetUserPackets.h
Generated on Sat Feb 13 2021 09:30:43 for Avionics by
1.8.14