Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Fix player movement when on zoned servers #1235

Merged
merged 3 commits into from
Jul 29, 2019

Conversation

yumnuska
Copy link
Contributor

@yumnuska yumnuska commented Jul 29, 2019

Description

Fix player movement on zoned servers (UNR-1820).

The symptom fixed by this PR was that, on a zoned deployment, one or more players would occasionally not have control of their player after joining a session. This was because the player movement component was not initialized, which is further caused by the client not processing the ClientRestart RPC.

The root cause is that the sending worker had two channels for the Actor for the RPC, and was checking the incorrect channel to determine if the channel is ready to receive RPCs.

Also made some changes to validate preconditions for private functions and avoid creation without first checking for existence of a channel.

Release note

In CHANGELOG.md

Tests

Run a deployment with multiple server workers and clients.

@improbable-prow-robot improbable-prow-robot added jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/M Denotes a PR that changes 40-149 lines, ignoring generated files. labels Jul 29, 2019
@@ -769,6 +769,13 @@ int32 USpatialNetDriver::ServerReplicateActors_PrepConnections(const float Delta

int32 USpatialNetDriver::ServerReplicateActors_PrioritizeActors(UNetConnection* InConnection, const TArray<FNetViewer>& ConnectionViewers, const TArray<FNetworkObjectInfo*> ConsiderList, const bool bCPUSaturated, FActorPriority*& OutPriorityList, FActorPriority**& OutPriorityActors)
{
// Since this function signature is copied from NetworkDriver.cpp, I don't want to change the signature. But we expect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@m-samiec m-samiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@@ -977,7 +991,7 @@ void USpatialNetDriver::ServerReplicateActors_ProcessPrioritizedActors(UNetConne
continue;
}

Channel = CreateSpatialActorChannel(Actor, Cast<USpatialNetConnection>(InConnection));
Channel = GetOrCreateSpatialActorChannel(Actor);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that fixes the root cause.

@yumnuska yumnuska merged commit 3b692b8 into master Jul 29, 2019
@yumnuska yumnuska deleted the bugfix/unr1820-zoned-movement branch July 29, 2019 15:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/M Denotes a PR that changes 40-149 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants