4 #include "D:/Rise Base/RakNet/Source/EmailSender.h" 18 rak4Peers = RakPeerInterface::GetInstance();
23 if (result == StartupResult::RAKNET_STARTED)
27 sprintf_s(msg, 99,
"RakNet::ctor Ready to accept peer connection(s) on port: %i",
config->
clientPort);
29 sprintf_s(msg, 99,
"RakNet::ctor MTU size: %i",
rak4Peers->GetMTUSize(
serverC));
50 ::RakNet::RakPeerInterface::DestroyInstance(
rak4Peers);
55 static float timeSinceLastEmail = 60.0f;
56 timeSinceLastEmail += fElapsed;
61 if (command.
delay != 0.0f)
continue;
63 if (command.
name ==
"SendEmail" && timeSinceLastEmail >= 60.0f)
68 else if (command.
name ==
"Display-Reset")
73 else if (command.
name ==
"Display-Event")
76 cs.
type = ID_USER_PACKET_ENUM + 3;
81 else if (command.
ivalue == 2)
86 setting.
priority = PacketPriority::HIGH_PRIORITY;
98 if (
p->data[0] == ID_NEW_INCOMING_CONNECTION)
101 sprintf_s(msg, 199,
"RakNet::RakNetMessageHandler ID_NEW_INCOMING_CONNECTION: %s",
p->systemAddress.ToString());
110 else if (
p->systemAddress ==
serverC)
116 static float timeSinceControlUpdate = 0.0f;
117 timeSinceControlUpdate += fElapsed;
118 if (timeSinceControlUpdate >= 0.1f)
120 timeSinceControlUpdate = 0.0f;
124 cs.
type = ID_USER_PACKET_ENUM + 0;
134 setting.
priority = PacketPriority::MEDIUM_PRIORITY;
135 setting.
reliability = PacketReliability::UNRELIABLE_SEQUENCED;
147 case ID_CONNECTION_LOST:
148 sprintf_s(msg, 199,
"RakNet::RakNetMessageHandler ID_CONNECTION_LOST: %s",
p->systemAddress.ToString());
150 displayC = UNASSIGNED_SYSTEM_ADDRESS;
152 case ID_DISCONNECTION_NOTIFICATION:
153 sprintf_s(msg, 199,
"RakNet::RakNetMessageHandler ID_DISCONNECTION_NOTIFICATION: %s",
p->systemAddress.ToString());
155 displayC = UNASSIGNED_SYSTEM_ADDRESS;
157 case ID_USER_PACKET_ENUM + 2:
202 sprintf_s(msg, 999,
"RakNet::SendEmail Disabled, would have sent email: %s", subject.c_str());
208 sprintf_s(msg, 999,
"RakNet::SendEmail Sending message: %s", subject.c_str());
213 logger->
Log(
"RakNet::SendEmail Detached as asynchronous thread...");
221 EmailSender* emailSender = EmailSender::GetInstance();
222 const char* sendResult = emailSender->Send(
234 if (sendResult !=
nullptr)
237 sprintf_s(msg, 999,
"RakNet::AsyncEmailSender Send failed: %s", sendResult);
242 logger->
Log(
"RakNet::AsyncEmailSender Sent successfully!");
244 EmailSender::DestroyInstance(emailSender);
250 cs.
type = ID_USER_PACKET_ENUM + 1;
255 setting.
priority = PacketPriority::HIGH_PRIORITY;
float EngineThrustOutput[enginesC]
(9) Thrust/power of each engine—primary flight crew reference;
void SendEmail(std::string subject, std::string body="", int severity=0)
void RakNetMessageHandlerPeer()
std::vector< Command > commandStream
float IndicatedAirspeed
(3) Indicated Airspeed in km per second?
bool reset
eventually this will be location, orientation, etc
float PitchAttitude
(6) Pitch attitude;
okay, the portable keyboard numbers don't work like the outside keypad because the outside keypad is ...
void Initialize(Logger *, RakNetConfig *, Bus *)
float HeadingTrue
(4) Heading–primary flight crew reference (if selectable, record discrete, true or magnetic); ...
std::string recipientEmail
std::string name
command name
D3DXVECTOR3 NormalAcceleration
(5) vertical (11) longitudinal (18) lateral
float RollAttitude
(7) Roll attitude;
float GrossWeight() const
pounds
float DiscreetSurfacePostion[4]
void AsyncEmailSender(std::string subject, std::string body="", int severity=0) const
void Send(RakNet::RakPeerInterface *rak4Peers, SPacketSetting setting) const
std::string recipientName
void Log(const char *msg, Level level=Info, int errorCode=0)
These have to be in this order.
float engineThrustPounds[2]
PacketReliability reliability
float delay
wait number of seconds before executing command
void SendInitialData() const
static bool Replace(std::string &str, const std::string &from, const std::string &to)
RakPeerInterface * rak4Peers