Appearance
Appearance
Hotfix Release
Release 30.1 is the latest hotfix release for Release 30 and contains a fix for CVE-2024-43483.
If you are on Release 30, you should upgrade to Release 30.1!
You can now skip time into the future on development game servers. This is useful for testing complex event scheduling setups. See the Testing Game Schedules With Time Skipping guide for more information.
The Environment page has been redesigned to display more information about the server cluster, including the status of each node. The page is now organized into tabs, with the runtime options moved into a dedicated tab.
Support for multiple logic versions on the server has been significantly improved. We've added support for using the AddedInVersion
attribute on classes, enhanced safety for incompatible logic versions, and introduced visualization in the dashboard.
MetaplaySDK.IncidentTracker.AddIncidentAndAnalyticsEvent()
to report your custom incident or MetaplaySDK.IncidentTracker.AddIncidentWithNetworkReportAndAnalyticsEvent()
to include a network report. See Implementing Custom Incident Reports for more information.PlayerActor
crashes now produce an incident report and an analytics event to help debug and fix these issues.MyList[].OtherList[0].Member
are now supported, where previously, at most, 1 level of nesting after the []
was supported.//
are now ignored.CustomReferencePriceForDashboard
, which you can override in your subclass of MetaOfferInfoBase
in order to display a price for offers that are not paid with in-app purchases, but with custom means such as soft currencies.[EnvironmentVariable()]
to add additional environment variables as sources.EntitySubscriber
and EntitySubscription
have SetUserdata<T>()
and GetUserdata<T>()
to allow storing per-subscription state conveniently.--GuestCredentialsSlot
for declaring the name of the active slot for the run, the resolving of the active slot can be overridden by a custom implementation of IMetaplayClientConnectionDelegate.GetGuestCredentialsSlotName()
.PlayerPropertyLogicVersion
to segment based on the player's logic version.SessionForceTerminateReason.LogicVersionUpdated
to indicate that the player was kicked due to their logic version being updated mid-session.SessionPingPongDurationThresholdExceeded
incident type and the ConfigFetchFailed
incident type.kubectl cp
) is now compiled with Ubuntu 24.04.IAPManager
now logs store purchase failures on the Warning
level instead of Info
.MetaDatabase
and MetaDbContext
types are now in Metaplay.Cloud.Persistence
namespace.entrypoint
binary to be built with Golang 1.22.7. Fixes CVE-2024-34156.MultiplayerEntityClientBase.LogChannelName
and MultiplayerEntityClientBase.CreateActiveModelContext()
to reduce boilerplate when no customization is needed.MetaDatabaseBase
has been removed; MetaDatabase
should be used instead.MultiplayerEntityActorBase.TryGetClientPeer()
now takes in the EntitySubscription
instead of the EntityId
.NodeSetConfig.GetMaxNodeCount()
is no longer marked as Obsolete.Player:NumDebugModeSessions
has been removed, as this is now controllable directly from the dashboard when enabling the debug mode.ChannelContextDataBase
has been renamed to EntityClientData
.AddedInVersionAttribute
is now allowed to be used on classes. An exception of type MetaTypeMissingInLogicVersionSerializationException
will be thrown if a type known to be incompatible is serialized.MetaTime
and MetaDuration
have been changed to DateTime
and TimeSpan
in various places. See Miscellaneous API Changes for details on how you may need to update your code.IMetaplayLocalizationDelegate.AutoActivateLanguageUpdates
setting.MultiplayerEntityActorBase.RequireClientHasGameConfigPresentOnSessionStart
.Dockerfile.server
, use correct consistent capitalization for FROM ... AS
syntax and remove the redundant target platform definition to silence the related warnings.entrypoint
binary is now copied from a pre-built source instead of building it in the image. This avoids occasional segmentation faults from go build
during cross-architecture docker builds.GlobalStateProxy
now properly unsubscribes from GlobalStateManager
on server shutdown, and a warning is no longer logged.Dockerfile.server
now properly supports cross-compilation of the server and botclient dotnet binaries again.SessionCommunicationHanged
incident reports (subtype ServerSideSessionPingDurationThresholdExceeded
). These false positives would happen when the client went to pause right after resuming a session after a connection loss. Now, the server only reports this incident if the client is not known to be on pause.WebApiBridge.JsonCallSync()
is now the value returned from the called Javascript method, instead of being always null
.PlayerActor
associated with new entities during session start, this could have caused very short sessions to be reported to analytics and shown in Player event log.MPlot
and MTimeseriesBarChart
components for creating custom data visualizations in the LiveOps Dashboard.MTabLayout
component, a tab layout for dashboard pages that provides a way to organize dashboard components into separate tabs.MetaUtilities
, to house utility functions that are shared by other Metaplay modules. This enabled the cleanup and standardization of utility functions as well as the deduplication of some functions that were repeated across modules.MInputSwitch
component. You can now set a required permission to control who is allowed to interact with the switch.is-targeting-multiple-players
property to all meta-generated-*
components. is-targeting-multiple-players
property will show warnings if fields are only supported for a subset of players.logic-version
property to all meta-generated-*
components. logic-version
to a valid value will disable incompatible member and type inputs.MInputSingleSelectRadio
component now supports disabling individual options.b-container
component. It is now fully deprecated and has been replaced by the MViewContainer
or the Tailwind @tw-container
directive to create a responsive container element.MessageAudienceForm
and TriggerConditionForm
components refactored to the Vue 3 v-model syntax. You may need to update your usage of these components from v-model
to model-value
and @input
to @update:modelValue
.Core
and MetaUi
were moved to the new MetaUtilities
module. This may require you to update some of your imports. See the migration guide for details.MInputSegmentedSwitch
component has been renamed to MInputSingleSelectSwitch
for consistency with other input components.MInputSingleSelectSwitch
sizes have been updated from sm
and md
to small
and default
, respectively.MTabLayout
component to manage the tab layout. Some pages now have red highlight indicators for tabs with high-priority information.MInputSwitch
component sizes have been updated from xs
, sm
and md
to extraSmall
, small
and default
, respectively.disabled
prop in the MButton
, MIconButton
and MTextButton
components has been replaced by the disabledTooltip
prop. To disable the button, set the disabledTooltip
prop with an explanation of why the button is disabled.triggerButtonDisabled
prop in the MActionModalButton
component has been removed in favor of the triggerButtonDisabledTooltip
prop. To disable the trigger button, set the triggerButtonDisabledTooltip
prop with an explanation of why the button is disabled.TerminalNetworkError
and SessionStartFailed
incident types to use the stack trace view.MInputSingleSelectRadio
to ensure consistent styling and behavior across the dashboard.variant
prop in MInputSingleSelectRadio
now uses primary
instead of default
as the default variant.Environment
page has been refactored with improvements to layout and styling. The page overview section now provides more detailed information about the current environment.Clusters
tab within the Environment
page has been renamed to Servers
and refactored to display more information about the nodes running in your environment.Runtime Options
page has been moved to the Environment
page and is no longer accessible directly from the sidebar.uiPlacementApis.ts
to uiPlacementList.ts
file. Moving forward, all new custom placements should be added to the uiPlacementList.ts file to ensure consistency.MInputSingleSelectSwitch
component. It now switches to a dropdown on mobile devices for improved usability on smaller screens.MTooltip
component sometimes having mouse over trigger area that was too small.MetaDuration
would not display anything if the duration was less than one second.MInputNumber
as it was both broken and unused.metaplay-loadtest
Helm chart v0.4.2 if you plan to run bot clients in metaplay-hosted platforms. The metaplay-loadtest
Helm chart v0.4.2 adds support for pod affinity rules, which contribute to better pod scheduling and mitigate the risk of resource starvation on nodes on which the game server runs.UiPlacements
and updated instructions on how to use them to customize the dashboard.Metaplay SDK has deprecated support for Unity 2021.3 as it has reached end-of-life and is no longer supported by Unity. The lowest supported Unity version is now 2022.3. While this release still works with Unity 2021.3, we plan to remove support for it in R31, tentatively scheduled for December 2024.
Still using 2021.3?
If you cannot reasonably upgrade to 2022.3 or later in the near future, please let us know.
Please apply the following changes to your project to ensure compatibility with the latest Metaplay SDK.
Backward-Incompatible Changes
Bump your game's MetaplayCoreOptions.supportedLogicVersions
to force a synchronized update of your game client and server.
The Metaplay SDK now requires Helm chart v0.6.3 for any cloud deployments. This has not changed from Release 29, if you are already on Helm Chart v0.6.3, then no action is required.
Migration Steps:
Update your CI pipelines for all your environments to use version 0.6.3 of the Helm chart.
When using GitHub Action scripts, make the following change:
jobs:
...
build-and-deploy-server:
...
with:
- helm-chart-version: "0.x.y"
+ helm-chart-version: "0.6.3"
With other CI systems, apply the following change (or the equivalent in your CI system):
- export HELM_CHART_VERSION="0.x.y"
+ export HELM_CHART_VERSION="0.6.3"
Roll out the change to each environment by running the CI job to build and deploy a new version. You can do this for each environment separately whenever it is a good time for you.
Premium SDK Update Support
If your support contract includes Metaplay-provided SDK updates, all the following steps have already been applied to your project. You can skip this migration guide!
This guide offers step-by-step instructions for migrating your project to the latest version of the Metaplay SDK. You can skip the migration steps for features you are not using in your project.
The following core SDK changes affect all Metaplay projects:
We've created a new set of code analyzers to help catch serialization errors earlier.
Migration Steps:
MyGame-Server
solutionMetaplay
folderAdd > Existing Project
menu item to add MetaplaySDK\Backend\CodeAnalyzers.Shared\Metaplay.CodeAnalyzers.Shared.csproj
Server.csproj
and SharedCode.csproj
, insert the following snippet next to the other ProjectReference
entries.<ProjectReference Include="$(MetaplayServerPath)\CodeAnalyzers.Shared\Metaplay.CodeAnalyzers.Shared.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Analyzer</OutputItemType>
</ProjectReference>
We've updated our CI job templates to be much better at reporting errors, for example when the deployment fails due to the server not starting due to a misconfiguration. You should upgrade to the latest revision to get the benefits.
Migration Steps:
.github/workflows/build-deploy-server-<environment>.yaml
for those using Github Actions).Metaplay's built-in database schema has changed, and you need to apply the migration steps to your project.
You might need to apply some of the steps in Miscellaneus API Changes before you can run the database schema migrations.
Migration Steps:
Generate the database schema migration code with:
# Install or update the EFCore tool:
Backend/Server$ dotnet tool install -g dotnet-ef
# Then, generate the migration code:
Backend/Server$ dotnet ef migrations add MetaplayReleaseXX
Then, add the generated files to your project's source control. For example, using Git:
Backend/Server$ git add .
Backend/Server$ git commit -m "Database schema migrations"
The migration steps will be automatically applied when you deploy the updated game server into an environment.
Possibly long migrations
Note: Release 30 introduces a new index to the player and guild search tables and the migrations can take up to several minutes on large databases.
The following core SDK changes affect projects that have an Android client.
MetaplaySDK depends on External Dependencies on Android for Maven packages. You will need to ensure EDM4U is installed to the Unity Project.
Migration steps:
The following LiveOps Dashboard changes affect projects that have a customized dashboard:
You should ensure that you have Node version 20.18.0 (the latest 20.x version at the time of writing) installed. To check the current version, run node --version
. If you are using nvm
, you can update Node with:
# Install Node 20.18.0 with Node Version Manager (nvm).
nvm install 20.18.0
# Use the new version.
nvm use 20.18.0
To ensure that your dashboard project has the correct dependencies, you will need to clear the existing cached files and recreate them.
Migration Steps:
Remove any files that Node has cached in your repository. This will lead to a fresh install of all dependencies.
node_modules
directories and their contents. This clears any currently installed dependencies. One way to do this is to run git clean -fdx ':(glob)**/node_modules/*'
from the root of your repository.dist
directories and their contents. This clears any previously built files. One way to do this is to run git clean -fdx ':(glob)**/dist/*'
from the root of your repository.pnpm-lock.yaml
file from the root of your repository. This clears the cached dependency versions.Old project and configuration files often accumulate in repositories over time. You should remove all of the following files and directories from your dashboard directory if they exist.
metaplay_temporary_copy_of_core_tests
src\vue-compat.d.ts
.eslintrc.cjs
cypress.config.ts
postcss.config.cjs
tailwind.config.cjs
As usual, we have updated the underlying dependencies and configurations of the LiveOps Dashboard. This causes changes to several configuration files, which you will need to update in your dashboard project. We use the MetaplaySDK/Frontend/DefaultDashboard
directory as the source of truth for these files.
Migration Steps:
Copy the following files to your dashboard root directory:
.prettierignore
eslint.config.js
postcss.config.js
prettier.config.js
tailwind.config.js
Optional: This release includes new, stricter code formatting results that are applied automatically by default. This can cause issues in a large codebase where the number of changes can be overwhelming. While we strongly recommend working through these issues and addressing each one, you may decide to opt out of the automatic code formatting introduced in this release. You can do this by changing the first line of your eslint.config.js
:
import MetaplayEslintConfig from '@metaplay/eslint-config/recommended'
import MetaplayEslintConfig from '@metaplay/eslint-config'
Copy and overwrite the following files
tsconfig.app.json
tsconfig.node.json
Update the package.json
to update your project's dependencies.
package.json
file directly from the MetaplaySDK/Frontend/DefaultDashboard
directory. Next, restore the name property inside the file to that of your project. This is typically of the form "name": "<projectName>-dashboard"
.Run pnpm install
in your dashboard directory. This installs all of the correct dependencies.
As part of the ongoing effort to migrate away from Bootstrap, we have removed the following components in favor of the new MetaUiNext
components.
b-container
is replaced by MViewContainer
or the Tailwind @tw-container
directive.Unfortunately, the migration is not automatic, so you will need to manually replace the removed components with the new ones in your dashboard project.
Migration Steps:
Find all instances of the b-container
component in your dashboard project.
Replace b-container
with the MViewContainer
component for root-level elements or use the Tailwind @tw-container
directive for child-level elements that previously used b-container
, as shown below:
// For root-level elements
b-container(
MViewContainer(
...
)
import { MViewContainer } from '@metaplay/meta-ui-next'
// Or
// For child-level elements
b-container(
div(class="@tw-container"
...
)
We have updated ESLint and enabled more rules to help you write safer and more maintainable code. Run ESLint to find and fix any new issues.
Migration Steps:
Run pnpm lint
in your dashboard directory. This will show you all ESLint errors and warnings.
Either fix the issues or selectively ignore them with // eslint-disable-next-line RULE_NAME_HERE
comments.
If the number of issues is overwhelming, you may choose to disable the new formatting rules. See section 2 of Update the LiveOps Dashboard Project Files
for how to do this.
We have moved a number of utility functions from Core
and MetaUi
to a new MetaUtilities
module. If you are using any of these functions in your custom dashboard code you will need to update your imports.
The following functions were moved to MetaUtilities
:
abbreviateNumber(x: number)
- Abbreviates an arbitrary number into a short display string.maybePluralPrefixString(count: number, singular: string, plural: string)
- Generates prefix text for potentially pluralized text.maybePluralString(count: number, singular: string, plural: string)
- Generates a humanized string that pluralizes a word if needed.toOrdinalString(n: number)
- Returns a string with an ordinal appended to the given number.camelCaseToSentenceCase(input: string)
- Convert a camelCase string to sentence case.camelCaseToTitleCase(input: string)
- Convert a camelCase string to title case.sentenceCaseToKebabCase(input: string)
- Converts a sentence case string to a kebab case string.stringToSentenceCase(input: string)
- Convert a string to sentence case.stringToTitleCase(input: string)
- Convert a string to title case.makeIntoUniqueKey(input: string)
- Generates guaranteed locally unique keys.Migration Steps:
Update affected imports in your .ts
and .vue
source files.
- import { abbreviateNumber } from '@metaplay/meta-ui'
+ import { abbreviateNumber } from '@metaplay/meta-utilities'
Run pnpm build
from your dashboard directory to verify that all imports have been correctly updated.
The MInputSegmentedSwitch
component has been renamed to MInputSingleSelectSwitch
and sizes updated. For more details check our meta-ui docs. The MInputSwitch
component sizes have been updated from xs
, sm
and md
to extraSmall
, small
and default
, respectively. The disabled
prop in the MButton
,MIconButton
and MTextButton
components has been replaced by the disabledTooltip
prop. The triggerButtonDisabled
prop in the MActionModalButton
component has been removed in favor of the triggerButtonDisabledTooltip
prop.
Migration Steps:
Replace MInputSegmentedSwitch
with MInputSingleSelectSwitch
Search and replace all instances of the MInputSegmentedSwitch
with the MInputSingleSelectSwitch
component.
MInputSegmentedSwitch(
MInputSingleSelectSwitch(
size="sm"
size="small"
...
)
Update Size Prop in MInputSwitch
Search and replace all instances of the MInputSwitch
component in your dashboard project that have sizes set to xs
, sm
or md
, with extraSmall
, small
or default
, respectively. For example:
MInputSwitch(
size="sm"
size="small"
...
)
Replace disabled
Prop in Button Components Search for all instances of the MButton
, MIconButton
and MTextButton
components in your dashboard project that have the disabled
prop set and replace the disabled
prop with the disabledTooltip
prop as follows:
MButton(
:disabled="disabledFlag"
:disabled-tooltip="disabledFlag ? 'Reason for disabling.' : undefined"
...
)
Replace triggerButtonDisabled
Prop in MActionModalButton
Component Search and replace all instances of the MActionModalButton
component in your dashboard project that have the triggerButtonDisabled
prop set with the triggerButtonDisabledTooltip
prop.
MActionModalButton(
:trigger-button-disabled="disabledFlag"
:trigger-button-disabled-tooltip="disabledFlag ? 'Reason for disabling.' : undefined"
...
)
If you have customized the role-to-permission table in your Options.base.yaml
, you need to add two additional permissions to the table.
The following new dashboard admin permissions have been introduced:
api.system.view_cluster_nodes
- Controls who can view the cluster nodes in environment page.api.game_time_offset.edit
- Controls who can use the server time skip development feature.Migration Steps:
Specify which roles should have access to these permissions in your Backend/Server/Config/Options.*.yaml
(whichever file you use to configure the access). You can modify the roles as needed.
AdminApi:
Permissions:
...
api.system.view_cluster_nodes: [ game-admin, game-viewer ]
api.game_time_offset.edit: [ game-admin ]
If you have added custom UiPlacements
to your dashboard, you need to move them from the uiPlacementApi.ts
to the uiPlacementList.ts
file.
Migration steps:
uiPlacementApi.ts
file.uiPlacementList
in the uiPlacementList.ts
file. // uiPlacementApi.ts
const const uiPlacementList = [
...
// Custom UiPlacements
'Players/Details/CustomPlacement',
...
// uiPlacementList.ts
const uiPlacementList = [
...
// Custom UiPlacements
'Players/Details/CustomPlacement',
...
]
UdpPassthrough
If you are running UdpPassthrough
in direct Public IP mode, i.e. bypassing loadbalancers, defining METAPLAY_SUPPORT_PUBLIC_IP_UDP_PASSTHROUGH
is no longer required.
METAPLAY_SUPPORT_PUBLIC_IP_UDP_PASSTHROUGH
define symbolTo ensure smooth MetaplaySDK updates, experimental feature flags should be cleaned after the features graduate and become incorporated into vanilla SDK.
Migration steps:
In Directory.Build.targets
remove the symbol:
- <DefineConstants>$(DefineConstants);METAPLAY_SUPPORT_PUBLIC_IP_UDP_PASSTHROUGH</DefineConstants>
Player:NumDebugModeSessions
If you have specified a value for option Player:NumDebugModeSessions
in your Options.*.yaml
files, you need to remove it.
Player:NumDebugModeSessions
OptionThe number of sessions that the debug mode remains active is now controlled directly from the dashboard, in the Enable Debug Mode form on the player page. The old server option for it has been removed.
Migration steps:
In the options file, such as Options.base.yaml
, remove the NumDebugModeSessions
option in the Player
section.
Player:
NumDebugModeSessions: 5
PlayerIncident
section If you have specified a value for any of the upload percentage options under PlayerIncident
options in your Options.*.yaml
files, you need to migrate them to the new dictionary format.
The upload percentage for Player Incidents is now set through a dictionary to support custom Player Incident types. This affects options PlayerIncident:UploadPercentageTerminalNetworkError
, PlayerIncident:UploadPercentageUnhandledExceptionError
, PlayerIncident:UploadPercentageSessionCommunicationHanged
, PlayerIncident:UploadPercentageSessionStartFailed
and PlayerIncident:UploadPercentageCompanyIdLoginError
.
Migration steps:
In the options file, such as Options.base.yaml
, replace the UploadPercentage*
options in the PlayerIncident
section with dictionary entries in UploadPercentagesPerIncidentType
. The dictionary keys should match the C# type names.
PlayerIncident:
UploadPercentageTerminalNetworkError: 50
UploadPercentagesPerIncidentType:
"TerminalNetworkError": 50
If you update and publish localizations throught the Dashboard, you need to update the client configuration if you want to keep the existing client-side behavior.
The IMetaplayLocalizationDelegate.AutoActivateLanguageUpdates
has been changed to default to false
. This means that if a localization is updated during a session, the client will not use the new localization until the start of the new session. The previous default value of true
means the client would have switched to the new localization version immediately after downloading the new localization data.
To keep the previous default, automatic hot-loading, you need to update the your LocalizationDelegate
.
Migration steps:
If you do not already have a LocalizationDelegate
, define a new class in the client code.
class GameLocalizationDelegate : DefaultMetaplayLocalizationDelegate
{
}
And add it as the localization delegate in SDK init.
MetaplayClient.Initialize(new MetaplayClientOptions
{
...
LocalizationDelegate = new GameLocalizationDelegate(),
};
In your LocalizationDelegate
, override the AutoActivateLanguageUpdates
property to return true.
class GameLocalizationDelegate : DefaultMetaplayLocalizationDelegate
{
public override bool AutoActivateLanguageUpdates => true;
}
These changes affect you in case you happen to use any of the APIs changed. You can build your project to get a list of any incompatibilities instead of going through the list one item at a time.
MetaTime
to DateTime
With the server time skip feature, we have changed some SDK-side usage of MetaTime
to DateTime
to avoid unwanted effects during time skips. Similarly, some MetaDuration
instances have been changed to TimeSpan
. These changes affect some public APIs.
Migration Steps:
If you pass ConnectionConfig
in MetaplayClientOptions
when calling MetaplayClient.Initialize()
, update the MetaDuration
s to TimeSpan
s. For example:
MetaplayClient.Initialize(new MetaplayClientOptions
{
...
ConnectionConfig = new ConnectionConfig
{
ConnectTimeout = MetaDuration.FromSeconds(40),
ConnectTimeout = TimeSpan.FromSeconds(40),
},
}
When calling MetaplaySDK.OnApplicationAboutToBePaused()
, pass in a TimeSpan
instead of MetaDuration
:
MetaplaySDK.OnApplicationAboutToBePaused("Showing an ad", MetaDuration.FromSeconds(180));
MetaplaySDK.OnApplicationAboutToBePaused("Showing an ad", TimeSpan.FromSeconds(180));
When accessing MetaplaySDK
's pause-related static properties, use DateTime
and TimeSpan
instead of MetaTime
and MetaDuration
.
MetaTime pauseBeganAt = MetaplaySDK.ApplicationLastPauseBeganAt;
MetaDuration pauseDuration = MetaplaySDK.ApplicationLastPauseDuration;
DateTime pauseBeganAt = MetaplaySDK.ApplicationLastPauseBeganAt;
TimeSpan pauseDuration = MetaplaySDK.ApplicationLastPauseDuration;
⚠️ Heads up
If your existing code used the Milliseconds
property of MetaDuration
, make sure to change that to the TotalMilliseconds
property of TimeSpan
! TimeSpan
also has a Milliseconds
property, but with a different meaning: it is only the milliseconds component, instead of the total milliseconds as in MetaDuration
. This discrepancy won't be caught by the compiler on its own, so after changing MetaDuration
s to TimeSpan
s, you should use your IDE to find all references to TimeSpan.Milliseconds
and review those.
GuildModelBase.IsNameSearchValid
GuildModelBase.IsNameSearchValid
has been removed in favor of the new GuildModelBase.SearchVersion
, which automatically fulfills the same function.
Migration steps:
GuildModelBase.IsNameSearchValid
.MetaDatabase
, MetaDbContext
and QueryPriority
.MetaDatabase
and MetaDbContext
types have been moved into Metaplay.Cloud.Persistence
namespace.
Migration steps:
MetaDatabase
, MetaDbContext
or QueryPriority
, addusing Metaplay.Cloud.Persistence;
PlayerSessionParamsBase.IsDryRun
Dry-run mode has been removed from session start protocol. All references to it should be removed.
Migration steps:
If you have a type inheriting PlayerSessionParamsBase
, do not pass in isDryRun
argument to base constructor.
Remove references to InternalSessionStartNewRequest.IsDryRun
.
ChannelContextData
with EntityClientData
.The ChannelContextData
has been removed and replaced with EntityClientData
. If you have custom Multiplayer Entities and you supply the client a custom ChannelContextData
in via MultiplayerEntityActorBase.CreateClientSessionStartChannelContext()
, you need to update the API calls to the new naming.
Migration steps:
Change the base class of your ChannelContextData
to EntityClientData
:
public class MyChannelContextData : ChannelContextDataBase
public class MyEntityClientData : EntityClientData
{
...
}
In Multiplayer Entity Actor, replace the CreateClientSessionStartChannelContext()
hook with CreateClientSessionStartEntityClientData()
protected override ChannelContextDataBase CreateClientSessionStartChannelContext(...)
protected override EntityClientData CreateClientSessionStartEntityClientData(...)
{
return new MyChannelContextData(...);
return new MyEntityClientData(...);
}
Replace all uses of EntityInitialState.ContextData
with EntityInitialState.ClientData
:
void DoSomethingWithState(EntityInitialState state)
{
MyChannelContextData clientData = (MyChannelContextData)state.ContextData;
MyEntityClientData clientData = (MyEntityClientData)state.ClientData;
// do something with clientData.Slot or other fields.
}
SessionProtocol.SessionStartSuccess.ActiveExperiments
been moved into InitialPlayerState.ActiveExperiments
. ClientSessionStartResources.GameConfigs
no longer has specialized configs per slot.
Migration steps:
If you have a custom connection delegate, update OnSessionStarted()
signature.
class MyConnectionDelegate
{
public override void OnSessionStarted(ClientSessionStartResources startResources)
public override void OnSessionStarted(SessionProtocol.SessionStartSuccess sessionStart, ClientSessionStartResources startResources)
{
...
}
}
In each call site for ClientSessionStartResources.GameConfigs[ClientSlotCore.Player]
, (i.e. Getting the player's game config), use the GetConfigForPlayer()
method:
public override void OnSessionStarted(SessionProtocol.SessionStartSuccess sessionStart, ClientSessionStartResources startResources)
{
var something = Connection.SessionStartResources.GameConfigs[ClientSlotCore.Player];
var something = Connection.SessionStartResources.GetConfigForPlayer(sessionStart.PlayerState);
}
In each call site for ClientSessionStartResources.GameConfigs
for non-player entities, use the TryGetConfigForEntity()
method:
EntityInitialState initialState = ...;
var something = Connection.SessionStartResources.GameConfigs[myslot];
var something = Connection.SessionStartResources.TryGetConfigForEntity(initialState.State);
Note that TryGetConfigForEntity()
may return a null value if the Entity of the EntityInitialState
is added during an ongoing session, or if Entity is added on Session Start but Entity Actor's MultiplayerEntityActorBase.EntityInitialStateRequireClientHasGameConfigPresentOnSessionStart => false
.
In each file using SessionStartSuccess.ActiveExperiments
, update access path:
public override void OnSessionStarted(SessionProtocol.SessionStartSuccess sessionStart, ClientSessionStartResources startResources)
{
DoSomething(sessionStart.ActiveExperiments);
DoSomething(sessionStart.PlayerState.ActiveExperiments);
}
Released on: October 17th, 2024
This issue affects all Metaplay server instances.
The CVE-2024-43483 vulnerability affects the System.Security.Cryptography.Cose, System.IO.Packaging, and Microsoft.Extensions.Caching.Memory packages.
Migration Steps:
dotnet restore
.dotnet list package --include-transitive
.