IGameFramework

Interface which exposes the CryAction subsystems. More...

#include

Public Types

typedef uint32 TimerID
typedef Functor2< void *, TimerID > TimerCallback
typedef CryStackStringT< char, 256 > TSaveGameName
Type to represent saved game names, keeping the string on the stack if possible.

Public Member Functions

DECLARE_GAMEOBJECT_FACTORY (ISaveGame)
DECLARE_GAMEOBJECT_FACTORY (ILoadGame)
DECLARE_GAMEOBJECTEXTENSION_FACTORY (Actor)
DECLARE_GAMEOBJECTEXTENSION_FACTORY (Item)
DECLARE_GAMEOBJECTEXTENSION_FACTORY (Vehicle)
DECLARE_GAMEOBJECTEXTENSION_FACTORY (GameObjectExtension)
virtual void ShutDown ()=0
Called when the engine is shutting down to finalize the game framework.
virtual void PreSystemUpdate ()=0
Called just before calling ISystem::RenderBegin, after the renderer has been notified to prepare for a new frame.
virtual bool PostSystemUpdate (bool hasFocus, CEnumFlags< ESystemUpdateFlags > updateFlags)=0
virtual void PreFinalizeCamera (CEnumFlags< ESystemUpdateFlags > updateFlags)=0
virtual void PreRender ()=0
Called just before ISystem::Render.
virtual void PostRender (CEnumFlags< ESystemUpdateFlags > updateFlags)=0
Called after ISystem::Render, when the renderer should now have started rendering.
virtual void PostRenderSubmit ()=0
Called after ISystem::RenderEnd, when the renderer has been notified that the frame is final.
virtual void InitGameType (bool multiplayer, bool fromInit)=0
Used to notify the framework that we're switching between single and multi player.
virtual void PrePhysicsUpdate ()=0
Calls Physics update before starting a game frame.
virtual void Reset (bool clients)=0
Resets the current game.
virtual void PauseGame (bool pause, bool force, unsigned int nFadeOutInMS=0)=0
virtual bool IsGamePaused ()=0
virtual bool IsGameStarted ()=0
Are we completely into game mode?
virtual ISystem * GetISystem ()=0
virtual ILanQueryListener * GetILanQueryListener ()=0
virtual IUIDraw * GetIUIDraw ()=0
virtual IMannequin & GetMannequinInterface ()=0
virtual IGameObjectSystem * GetIGameObjectSystem ()=0
virtual ILevelSystem * GetILevelSystem ()=0
virtual IActorSystem * GetIActorSystem ()=0
virtual IItemSystem * GetIItemSystem ()=0
virtual IBreakReplicator * GetIBreakReplicator ()=0
virtual IActionMapManager * GetIActionMapManager ()=0
virtual IViewSystem * GetIViewSystem ()=0
virtual IGameplayRecorder * GetIGameplayRecorder ()=0
virtual IVehicleSystem * GetIVehicleSystem ()=0
virtual IGameRulesSystem * GetIGameRulesSystem ()=0
virtual IFlowSystem * GetIFlowSystem ()=0
virtual IGameTokenSystem * GetIGameTokenSystem ()=0
virtual IEffectSystem * GetIEffectSystem ()=0
virtual IMaterialEffects * GetIMaterialEffects ()=0
virtual IDialogSystem * GetIDialogSystem ()=0
virtual IPlayerProfileManager * GetIPlayerProfileManager ()=0
virtual ISubtitleManager * GetISubtitleManager ()=0
virtual IRealtimeRemoteUpdate * GetIRealTimeRemoteUpdate ()=0
Returns a pointer to the IRealtimeUpdate Interface.
virtual IGameStatistics * GetIGameStatistics ()=0
Returns a pointer to the IGameStatistics interface.
virtual ICooperativeAnimationManager * GetICooperativeAnimationManager ()=0
Pointer to ICooperativeAnimationManager interface.
virtual ICheckpointSystem * GetICheckpointSystem ()=0
Pointer to ICheckpointSystem interface.
virtual IForceFeedbackSystem * GetIForceFeedbackSystem () const =0
Pointer to IForceFeedbackSystem interface.
virtual ICustomActionManager * GetICustomActionManager () const =0
Pointer to ICustomActionManager interface.
virtual ICustomEventManager * GetICustomEventManager () const =0
Pointer to ICustomEventManager interface.
virtual IGameSessionHandler * GetIGameSessionHandler ()=0
virtual ISharedParamsManager * GetISharedParamsManager ()=0
Get pointer to Shared Parameters manager interface class.
virtual IGame * GetIGame ()=0
virtual void * GetGameModuleHandle () const =0
virtual bool StartGameContext (const SGameStartParams *pGameStartParams)=0
virtual bool ChangeGameContext (const SGameContextParams *pGameContextParams)=0
virtual void EndGameContext ()=0
Finished a game context (no game running anymore).
virtual bool StartedGameContext () const =0
virtual bool StartingGameContext () const =0
virtual void SetGameSessionHandler (IGameSessionHandler *pSessionHandler)=0
Sets the current game session handler to another implementation.
virtual bool BlockingSpawnPlayer ()=0
For the editor: spawn a player and wait for connection.
virtual void FlushBreakableObjects ()=0
Remove broken entity parts.
virtual void ResetBrokenGameObjects ()=0
For the game : fix the broken game objects (to restart the map)
virtual void CloneBrokenObjectsAndRevertToStateAtTime (int32 iFirstBreakEventIndex, uint16 *pBreakEventIndices, int32 &iNumBreakEvents, IRenderNode **outClonedNodes, int32 &iNumClonedNodes, SRenderNodeCloneLookup &renderNodeLookup)=0
For the kill cam : clone the list of objects specified in the break events indexed.
virtual void ApplySingleProceduralBreakFromEventIndex (uint16 uBreakEventIndex, const SRenderNodeCloneLookup &renderNodeLookup)=0
For the kill cam: apply a single break event from an index.
virtual void UnhideBrokenObjectsByIndex (uint16 *ObjectIndicies, int32 iNumObjectIndices)=0
For the game: unhide the broken game objects (at the end of the kill cam)
virtual void InitEditor (IGameToEditorInterface *pGameToEditor)=0
Let the GameFramework initialize with the editor.
virtual void SetEditorLevel (const char *levelName, const char *levelFolder)=0
Inform the GameFramework of the current level loaded in the editor.
virtual void GetEditorLevel (char **levelName, char **levelFolder)=0
virtual void BeginLanQuery ()=0
Begin a query on the LAN for games.
virtual void EndCurrentQuery ()=0
End the current game query.
virtual IActor * GetClientActor () const =0
Returns the Actor associated with the client (or NULL)
virtual EntityId GetClientActorId () const =0
Returns the Actor Id associated with the client (or NULL)
virtual IEntity * GetClientEntity () const =0
Returns the Entity associated with the client (or NULL)
virtual EntityId GetClientEntityId () const =0
Returns the EntityId associated with the client (or NULL)
virtual INetChannel * GetClientChannel () const =0
Returns the INetChannel associated with the client (or NULL)
virtual CTimeValue GetServerTime ()=0
Returns the (synched) time of the server (so use this for timed events, such as MP round times)
virtual uint16 GetGameChannelId (INetChannel *pNetChannel)=0
virtual bool IsChannelOnHold (uint16 channelId)=0
virtual INetChannel * GetNetChannel (uint16 channelId)=0
virtual void SetServerChannelPlayerId (uint16 channelId, EntityId id)=0
virtual const SEntitySchedulingProfiles * GetEntitySchedulerProfiles (IEntity *pEnt)=0
virtual IGameObject * GetGameObject (EntityId id)=0
virtual bool GetNetworkSafeClassId (uint16 &id, const char *className)=0
virtual bool GetNetworkSafeClassName (char *className, size_t maxn, uint16 id)=0
virtual IGameObjectExtension * QueryGameObjectExtension (EntityId id, const char *name)=0
virtual ITimeDemoRecorder * GetITimeDemoRecorder () const =0
Retrieve pointer to the ITimeDemoRecorder (or NULL)
virtual bool SaveGame (const char *path, bool quick=false, bool bForceImmediate=true, ESaveGameReason reason=eSGR_QuickSave, bool ignoreDelay=false, const char *checkPoint=NULL)=0
Save the current game to disk.
virtual ELoadGameResult LoadGame (const char *path, bool quick=false, bool ignoreDelay=false)=0
Load a game from disk (calls StartGameContext...)
virtual TSaveGameName CreateSaveGameName ()=0
virtual void ScheduleEndLevel (const char *nextLevel)=0
virtual void ScheduleEndLevelNow (const char *nextLevel)=0
Schedules the level load for the next level.
virtual void OnEditorSetGameMode (int iMode)=0
virtual bool IsEditing ()=0
virtual bool IsInLevelLoad ()=0
virtual bool IsLoadingSaveGame ()=0
virtual bool IsInTimeDemo ()=0
virtual bool IsTimeDemoRecording ()=0
virtual void AllowSave (bool bAllow=true)=0
virtual void AllowLoad (bool bAllow=true)=0
virtual bool CanSave ()=0
virtual bool CanLoad ()=0
virtual ISerializeHelper * GetSerializeHelper () const =0
Gets a serialization helper for read/write usage based on settings.
virtual bool CanCheat ()=0
Check if the current game can activate cheats (flymode, godmode, nextspawn)
virtual const char * GetLevelName ()=0
virtual void GetAbsLevelPath (char *pPathBuffer, uint32 pathBufferSize)=0
virtual IPersistantDebug * GetIPersistantDebug ()=0
virtual void AddBreakEventListener (IBreakEventListener *pListener)=0
Adds a listener for break events.
virtual void RemoveBreakEventListener (IBreakEventListener *pListener)=0
Removes a listener for break events.
virtual void RegisterListener (IGameFrameworkListener *pGameFrameworkListener, const char *name, EFRAMEWORKLISTENERPRIORITY eFrameworkListenerPriority)=0
virtual void UnregisterListener (IGameFrameworkListener *pGameFrameworkListener)=0
virtual INetNub * GetServerNetNub ()=0
virtual IGameServerNub * GetIGameServerNub ()=0
virtual INetNub * GetClientNetNub ()=0
virtual IGameClientNub * GetIGameClientNub ()=0
virtual void SetGameGUID (const char *gameGUID)=0
virtual const char * GetGameGUID ()=0
virtual INetContext * GetNetContext ()=0
virtual void GetMemoryUsage (ICrySizer *pSizer) const =0
virtual void EnableVoiceRecording (const bool enable)=0
virtual void MutePlayerById (EntityId mutePlayer)=0
virtual IDebugHistoryManager * CreateDebugHistoryManager ()=0
virtual void DumpMemInfo (const char *format,...) PRINTF_PARAMS(2
virtual void virtual bool IsVoiceRecordingEnabled ()=0
Check whether the client actor is using voice communication.
virtual bool IsImmersiveMPEnabled ()=0
virtual void ExecuteCommandNextFrame (const char *)=0
Executes console command on next frame's beginning.
virtual const char * GetNextFrameCommand () const =0
virtual void ClearNextFrameCommand ()=0
virtual void ShowPageInBrowser (const char *URL)=0
Opens a page in default browser.
virtual bool StartProcess (const char *cmd_line)=0
Opens a page in default browser.
virtual bool SaveServerConfig (const char *path)=0
Saves dedicated server console variables in server config file.
virtual void PrefetchLevelAssets (const bool bEnforceAll)=0
virtual void ReleaseGameStats ()=0
virtual void OnBreakageSpawnedEntity (IEntity *pEntity, IPhysicalEntity *pPhysEntity, IPhysicalEntity *pSrcPhysEntity)=0
Inform that an IEntity was spawned from breakage.
virtual bool IsGameSession (CrySessionHandle sessionHandle)=0
Returns true if the supplied game session is a game session.
virtual bool ShouldMigrateNub (CrySessionHandle sessionHandle)=0
Returns true if the nub should be migrated for a given session.
virtual IGameFramework::TimerID AddTimer (CTimeValue interval, bool repeat, TimerCallback callback, void *userdata=0)=0
virtual void * RemoveTimer (TimerID timerID)=0
Remove an existing timer by using its handle, returns user data.
virtual uint32 GetPreUpdateTicks ()=0
Return ticks last preupdate took.
virtual float GetLoadSaveDelay () const =0
virtual void StartNetworkStallTicker (bool includeMinimalUpdate)=0
Allows the network code to keep ticking in the event of a stall on the main thread.
virtual void StopNetworkStallTicker ()=0
virtual IGameVolumes * GetIGameVolumesManager () const =0
Retrieves manager which handles game objects tied to editor shapes and volumes.
virtual void PreloadAnimatedCharacter (IScriptTable *pEntityScript)=0
virtual void PrePhysicsTimeStep (float deltaTime)=0
virtual void RegisterExtension (ICryUnknownPtr pExtension)=0
virtual void ReleaseExtensions ()=0
template
ExtensionInterface * QueryExtension () const
Retrieves an extension interface if registered with the framework.
virtual void AddNetworkedClientListener (INetworkedClientListener &listener)=0
virtual void RemoveNetworkedClientListener (INetworkedClientListener &listener)=0
virtual void DoInvokeRMI (_smart_ptr< IRMIMessageBody > pBody, unsigned where, int channel, const bool isGameObjectRmi)=0

Protected Member Functions

virtual ICryUnknownPtr QueryExtensionInterfaceById (const CryInterfaceID &interfaceID) const =0

Detailed Description

Interface which exposes the CryAction subsystems.

Member Function Documentation

◆ AddTimer()

virtual IGameFramework::TimerID IGameFramework::AddTimer ( CTimeValue interval,
bool repeat,
TimerCallback callback,
void * userdata = 0
)
pure virtual

Adds a timer that will trigger a callback function passed by parameter. Allows to pass some user data pointer that will be one of the parameters for the callback function. The signature for the callback function is: void (void*, int). It allows member functions by using CE functors.

Returns
Handle of the timer created

◆ ChangeGameContext()

virtual bool IGameFramework::ChangeGameContext ( const SGameContextParams * pGameContextParams)
pure virtual

Changes a game context (levels and rules, etc); only allowed on the server.

Parameters
pGameContextParamsParameters for configuring the context.
Returns
true if successful, false otherwise.

◆ GetEditorLevel()

virtual void IGameFramework::GetEditorLevel ( char ** levelName,
char ** levelFolder
)
pure virtual

Retrieves the current level loaded by the editor. Parameters are pointers to receive the level infos.

◆ GetGameChannelId()

virtual uint16 IGameFramework::GetGameChannelId ( INetChannel * pNetChannel)
pure virtual

Retrieve the Game Server Channel Id associated with the specified INetChannel.

Returns
The Game Server ChannelId associated with the specified INetChannel.

◆ GetGameObject()

virtual IGameObject* IGameFramework::GetGameObject ( EntityId id)
pure virtual

Retrieve an IGameObject from an entity id

Returns
Pointer to IGameObject of the entity if it exists (or NULL otherwise)

◆ GetIActionMapManager()

virtual IActionMapManager* IGameFramework::GetIActionMapManager ( )
pure virtual

Returns a pointer to the IActionMapManager interface.

Returns
Pointer to IActionMapManager interface.

◆ GetIActorSystem()

virtual IActorSystem* IGameFramework::GetIActorSystem ( )
pure virtual

Returns a pointer to the IActorSystem interface.

Returns
Pointer to IActorSystem interface.

◆ GetIBreakReplicator()

virtual IBreakReplicator* IGameFramework::GetIBreakReplicator ( )
pure virtual

Returns a pointer to the IBreakReplicator interface.

Returns
Pointer to IBreakReplicator interface.

◆ GetIDialogSystem()

virtual IDialogSystem* IGameFramework::GetIDialogSystem ( )
pure virtual

Returns a pointer to the IDialogSystem interface

Returns
Pointer to IDialogSystem interface.

◆ GetIEffectSystem()

virtual IEffectSystem* IGameFramework::GetIEffectSystem ( )
pure virtual

Returns a pointer to the IEffectSystem interface

Returns
Pointer to IEffectSystem interface.

◆ GetIFlowSystem()

virtual IFlowSystem* IGameFramework::GetIFlowSystem ( )
pure virtual

Returns a pointer to the IFlowSystem interface.

Returns
Pointer to IFlowSystem interface.

◆ GetIGameObjectSystem()

virtual IGameObjectSystem* IGameFramework::GetIGameObjectSystem ( )
pure virtual

Returns a pointer to the IGameObjectSystem interface.

Returns
Pointer to IGameObjectSystem interface.

◆ GetIGameplayRecorder()

virtual IGameplayRecorder* IGameFramework::GetIGameplayRecorder ( )
pure virtual

Returns a pointer to the IGameplayRecorder interface.

Returns
Pointer to IGameplayRecorder interface.

◆ GetIGameRulesSystem()

virtual IGameRulesSystem* IGameFramework::GetIGameRulesSystem ( )
pure virtual

Returns a pointer to the IGameRulesSystem interface.

Returns
Pointer to IGameRulesSystem interface.

◆ GetIGameTokenSystem()

virtual IGameTokenSystem* IGameFramework::GetIGameTokenSystem ( )
pure virtual

Returns a pointer to the IGameTokenSystem interface

Returns
Pointer to IGameTokenSystem interface.

◆ GetIItemSystem()

virtual IItemSystem* IGameFramework::GetIItemSystem ( )
pure virtual

Returns a pointer to the IItemSystem interface.

Returns
Pointer to IItemSystem interface.

◆ GetILanQueryListener()

virtual ILanQueryListener* IGameFramework::GetILanQueryListener ( )
pure virtual
Returns
Pointer to the ILanQueryListener interface.

◆ GetILevelSystem()

virtual ILevelSystem* IGameFramework::GetILevelSystem ( )
pure virtual

Returns a pointer to the ILevelSystem interface.

Returns
Pointer to ILevelSystem interface.

◆ GetIMaterialEffects()

virtual IMaterialEffects* IGameFramework::GetIMaterialEffects ( )
pure virtual

Returns a pointer to the IMaterialEffects interface.

Returns
Pointer to IMaterialEffects interface.

◆ GetIPlayerProfileManager()

virtual IPlayerProfileManager* IGameFramework::GetIPlayerProfileManager ( )
pure virtual

Returns a pointer to the IPlayerProfileManager interface.

Returns
Pointer to IPlayerProfileManager interface.

◆ GetISubtitleManager()

virtual ISubtitleManager* IGameFramework::GetISubtitleManager ( )
pure virtual

Returns a pointer to the ISubtitleManager interface.

Returns
Pointer to ISubtitleManager interface.

◆ GetISystem()

virtual ISystem* IGameFramework::GetISystem ( )
pure virtual
Returns
Pointer to the ISystem interface.

◆ GetIUIDraw()

virtual IUIDraw* IGameFramework::GetIUIDraw ( )
pure virtual
Returns
Pointer to the IUIDraw interface.

◆ GetIVehicleSystem()

virtual IVehicleSystem* IGameFramework::GetIVehicleSystem ( )
pure virtual

Returns a pointer to the IVehicleSystem interface.

Returns
Pointer to IVehicleSystem interface.

◆ GetIViewSystem()

virtual IViewSystem* IGameFramework::GetIViewSystem ( )
pure virtual

Returns a pointer to the IViewSystem interface.

Returns
Pointer to IViewSystem interface.

◆ GetLevelName()

virtual const char* IGameFramework::GetLevelName ( )
pure virtual
Returns
Path relative to the levels folder e.g. "Multiplayer\PS\Shore".

◆ GetLoadSaveDelay()

virtual float IGameFramework::GetLoadSaveDelay ( ) const
pure virtual

Get the time left when we are allowed to load a new game. When this returns 0, we are allowed to load a new game.

◆ GetNetChannel()

virtual INetChannel* IGameFramework::GetNetChannel ( uint16 channelId)
pure virtual

Retrieve a pointer to the INetChannel associated with the specified Game Server Channel Id.

Returns
Pointer to INetChannel associated with the specified Game Server Channel Id.

◆ GetNetworkSafeClassId()

virtual bool IGameFramework::GetNetworkSafeClassId ( uint16 & id,
const char * className
)
pure virtual

Retrieve a network safe entity class id, that will be the same in client and server

Returns
true if an entity class with this name has been registered

◆ GetNetworkSafeClassName()

virtual bool IGameFramework::GetNetworkSafeClassName ( char * className,
size_t maxn,
uint16 id
)
pure virtual

Retrieve a network safe entity class name, that will be the same in client and server

Returns
true if an entity class with this id has been registered

◆ IsChannelOnHold()

virtual bool IGameFramework::IsChannelOnHold ( uint16 channelId)
pure virtual

Check if the game server channel has lost connection but still on hold and able to recover...

Returns
true if the specified game server channel has lost connection but it's stil able to recover...

◆ IsGamePaused()

virtual bool IGameFramework::IsGamePaused ( )
pure virtual

Returns the pause status

Returns
true if the game is paused, false otherwise.

◆ OnEditorSetGameMode()

virtual void IGameFramework::OnEditorSetGameMode ( int iMode)
pure virtual

Notification that game mode is being entered/exited iMode values: 0-leave game mode, 1-enter game mode, 3-leave AI/Physics mode, 4-enter AI/Physics mode

◆ PauseGame()

virtual void IGameFramework::PauseGame ( bool pause,
bool force,
unsigned int nFadeOutInMS = 0
)
pure virtual

Pauses the game

Parameters
pausetrue if the game is pausing, false otherwise.
nFadeOutInMSTime SFX and Voice will be faded out over in MilliSec.

◆ PostSystemUpdate()

virtual bool IGameFramework::PostSystemUpdate ( bool hasFocus,
CEnumFlags< ESystemUpdateFlags > updateFlags
)
pure virtual

Updates the main game systems Called immediately after ISystem::Update, when core engine systems have been updated

Returns
True if the engine should continue running, otherwise false.

◆ PrefetchLevelAssets()

virtual void IGameFramework::PrefetchLevelAssets ( const bool bEnforceAll)
pure virtual

To avoid stalls during gameplay and to get a list of all assets needed for the level (bEnforceAll=true).

Parameters
bEnforceAlltrue to ensure all possible assets become registered (list should not be too conservative - to support level stripification).

◆ PreFinalizeCamera()

virtual void IGameFramework::PreFinalizeCamera ( CEnumFlags< ESystemUpdateFlags > updateFlags)
pure virtual

Called when systems depending on rendering have been updated, and we are about to use the system camera This is the final chance to modify the camera before it is passed to the 3D engine for occlusion culling

◆ PrePhysicsTimeStep()

virtual void IGameFramework::PrePhysicsTimeStep ( float deltaTime)
pure virtual

Gets called from the physics thread just before doing a time step.

Parameters
deltaTime- the time interval that will be simulated.

◆ QueryExtensionInterfaceById()

virtual ICryUnknownPtr IGameFramework::QueryExtensionInterfaceById ( const CryInterfaceID & interfaceID) const
protected
pure virtual

Retrieves an extension interface by interface id. Internal, client uses 'QueryExtension()

Parameters
interfaceIDInterface id.

◆ QueryGameObjectExtension()

virtual IGameObjectExtension* IGameFramework::QueryGameObjectExtension ( EntityId id,
const char * name
)
pure virtual

Retrieve an IGameObjectExtension by name from an entity

Returns
Pointer to IGameObjectExtension of the entity if it exists (or NULL otherwise)

◆ RegisterExtension()

virtual void IGameFramework::RegisterExtension ( ICryUnknownPtr pExtension)
pure virtual

Register an extension to the game framework and makes it accessible through it

Parameters
pExtensionExtension to be added to the game framework.

◆ StartedGameContext()

virtual bool IGameFramework::StartedGameContext ( ) const
pure virtual

Detect if a context is currently running.

Returns
true if a game context is running.

◆ StartGameContext()

virtual bool IGameFramework::StartGameContext ( const SGameStartParams * pGameStartParams)
pure virtual

Initialises a game context.

Parameters
pGameStartParamsParameters for configuring the game.
Returns
true if successful, false otherwise.

◆ StartingGameContext()

virtual bool IGameFramework::StartingGameContext ( ) const
pure virtual

Detect if a context is currently starting.

Returns
true if a game context is starting.