more fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-08 08:48:32 -07:00
parent c805d443d2
commit 860b28c10b
38 changed files with 251 additions and 256 deletions
+1 -1
View File
@@ -844,7 +844,7 @@ namespace AZ
return AZ::AllocatorInstance<Parent>::Get().GetUnAllocatedMemory(isPrint);
}
virtual IAllocatorAllocate* GetSubAllocator() override
IAllocatorAllocate* GetSubAllocator() override
{
return AZ::AllocatorInstance<Parent>::Get().GetSubAllocator();
}
@@ -866,7 +866,7 @@ namespace AzFramework
FileIsReadOnlyResponse() = default;
FileIsReadOnlyResponse(bool isReadOnly);
unsigned int GetMessageType() const;
unsigned int GetMessageType() const override;
bool m_isReadOnly;
};
@@ -945,7 +945,7 @@ namespace AzFramework
FileModTimeRequest() = default;
FileModTimeRequest(const AZ::OSString& filePath);
unsigned int GetMessageType() const;
unsigned int GetMessageType() const override;
AZ::OSString m_filePath;
};
@@ -195,7 +195,7 @@ namespace AzFramework
TmMsgCallback(const MsgCB& cb = NULL)
: m_cb(cb) {}
virtual void OnReceivedMsg(TmMsgPtr msg)
void OnReceivedMsg(TmMsgPtr msg) override
{
if (m_cb)
{
@@ -54,7 +54,7 @@ namespace AzNetworking
//! Handler callback for timed out items.
//! @param item containing registered timeout details
//! @return ETimeoutResult for whether to re-register or discard the timeout params
virtual TimeoutResult HandleTimeout(TimeoutQueue::TimeoutItem& item) override;
TimeoutResult HandleTimeout(TimeoutQueue::TimeoutItem& item) override;
TimeoutQueue m_timeoutQueue;
SequenceGenerator m_sequenceGenerator;
@@ -33,7 +33,7 @@ namespace UnitTest
;
}
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) override
{
EXPECT_TRUE((packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::InitiateConnectionPacket))
|| (packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::HeartbeatPacket)));
@@ -36,7 +36,7 @@ namespace UnitTest
;
}
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer)
PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) override
{
EXPECT_TRUE((packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::InitiateConnectionPacket))
|| (packetHeader.GetPacketType() == static_cast<PacketType>(CorePackets::PacketType::HeartbeatPacket)));
@@ -300,13 +300,13 @@ namespace AzToolsFramework
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override;
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
void setEditorData(QWidget* editor, const QModelIndex& index) const;
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
void setEditorData(QWidget* editor, const QModelIndex& index) const override;
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
QWidget* pOwnerWidget;
QLabel* m_painterLabel;
@@ -25,34 +25,34 @@ namespace GridMate
DefaultHandshake(unsigned int timeOut, VersionType version);
virtual ~DefaultHandshake();
/// Called from the system to write initial handshake data.
virtual void OnInitiate(ConnectionID id, WriteBuffer& wb);
void OnInitiate(ConnectionID id, WriteBuffer& wb) override;
/**
* Called when a system receives a handshake initiation from another system.
* You can write a reply in the WriteBuffer.
* return true if you accept this connection and false if you reject it.
*/
virtual HandshakeErrorCode OnReceiveRequest(ConnectionID id, ReadBuffer& rb, WriteBuffer& wb);
HandshakeErrorCode OnReceiveRequest(ConnectionID id, ReadBuffer& rb, WriteBuffer& wb) override;
/**
* If we already have a valid connection and we receive another connection request, the system will
* call this function to verify the state of the connection.
*/
virtual bool OnConfirmRequest(ConnectionID id, ReadBuffer& rb);
bool OnConfirmRequest(ConnectionID id, ReadBuffer& rb) override;
/**
* Called when we receive Ack from the other system on our initial data \ref OnInitiate.
* return true to accept the ack or false to reject the handshake.
*/
virtual bool OnReceiveAck(ConnectionID id, ReadBuffer& rb);
bool OnReceiveAck(ConnectionID id, ReadBuffer& rb) override;
/**
* Called when we receive Ack from the other system while we were connected. This callback is called
* so we can just confirm that our connection is valid!
*/
virtual bool OnConfirmAck(ConnectionID id, ReadBuffer& rb);
bool OnConfirmAck(ConnectionID id, ReadBuffer& rb) override;
/// Return true if you want to reject early reject a connection.
virtual bool OnNewConnection(const AZStd::string& address);
bool OnNewConnection(const AZStd::string& address) override;
/// Called when we close a connection.
virtual void OnDisconnect(ConnectionID id);
void OnDisconnect(ConnectionID id) override;
/// Return timeout in milliseconds of the handshake procedure.
virtual unsigned int GetHandshakeTimeOutMS() const { return m_handshakeTimeOutMS; }
unsigned int GetHandshakeTimeOutMS() const override { return m_handshakeTimeOutMS; }
private:
unsigned int m_handshakeTimeOutMS;
VersionType m_version;
@@ -23,21 +23,21 @@ namespace GridMate
friend class CarrierThread;
/// Called from Carrier, so simulator can use the low level driver directly.
virtual void BindDriver(Driver* driver);
void BindDriver(Driver* driver) override;
/// Called from Carrier when driver can no longer be used(ie. will be destroyed)
virtual void UnbindDriver();
void UnbindDriver() override;
/// Called when Carrier has established a new connection.
virtual void OnConnect(const AZStd::intrusive_ptr<DriverAddress>& address);
void OnConnect(const AZStd::intrusive_ptr<DriverAddress>& address) override;
/// Called when Carrier has lost a connection.
virtual void OnDisconnect(const AZStd::intrusive_ptr<DriverAddress>& address);
void OnDisconnect(const AZStd::intrusive_ptr<DriverAddress>& address) override;
/// Called when Carrier has send a package.
virtual bool OnSend(const AZStd::intrusive_ptr<DriverAddress>& to, const void* data, unsigned int dataSize);
bool OnSend(const AZStd::intrusive_ptr<DriverAddress>& to, const void* data, unsigned int dataSize) override;
/// Called when Carrier receives package receive.
virtual bool OnReceive(const AZStd::intrusive_ptr<DriverAddress>& from, const void* data, unsigned int dataSize);
bool OnReceive(const AZStd::intrusive_ptr<DriverAddress>& from, const void* data, unsigned int dataSize) override;
/// Called from Carrier when no more data has arrived and you can supply you data (with latency, out of order, etc.
virtual unsigned int ReceiveDataFrom(AZStd::intrusive_ptr<DriverAddress>& from, char* data, unsigned int maxDataSize);
unsigned int ReceiveDataFrom(AZStd::intrusive_ptr<DriverAddress>& from, char* data, unsigned int maxDataSize) override;
virtual void Update();
void Update() override;
public:
GM_CLASS_ALLOCATOR(DefaultSimulator);
@@ -88,11 +88,11 @@ namespace GridMate
bool operator==(const SocketDriverAddress& rhs) const;
bool operator!=(const SocketDriverAddress& rhs) const;
virtual AZStd::string ToString() const;
virtual AZStd::string ToAddress() const;
virtual AZStd::string GetIP() const;
virtual unsigned int GetPort() const;
virtual const void* GetTargetAddress(unsigned int& addressSize) const;
AZStd::string ToString() const override;
AZStd::string ToAddress() const override;
AZStd::string GetIP() const override;
unsigned int GetPort() const override;
const void* GetTargetAddress(unsigned int& addressSize) const override;
union
{
@@ -117,11 +117,11 @@ namespace GridMate
* Platform specific functionality.
*/
/// Return maximum number of active connections at the same time.
virtual unsigned int GetMaxNumConnections() const { return 32; }
unsigned int GetMaxNumConnections() const override { return 32; }
/// Return maximum data size we can send/receive at once in bytes, supported by the platform.
virtual unsigned int GetMaxSendSize() const;
unsigned int GetMaxSendSize() const override;
/// Return packet overhead size in bytes.
virtual unsigned int GetPacketOverheadSize() const;
unsigned int GetPacketOverheadSize() const override;
/**
* User should implement create and bind a UDP socket. This socket will be used for all communications.
@@ -132,39 +132,39 @@ namespace GridMate
* \param receiveBufferSize socket receive buffer size in bytes, use 0 for default values.
* \param sendBufferSize socket send buffer size, use 0 for default values.
*/
virtual ResultCode Initialize(int familyType = BSD_AF_INET, const char* address = nullptr, unsigned int port = 0, bool isBroadcast = false, unsigned int receiveBufferSize = 0, unsigned int sendBufferSize = 0);
ResultCode Initialize(int familyType = BSD_AF_INET, const char* address = nullptr, unsigned int port = 0, bool isBroadcast = false, unsigned int receiveBufferSize = 0, unsigned int sendBufferSize = 0) override;
/// Returns communication port (must be called after Initialize, otherwise it will return 0)
virtual unsigned int GetPort() const;
unsigned int GetPort() const override;
/// Send data to a user defined address
virtual ResultCode Send(const AZStd::intrusive_ptr<DriverAddress>& to, const char* data, unsigned int dataSize);
ResultCode Send(const AZStd::intrusive_ptr<DriverAddress>& to, const char* data, unsigned int dataSize) override;
/**
* Receives a datagram and stores the source address. maxDataSize must be >= than GetMaxSendSize(). Returns the num of of received bytes.
* \note If a datagram from a new connection is received, NewConnectionCB will be called. If it rejects the connection the returned from pointer
* will be NULL while the actual data will be returned.
*/
virtual unsigned int Receive(char* data, unsigned int maxDataSize, AZStd::intrusive_ptr<DriverAddress>& from, ResultCode* resultCode = 0);
unsigned int Receive(char* data, unsigned int maxDataSize, AZStd::intrusive_ptr<DriverAddress>& from, ResultCode* resultCode = 0) override;
/**
* Wait for data to be to the ready for receive. Time out is the maximum time to wait
* before this function returns. If left to default value it will be in blocking mode (wait until data is ready to be received).
* \returns true if there is data to be received (always true if timeOut == 0), otherwise false.
*/
virtual bool WaitForData(AZStd::chrono::microseconds timeOut = AZStd::chrono::microseconds(0));
bool WaitForData(AZStd::chrono::microseconds timeOut = AZStd::chrono::microseconds(0)) override;
/**
* When you enter wait for data mode, for many reasons you might want to stop wait for data.
* If you implement this function you need to make sure it's a thread safe function.
*/
virtual void StopWaitForData();
void StopWaitForData() override;
/// Return true if WaitForData was interrupted before the timeOut expired, otherwise false.
virtual bool WasStopeedWaitingForData() { return m_isStoppedWaitForData; }
bool WasStopeedWaitingForData() override { return m_isStoppedWaitForData; }
/// @{ Address conversion functionality. They MUST implemented thread safe. Generally this is not a problem since they just part local data.
/// Create address from ip and port. If ip == NULL we will assign a broadcast address.
virtual AZStd::string IPPortToAddress(const char* ip, unsigned int port) const { return IPPortToAddressString(ip, port); }
virtual bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const { return AddressStringToIPPort(address, ip, port); }
AZStd::string IPPortToAddress(const char* ip, unsigned int port) const override { return IPPortToAddressString(ip, port); }
bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const override { return AddressStringToIPPort(address, ip, port); }
/// Create address for the socket driver from IP and port
static AZStd::string IPPortToAddressString(const char* ip, unsigned int port);
/// Decompose an address to IP and port
@@ -174,7 +174,7 @@ namespace GridMate
static BSDSocketFamilyType AddressFamilyType(const char* ip) { return AddressFamilyType(AZStd::string(ip)); }
/// @}
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address) = 0;
AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address) override = 0;
/// Additional CreateDriverAddress function should be implemented.
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const sockaddr* sockAddr) = 0;
@@ -352,10 +352,10 @@ namespace GridMate
* \note Driver address allocates internal resources, use it only when you intend to communicate. Otherwise operate with
* the string address.
*/
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address);
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const sockaddr* addr);
AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address) override;
AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const sockaddr* addr) override;
/// Called only from the DriverAddress when the use count becomes 0
virtual void DestroyDriverAddress(DriverAddress* address);
void DestroyDriverAddress(DriverAddress* address) override;
typedef AZStd::unordered_set<SocketDriverAddress, SocketDriverAddress::Hasher> AddressSetType;
AddressSetType m_addressMap;
@@ -33,42 +33,42 @@ namespace GridMate
//////////////////////////////////////////////////////////////////////////
// Driller
virtual const char* GroupName() const { return "GridMate"; }
virtual const char* GetName() const { return "SessionDriller"; }
virtual const char* GetDescription() const { return "Drills GridSession, Search, etc."; }
virtual void Start(const Param* params = NULL, int numParams = 0);
virtual void Stop();
const char* GroupName() const override { return "GridMate"; }
const char* GetName() const override { return "SessionDriller"; }
const char* GetDescription() const override { return "Drills GridSession, Search, etc."; }
void Start(const Param* params = NULL, int numParams = 0) override;
void Stop() override;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Session Event Bus
/// Callback that is called when the Session service is ready to process sessions.
virtual void OnSessionServiceReady();
void OnSessionServiceReady() override;
//virtual OnCommucationChanged() = 0 Callback that notifies the title when a member's communication settings change.
/// Callback that notifies the title when a game search query have completed.
virtual void OnGridSearchComplete(GridSearch* gridSearch);
void OnGridSearchComplete(GridSearch* gridSearch) override;
/// Callback that notifies the title when a new member joins the game session.
virtual void OnMemberJoined(GridSession* session, GridMember* member);
void OnMemberJoined(GridSession* session, GridMember* member) override;
/// Callback that notifies the title that a member is leaving the game session. member pointer is NOT valid after the callback returns.
virtual void OnMemberLeaving(GridSession* session, GridMember* member);
void OnMemberLeaving(GridSession* session, GridMember* member) override;
// \todo a better way will be (after we solve migration) is to supply a reason to OnMemberLeaving... like the member was kicked.
// this will require that we actually remove the replica at the same moment.
/// Callback that host decided to kick a member. You will receive a OnMemberLeaving when the actual member leaves the session.
virtual void OnMemberKicked(GridSession* session, GridMember* member);
void OnMemberKicked(GridSession* session, GridMember* member) override;
/// After this callback it is safe to access session features. If host session is fully operational if client wait for OnSessionJoined.
virtual void OnSessionCreated(GridSession* session);
void OnSessionCreated(GridSession* session) override;
/// Called on client machines to indicate that we join successfully.
virtual void OnSessionJoined(GridSession* session);
void OnSessionJoined(GridSession* session) override;
/// Callback that notifies the title when a session will be left. session pointer is NOT valid after the callback returns.
virtual void OnSessionDelete(GridSession* session);
void OnSessionDelete(GridSession* session) override;
/// Called when a session error occurs.
virtual void OnSessionError(GridSession* session, const AZStd::string& errorMsg);
void OnSessionError(GridSession* session, const AZStd::string& errorMsg) override;
/// Called when the actual game(match) starts
virtual void OnSessionStart(GridSession* session);
void OnSessionStart(GridSession* session) override;
/// Called when the actual game(match) ends
virtual void OnSessionEnd(GridSession* session);
void OnSessionEnd(GridSession* session) override;
/// Called when we have our last chance to write statistics data for member in the session.
virtual void OnWriteStatistics(GridSession* session, GridMember* member, StatisticsData& data);
void OnWriteStatistics(GridSession* session, GridMember* member, StatisticsData& data) override;
//////////////////////////////////////////////////////////////////////////
};
}
@@ -525,12 +525,12 @@ namespace GridMate
void Set(const DataType& val) { m_value = val; }
const DataType& Get() const { return m_value; }
virtual void Marshal(WriteBuffer& wb)
void Marshal(WriteBuffer& wb) override
{
wb.Write(m_value, m_marshaler);
}
virtual void Unmarshal(ReadBuffer& rb)
void Unmarshal(ReadBuffer& rb) override
{
rb.Read(m_value, m_marshaler);
}
@@ -64,8 +64,8 @@ namespace GridMate
///////////////////////////////////////////////////////////////////
// ReplicaMgrCallbackBus
virtual void OnDeactivateReplica(ReplicaId replicaId, ReplicaManager* pMgr) override;
virtual void OnPeerRemoved(PeerId peerId, ReplicaManager* pMgr) override;
void OnDeactivateReplica(ReplicaId replicaId, ReplicaManager* pMgr) override;
void OnPeerRemoved(PeerId peerId, ReplicaManager* pMgr) override;
///////////////////////////////////////////////////////////////////
void OnReceivedAckUpstreamSuspended(PeerId from, AZ::u32 requestTime);