INetContext

C++
struct INetContext {
};
File

INetwork.h

Description

An INetContext manages the list of objects synchronized over the network ONLY to be implemented in CryNetwork.

INetContext::~INetContext Destructor
C++
virtual ~INetContext();
INetContext::ActivateDemoPlayback Method
C++
virtual void ActivateDemoPlayback(const char * filename, INetChannel * pClient, INetChannel * pServer) = 0;
Description

Records this context as a demo file.

INetContext::ActivateDemoRecorder Method
C++
virtual void ActivateDemoRecorder(const char * filename) = 0;
Description

Records this context as a demo file.

INetContext::BindObject Method
C++
virtual void BindObject(EntityId id, EntityId parentId, NetworkAspectType aspectBits, bool bStatic) = 0;
Parameters
Parameters
Description
EntityId id
A user supplied id for this object (probably the entity id :)).
EntityId parentId
A user supplied id for this object's parent (0 = no parent)
NetworkAspectType aspectBits
A bit mask specifying which aspects are enabled now.
Description

Binds an object to the network so it starts synchronizing its state.

INetContext::ChangeContext Method
C++
virtual bool ChangeContext() = 0;
Description

Changes the game context.

Notes

Destroy all objects, and cause all channels to load a new level, and reinitialize state.

INetContext::ChangedAspects Method
C++
virtual void ChangedAspects(EntityId id, NetworkAspectType aspectBits) = 0;
Parameters
Parameters
Description
EntityId id
The id of the object changed.
NetworkAspectType aspectBits
A bit field describing which aspects have been changed.
Description

Some aspects of an object have been changed - and those aspects should be updated shortly.

Notes

The only way to get eAF_UpdateOccasionally aspects updated.

INetContext::DeclareAspect Method
C++
virtual void DeclareAspect(const char * name, NetworkAspectType aspectBit, uint8 aspectFlags) = 0;
Parameters
Parameters
Description
NetworkAspectType aspectBit
The bit we are changing (1,2,4,8,16,32,64 or 128).
uint8 aspectFlags
Some combination of eAF_* that describes how this parameter will change.
basePriority
Base priority for this aspect (TODO: may be removed).
Description

Calls just after construction to declare which aspect bits have which characteristics.

INetContext::DelegatableAspects Method
C++
virtual NetworkAspectType DelegatableAspects() const = 0;
Description

Get a mask of all aspects declared with the eAF_Delegatable flag

INetContext::DelegateAuthority Method
C++
virtual void DelegateAuthority(EntityId id, INetChannel * pControlling) = 0;
Parameters
Parameters
Description
EntityId id
The id of a *bound* object to change authority for.
INetChannel * pControlling
The channel who will now control the object (or NULL if we wish to take control).
Description

Passes authority for updating an object to some remote channel; this channel must have had SetServer() called on it at construction time.

Notes

Only those aspects marked as eAF_Delegatable are passed on.

INetContext::DeleteContext Method
C++
virtual void DeleteContext() = 0;
Description

Releases this context.

INetContext::EnableAspects Method
C++
virtual void EnableAspects(EntityId id, NetworkAspectType aspectBits, bool enabled) = 0;
Parameters
Parameters
Description
EntityId id
The id of a *bound* object.
NetworkAspectType aspectBits
The aspects to enable/disable.
bool enabled
Are we enabling new aspects, or disabling old ones.
Description

Enables/disables the synchronization of some aspects over the network.

INetContext::EnableBackgroundPassthrough Method
C++
virtual void EnableBackgroundPassthrough(bool enable) = 0;
Description

Enables on a server to lower pass-through message latency.

INetContext::EstablishedContext Method
C++
virtual void EstablishedContext(int establishToken) = 0;
Description

The level has finished loading

Notes

Call this after a call to IGameContext::EstablishContext.

See Also

IGameContext::EstablishContext

Example

The slow part of context establishment is complete.

INetContext::GetAspectChannelMask Method
C++
virtual ChannelMaskType GetAspectChannelMask(NetworkAspectID aspectID) = 0;
Parameters
Parameters
Description
aspectBit
The bit we are setting the mask for
Description

Returns the channel mask for this aspect

INetContext::GetAspectProfile Method
C++
virtual uint8 GetAspectProfile(EntityId id, NetworkAspectType aspectBit) = 0;
Description

Fetches the profile on an aspect; this is a very heavyweight method as it must completely flush the state of network queues before operating.

INetContext::GetDemoRecorderChannel Method
C++
virtual INetChannel* GetDemoRecorderChannel() const = 0;
Description

Returs demo recorder channel

INetContext::GetEntityID Method
C++
virtual EntityId GetEntityID(SNetObjectID netID) = 0;
INetContext::GetMemoryStatistics Method
C++
virtual void GetMemoryStatistics(ICrySizer* pSizer) = 0;
INetContext::GetNetID Method
C++
virtual SNetObjectID GetNetID(EntityId userID, bool ensureNotUnbinding = true) = 0;
Description

convert EntityId to netId and vice versa

INetContext::GetServerControlledICryPak Method
C++
virtual ICryPak * GetServerControlledICryPak() = 0;
Description

get an ICryPak interface for server controlled files

INetContext::GetServerControlledXml Method
C++
virtual XmlNodeRef GetServerControlledXml(const char * filename) = 0;
Description

Read XML out of a synced file

INetContext::GetVoiceContext Method
C++
virtual IVoiceContext* GetVoiceContext() = 0;
INetContext::IsBound Method
C++
virtual bool IsBound(EntityId id) = 0;
Description

Removes the binding of an object to the network.

INetContext::IsDemoPlayback Method
C++
virtual bool IsDemoPlayback() const = 0;
Description

Are we playing back a demo session?

INetContext::IsDemoRecording Method
C++
virtual bool IsDemoRecording() const = 0;
Description

Are we recording a demo session?

INetContext::LogBreak Method
C++
virtual void LogBreak(const SNetBreakDescription& des) = 0;
Description

add a break event to the log of breaks for this context

INetContext::LogCppRMI Method
C++
virtual void LogCppRMI(EntityId id, IRMICppLogger * pLogger) = 0;
Description

Logs a custom (C++ based) RMI call to the demo file.

INetContext::LogRMI Method
C++
virtual void LogRMI(const char * function, ISerializable * pParams) = 0;
Description

If we're recording, log an RMI call to a file.

INetContext::PulseObject Method
C++
virtual void PulseObject(EntityId objId, uint32 pulseType) = 0;
Description

add a priority pulse to an object (the shape of the pulse is described in the scheduling group in game/scripts/network/scheduler.

INetContext::RegisterPredictedSpawn Method
C++
virtual int RegisterPredictedSpawn(INetChannel * pChannel, EntityId id) = 0;
INetContext::RegisterServerControlledFile Method
C++
virtual void RegisterServerControlledFile(const char * filename) = 0;
Description

register a file that should be server controlled

INetContext::RegisterValidatedPredictedSpawn Method
C++
virtual void RegisterValidatedPredictedSpawn(INetChannel * pChannel, int predictionHandle, EntityId id) = 0;
INetContext::RemoteContextHasAuthority Method
C++
virtual bool RemoteContextHasAuthority(INetChannel * pChannel, EntityId id) = 0;
Description

Determines if the context on the remote end of a channel has authority over an object.

INetContext::RemoveRMIListener Method
C++
virtual void RemoveRMIListener(IRMIListener * pListener) = 0;
Description

Removing an RMI listener -- make sure there's no pointers left to it.

INetContext::RequestRemoteUpdate Method
C++
virtual void RequestRemoteUpdate(EntityId id, NetworkAspectType aspects) = 0;
INetContext::Resaltify Method
C++
virtual void Resaltify(SNetObjectID& id) = 0;
INetContext::SafelyUnbind Method
C++
virtual void SafelyUnbind(EntityId id) = 0;
INetContext::ServerControllerOnlyAspects Method
C++
virtual NetworkAspectType ServerControllerOnlyAspects() const = 0;
Description

Get a mask of all aspects declared with the eAF_ServerControllerOnly flag

INetContext::SetAspectChannelMask Method
C++
virtual void SetAspectChannelMask(NetworkAspectType aspectBit, ChannelMaskType mask) = 0;
Parameters
Parameters
Description
NetworkAspectType aspectBit
The bit we are setting the mask for
ChannelMaskType mask
The channel mask
Description

Sets the channel mask for this aspect (aspectchannelmask & channelmask must be non 0 for send to occur)

INetContext::SetAspectProfile Method
C++
virtual void SetAspectProfile(EntityId id, NetworkAspectType aspectBit, uint8 profile) = 0;
Parameters
Parameters
Description
NetworkAspectType aspectBit
The aspect we are changing.
uint8 profile
The new profile of the aspect.
Description

Modifies the profile of an aspect.

INetContext::SetDelegatableMask Method
C++
virtual void SetDelegatableMask(EntityId id, NetworkAspectType delegateMask) = 0;
Description

The below can be used per object to prevent delegatable aspects from being delegated

INetContext::SetParentObject Method
C++
virtual void SetParentObject(EntityId objId, EntityId parentId) = 0;
Description

Specifies an objects 'network parent'.

  • Child objects are unspawned after the parent object is.
  • Child objects are spawned after the parent object is.
INetContext::SetSchedulingParams Method
C++
virtual bool SetSchedulingParams(EntityId objId, uint32 normal, uint32 owned) = 0;
Description

set scheduling parameters for an object normal and owned are 4cc's from game/scripts/network/scheduler.xml

INetContext::SpawnedObject Method
C++
virtual void SpawnedObject(EntityId id) = 0;
Description

Must be called ONCE in response to a message sent from a SendSpawnObject call on the server (from the client).

INetContext::UnbindObject Method
C++
virtual bool UnbindObject(EntityId id) = 0;
Description

Determines if an object is bound or not.