struct INetChannel : public INetMessageSink { struct SPerformanceMetrics { ICVar * pBitRateDesired; ICVar * pBitRateToleranceHigh; ICVar * pBitRateToleranceLow; ICVar * pPacketRateDesired; ICVar * pIdlePacketRateDesired; ICVar * pPacketRateToleranceHigh; ICVar * pPacketRateToleranceLow; }; struct SStatistics { float bandwidthUp; float bandwidthDown; }; };
INetwork.h
struct SPerformanceMetrics { ICVar * pBitRateDesired; ICVar * pBitRateToleranceHigh; ICVar * pBitRateToleranceLow; ICVar * pPacketRateDesired; ICVar * pIdlePacketRateDesired; ICVar * pPacketRateToleranceHigh; ICVar * pPacketRateToleranceLow; };
INetwork.h
See CNetCVars - net_defaultChannelfor defaults
ICVar * pBitRateDesired;
Desired bit rate (in bits-per-second).
ICVar * pBitRateToleranceHigh;
Bit rate targets can climb to bitRateDesired * (1.0f + bitRateToleranceHigh).
ICVar * pBitRateToleranceLow;
Bit rate targets can fall to bitRateDesired * (1.0f - bitRateToleranceLow).
ICVar * pIdlePacketRateDesired;
Desired packet rate when nothing urgent needs to be sent (in packets-per-second).
ICVar * pPacketRateDesired;
Desired packet rate (in packets-per-second)
ICVar * pPacketRateToleranceHigh;
Packet rate targets can climb to packetRateDesired * (1.0f + packetRateToleranceHigh).
ICVar * pPacketRateToleranceLow;
Packet rate targets can fall to packetRateDesired * (1.0f - packetRateToleranceLow).
SPerformanceMetrics();
struct SStatistics { float bandwidthUp; float bandwidthDown; };
INetwork.h
float bandwidthDown;
float bandwidthUp;
SStatistics();
virtual bool AddSendable(INetSendablePtr pMsg, int numAfterHandle, const SSendableHandle * afterHandle, SSendableHandle * handle) = 0;
Lower level, more advanced sending interface; enforces sending after afterHandle, and returns a handle to this message in handle.
virtual void AddWaitForFileSyncComplete(IContextEstablisher * pEst, EContextViewState when) = 0;
add a wait for file sync complete marker to a context establisher
virtual void AllowVoiceTransmission(bool allow) = 0;
virtual void CallUpdate(CTimeValue time);
virtual void CallUpdateIfNecessary(CTimeValue time, bool force);
virtual void DeclareWitness(EntityId id) = 0;
Declares an entity that "witnesses" the world... allows prioritization.
virtual void Disconnect(EDisconnectionCause cause, const char * fmt, ...) = 0;
Disconnects this channel.
virtual void DispatchRMI(IRMIMessageBodyPtr pBody) = 0;
Dispatches a remote method invocation.
virtual EChannelConnectionState GetChannelConnectionState() const = 0;
virtual ChannelMaskType GetChannelMask() = 0;
virtual EContextViewState GetContextViewState() const = 0;
virtual int GetContextViewStateDebugCode() const = 0;
virtual IGameChannel * GetGameChannel() = 0;
virtual TNetChannelID GetLocalChannelID() = 0;
Gets the local channel ID.
virtual void GetMemoryStatistics(ICrySizer* pSizer, bool countingThis = false) = 0;
virtual const char * GetName() = 0;
Gets a descriptive string describing the channel.
virtual const char* GetNickname() = 0;
Gets a descriptive string describing the channel.
virtual float GetPing(bool smoothed) const = 0;
Gets the current ping.
virtual int GetProfileId() const = 0;
Gets the unique and persistent profile id for this client (profile id is associated with the user account).
virtual TNetChannelID GetRemoteChannelID() = 0;
Gets the remote channel ID.
virtual CTimeValue GetRemoteTime() const = 0;
Gets the remote time.
virtual CrySessionHandle GetSession() const = 0;
virtual const SStatistics& GetStatistics() = 0;
Gets current channel based statistics for this channel.
virtual CTimeValue GetTimeSinceRecv() const = 0;
Gets the time since data was last received on this channel.
virtual bool HasGameRequestedUpdate() = 0;
virtual bool IsConnectionEstablished() const = 0;
Checks if this connection has been successfully established.
virtual bool IsFakeChannel() const = 0;
Checks if this channel is a fake one.
ContextView extensions will not be created for fake channels.
Demorecording, debug channel etc.
virtual bool IsInTransition() = 0;
is this channel currently transitioning between levels?
virtual bool IsLocal() const = 0;
Checks if this channel is connected locally.
virtual bool IsMigratingChannel() const = 0;
virtual bool IsPreordered() const = 0;
Checks if remote channel have pre-ordered copy.
virtual bool IsSufferingHighLatency(CTimeValue nTime) const = 0;
Checks if the system is suffering high latency.
virtual bool IsTimeReady() const = 0;
has timing synchronization reached stabilization
virtual bool RemoveSendable(SSendableHandle handle) = 0;
Undoes a sent message if possible.
virtual void RequestUpdate(CTimeValue time) = 0;
virtual void SendMsg(INetMessage *) = 0;
Sends a message to the other end of this channel.
virtual void SetChannelMask(ChannelMaskType newMask) = 0;
virtual void SetClient(INetContext* pNetContext, bool cheatProtection) = 0;
virtual void SetMigratingChannel(bool bIsMigrating) = 0;
virtual void SetNickname(const char* name) = 0;
Sets a persistent nickname for this channel (MP playername).
virtual void SetPassword(const char * password) = 0;
Parameters |
Description |
const char * password |
The new password string; will be checked at every context change if the length>0. |
Sets/resets the server password.
virtual void SetPeer(INetContext* pNetContext, bool cheatProtection) = 0;
virtual void SetPerformanceMetrics(SPerformanceMetrics * pMetrics) = 0;
Parameters |
Description |
SPerformanceMetrics * pMetrics |
An SPerformanceMetrics structure describing these tolerances. |
Sets tolerances on packet delivery rate, bandwidth consumption, packet size, etc...
virtual void SetServer(INetContext* pNetContext, bool cheatProtection) = 0;
virtual bool SubstituteSendable(INetSendablePtr pMsg, int numAfterHandle, const SSendableHandle * afterHandle, SSendableHandle * handle) = 0;
Like AddSendable, but removes an old message if it still exists.
virtual CTimeValue TimeSinceVoiceReceipt(EntityId id) = 0;
virtual CTimeValue TimeSinceVoiceTransmission() = 0;