#include
Public Member Functions | |
| virtual void | DeleteContext ()=0 |
| Releases this context. | |
| virtual void | ActivateDemoRecorder (const char *filename)=0 |
| Records this context as a demo file. | |
| virtual INetChannel * | GetDemoRecorderChannel () const =0 |
| Returs demo recorder channel. | |
| virtual void | ActivateDemoPlayback (const char *filename, INetChannel *pClient, INetChannel *pServer)=0 |
| Records this context as a demo file. | |
| 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 | LogRMI (const char *function, ISerializable *pParams)=0 |
| If we're recording, log an RMI call to a file. | |
| virtual void | LogCppRMI (EntityId id, IRMICppLogger *pLogger)=0 |
| Logs a custom (C++ based) RMI call to the demo file. | |
| virtual void | EnableBackgroundPassthrough (bool enable)=0 |
| Enables on a server to lower pass-through message latency. | |
| virtual void | DeclareAspect (const char *name, NetworkAspectType aspectBit, uint8 aspectFlags)=0 |
| virtual void | SetAspectChannelMask (NetworkAspectType aspectBit, ChannelMaskType mask)=0 |
| virtual ChannelMaskType | GetAspectChannelMask (NetworkAspectID aspectID)=0 |
| virtual void | SetAspectProfile (EntityId id, NetworkAspectType aspectBit, uint8 profile)=0 |
| 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 void | BindObject (EntityId id, EntityId parentId, NetworkAspectType aspectBits, bool bStatic)=0 |
| virtual void | SetDelegatableMask (EntityId id, NetworkAspectType delegateMask)=0 |
| The below can be used per object to prevent delegatable aspects from being delegated. | |
| virtual void | SafelyUnbind (EntityId id)=0 |
| virtual bool | IsBound (EntityId id)=0 |
| Removes the binding of an object to the network. | |
| 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. | |
| virtual EntityId | RemoveReservedUnboundEntityMapEntry (uint16 partialNetID)=0 |
| virtual void | EnableAspects (EntityId id, NetworkAspectType aspectBits, bool enabled)=0 |
| virtual void | ChangedAspects (EntityId id, NetworkAspectType aspectBits)=0 |
| virtual void | DelegateAuthority (EntityId id, INetChannel *pControlling)=0 |
| virtual bool | ChangeContext ()=0 |
| virtual void | EstablishedContext (int establishToken)=0 |
| virtual void | RemoveRMIListener (IRMIListener *pListener)=0 |
| Removing an RMI listener – make sure there's no pointers left to it. | |
| 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 | SetParentObject (EntityId objId, EntityId parentId)=0 |
| virtual void | RequestRemoteUpdate (EntityId id, NetworkAspectType aspects)=0 |
| virtual void | LogBreak (const SNetBreakDescription &des)=0 |
| Add a break event to the log of breaks for this context. | |
| virtual bool | SetSchedulingParams (EntityId objId, uint32 normal, uint32 owned)=0 |
| 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 | RegisterValidatedPredictedSpawn (INetChannel *pChannel, int predictionHandle, EntityId id)=0 |
| virtual void | GetMemoryStatistics (ICrySizer *pSizer)=0 |
| virtual void | RegisterServerControlledFile (const char *filename)=0 |
| register a file that should be server controlled | |
| 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 SNetObjectID | GetNetID (EntityId userID, bool ensureNotUnbinding=true)=0 |
| convert EntityId to netId and vice versa | |
| virtual EntityId | GetEntityID (SNetObjectID netID)=0 |
| virtual void | Resaltify (SNetObjectID &id)=0 |
| virtual NetworkAspectType | ServerControllerOnlyAspects () const =0 |
| Get a mask of all aspects declared with the eAF_ServerControllerOnly flag. | |
| virtual NetworkAspectType | DelegatableAspects () const =0 |
| Get a mask of all aspects declared with the eAF_Delegatable flag. | |
| virtual IVoiceContext * | GetVoiceContext ()=0 |
An INetContext manages the list of objects synchronized over the network.
|
pure virtual |
Binds an object to the network so it starts synchronizing its state.
| id | A user supplied id for this object (probably the entity id :)). |
| parentId | A user supplied id for this object's parent (0 = no parent). |
| aspectBits | A bit mask specifying which aspects are enabled now. |
|
pure virtual |
Changes the game context.
|
pure virtual |
Some aspects of an object have been changed - and those aspects should be updated shortly.
| id | ID of the object changed. |
| aspectBits | Bit field describing which aspects have been changed. |
|
pure virtual |
Calls just after construction to declare which aspect bits have which characteristics.
| aspectBit | Bit we are changing (1,2,4,8,16,32,64 or 128). |
| aspectFlags | Some combination of eAF_* that describes how this parameter will change. |
| basePriority | ase priority for this aspect. |
|
pure virtual |
Passes authority for updating an object to some remote channel. This channel must have had SetServer() called on it at construction time.
| id | The id of a bound object to change authority for. |
| pControlling | Channel who will now control the object (or NULL if we wish to take control). |
#include
#include
// Example for how authority / control of an entity can be delegated to a specific client channel
// Note that INetEntity::EnableDelegatableAspect has to have been called during entity spawning for aspects we want to handle on the client
void DelegateAuthorityToClient(const EntityId controlledEntityId, const uint16 clientChannelId)
{
INetChannel* pNetChannel = gEnv->pGameFramework->GetNetChannel(clientChannelId);
gEnv->pGameFramework->GetNetContext()->DelegateAuthority(controlledEntityId, pNetChannel);
}
// Example for how authority / control of an entity can be delegated back to the server
void DelegateAuthorityToServer(const EntityId controlledEntityId)
{
gEnv->pGameFramework->GetNetContext()->DelegateAuthority(controlledEntityId, nullptr);
}
|
pure virtual |
Enables/disables the synchronization of some aspects over the network.
| id | ID of a bound object. |
| aspectBits | The aspects to enable/disable. |
| enabled | Are we enabling new aspects, or disabling old ones. |
|
pure virtual |
The level has finished loading Example: The slow part of context establishment is complete.
|
pure virtual |
Returns the channel mask for this aspect
| aspectBit | Bit for which we are setting the mask. |
|
pure virtual |
Retrieve a reserved EntityId for previous known netID that had no entity bound to it.
| partialNetID | ID portion of a known SNetObjectID, without the salt. |
|
pure virtual |
Sets the channel mask for this aspect (aspectchannelmask & channelmask must be non 0 for send to occur)
| aspectBit | Bit for which we are setting the mask. |
| mask | Channel mask. |
|
pure virtual |
Modifies the profile of an aspect.
| aspectBit | The aspect we are changing. |
| profile | The new profile of the aspect. |
|
pure virtual |
Specifies an objects 'network parent'. Child objects are unspawned after the parent object is. Child objects are spawned after the parent object is.
|
pure virtual |
Set scheduling parameters for an object.
| normal | 4cc game/scripts/network/scheduler.xml. |
| owned | 4cc from game/scripts/network/scheduler.xml. |