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 
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)
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 
35 {
36  float discreet[4];
38  float weight;
39 };
40 
43 {
45  bool reset = true;
46 };
47 
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 
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 };
ID_USER_PACKET_ENUM + 2.
D3DXVECTOR3 sumOfForces
bool reset
eventually this will be location, orientation, etc
ID_USER_PACKET_ENUM + 3.
unsigned char type
void Send(RakNet::RakPeerInterface *rak4Peers, SPacketSetting setting) const
ID_USER_PACKET_ENUM + 1.
ID_USER_PACKET_ENUM + 0.
float engineThrustPounds[2]
D3DXVECTOR3 location
PacketReliability reliability
PacketPriority priority