mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user