Skip to content

Platform

Francisco Dias edited this page Jun 20, 2024 · 3 revisions

Platform

Epic Online Services Interface: Platform Interface

The Platform Interface sits at the heart of the Epic Online Services (EOS) SDK and holds the handles you need to access every other interface and keep them all running. When your application starts up, you can initialise the SDK and get a handle to the Platform Interface. This handle is usable for the lifetime of the SDK.

Functions

These functions are provided for handling platform functionality:



Back To Top

EpicGames_Platform_CheckForLauncherAndRestart

Epic Online Services Function: EOS_Platform_CheckForLauncherAndRestart

This function checks if the app was launched through the Epic Launcher, and relaunches it through the Epic Launcher if it wasn't. The function returns one of 3 possible results:

  1. EpicGames_Success is returned if the app is being restarted. You should quit your process as soon as possible.
  2. EpicGames_NoChange is returned if the app was already launched through the Epic Launcher, and no action needs to be taken.
  3. EpicGames_UnexpectedError is returned if the LauncherCheck module failed to initialise, or the module tried and failed to restart the app.

Syntax:

EpicGames_Platform_CheckForLauncherAndRestart()



Returns:

Real


Example:

if (EpicGames_Platform_CheckForLauncherAndRestart() != EpicGames_NoChange) { game_end(); }

The above code shows an example of how the function should be used. If the output of the function is other than EpicGames_NoChange it will force close the project.




Back To Top

EpicGames_Platform_GetActiveCountryCode

Epic Online Services Function: EOS_Platform_GetActiveCountryCode

This function returns the active country code. This will only return the value set as the override, otherwise an empty string is returned.

Note

This is NOT currently used for anything internally.


Syntax:

EpicGames_Platform_GetActiveCountryCode(accountID)
Argument Type Description
accountID String The account to get the active country code of



Returns:

String


Example:

show_debug_message("CountryCode: " + EpicGames_Platform_GetActiveCountryCode(accountID));

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_GetActiveLocaleCode

Epic Online Services Function: EOS_Platform_GetActiveLocaleCode

This function gets the active locale code that the SDK will send to services which require it. This returns the override value otherwise it will use the locale code of the given user. This is used for localization. This follows ISO 639.


Syntax:

EpicGames_Platform_GetActiveLocaleCode(accountID)
Argument Type Description
accountID String The account to get the local code of



Returns:

String


Example:

show_debug_message("LocaleCode: " + EpicGames_Platform_GetActiveLocaleCode(accountID));

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_GetOverrideCountryCode

Epic Online Services Function: EOS_Platform_GetOverrideCountryCode

This function gets the override country code that the SDK will send to services which require it. This is not currently used for anything internally.

Note

This is NOT currently used for anything internally.


Syntax:

EpicGames_Platform_GetOverrideCountryCode()



Returns:

String


Example:

show_debug_message("CountryCode: " + EpicGames_Platform_GetOverrideCountryCode());

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_GetOverrideLocaleCode

Epic Online Services Function: EOS_Platform_GetOverrideLocaleCode

This function gets the override locale code that the SDK will send to services which require it. This is used for localization. This follows ISO 639.


Syntax:

EpicGames_Platform_GetOverrideLocaleCode()



Returns:

String


Example:

show_debug_message("LocaleCode: " + EpicGames_Platform_GetOverrideCountryCode());

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_Release

Epic Online Services Function: EOS_Platform_Release

This function releases an Epic Online Services platform. This function should only be called when terminating your application right before calling EpicGames_Shutdown. Undefined behaviour will result in calling it more than once.


Syntax:

EpicGames_Platform_Release()



Returns:

N/A


Example:

EpicGames_Platform_Release();
EpicGames_Shutdown();

game_end();

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_SetOverrideCountryCode

Epic Online Services Function: EOS_Platform_SetOverrideCountryCode

This function sets the override country code that the SDK will send to services which require it. This is not currently used for anything internally.


Syntax:

EpicGames_Platform_SetOverrideCountryCode(countryCode)
Argument Type Description
countryCode String New country code ISO 639



Returns:

N/A


Example:

EpicGames_Platform_SetOverrideCountryCode("UK");

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_SetOverrideLocaleCode

Epic Online Services Function: EOS_Platform_SetOverrideLocaleCode

This function sets the override locale code that the SDK will send to services which require it. This is used for localization. This follows ISO 639.


Syntax:

EpicGames_Platform_SetOverrideLocaleCode(localCode)
Argument Type Description
localCode String New local code



Returns:

N/A


Example:

EpicGames_Platform_SetOverrideLocaleCode("en");

The above code shows an example of how the function should be used.




Back To Top

EpicGames_Platform_Tick

Epic Online Services Function: EOS_Platform_Tick

This function notifies the platform instance to do work. This function must be called frequently in order for the services provided by the SDK to work properly.

Note

For tick-based applications, it is usually desirable to call this once per-tick.


Syntax:

EpicGames_Platform_Tick()



Returns:

N/A


Example:

/// Step Event
EpicGames_Platform_Tick();

The above code shows a code example.



Clone this wiki locally