Unique network transmission handling of flares

This patch addresses issues concerning a1796ed71f:

Allow for a more elegant implementation of observer flares.
And still display flares even if the sender is lagging behind:
Split off flares from simulation commands.
Remove the new, problematic 'observer commands' entirely.
Provide an engine function 'SendNetworkFlare' to the JS interface.
-> which sets off the (pretty ordinary) transmission process.
Add a new type of net messages exclusively for flares
-> contains the flare's position and its sender's GUID.
This commit is contained in:
Vantha
2024-12-03 21:24:55 +01:00
committed by phosit
parent 75205699d0
commit 960bd5eace
11 changed files with 125 additions and 55 deletions
+7
View File
@@ -18,6 +18,7 @@
#ifndef NETCLIENT_H
#define NETCLIENT_H
#include "network/FSM.h"
#include "network/NetFileTransfer.h"
#include "network/NetHost.h"
@@ -236,6 +237,11 @@ public:
void SendStartGameMessage(const CStr& initAttribs);
/**
* Call when the client (player or observer) has sent a flare.
*/
void SendFlareMessage(const CStr& positionX, const CStr& positionY, const CStr& positionZ);
/**
* Call when the client has rejoined a running match and finished
* the loading screen.
@@ -279,6 +285,7 @@ private:
static bool OnGameStart(CNetClient* client, CFsmEvent* event);
static bool OnJoinSyncStart(CNetClient* client, CFsmEvent* event);
static bool OnJoinSyncEndCommandBatch(CNetClient* client, CFsmEvent* event);
static bool OnFlare(CNetClient* client, CFsmEvent* event);
static bool OnRejoined(CNetClient* client, CFsmEvent* event);
static bool OnKicked(CNetClient* client, CFsmEvent* event);
static bool OnClientTimeout(CNetClient* client, CFsmEvent* event);