diff --git a/Resources/XPMP2.example.prf b/Resources/XPMP2.example.prf
index b342328..4dfebee 100644
--- a/Resources/XPMP2.example.prf
+++ b/Resources/XPMP2.example.prf
@@ -89,6 +89,15 @@ remoteMCGroup 239.255.1.1
# Port used for communication between XPMP2 masters and the Remote Client.
remotePort 49788
+# Interface to _send_ multicast on.
+# Auto-discovery is used if option is not defined (commented out).
+# Define an interface by numeric interface index or its interface name.
+# If the defined interface name cannot be resolved you'll find a list
+# of available interface names output to Log.txt after the respective ERROR line.
+# Examples:
+# remoteSendIntf Ethernet
+# remoteSendIntf en0
+
# TTL (Time-to-live) for multicast packets, ie. max number of hops they across routers they take
remoteTTL 8
diff --git a/docs/html/Network_8cpp.html b/docs/html/Network_8cpp.html
index cc5043a..ec41531 100644
--- a/docs/html/Network_8cpp.html
+++ b/docs/html/Network_8cpp.html
@@ -84,6 +84,12 @@
std::string | XPMP2::_NetwGetIntfName (uint32_t idx, uint8_t family) |
| Get an interface's name. More...
|
|
+LocalIntfAddrTy | XPMP2::_NetwFindLocalIntf (const std::string &intf, uint8_t family) |
+ | Find a matching local interface based on name and family. More...
|
+ |
+std::string | XPMP2::_NetwGetInterfaceNames (uint8_t family) |
+ | Return list of interface names of given family. More...
|
+ |
void | XPMP2::_NetwGetLocalAddresses (bool bForceRefresh=false) |
| Fetch all local addresses and cache locally. More...
|
|
diff --git a/docs/html/Network_8h_source.html b/docs/html/Network_8h_source.html
index 36bd968..09f3637 100644
--- a/docs/html/Network_8h_source.html
+++ b/docs/html/Network_8h_source.html
@@ -81,7 +81,7 @@
-
+
@@ -190,178 +190,180 @@
- 210 UDPMulticast(
const std::string& _multicastAddr,
int _port,
int _ttl=8,
- 211 size_t _bufSize = 512,
unsigned _timeOut_ms = 0);
-
-
-
-
- 220 void Join (
const std::string& _multicastAddr,
int _port,
int _ttl=8,
- 221 size_t _bufSize = 512,
unsigned _timeOut_ms = 0);
-
-
-
-
-
-
-
-
-
- 239 size_t SendMC (
const void* _bufSend,
size_t _bufSendSize);
-
- 247 size_t RecvMC (
bool bSwitchToRecvIntf,
- 248 std::string* _pFromAddr =
nullptr,
-
- 250 bool* _pbIntfChanged =
nullptr);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 269 #if APL == 1 || LIN == 1
-
-
-
-
-
-
- 279 unsigned _timeOut_ms = 0) :
-
-
- 282 virtual void Close();
-
-
- 285 void listen (
int numConnections = 1);
- 286 bool accept (
bool bUnlisten =
false);
-
-
-
-
- 293 bool send(
const char* msg);
-
-
-
-
-
-
-
-
- 303 std::uint32_t addr[4] = {0,0,0,0};
- 304 struct in_addr in_addr;
- 305 struct in6_addr in6_addr;
-
-
-
-
-
-
-
-
-
- 320 {
return std::memcmp(
this, &o,
sizeof(*
this)) == 0; }
-
-
- 324 {
return std::memcmp(
this, &o,
sizeof(*
this)) < 0; }
-
-
+ 210 UDPMulticast(
const std::string& _multicastAddr,
int _port,
+ 211 const std::string& _sendIntf,
+ 212 int _ttl=8,
size_t _bufSize = 512,
unsigned _timeOut_ms = 0);
+
+
+
+
+ 221 void Join (
const std::string& _multicastAddr,
int _port,
+ 222 const std::string& _sendIntf,
+ 223 int _ttl=8,
size_t _bufSize = 512,
unsigned _timeOut_ms = 0);
+
+
+
+
+
+
+
+
+
+ 241 size_t SendMC (
const void* _bufSend,
size_t _bufSendSize);
+
+ 249 size_t RecvMC (
bool bSwitchToRecvIntf,
+ 250 std::string* _pFromAddr =
nullptr,
+
+ 252 bool* _pbIntfChanged =
nullptr);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 271 #if APL == 1 || LIN == 1
+
+
+
+
+
+
+ 281 unsigned _timeOut_ms = 0) :
+
+
+ 284 virtual void Close();
+
+
+ 287 void listen (
int numConnections = 1);
+ 288 bool accept (
bool bUnlisten =
false);
+
+
+
+
+ 295 bool send(
const char* msg);
+
+
+
+
+
+
+
+
+ 305 std::uint32_t addr[4] = {0,0,0,0};
+ 306 struct in_addr in_addr;
+ 307 struct in6_addr in6_addr;
+
+
+
+
+
+
+
+
+
+ 322 {
return std::memcmp(
this, &o,
sizeof(*
this)) == 0; }
+
+
+ 326 {
return std::memcmp(
this, &o,
sizeof(*
this)) < 0; }
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
+
Exception raised by XPMP2::SocketNetworking objects.
Definition: Network.h:87
std::string errTxt
OS text for what errno says, output of strerror_s()
Definition: Network.h:89
std::string fullWhat
combines w and errTxt
Definition: Network.h:90
-NetRuntimeError(const std::string &w)
Definition: Network.cpp:302
+NetRuntimeError(const std::string &w)
Definition: Network.cpp:345
const char * what() const noexcept override
Return the full message, ie. fullWhat
Definition: Network.h:93
Base class for any socket-based networking.
Definition: Network.h:99
-virtual ~SocketNetworking()
Destructor makes sure the socket is closed.
Definition: Network.cpp:324
+virtual ~SocketNetworking()
Destructor makes sure the socket is closed.
Definition: Network.cpp:367
SOCKET getSocket() const
the socket
Definition: Network.h:138
bool isOpen() const
Is a socket open?
Definition: Network.h:131
const char * getBuf() const
return the buffer
Definition: Network.h:143
-static std::string GetAddrString(const SockAddrTy &sa, bool withPort=true)
Convert addresses to string.
Definition: Network.cpp:681
-virtual void Close()
Thread-safely close the connection(s) and frees the buffer.
Definition: Network.cpp:489
+static std::string GetAddrString(const SockAddrTy &sa, bool withPort=true)
Convert addresses to string.
Definition: Network.cpp:724
+virtual void Close()
Thread-safely close the connection(s) and frees the buffer.
Definition: Network.cpp:532
SOCKET f_socket
Definition: Network.h:101
size_t bufSize
Definition: Network.h:107
-virtual void Open(const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0, bool _bBroadcast=false)
Creates a socket and binds it to the given local address.
Definition: Network.cpp:329
+virtual void Open(const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0, bool _bBroadcast=false)
Creates a socket and binds it to the given local address.
Definition: Network.cpp:372
std::string f_addr
Definition: Network.h:103
SocketNetworking()
Default constructor is not doing anything.
Definition: Network.h:115
int f_port
Definition: Network.h:102
-virtual void Connect(const std::string &_addr, int _port, size_t _bufSize, unsigned _timeOut_ms=0)
Creates a socket and connects it to the given remote server.
Definition: Network.cpp:422
-void SetBufSize(size_t _bufSize)
(Re)Sets the buffer size (or clears it if _bufSize==0)
Definition: Network.cpp:503
-long recv()
Waits to receive a message, ensures zero-termination in the buffer.
Definition: Network.cpp:573
-static std::string GetLastErr()
Returns a human-readable text for the last error.
Definition: Network.cpp:521
-void setBlocking(bool bBlock)
Set blocking mode.
Definition: Network.cpp:540
+virtual void Connect(const std::string &_addr, int _port, size_t _bufSize, unsigned _timeOut_ms=0)
Creates a socket and connects it to the given remote server.
Definition: Network.cpp:465
+void SetBufSize(size_t _bufSize)
(Re)Sets the buffer size (or clears it if _bufSize==0)
Definition: Network.cpp:546
+long recv()
Waits to receive a message, ensures zero-termination in the buffer.
Definition: Network.cpp:616
+static std::string GetLastErr()
Returns a human-readable text for the last error.
Definition: Network.cpp:564
+void setBlocking(bool bBlock)
Set blocking mode.
Definition: Network.cpp:583
virtual void GetAddrHints(struct addrinfo &hints)=0
Subclass to tell which addresses to look for.
char * buf
Definition: Network.h:106
std::string getAddr() const
the interface address
Definition: Network.h:140
-bool broadcast(const char *msg)
Sends a broadcast message.
Definition: Network.cpp:652
-long timedRecv(int max_wait_ms)
Waits to receive a message with timeout, ensures zero-termination in the buffer.
Definition: Network.cpp:610
+bool broadcast(const char *msg)
Sends a broadcast message.
Definition: Network.cpp:695
+long timedRecv(int max_wait_ms)
Waits to receive a message with timeout, ensures zero-termination in the buffer.
Definition: Network.cpp:653
int getPort() const
the port
Definition: Network.h:139
-Listens to TCP connections and opens a session socket upon connect.
Definition: Network.h:265
-bool IsConnected() const
Connected to a counterparty?
Definition: Network.h:290
-void listen(int numConnections=1)
listen for incoming connections
Definition: Network.cpp:1187
-virtual void Close()
also close session connection
Definition: Network.cpp:1157
-bool accept(bool bUnlisten=false)
accept an incoming connections, optinally stop listening
Definition: Network.cpp:1193
-bool send(const char *msg)
send messages on session connection
Definition: Network.cpp:1265
-virtual void GetAddrHints(struct addrinfo &hints)
Subclass to tell which addresses to look for.
Definition: Network.cpp:1289
-void CloseListenerOnly()
only closes the listening socket, but not a connected session
Definition: Network.cpp:1170
-TCPConnection(const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0)
Constructor creates a socket and binds it to the given address.
Definition: Network.h:278
-SOCKET f_session_socket
session socket, ie. the socket opened when a counterparty connects
Definition: Network.h:267
-TCPConnection()
Default constructor is not doing anything.
Definition: Network.h:276
-struct sockaddr_in f_session_addr
address of the connecting counterparty
Definition: Network.h:268
-bool listenAccept(int numConnections=1)
combines listening and accepting
Definition: Network.cpp:1212
+Listens to TCP connections and opens a session socket upon connect.
Definition: Network.h:267
+bool IsConnected() const
Connected to a counterparty?
Definition: Network.h:292
+void listen(int numConnections=1)
listen for incoming connections
Definition: Network.cpp:1241
+virtual void Close()
also close session connection
Definition: Network.cpp:1211
+bool accept(bool bUnlisten=false)
accept an incoming connections, optinally stop listening
Definition: Network.cpp:1247
+bool send(const char *msg)
send messages on session connection
Definition: Network.cpp:1319
+virtual void GetAddrHints(struct addrinfo &hints)
Subclass to tell which addresses to look for.
Definition: Network.cpp:1343
+void CloseListenerOnly()
only closes the listening socket, but not a connected session
Definition: Network.cpp:1224
+TCPConnection(const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0)
Constructor creates a socket and binds it to the given address.
Definition: Network.h:280
+SOCKET f_session_socket
session socket, ie. the socket opened when a counterparty connects
Definition: Network.h:269
+TCPConnection()
Default constructor is not doing anything.
Definition: Network.h:278
+struct sockaddr_in f_session_addr
address of the connecting counterparty
Definition: Network.h:270
+bool listenAccept(int numConnections=1)
combines listening and accepting
Definition: Network.cpp:1266
UDP Multicast, always binding to INADDR_ANY.
Definition: Network.h:195
-const std::string & GetMCAddr() const
Return formatted multicast address, including port.
Definition: Network.h:216
-void SendToIntf(uint32_t idx)
Send future datagrams on this particular interface only.
Definition: Network.cpp:889
-void SendToAll()
Send future datagrams on all interfaces.
Definition: Network.cpp:878
-size_t RecvMC(bool bSwitchToRecvIntf, std::string *_pFromAddr=nullptr, SockAddrTy *_pFromSockAddr=nullptr, bool *_pbIntfChanged=nullptr)
Receive a multicast, received message is in XPMP2::SocketNetworking::GetBuf()
Definition: Network.cpp:966
-void SendToDefault()
Send future datagrams on default interfaces only (default)
Definition: Network.cpp:855
-bool IsIPv6() const
IPv6?
Definition: Network.h:226
-void SetSendInterface(const in_addr &addr)
Set multicast send interface (IPv4 only)
Definition: Network.cpp:1120
+const std::string & GetMCAddr() const
Return formatted multicast address, including port.
Definition: Network.h:217
+void Join(const std::string &_multicastAddr, int _port, const std::string &_sendIntf, int _ttl=8, size_t _bufSize=512, unsigned _timeOut_ms=0)
Connect to the multicast group.
Definition: Network.cpp:803
+void SendToIntf(uint32_t idx)
Send future datagrams on this particular interface only.
Definition: Network.cpp:943
+void SendToAll()
Send future datagrams on all interfaces.
Definition: Network.cpp:932
+size_t RecvMC(bool bSwitchToRecvIntf, std::string *_pFromAddr=nullptr, SockAddrTy *_pFromSockAddr=nullptr, bool *_pbIntfChanged=nullptr)
Receive a multicast, received message is in XPMP2::SocketNetworking::GetBuf()
Definition: Network.cpp:1020
+void SendToDefault()
Send future datagrams on default interfaces only (default)
Definition: Network.cpp:909
+bool IsIPv6() const
IPv6?
Definition: Network.h:228
+void SetSendInterface(const in_addr &addr)
Set multicast send interface (IPv4 only)
Definition: Network.cpp:1174
uint32_t oneIntfIdx
When sending to one interface only, which one?
Definition: Network.h:201
struct addrinfo * pMCAddr
the multicast address
Definition: Network.h:198
-size_t SendMC(const void *_bufSend, size_t _bufSendSize)
Send a multicast.
Definition: Network.cpp:909
+size_t SendMC(const void *_bufSend, size_t _bufSendSize)
Send a multicast.
Definition: Network.cpp:963
std::map< SockAddrTy, std::chrono::time_point< std::chrono::steady_clock > > mapSender
Keep a list of sources we received data from to be able to identify new sources.
Definition: Network.h:204
std::string multicastAddr
the multicast address
Definition: Network.h:197
UDPMulticast()
Default constructor is not doing anything.
Definition: Network.h:208
-uint8_t GetFamily() const
Protocol family.
Definition: Network.h:224
-bool IsIPv4() const
IPv4?
Definition: Network.h:225
-void GetAddrHints(struct addrinfo &hints) override
returns information from *pMCAddr
Definition: Network.cpp:1109
-void Cleanup()
Definition: Network.cpp:1098
-void Join(const std::string &_multicastAddr, int _port, int _ttl=8, size_t _bufSize=512, unsigned _timeOut_ms=0)
Connect to the multicast group.
Definition: Network.cpp:759
-virtual ~UDPMulticast()
makes sure pMCAddr is cleared up
Definition: Network.cpp:753
+uint8_t GetFamily() const
Protocol family.
Definition: Network.h:226
+bool IsIPv4() const
IPv4?
Definition: Network.h:227
+void GetAddrHints(struct addrinfo &hints) override
returns information from *pMCAddr
Definition: Network.cpp:1163
+void Cleanup()
Definition: Network.cpp:1152
+virtual ~UDPMulticast()
makes sure pMCAddr is cleared up
Definition: Network.cpp:797
bool bSendToAll
Send out multicast datagrams to all interfaces.
Definition: Network.h:200
Receives UDP messages.
Definition: Network.h:177
-virtual void GetAddrHints(struct addrinfo &hints)
Sets flags to AI_PASSIVE, AF_INET, SOCK_DGRAM, IPPROTO_UDP.
Definition: Network.cpp:732
+virtual void GetAddrHints(struct addrinfo &hints)
Sets flags to AI_PASSIVE, AF_INET, SOCK_DGRAM, IPPROTO_UDP.
Definition: Network.cpp:775
UDPReceiver(const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0)
Constructor creates a socket and binds it to the given address.
Definition: Network.h:182
UDPReceiver()
Default constructor is not doing anything.
Definition: Network.h:180
Definition: XPMPAircraft.h:70
-bool NetwIsLocalAddr(const InetAddrTy &addr)
Is given address a local one?
Definition: Network.cpp:1325
+bool NetwIsLocalAddr(const InetAddrTy &addr)
Is given address a local one?
Definition: Network.cpp:1379
constexpr SOCKET INVALID_SOCKET
Definition: Network.h:49
int SOCKET
Windows defines SOCKET, so we define it for non-Windows manually.
Definition: Network.h:48
-Numerical IP address, used for both ipv4 and ipv6, for ease of handling.
Definition: Network.h:301
-InetAddrTy(const sockaddr *pSa)
Take over from structure.
Definition: Network.h:313
-void CopyFrom(const SockAddrTy &sa)
Take over address from structure.
Definition: Network.cpp:1302
-bool operator<(const InetAddrTy &o) const
Comparison also uses memcmp for defined order.
Definition: Network.h:323
-bool operator==(const InetAddrTy &o) const
Equality means: all elements are equal.
Definition: Network.h:319
-InetAddrTy()
Default does nothing.
Definition: Network.h:309
-InetAddrTy(const SockAddrTy &sa)
Take over from structure.
Definition: Network.h:311
+Numerical IP address, used for both ipv4 and ipv6, for ease of handling.
Definition: Network.h:303
+InetAddrTy(const sockaddr *pSa)
Take over from structure.
Definition: Network.h:315
+void CopyFrom(const SockAddrTy &sa)
Take over address from structure.
Definition: Network.cpp:1356
+bool operator<(const InetAddrTy &o) const
Comparison also uses memcmp for defined order.
Definition: Network.h:325
+bool operator==(const InetAddrTy &o) const
Equality means: all elements are equal.
Definition: Network.h:321
+InetAddrTy()
Default does nothing.
Definition: Network.h:311
+InetAddrTy(const SockAddrTy &sa)
Take over from structure.
Definition: Network.h:313
Helper definition for all these IPv4/6 differences.
Definition: Network.h:54
bool operator<(const SockAddrTy &o) const
Comparison bases solely on memory compare, order isn't important, just that there is order.
Definition: Network.h:67
bool isIp4() const
is this an IPv4 address?
Definition: Network.h:74
diff --git a/docs/html/Remote_8h_source.html b/docs/html/Remote_8h_source.html
index c9c1caf..9cf20a2 100644
--- a/docs/html/Remote_8h_source.html
+++ b/docs/html/Remote_8h_source.html
@@ -197,24 +197,24 @@
UDP Multicast, always binding to INADDR_ANY.
Definition: Network.h:195
Definition: XPMPAircraft.h:70
std::map< XPMPPlaneID, RmtAcCacheTy > mapRmtAcCacheTy
Defines a map with the plane id as key and the aboce cache structure as payload.
Definition: Remote.h:63
-void RemoteAcClearAll()
Informs us that there are no more aircraft, clear our caches!
Definition: Remote.cpp:1376
-void RemoteAcEnqueueDone()
Informs us that all a/c have been processed: All pending messages to be sent now.
Definition: Remote.cpp:1315
-void RemoteAcRemove(const Aircraft &ac)
Informs us about an aircraft deletion.
Definition: Remote.cpp:1348
-void RemoteAcEnqueueStarts(float now)
Definition: Remote.cpp:1190
+void RemoteAcClearAll()
Informs us that there are no more aircraft, clear our caches!
Definition: Remote.cpp:1378
+void RemoteAcEnqueueDone()
Informs us that all a/c have been processed: All pending messages to be sent now.
Definition: Remote.cpp:1317
+void RemoteAcRemove(const Aircraft &ac)
Informs us about an aircraft deletion.
Definition: Remote.cpp:1350
+void RemoteAcEnqueueStarts(float now)
Definition: Remote.cpp:1192
RemoteMsgTy
Message type.
Definition: XPMPRemote.h:77
@ RMT_MSG_AC_ANIM
aircraft animation values (dataRef values) only
Definition: XPMPRemote.h:83
-void RemoteSenderUpdateStatus()
Compares current vs. expected status and takes appropriate action.
Definition: Remote.cpp:1153
+void RemoteSenderUpdateStatus()
Compares current vs. expected status and takes appropriate action.
Definition: Remote.cpp:1155
RemoteCfgTy
Configuration for remote communications support.
Definition: Remote.h:32
@ REMOTE_CFG_ON
config: force on
Definition: Remote.h:35
@ REMOTE_CFG_OFF
config: force off
Definition: Remote.h:33
@ REMOTE_CFG_AUTO
config: on if in a netwoked/multiplayer setup
Definition: Remote.h:34
std::unique_ptr< RmtDataBaseTy > ptrRmtDataBaseTy
Smart pointer to XPMP2::RmtDataBaseTy by which we manage objects of this and derived types.
Definition: Remote.h:79
RmtDataEnqeueTy< RemoteAcRemoveTy, RMT_MSG_AC_REMOVE > RmtDataAcRemoveTy
A/C Removal queue type.
Definition: Remote.h:100
-void RemoteCleanup()
Grace cleanup, stops all threads.
Definition: Remote.cpp:1130
-void RemoteAcEnqueue(const Aircraft &ac)
Regularly called from the flight loop callback to send a/c date onto the network.
Definition: Remote.cpp:1221
+void RemoteCleanup()
Grace cleanup, stops all threads.
Definition: Remote.cpp:1132
+void RemoteAcEnqueue(const Aircraft &ac)
Regularly called from the flight loop callback to send a/c date onto the network.
Definition: Remote.cpp:1223
std::queue< ptrRmtDataBaseTy, std::list< ptrRmtDataBaseTy > > queueRmtDataTy
A queue managing the information objects, used to transfer data between main thread and network threa...
Definition: Remote.h:81
std::unique_ptr< RmtDataAcAnimTy > ptrRmtDataAcAnimTy
Smart pointer to XPMP2::RmtDataAcAnimTy.
Definition: Remote.h:122
-void RemoteInit()
Initialize the module.
Definition: Remote.cpp:1121
+void RemoteInit()
Initialize the module.
Definition: Remote.cpp:1123
RmtDataEnqeueTy< RemoteAcPosUpdateTy, RMT_MSG_AC_POS_UPDATE > RmtDataAcPosUpdateTy
A/C Position Update queue type.
Definition: Remote.h:99
DR_VALS
The dataRefs provided by XPMP2 to the CSL models.
Definition: XPMPAircraft.h:87
@ V_COUNT
always last, number of dataRefs XPMP2 pre-defines
Definition: XPMPAircraft.h:137
diff --git a/docs/html/Sound_8h_source.html b/docs/html/Sound_8h_source.html
index 768cae8..459753d 100644
--- a/docs/html/Sound_8h_source.html
+++ b/docs/html/Sound_8h_source.html
@@ -358,7 +358,7 @@
@ logERR
errors mean, aircraft can potentially not be displayed
Definition: Utilities.h:253
std::string leftOf(const std::string &s, const std::string &terminators)
Returns everything left of any of terminators.
Definition: Utilities.h:118
std::map< std::string, SoundFilePtr > mapSoundPtrTy
Map of all sounds, indexed by a sound name (type)
Definition: Sound.h:146
-void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:848
+void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:849
SoundSystem * gpSndSys
The sound system in use.
Definition: Sound.cpp:39
void SoundInit()
Initialize the sound module and load the sounds.
Definition: Sound.cpp:973
void FmodHeadPitchRoll2Normal(const float head, const float pitch, const float roll, FMOD_VECTOR &vecDir, FMOD_VECTOR &vecNorm)
Convert heading/pitch to normal x/y/z vector.
Definition: Sound.cpp:682
diff --git a/docs/html/Utilities_8h.html b/docs/html/Utilities_8h.html
index 809c271..af245ec 100644
--- a/docs/html/Utilities_8h.html
+++ b/docs/html/Utilities_8h.html
@@ -377,7 +377,7 @@ if (XPMP2::glob.bLogMdlMatch && lvl >= glob.logLvl) \
{
LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
}
-void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:848
+void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:849
GlobVars glob
The one and only global variable structure.
Definition: Utilities.cpp:29
logLevelTy logLvl
Logging level.
Definition: XPMP2.h:132
diff --git a/docs/html/Utilities_8h_source.html b/docs/html/Utilities_8h_source.html
index 33b0ea0..e505810 100644
--- a/docs/html/Utilities_8h_source.html
+++ b/docs/html/Utilities_8h_source.html
@@ -322,7 +322,7 @@
#define WHITESPACE
Definition: Utilities.h:89
#define XPMP2_FMTARGS(FMT)
To apply printf-style warnings to our functions.
Definition: Utilities.h:245
Definition: XPMPAircraft.h:70
-std::valarray< float > HeadPitch2Vec(const float head, const float pitch)
Convert heading/pitch to normalized x/y/z vector.
Definition: Utilities.cpp:657
+std::valarray< float > HeadPitch2Vec(const float head, const float pitch)
Convert heading/pitch to normalized x/y/z vector.
Definition: Utilities.cpp:658
T rad2deg(const T _rad)
Convert radians to degrees, normalized to [0..360)
Definition: Utilities.h:145
logLevelTy
Logging level.
Definition: Utilities.h:249
@ logFATAL
fatal is shortly before a crash
Definition: Utilities.h:254
@@ -332,47 +332,47 @@
@ logERR
errors mean, aircraft can potentially not be displayed
Definition: Utilities.h:253
@ logINFO
regular info messages
Definition: Utilities.h:251
std::string leftOf(const std::string &s, const std::string &terminators)
Returns everything left of any of terminators.
Definition: Utilities.h:118
-const char * LogGetString(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
Returns ptr to static buffer filled with formatted log string.
Definition: Utilities.cpp:808
+const char * LogGetString(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
Returns ptr to static buffer filled with formatted log string.
Definition: Utilities.cpp:809
constexpr const char * RSRC_OBJ8DATAREFS
Definition: Utilities.h:38
std::string TOPOSIX(const std::string &p)
On Lin/Win there is no need for a conversion, but we do treat p now as std::string
Definition: Utilities.h:349
constexpr double PI
Pi.
Definition: Utilities.h:133
-void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:848
-bool CheckEverySoOften(float &_lastCheck, float _interval, float _now)
Convenience function to check on something at most every x seconds.
Definition: Utilities.cpp:764
+void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
Log Text to log file.
Definition: Utilities.cpp:849
+bool CheckEverySoOften(float &_lastCheck, float _interval, float _now)
Convenience function to check on something at most every x seconds.
Definition: Utilities.cpp:765
std::string & ltrim(std::string &s, const char *t=WHITESPACE)
trimming of string (from left)
Definition: Utilities.h:104
-std::string GetMiscNetwTimeStr(float _time)
Return the network time as a string like used in the XP's Log.txt.
Definition: Utilities.cpp:720
+std::string GetMiscNetwTimeStr(float _time)
Return the network time as a string like used in the XP's Log.txt.
Definition: Utilities.cpp:721
std::string FROMPOSIX(const std::string &p)
On Lin/Win there is no need for a conversion, but we do treat p now as std::string
Definition: Utilities.h:351
float angleLocCoord(float x1, float z1, float x2, float z2)
Angle of line from point (x1|z1) to point (x2|z2)
Definition: Utilities.h:176
-void RemoveExtension(std::string &path)
Removes everything after the last dot, the dot including.
Definition: Utilities.cpp:472
-std::list< std::string > GetDirContents(const std::string &path)
List of files in a directory (wrapper around XPLMGetDirectoryContents)
Definition: Utilities.cpp:403
+void RemoveExtension(std::string &path)
Removes everything after the last dot, the dot including.
Definition: Utilities.cpp:473
+std::list< std::string > GetDirContents(const std::string &path)
List of files in a directory (wrapper around XPLMGetDirectoryContents)
Definition: Utilities.cpp:404
constexpr const char * RSRC_RELATED
Definition: Utilities.h:34
-std::valarray< float > HeadPitchRoll2Normal(const float head, const float pitch, const float roll)
Convert heading/pitch/roll to unit and normal vector, ie. returns 6 values, first 3 like HeadPitch2Ve...
Definition: Utilities.cpp:678
+std::valarray< float > HeadPitchRoll2Normal(const float head, const float pitch, const float roll)
Convert heading/pitch/roll to unit and normal vector, ie. returns 6 values, first 3 like HeadPitch2Ve...
Definition: Utilities.cpp:679
T sqr(const T a)
Square.
Definition: Utilities.h:155
-float GetMiscNetwTime()
Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log....
Definition: Utilities.cpp:711
+float GetMiscNetwTime()
Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log....
Definition: Utilities.cpp:712
bool fequal(float a, float b)
Are these two float near-equal? (to avoid trying something like a == b)
Definition: Utilities.h:139
-const std::string & GetXPSystemPath()
Returns XP's system directory, including a trailing slash.
Definition: Utilities.cpp:449
+const std::string & GetXPSystemPath()
Returns XP's system directory, including a trailing slash.
Definition: Utilities.cpp:450
numT headNormalize(numT _head)
Normalize a heading value to [0..360), works for both float and double values.
Definition: Utilities.h:184
constexpr float EPSILON_F
Epsilon, a small number.
Definition: Utilities.h:136
-const char * GetGraphicsDriverTxt()
Text string for current graphics driver in use.
Definition: Utilities.cpp:737
-float headDiff(float head1, float head2)
(Shortest) difference between 2 angles: How much to turn to go from h1 to h2?
Definition: Utilities.cpp:637
-bool ExistsFile(const std::string &filename)
Does a file path exist?
Definition: Utilities.cpp:319
-bool CreateDir(const std::string &path)
Create directory if it does not exist.
Definition: Utilities.cpp:335
-std::string & str_tolower(std::string &s)
change a std::string to uppercase
Definition: Utilities.cpp:583
-bool CopyFileIfNewer(const std::string &source, const std::string &destDir)
Copy file if source is newer or destination missing.
Definition: Utilities.cpp:350
+const char * GetGraphicsDriverTxt()
Text string for current graphics driver in use.
Definition: Utilities.cpp:738
+float headDiff(float head1, float head2)
(Shortest) difference between 2 angles: How much to turn to go from h1 to h2?
Definition: Utilities.cpp:638
+bool ExistsFile(const std::string &filename)
Does a file path exist?
Definition: Utilities.cpp:320
+bool CreateDir(const std::string &path)
Create directory if it does not exist.
Definition: Utilities.cpp:336
+std::string & str_tolower(std::string &s)
change a std::string to uppercase
Definition: Utilities.cpp:584
+bool CopyFileIfNewer(const std::string &source, const std::string &destDir)
Copy file if source is newer or destination missing.
Definition: Utilities.cpp:351
constexpr const char * RSRC_MAP_ICONS
Definition: Utilities.h:37
-bool IsPaused()
X-Plane in a Pause state?
Definition: Utilities.cpp:750
-bool IsViewExternal()
Is current X-Plane view an external view (outside a cockpit)?
Definition: Utilities.cpp:757
+bool IsPaused()
X-Plane in a Pause state?
Definition: Utilities.cpp:751
+bool IsViewExternal()
Is current X-Plane view an external view (outside a cockpit)?
Definition: Utilities.cpp:758
T dist(const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
Pythagorean distance between two points in a 3-D world.
Definition: Utilities.h:159
std::string & trim(std::string &s, const char *t=WHITESPACE)
trimming of string (from both ends)
Definition: Utilities.h:112
-std::string StripXPSysDir(const std::string &path)
If a path starts with X-Plane's system directory it is stripped.
Definition: Utilities.cpp:462
+std::string StripXPSysDir(const std::string &path)
If a path starts with X-Plane's system directory it is stripped.
Definition: Utilities.cpp:463
T deg2rad(const T _deg)
Convert degree to radians.
Definition: Utilities.h:150
constexpr const char * RSRC_REL_OP
Definition: Utilities.h:35
std::string & rtrim(std::string &s, const char *t=WHITESPACE)
trimming of string (from right)
Definition: Utilities.h:96
-bool IsDir(const std::string &path)
Is path a directory?
Definition: Utilities.cpp:326
+bool IsDir(const std::string &path)
Is path a directory?
Definition: Utilities.cpp:327
float atan2deg(float x, float y)
atan2 converted to degrees: the angle between (0|0) and the given point
Definition: Utilities.h:166
-int PrefsFuncIntDefault(const char *, const char *, int _default)
Default config function just always returns the provided default value.
Definition: Utilities.cpp:161
+int PrefsFuncIntDefault(const char *, const char *, int _default)
Default config function just always returns the provided default value.
Definition: Utilities.cpp:162
constexpr const char * RSRC_DOC8643
Definition: Utilities.h:36
-std::vector< std::string > str_tokenize(const std::string s, const std::string tokens, bool bSkipEmpty)
separates string into tokens
Definition: Utilities.cpp:590
-std::istream & safeGetline(std::istream &is, std::string &t)
Read a line from a text file, no matter if ending on CRLF or LF.
Definition: Utilities.cpp:436
+std::vector< std::string > str_tokenize(const std::string s, const std::string tokens, bool bSkipEmpty)
separates string into tokens
Definition: Utilities.cpp:591
+std::istream & safeGetline(std::istream &is, std::string &t)
Read a line from a text file, no matter if ending on CRLF or LF.
Definition: Utilities.cpp:437