Mirror/docs/Components/NetworkLobbyManager.md

126 lines
3.2 KiB
Markdown
Raw Normal View History

Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
# Network Lobby Manager
2019-06-25 17:38:10 +00:00
\*\*Please see the Lobby example in the Examples folder in your Mirror folder
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
2019-06-25 17:38:10 +00:00
The Network Lobby Manager is a specialized type of [Network Manager](NetworkManager) that provides a multiplayer lobby before entering the main play scene of the game. It allows you to set up a network with:
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- A maximum player limit
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Automatic start when all players are ready
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Option to prevent players from joining a game in progress
2019-06-25 17:38:10 +00:00
- Customizable ways for players to choose options while in lobby  
There are two types of player objects with the Network Lobby Manager:
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
**Lobby Player Prefab**
- One for each player
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Created when client connects, or player is added
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Persists until client disconnects
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Holds ready flag and configuration data
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Handles commands in the lobby
2019-06-25 17:38:10 +00:00
- Must use the [Network Lobby Player](NetworkLobbyPlayer) component
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
**Player Prefab**
- One for each player
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Created when game scene is started
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- Destroyed when leaving game scene
2019-06-25 17:38:10 +00:00
- Handles commands in the game  
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
![Network Lobby Manager](NetworkLobbyManager.PNG)
## Properties
- **Show Lobby GUI**
Show the default OnGUI controls for the lobby.
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- **Min Players**
Minimum number of players needed to start a game.
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- **Lobby Player Prefab**
2019-06-25 17:38:10 +00:00
The prefab to create for players when they enter the lobby (requires Network Lobby Player component).
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- **Lobby Scene**
The scene to use for the lobby.
2019-06-25 17:38:10 +00:00
Network Lobby Manager & Lobby Player (#356) * Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
2019-02-20 15:58:50 +00:00
- **Gameplay Scene**
The scene to use for main game play.
2019-07-06 17:16:05 +00:00
- **pendingPlayers**
List\<PendingPlayer\> that holds players that are ready to start playing.
- **lobbySlots**
List\<NetworkLobbyPlayer\> that manages the slots for connected clients in the lobby.
- **allPlayersReady**
Bool indicating if all players are ready to start playing. This value changes as players invoke `CmdChangeReadyState` indicating true or false, and will be set false when a new client connects.
## Methods
### Server Virtual Methods
2019-07-07 06:05:45 +00:00
```cs
2019-07-06 17:16:05 +00:00
public virtual void OnLobbyStartHost() {}
public virtual void OnLobbyStopHost() {}
public virtual void OnLobbyStartServer() {}
public virtual void OnLobbyServerConnect(NetworkConnection conn) {}
public virtual void OnLobbyServerDisconnect(NetworkConnection conn) {}
public virtual void OnLobbyServerSceneChanged(string sceneName) {}
public virtual GameObject OnLobbyServerCreateLobbyPlayer(NetworkConnection conn)
{
return null;
}
public virtual GameObject OnLobbyServerCreateGamePlayer(NetworkConnection conn)
{
return null;
}
public virtual bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayer, GameObject gamePlayer)
{
return true;
}
public virtual void OnLobbyServerPlayersReady()
{
ServerChangeScene(GameplayScene);
}
```
### Client Virtual Methods
2019-07-07 06:05:45 +00:00
```cs
2019-07-06 17:16:05 +00:00
public virtual void OnLobbyClientEnter() {}
public virtual void OnLobbyClientExit() {}
public virtual void OnLobbyClientConnect(NetworkConnection conn) {}
public virtual void OnLobbyClientDisconnect(NetworkConnection conn) {}
public virtual void OnLobbyStartClient() {}
public virtual void OnLobbyStopClient() {}
public virtual void OnLobbyClientSceneChanged(NetworkConnection conn) {}
public virtual void OnLobbyClientAddPlayerFailed() {}
```