Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Remove the View #1364

Merged
merged 11 commits into from
Aug 7, 2020
Merged

Remove the View #1364

merged 11 commits into from
Aug 7, 2020

Conversation

zeroZshadow
Copy link
Contributor

Description

Experimental change to remove the View and ViewStorage classes.
This also removes our support for AuthorityImminentLoss.

Might move the WorkerFlags from the WorkerSystem to the Worker class. Opinions welcome.

Documentation

This will need a rather heavy upgrade guide on:

  • Reading worker flags.
  • Deprecating AuthorityImminentLoss.
  • The view is gone, its just gone.

@zeroZshadow zeroZshadow requested a review from jamiebrynes7 May 15, 2020 11:53
@improbable-prow-robot improbable-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/XXL Denotes a PR that changes 600+ lines, ignoring generated files. labels May 15, 2020
@zeroZshadow zeroZshadow force-pushed the feature/remove-view branch from c31ea31 to 41ffbf7 Compare May 15, 2020 11:54
@improbable-prow-robot improbable-prow-robot added A: core Area: Core GDK A: game-object-creation Area: Gameobject creation feature module A: player-lifecycle Area: Player lifecycle feature module A: playground Area: Playground A: transform-synchronization Area: Transform synchronization feature module labels May 15, 2020
@zeroZshadow zeroZshadow changed the title Remove the View (Experiment) Remove the View May 15, 2020
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 15, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

71.1% 71.1% Coverage
0.0% 0.0% Duplication

@zeroZshadow zeroZshadow force-pushed the feature/remove-view branch from 90ff8fa to c4abda6 Compare July 10, 2020 10:30
@improbable-prow-robot improbable-prow-robot added size/XL Denotes a PR that changes 300-599 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 600+ lines, ignoring generated files. labels Jul 10, 2020
@zeroZshadow zeroZshadow force-pushed the feature/remove-view branch from c4abda6 to 77f0d99 Compare August 4, 2020 10:26
@zeroZshadow zeroZshadow changed the title (Experiment) Remove the View Remove the View Aug 4, 2020
Comment on lines +40 to +49
public bool HasAuthority
{
get
{
if (!IsValid)
{
throw new InvalidOperationException("Cannot read authority when Reader is not valid");
throw new InvalidOperationException($"Cannot read {nameof(HasAuthority)} when Reader is not valid");
}

return ComponentUpdateSystem.GetAuthority(EntityId, ComponentId);
return EntityManager.HasComponent(Entity, ComponentAuthType);
Copy link
Contributor

Choose a reason for hiding this comment

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

On balance, should we make this breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the breaking change here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Both the type and name of the property are changing.

We could keep this backwards compatible by changing the return to:

return EntityManager.HasComponent(Entity, ComponentAuthType) ? Authority.Authoritative : Authority.NotAuthoritative;

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the endgame is to remove auth loss imminent, I think it's fine to make this breaking change

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but removing auth loss imminent doesn't mandate or require this change

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I just don't see the value in keeping backwards compatibility given we'll be imposing that Authority is essentially nothing but true or false

Sure it's breaking but it does simplify logic for users (no more ==/!= comparisons)

Copy link
Contributor

Choose a reason for hiding this comment

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

My opinion is that the bar for making a breaking change should be relatively high and be done for good reason. With this case I don't feel the rationale is strong enough, but if you two both feel otherwise, I'm not gonna die on this hill.

@zeroZshadow zeroZshadow marked this pull request as ready for review August 6, 2020 13:44
@improbable-prow-robot improbable-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
UPGRADE_GUIDE.md Outdated Show resolved Hide resolved
Comment on lines +40 to +49
public bool HasAuthority
{
get
{
if (!IsValid)
{
throw new InvalidOperationException("Cannot read authority when Reader is not valid");
throw new InvalidOperationException($"Cannot read {nameof(HasAuthority)} when Reader is not valid");
}

return ComponentUpdateSystem.GetAuthority(EntityId, ComponentId);
return EntityManager.HasComponent(Entity, ComponentAuthType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the endgame is to remove auth loss imminent, I think it's fine to make this breaking change

@zeroZshadow zeroZshadow requested a review from paulbalaji August 6, 2020 15:32
Copy link
Contributor

@BryanJY-Wong BryanJY-Wong left a comment

Choose a reason for hiding this comment

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

Death to ImminentLoss (and the View)!

UPGRADE_GUIDE.md Outdated Show resolved Hide resolved
@zeroZshadow zeroZshadow force-pushed the feature/remove-view branch from e49bc95 to fb89211 Compare August 7, 2020 12:42
Co-authored-by: Jamie Brynes <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

53.5% 53.5% Coverage
0.0% 0.0% Duplication

@zeroZshadow zeroZshadow merged commit 9ea8fd4 into develop Aug 7, 2020
@improbable-prow-robot improbable-prow-robot deleted the feature/remove-view branch August 7, 2020 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: core Area: Core GDK A: game-object-creation Area: Gameobject creation feature module A: player-lifecycle Area: Player lifecycle feature module A: playground Area: Playground A: transform-synchronization Area: Transform synchronization feature module jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/XL Denotes a PR that changes 300-599 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants