struct INetContext { };
INetwork.h
An INetContext manages the list of objects synchronized over the network ONLY to be implemented in CryNetwork.
virtual ~INetContext();
virtual void ActivateDemoPlayback(const char * filename, INetChannel * pClient, INetChannel * pServer) = 0;
Records this context as a demo file.
virtual void ActivateDemoRecorder(const char * filename) = 0;
Records this context as a demo file.
virtual void BindObject(EntityId id, EntityId parentId, NetworkAspectType aspectBits, bool bStatic) = 0;
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. |
Binds an object to the network so it starts synchronizing its state.
virtual bool ChangeContext() = 0;
Changes the game context.
Destroy all objects, and cause all channels to load a new level, and reinitialize state.
virtual void ChangedAspects(EntityId id, NetworkAspectType aspectBits) = 0;
Parameters |
Description |
EntityId id |
The id of the object changed. |
NetworkAspectType aspectBits |
A bit field describing which aspects have been changed. |
Some aspects of an object have been changed - and those aspects should be updated shortly.
The only way to get eAF_UpdateOccasionally aspects updated.
virtual void DeclareAspect(const char * name, NetworkAspectType aspectBit, uint8 aspectFlags) = 0;
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). |
Calls just after construction to declare which aspect bits have which characteristics.
virtual NetworkAspectType DelegatableAspects() const = 0;
Get a mask of all aspects declared with the eAF_Delegatable flag
virtual void DelegateAuthority(EntityId id, INetChannel * pControlling) = 0;
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). |
Passes authority for updating an object to some remote channel; this channel must have had SetServer() called on it at construction time.
Only those aspects marked as eAF_Delegatable are passed on.
virtual void DeleteContext() = 0;
Releases this context.
virtual void EnableAspects(EntityId id, NetworkAspectType aspectBits, bool enabled) = 0;
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. |
Enables/disables the synchronization of some aspects over the network.
virtual void EnableBackgroundPassthrough(bool enable) = 0;
Enables on a server to lower pass-through message latency.
virtual void EstablishedContext(int establishToken) = 0;
The level has finished loading
Call this after a call to IGameContext::EstablishContext.
IGameContext::EstablishContext
The slow part of context establishment is complete.
virtual ChannelMaskType GetAspectChannelMask(NetworkAspectID aspectID) = 0;
Parameters |
Description |
aspectBit |
The bit we are setting the mask for |
Returns the channel mask for this aspect
virtual uint8 GetAspectProfile(EntityId id, NetworkAspectType aspectBit) = 0;
Fetches the profile on an aspect; this is a very heavyweight method as it must completely flush the state of network queues before operating.
virtual INetChannel* GetDemoRecorderChannel() const = 0;
Returs demo recorder channel
virtual EntityId GetEntityID(SNetObjectID netID) = 0;
virtual void GetMemoryStatistics(ICrySizer* pSizer) = 0;
virtual SNetObjectID GetNetID(EntityId userID, bool ensureNotUnbinding = true) = 0;
convert EntityId to netId and vice versa
virtual ICryPak * GetServerControlledICryPak() = 0;
get an ICryPak interface for server controlled files
virtual XmlNodeRef GetServerControlledXml(const char * filename) = 0;
Read XML out of a synced file
virtual IVoiceContext* GetVoiceContext() = 0;
virtual bool IsBound(EntityId id) = 0;
Removes the binding of an object to the network.
virtual bool IsDemoPlayback() const = 0;
Are we playing back a demo session?
virtual bool IsDemoRecording() const = 0;
Are we recording a demo session?
virtual void LogBreak(const SNetBreakDescription& des) = 0;
add a break event to the log of breaks for this context
virtual void LogCppRMI(EntityId id, IRMICppLogger * pLogger) = 0;
Logs a custom (C++ based) RMI call to the demo file.
virtual void LogRMI(const char * function, ISerializable * pParams) = 0;
If we're recording, log an RMI call to a file.
virtual void PulseObject(EntityId objId, uint32 pulseType) = 0;
add a priority pulse to an object (the shape of the pulse is described in the scheduling group in game/scripts/network/scheduler.
virtual int RegisterPredictedSpawn(INetChannel * pChannel, EntityId id) = 0;
virtual void RegisterServerControlledFile(const char * filename) = 0;
register a file that should be server controlled
virtual void RegisterValidatedPredictedSpawn(INetChannel * pChannel, int predictionHandle, EntityId id) = 0;
virtual bool RemoteContextHasAuthority(INetChannel * pChannel, EntityId id) = 0;
Determines if the context on the remote end of a channel has authority over an object.
virtual void RemoveRMIListener(IRMIListener * pListener) = 0;
Removing an RMI listener -- make sure there's no pointers left to it.
virtual void RequestRemoteUpdate(EntityId id, NetworkAspectType aspects) = 0;
virtual void Resaltify(SNetObjectID& id) = 0;
virtual void SafelyUnbind(EntityId id) = 0;
virtual NetworkAspectType ServerControllerOnlyAspects() const = 0;
Get a mask of all aspects declared with the eAF_ServerControllerOnly flag
virtual void SetAspectChannelMask(NetworkAspectType aspectBit, ChannelMaskType mask) = 0;
Parameters |
Description |
NetworkAspectType aspectBit |
The bit we are setting the mask for |
ChannelMaskType mask |
The channel mask |
Sets the channel mask for this aspect (aspectchannelmask & channelmask must be non 0 for send to occur)
virtual void SetAspectProfile(EntityId id, NetworkAspectType aspectBit, uint8 profile) = 0;
Parameters |
Description |
NetworkAspectType aspectBit |
The aspect we are changing. |
uint8 profile |
The new profile of the aspect. |
Modifies the profile of an aspect.
virtual void SetDelegatableMask(EntityId id, NetworkAspectType delegateMask) = 0;
The below can be used per object to prevent delegatable aspects from being delegated
Specifies an objects 'network parent'.
virtual bool SetSchedulingParams(EntityId objId, uint32 normal, uint32 owned) = 0;
set scheduling parameters for an object normal and owned are 4cc's from game/scripts/network/scheduler.xml
virtual void SpawnedObject(EntityId id) = 0;
Must be called ONCE in response to a message sent from a SendSpawnObject call on the server (from the client).
virtual bool UnbindObject(EntityId id) = 0;
Determines if an object is bound or not.