-
Notifications
You must be signed in to change notification settings - Fork 450
refactor!: CustomMessageManager is no longer static #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BREAKING CHANGE: Access CustomMessageManager with NetworkManager.Singleton.CustomMessageManager
{ | ||
private NetworkManager m_NetworkManager { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea for later refactor, since several classes all have this pattern of having their own m_NetworkManager, you could have a base class like "NetworkManagerBound" or something. You could then wrap the xtor, m_NetworkManager property, its getter and maybe more things in that. You could then put those in an array in the NetworkManager.cs file and then loop over them to null them out, vs having the list of if statements that have to be maintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good input. At least a field would be nice, but some classes already have constructors like noels RPC queues so I think those should be left.
networkManager.StartServer(); | ||
|
||
Debug.Assert(preManager == null); | ||
Debug.Assert(networkManager.CustomMessagingManager != null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming you like the 'base class' idea above, then you could test all of the "NetworkManager-extended" classes in a loop here.
BREAKING CHANGE: Access CustomMessageManager with NetworkManager.Singleton.CustomMessageManager