Skip to content

refactor: Remove exceptions from Network Spawn Manager#3933

Draft
noellie-velez wants to merge 5 commits intodevelop-2.0.0from
refactor/remove-exceptions-network-spawn-manager
Draft

refactor: Remove exceptions from Network Spawn Manager#3933
noellie-velez wants to merge 5 commits intodevelop-2.0.0from
refactor/remove-exceptions-network-spawn-manager

Conversation

@noellie-velez
Copy link
Copy Markdown
Collaborator

Purpose of this PR

Remove exceptions from Network Spawn Manager

Jira ticket

MTT-14791

Changelog

  • Changed: Replaced Exceptions and Debug.Log by NetworkLog logs

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

if (NetworkManager.LogLevel <= LogLevel.Developer)
{
NetworkLog.LogInfo(builder.ToString());
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Revert this, keep the Debug.Log

{
Debug.LogWarning(
"Object was shown and hidden from the same client in the same Network frame. As a result, the client will _not_ receive a NetworkSpawn");
if (NetworkManager.LogLevel <= LogLevel.Developer)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If logged already set the log level to normal

if (NetworkManager.ShutdownInProgress)
{
Debug.LogWarning(InstantiateAndSpawnErrors[InstantiateAndSpawnErrorTypes.InvokedWhenShuttingDown]);
if (NetworkManager.LogLevel <= LogLevel.Developer)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Normal

Comment on lines +2092 to +2095
if (NetworkManager.LogLevel <= LogLevel.Developer)
{
NetworkLog.LogInfo($"[{objPerClient} of {totalObjectsToDistribute}][Client-{ownerList.Key}] Count: {ownerList.Value.Count} | ObjPerClient: {objPerClient} | maxD: {maxDistributeCount} | Offset: {offsetCount}");
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Revert

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

And everything that is in the EnableDistributeLogging check

if (!child.IsOwnershipDistributable || !child.IsOwnershipTransferable)
{
NetworkLog.LogWarning($"Sibling {child.name} of root parent {ownerList.Value[i].name} is neither transferable or distributable! Object distribution skipped and could lead to a potentially un-owned or owner-mismatched {nameof(NetworkObject)}!");
if (NetworkManager.LogLevel <= LogLevel.Developer)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Normal

Comment on lines +2129 to +2132
if (NetworkManager.LogLevel <= LogLevel.Developer)
{
NetworkLog.LogInfo($"[Client-{ownerList.Key}][NetworkObjectId-{ownerList.Value[i].NetworkObjectId} Distributed to Client-{clientId}");
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Revert - see the format

Comment on lines +2343 to +2355
if (NetworkManager.LogLevel <= LogLevel.Error)
{
NetworkLog.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!");
}
return;
}

if (NetworkManager.NetworkConfig.EnableSceneManagement)
{
Debug.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when scene management is disabled!");
if (NetworkManager.LogLevel <= LogLevel.Error)
{
NetworkLog.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when scene management is disabled!");
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Revert because internal

Comment on lines 2295 to +2308
{
Debug.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!");
if (NetworkManager.LogLevel <= LogLevel.Error)
{
NetworkLog.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!");
}
return;
}

if (NetworkManager.LocalClient.IsSessionOwner)
{
Debug.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked on a non-session owner client!");
if (NetworkManager.LogLevel <= LogLevel.Error)
{
NetworkLog.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked on a non-session owner client!");
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Revert because internal errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant