Skip to content

Commit 59d8322

Browse files
pdeschainveleekLPLafontaineBSamuelBellomofernando-cortez
authored
Lobby service integration (#480)
* Adding DIScope - an implementation of dependency injection container pattern * Reformat * Adding MessageChannel - a pub-sub message-passing pattern also adding DIScope extensions - this messaging system is particularly useful with DI and the extension provided allows to easily bind all the necessary interfaces to the DI Scope for easy retrieval of either publisher or subscriber interfaces to the message channel * Formatting * UpdateRunner - single Update, usable by non-mbh classes and capable of slower update rates than the FPS * Formatting * Initial UI work to add a toggle for selecting public Lobbies Further work is needed to integrate a nice-looking list of public lobbies * compilation error fix (After rebase) * Created most of the necessary UI for lobby creation and joining * moved logic from MainMenuUI to ClientMainMenuState * # * # * WIP work on porting Lobby Sample code to the Boss Room project * WIP initialization of the lobby system Added some more capability to the DI system so that it can handle lazy initialization. Working on the temporary placeholder class LobbyUIManager that contains setup for the di scope of the lobby system and will do other initialization and reactivity * lobby ui manager wiring preparation work to refactor the PopupPanel and put lobbies in front of all of our modes of connection * # * lobby ui manager injects it's GOs automatically * Added new popup prefab and moved logic to main menu state * wip main menu and login popup prefabs * More work on the LobbyPopup UI * # * # * Fixed DI issues DI scope now reliably works with method and constructor based injection. Renamed and refactored UpdateSlow into UpdateRunner - a tool for non-monobehs to run their update logic and for monobehs that want to save on an extra Update call. Added Bootstrap.cs - a class where we set up core dependencies and that then proceeds to load the first logical scene. * rename fix * Updated MainMenu to use LobbyPopup, removed old UI elements also renamed LobbyUIManager to LobbyUIMediator which is a more accurate reflection of what this class does (an entrypoint to all things LobbyUI) * # * Private Toggle had raycast target disabled and was un-toggleable * working on lobby creation and the appropriate UI callbacks and reacitons * # * Renamed UIFactory to GameObjectFactory, fixed the issue with lobby retrieval exceptions (parsing error) * # * # * # * # * # * Renamed error popup message into UnityServiceErrorMessage * # * Cleanups and refactorings * wip IP connection on lobby join (through creation and through the join ui both) * passing lobby data immediately on creation (because we can, so why wait) * Sometimes we want to block ui while fetching lobbies and other times we do it in the background and UI should not be blocked, * # * passing correct ip from UI * copied relay code from lobby sample * # * backup copies of my versions of scenes for easier rebasing on dev * re-did changes to startup scene * # * moved some of the dependency registrations to the Bootstrap, where we take care of stuff that persists while the app is alive * formatting * # * passed important dependency to the bootstrap class * # * post-rebase cleanup * fixed an issue with code 404 returned on lobby refresh request * Moved OnApplicationQuit Lobby quit attempt logic into Bootstrap, where we actually bind our original dependencies * �# * Bootstrap is now responsible for also containing applicaiton quit logic (so that we can control what services need shutdown messages) RoomNameBox now shows the code for either the IP or Relay based connection; Removed Photon Relay join option. * Added support for ParrelSync-based testing for Unity Services did it by utilizing Profiles features of Unity Authentication and passing custom argument to the * Stop lobby tracking if left lobby (ie quit the game or went back to main menu) * fixed bad default IP (used for localhost connection) * # * Fixed unclickable menu problem * Cleanup * Connected existing relay logic with some minor alterations to the lobby flow Cleaned up some of the unnecessary code inherited from the lobby sample, more of this to come * # * Got relay-based connection to work * Removed unnecessary data visualization * simplified mainmenustate prefab * Bootstrap renamed to ApplicationController to better reflect it's intent * Removed Identity system and replaced it with a simpled Auth service wrapper * Fixed a blocked UI bug Code cleanup * # * applied formatting * Removed unused code * accidentally reintroduced a class that was removed earlier * re-added lobby package * using cleanup and removal of unused enums * review feedback wip * Update Assets/BossRoom/Scripts/Client/UI/UITinter.cs Co-authored-by: Ben Randall <[email protected]> * Update Assets/BossRoom/Scripts/Client/UI/UITinter.cs Co-authored-by: Ben Randall <[email protected]> * # * Review comments wip - LobbyServiceData is no longer an Observed and now is using dedicated pub-sub; - Name changes (with requisite serialized object updates) to keep in line with our coding conventions - UITinter was simplified and now is always asking for an int - no more bool-based API - Name changes to the AutoInjected lists - now they're called very descriptively - GameObjectsThatWillBeInjectedAutomatically - Passing in dependencies instead of manually resolving them in MainMenuState * Build error fix * Removed verbs from Lobby-related UI class names * Update Assets/BossRoom/Scripts/Client/Game/State/ClientMainMenuState.cs Co-authored-by: LPLafontaineB <[email protected]> * # * Quit logic for lobbies has been moved to LobbyAsyncRequests * Removed redundant cancellationtokensource-realted code * Minor API change for AuthenticationAPIInterface * # * Added BufferedMessageChannel - it would call the subscriber immediately if it has a buffered message in it already Will be used to refactor out the "data singletons" and to just define message channels where that data would sit in an observable state. * # * Fun little regex mistake fixed * # * AuthenticationServiceFacade rename * simpligied RateLimitCooldown class * Lobby API Wrapper refactorings - Primary entrypoint to the Lobby stuff is now called LobbyServiceFacade - Many naming adustments - it cleanly encapsulates it's implementation details and passes them around using a child DI scope - Observable was removed (for UI purposes), however there is still a need for a Changed event for LocalUser and LocalLobby * # * # * Bad regex kicking out '.' * Fixing scene references after refactorings * Fixed issue with OnlineMode not being set for a new lobby * Update ui for room name box immediately * Leave lobby when quitting game or leaving char select * Fixed DI bug where if you access the same object through different interfaces it would create multiple objects * # * naming fix * Added 3 interface binding in DIScope * Removed old PopupPanel prefab * MainMenuState didn't have UICanvas set to autoinject * Class naming fix * Cleaned up photon usage * Code comments fix * Added command line argument parsing which allows us to set a different auth profile for the client * MessageChannel internal action queue doc * Naming and API tweaks * UpdateRunner implementation cleaned up brought in line with how MessageChannel is implemented * preventing endless re-queing of fetch lobbies we have a fetch call that's being called from time to time as is * ui testing * # * Update Assets/BossRoom/Scripts/Shared/Infrastructure/PubSub/MessageChannel.cs Co-authored-by: Sam Bellomo <[email protected]> * code style, renamings * Update Assets/BossRoom/Scripts/Client/UI/Lobby/LobbyCreationUI.cs Co-authored-by: Fernando Cortez <[email protected]> * # * # * Cleaned up the remainders of Photon package * relay package upgrade * code style pass * Room Name -> Join Code rename in the char select UI * Increased the delay for lobby update slightly more formatting changes * LobbyJoiningUI InjectDependenciesAndInstantiate -> InjectDependenciesAndInitialize * Added a filter and order usage within LobbyAPIInterface now there should be no need to filter lobbies out locally * Removed Photon Transport form the NM prefab * # * naming adjustment * unused comment * # * namespace adjustment * LobbyUIMediator relayjoinedfailed logic moved into internal scope * unlinked the project from project id Co-authored-by: Ben Randall <[email protected]> Co-authored-by: LPLafontaineB <[email protected]> Co-authored-by: Sam Bellomo <[email protected]> Co-authored-by: Fernando Cortez <[email protected]>
1 parent 8eb6836 commit 59d8322

File tree

95 files changed

+9310
-4945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+9310
-4945
lines changed

Assets/BossRoom/Prefabs/NetworkingManager.prefab

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Transform:
2929
m_LocalScale: {x: 1, y: 1, z: 1}
3030
m_Children: []
3131
m_Father: {fileID: 5436007408952557925}
32-
m_RootOrder: 2
32+
m_RootOrder: 1
3333
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
3434
--- !u!114 &5486862276979889515
3535
MonoBehaviour:
@@ -44,68 +44,17 @@ MonoBehaviour:
4444
m_Name:
4545
m_EditorClassIdentifier:
4646
m_ProtocolType: 0
47-
m_MaximumPacketSize: 2000
4847
m_MaxPacketQueueSize: 512
49-
m_SendQueueBatchSize: 16000
48+
m_MaxPayloadSize: 16000
49+
m_MaxSendQueueSize: 98304
5050
m_HeartbeatTimeoutMS: 500
5151
m_ConnectTimeoutMS: 1000
5252
m_MaxConnectAttempts: 60
5353
m_DisconnectTimeoutMS: 30000
5454
ConnectionData:
5555
Address: 127.0.0.1
5656
Port: 7777
57-
--- !u!1 &409269880
58-
GameObject:
59-
m_ObjectHideFlags: 0
60-
m_CorrespondingSourceObject: {fileID: 0}
61-
m_PrefabInstance: {fileID: 0}
62-
m_PrefabAsset: {fileID: 0}
63-
serializedVersion: 6
64-
m_Component:
65-
- component: {fileID: 409269881}
66-
- component: {fileID: 409269882}
67-
m_Layer: 0
68-
m_Name: PhotonTransport
69-
m_TagString: Untagged
70-
m_Icon: {fileID: 0}
71-
m_NavMeshLayer: 0
72-
m_StaticEditorFlags: 0
73-
m_IsActive: 1
74-
--- !u!4 &409269881
75-
Transform:
76-
m_ObjectHideFlags: 0
77-
m_CorrespondingSourceObject: {fileID: 0}
78-
m_PrefabInstance: {fileID: 0}
79-
m_PrefabAsset: {fileID: 0}
80-
m_GameObject: {fileID: 409269880}
81-
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
82-
m_LocalPosition: {x: 0, y: 0, z: 0}
83-
m_LocalScale: {x: 1, y: 1, z: 1}
84-
m_Children: []
85-
m_Father: {fileID: 5436007408952557925}
86-
m_RootOrder: 0
87-
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
88-
--- !u!114 &409269882
89-
MonoBehaviour:
90-
m_ObjectHideFlags: 0
91-
m_CorrespondingSourceObject: {fileID: 0}
92-
m_PrefabInstance: {fileID: 0}
93-
m_PrefabAsset: {fileID: 0}
94-
m_GameObject: {fileID: 409269880}
95-
m_Enabled: 1
96-
m_EditorHideFlags: 0
97-
m_Script: {fileID: 11500000, guid: 52c005b32a68a254cbe502a4e5cb8eb6, type: 3}
98-
m_Name:
99-
m_EditorClassIdentifier:
100-
m_NickName:
101-
m_RoomName:
102-
m_MaxPlayers: 16
103-
m_NetworkDeliveryEventCodesStartRange: 130
104-
m_AttachSupportLogger: 0
105-
m_BatchMode: 1
106-
m_SendQueueBatchSize: 100000
107-
m_BatchedTransportEventCode: 129
108-
m_KickEventCode: 130
57+
ServerListenAddress:
10958
--- !u!1 &503411707
11059
GameObject:
11160
m_ObjectHideFlags: 0
@@ -135,7 +84,7 @@ Transform:
13584
m_LocalScale: {x: 1, y: 1, z: 1}
13685
m_Children: []
13786
m_Father: {fileID: 5436007408952557925}
138-
m_RootOrder: 3
87+
m_RootOrder: 2
13988
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
14089
--- !u!114 &503411709
14190
MonoBehaviour:
@@ -150,16 +99,17 @@ MonoBehaviour:
15099
m_Name:
151100
m_EditorClassIdentifier:
152101
m_ProtocolType: 1
153-
m_MaximumPacketSize: 1400
154102
m_MaxPacketQueueSize: 256
155-
m_SendQueueBatchSize: 32000
103+
m_MaxPayloadSize: 32000
104+
m_MaxSendQueueSize: 98304
156105
m_HeartbeatTimeoutMS: 500
157106
m_ConnectTimeoutMS: 1000
158107
m_MaxConnectAttempts: 60
159108
m_DisconnectTimeoutMS: 30000
160109
ConnectionData:
161110
Address: 127.0.0.1
162111
Port: 7777
112+
ServerListenAddress:
163113
--- !u!1 &5436007408952557947
164114
GameObject:
165115
m_ObjectHideFlags: 0
@@ -189,7 +139,6 @@ Transform:
189139
m_LocalPosition: {x: 0, y: 0, z: 0}
190140
m_LocalScale: {x: 1, y: 1, z: 1}
191141
m_Children:
192-
- {fileID: 409269881}
193142
- {fileID: 1861090270400447367}
194143
- {fileID: 347284043}
195144
- {fileID: 503411708}
@@ -209,7 +158,6 @@ MonoBehaviour:
209158
m_Name:
210159
m_EditorClassIdentifier:
211160
m_IpHostTransport: {fileID: 5486862276979889515}
212-
m_RelayTransport: {fileID: 409269882}
213161
m_UnityRelayTransport: {fileID: 503411709}
214162
--- !u!114 &5436007408952557924
215163
MonoBehaviour:
@@ -223,7 +171,6 @@ MonoBehaviour:
223171
m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3}
224172
m_Name:
225173
m_EditorClassIdentifier:
226-
DontDestroy: 1
227174
RunInBackground: 1
228175
LogLevel: 1
229176
NetworkConfig:
@@ -315,7 +262,7 @@ Transform:
315262
m_LocalScale: {x: 1, y: 1, z: 1}
316263
m_Children: []
317264
m_Father: {fileID: 5436007408952557925}
318-
m_RootOrder: 1
265+
m_RootOrder: 0
319266
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
320267
--- !u!114 &7738483995325753316
321268
MonoBehaviour:

Assets/BossRoom/Prefabs/State/MainMenuState.prefab

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,37 @@ GameObject:
88
m_PrefabAsset: {fileID: 0}
99
serializedVersion: 6
1010
m_Component:
11-
- component: {fileID: 8576152884213668001}
11+
- component: {fileID: 3747962111577947793}
1212
- component: {fileID: 8576152884213668000}
13+
- component: {fileID: 2665876610389888237}
14+
- component: {fileID: 7369153188685295691}
15+
- component: {fileID: 493749757375256148}
1316
m_Layer: 0
1417
m_Name: MainMenuState
1518
m_TagString: Untagged
1619
m_Icon: {fileID: 0}
1720
m_NavMeshLayer: 0
1821
m_StaticEditorFlags: 0
1922
m_IsActive: 1
20-
--- !u!4 &8576152884213668001
21-
Transform:
23+
--- !u!224 &3747962111577947793
24+
RectTransform:
2225
m_ObjectHideFlags: 0
2326
m_CorrespondingSourceObject: {fileID: 0}
2427
m_PrefabInstance: {fileID: 0}
2528
m_PrefabAsset: {fileID: 0}
2629
m_GameObject: {fileID: 8576152884213668003}
2730
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2831
m_LocalPosition: {x: 0, y: 0, z: 0}
29-
m_LocalScale: {x: 1, y: 1, z: 1}
32+
m_LocalScale: {x: 0, y: 0, z: 0}
3033
m_Children: []
3134
m_Father: {fileID: 0}
3235
m_RootOrder: 0
3336
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
37+
m_AnchorMin: {x: 0, y: 0}
38+
m_AnchorMax: {x: 0, y: 0}
39+
m_AnchoredPosition: {x: 0, y: 0}
40+
m_SizeDelta: {x: 0, y: 0}
41+
m_Pivot: {x: 0, y: 0}
3442
--- !u!114 &8576152884213668000
3543
MonoBehaviour:
3644
m_ObjectHideFlags: 0
@@ -43,3 +51,70 @@ MonoBehaviour:
4351
m_Script: {fileID: 11500000, guid: ab10fd7c6aa7d36438f5ac1c0ebfadbb, type: 3}
4452
m_Name:
4553
m_EditorClassIdentifier:
54+
_autoInjected:
55+
- {fileID: 0}
56+
m_NameGenerationData: {fileID: 11400000, guid: cc0e4025ad893614a8db0d9c10bf7c4f, type: 2}
57+
m_lobbyUIMediator: {fileID: 0}
58+
m_mainMenuButtons: {fileID: 0}
59+
m_signInSpinner: {fileID: 0}
60+
--- !u!223 &2665876610389888237
61+
Canvas:
62+
m_ObjectHideFlags: 0
63+
m_CorrespondingSourceObject: {fileID: 0}
64+
m_PrefabInstance: {fileID: 0}
65+
m_PrefabAsset: {fileID: 0}
66+
m_GameObject: {fileID: 8576152884213668003}
67+
m_Enabled: 1
68+
serializedVersion: 3
69+
m_RenderMode: 0
70+
m_Camera: {fileID: 0}
71+
m_PlaneDistance: 100
72+
m_PixelPerfect: 0
73+
m_ReceivesEvents: 1
74+
m_OverrideSorting: 0
75+
m_OverridePixelPerfect: 0
76+
m_SortingBucketNormalizedSize: 0
77+
m_AdditionalShaderChannelsFlag: 25
78+
m_SortingLayerID: 0
79+
m_SortingOrder: 0
80+
m_TargetDisplay: 0
81+
--- !u!114 &7369153188685295691
82+
MonoBehaviour:
83+
m_ObjectHideFlags: 0
84+
m_CorrespondingSourceObject: {fileID: 0}
85+
m_PrefabInstance: {fileID: 0}
86+
m_PrefabAsset: {fileID: 0}
87+
m_GameObject: {fileID: 8576152884213668003}
88+
m_Enabled: 1
89+
m_EditorHideFlags: 0
90+
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
91+
m_Name:
92+
m_EditorClassIdentifier:
93+
m_UiScaleMode: 1
94+
m_ReferencePixelsPerUnit: 100
95+
m_ScaleFactor: 1
96+
m_ReferenceResolution: {x: 1920, y: 1080}
97+
m_ScreenMatchMode: 0
98+
m_MatchWidthOrHeight: 0.506
99+
m_PhysicalUnit: 3
100+
m_FallbackScreenDPI: 96
101+
m_DefaultSpriteDPI: 96
102+
m_DynamicPixelsPerUnit: 1
103+
m_PresetInfoIsWorld: 0
104+
--- !u!114 &493749757375256148
105+
MonoBehaviour:
106+
m_ObjectHideFlags: 0
107+
m_CorrespondingSourceObject: {fileID: 0}
108+
m_PrefabInstance: {fileID: 0}
109+
m_PrefabAsset: {fileID: 0}
110+
m_GameObject: {fileID: 8576152884213668003}
111+
m_Enabled: 1
112+
m_EditorHideFlags: 0
113+
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
114+
m_Name:
115+
m_EditorClassIdentifier:
116+
m_IgnoreReversedGraphics: 1
117+
m_BlockingObjects: 0
118+
m_BlockingMask:
119+
serializedVersion: 2
120+
m_Bits: 4294967295

Assets/BossRoom/Prefabs/UI/CharacterSelectCanvas.prefab

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ MonoBehaviour:
999999
m_OnCullStateChanged:
10001000
m_PersistentCalls:
10011001
m_Calls: []
1002-
m_text: 'Room Name: '
1002+
m_text: 'Join Code: '
10031003
m_isRightToLeft: 0
10041004
m_fontAsset: {fileID: 11400000, guid: 9641ce046d2227445b9684161a165f68, type: 2}
10051005
m_sharedMaterial: {fileID: -4106257185398102161, guid: 9641ce046d2227445b9684161a165f68, type: 2}
@@ -3757,14 +3757,14 @@ PrefabInstance:
37573757
objectReference: {fileID: 21300000, guid: bb7d37d2a40813048883c2696e975eac, type: 3}
37583758
m_RemovedComponents: []
37593759
m_SourcePrefab: {fileID: 100100000, guid: ff848390065bf914fb60582f4d872815, type: 3}
3760-
--- !u!224 &4148434299776943719 stripped
3760+
--- !u!224 &8367260898428394609 stripped
37613761
RectTransform:
3762-
m_CorrespondingSourceObject: {fileID: 7773346133266671123, guid: ff848390065bf914fb60582f4d872815, type: 3}
3762+
m_CorrespondingSourceObject: {fileID: 2768642224677944325, guid: ff848390065bf914fb60582f4d872815, type: 3}
37633763
m_PrefabInstance: {fileID: 5940892340993679476}
37643764
m_PrefabAsset: {fileID: 0}
3765-
--- !u!224 &8367260898428394609 stripped
3765+
--- !u!224 &4148434299776943719 stripped
37663766
RectTransform:
3767-
m_CorrespondingSourceObject: {fileID: 2768642224677944325, guid: ff848390065bf914fb60582f4d872815, type: 3}
3767+
m_CorrespondingSourceObject: {fileID: 7773346133266671123, guid: ff848390065bf914fb60582f4d872815, type: 3}
37683768
m_PrefabInstance: {fileID: 5940892340993679476}
37693769
m_PrefabAsset: {fileID: 0}
37703770
--- !u!1001 &5940892341121358677
@@ -4829,14 +4829,14 @@ PrefabInstance:
48294829
objectReference: {fileID: 21300000, guid: 9781ab5273dea1c4e94c1ab8d4d18b31, type: 3}
48304830
m_RemovedComponents: []
48314831
m_SourcePrefab: {fileID: 100100000, guid: ff848390065bf914fb60582f4d872815, type: 3}
4832-
--- !u!224 &8367260899810866543 stripped
4832+
--- !u!224 &4148434300538892153 stripped
48334833
RectTransform:
4834-
m_CorrespondingSourceObject: {fileID: 2768642224677944325, guid: ff848390065bf914fb60582f4d872815, type: 3}
4834+
m_CorrespondingSourceObject: {fileID: 7773346133266671123, guid: ff848390065bf914fb60582f4d872815, type: 3}
48354835
m_PrefabInstance: {fileID: 5940892341839497578}
48364836
m_PrefabAsset: {fileID: 0}
4837-
--- !u!224 &4148434300538892153 stripped
4837+
--- !u!224 &8367260899810866543 stripped
48384838
RectTransform:
4839-
m_CorrespondingSourceObject: {fileID: 7773346133266671123, guid: ff848390065bf914fb60582f4d872815, type: 3}
4839+
m_CorrespondingSourceObject: {fileID: 2768642224677944325, guid: ff848390065bf914fb60582f4d872815, type: 3}
48404840
m_PrefabInstance: {fileID: 5940892341839497578}
48414841
m_PrefabAsset: {fileID: 0}
48424842
--- !u!1001 &5940892341869088767

0 commit comments

Comments
 (0)