PR feedback addressing

This commit is contained in:
pereslav
2021-04-27 14:57:36 +01:00
parent 44ce664730
commit e3b016deba
6 changed files with 22 additions and 10 deletions
@@ -33,10 +33,10 @@ namespace Multiplayer
AzNetworking::IConnection* GetConnection() const override;
EntityReplicationManager& GetReplicationManager() override;
void Update(AZ::TimeMs serverGameTimeMs) override;
bool CanSendUpdates() const override;
void SetCanSendUpdates(bool canSendUpdates) override;
//! @}
bool CanSendUpdates();
private:
EntityReplicationManager m_entityReplicationManager;
AzNetworking::IConnection* m_connection = nullptr;
@@ -12,8 +12,13 @@
namespace Multiplayer
{
inline bool ClientToServerConnectionData::CanSendUpdates()
inline bool ClientToServerConnectionData::CanSendUpdates() const
{
return m_canSendUpdates;
}
inline void ClientToServerConnectionData::SetCanSendUpdates(bool canSendUpdates)
{
m_canSendUpdates = canSendUpdates;
}
}
@@ -44,5 +44,13 @@ namespace Multiplayer
//! Creates and manages sending updates to the remote endpoint.
//! @param serverGameTimeMs current server game time in milliseconds
virtual void Update(AZ::TimeMs serverGameTimeMs) = 0;
//! Returns whether update messages can be sent to the connection.
//! @return true if update messages can be sent
virtual bool CanSendUpdates() const = 0;
//! Sets the state of connection whether update messages can be sent or not.
//! @param canSendUpdates the state value
virtual void SetCanSendUpdates(bool canSendUpdates) = 0;
};
}
@@ -34,11 +34,10 @@ namespace Multiplayer
AzNetworking::IConnection* GetConnection() const override;
EntityReplicationManager& GetReplicationManager() override;
void Update(AZ::TimeMs serverGameTimeMs) override;
bool CanSendUpdates() const override;
void SetCanSendUpdates(bool canSendUpdates) override;
//! @}
bool CanSendUpdates() const;
void SetCanSendUpdates(bool canSendUpdates);
NetworkEntityHandle GetPrimaryPlayerEntity();
const NetworkEntityHandle& GetPrimaryPlayerEntity() const;