Implement NetworkManager

For now there are two methods:

- `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed.
- `NETWORK:HttpRequest()`: Perform an HTTP request.

By default access to the network is disabled for all target hosts. It
can be enabled by setting `HttpEnable=1` in the preferences. Individual
hosts have to be added to `HttpAllowHosts` as a comma separated list to
allow access.

See included docs for more details on usage.
This commit is contained in:
Martin Natano
2022-01-15 22:56:08 +01:00
parent ddfc49e0b5
commit dc49af3c59
265 changed files with 61571 additions and 0 deletions
+3
View File
@@ -61,6 +61,7 @@
#include "LightsManager.h"
#include "ModelManager.h"
#include "CryptManager.h"
#include "NetworkManager.h"
#include "NetworkSyncManager.h"
#include "MessageManager.h"
#include "StatsManager.h"
@@ -298,6 +299,7 @@ void ShutdownGame()
SAFE_DELETE( STATSMAN );
SAFE_DELETE( MESSAGEMAN );
SAFE_DELETE( NSMAN );
SAFE_DELETE( NETWORK );
/* Delete INPUTMAN before the other INPUTFILTER handlers, or an input
* driver may try to send a message to INPUTFILTER after we delete it. */
SAFE_DELETE( INPUTMAN );
@@ -1174,6 +1176,7 @@ int sm_main(int argc, char* argv[])
UNLOCKMAN = new UnlockManager;
SONGMAN->UpdatePopular();
SONGMAN->UpdatePreferredSort();
NETWORK = new NetworkManager;
NSMAN = new NetworkSyncManager( pLoadingWindow );
STATSMAN = new StatsManager;