Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "GameNetwork/GeneralsOnline/NGMP_interfaces.h"

#include <ws2ipdef.h>
#include <atomic>
#include "GameNetwork/NetworkDefs.h"
#include "GameNetwork/NetworkInterface.h"
#include "GameLogic/GameLogic.h"
Expand Down Expand Up @@ -324,17 +325,25 @@
{
CSignalingClient* const m_pOwner;
int64_t const m_targetUserID;
std::atomic<int> m_refCount;

ConnectionSignaling(CSignalingClient* owner, int64_t target_user_id)
: m_pOwner(owner)
, m_targetUserID(target_user_id)
, m_refCount(1)
{
}

//
// Implements ISteamNetworkingConnectionSignaling
//

// AddRef - increment reference count
virtual int AddRef() override

Check failure on line 342 in GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+e

'CSignalingClient::ConnectionSignaling::AddRef': method with override specifier 'override' did not override any base class methods

Check failure on line 342 in GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+e

'CSignalingClient::ConnectionSignaling::AddRef': method with override specifier 'override' did not override any base class methods

Check failure on line 342 in GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/NetworkMesh.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+e

'CSignalingClient::ConnectionSignaling::AddRef': method with override specifier 'override' did not override any base class methods
{
return ++m_refCount;
}

// This is called from SteamNetworkingSockets to send a signal. This could be called from any thread,
// so we need to be threadsafe, and avoid duoing slow stuff or calling back into SteamNetworkingSockets
virtual bool SendSignal(HSteamNetConnection hConn, const SteamNetConnectionInfo_t& info, const void* pMsg, int cbMsg) override
Expand All @@ -353,7 +362,11 @@
// Self destruct. This will be called by SteamNetworkingSockets when it's done with us.
virtual void Release() override
{
delete this;
int refCount = --m_refCount;
if (refCount == 0)
{
delete this;
}
}
};

Expand Down
Loading