@@ -88,8 +88,6 @@ public class GameNetPortal : MonoBehaviour
88
88
private LocalLobby m_LocalLobby ;
89
89
private LobbyServiceFacade m_LobbyServiceFacade ;
90
90
91
- public OnlineMode OnlineMode { get ; set ; }
92
-
93
91
[ Inject ]
94
92
private void InjectDependencies ( LocalLobby localLobby , LobbyServiceFacade lobbyServiceFacade )
95
93
{
@@ -169,7 +167,6 @@ private void OnNetworkReady()
169
167
/// <param name="port">The port to connect to. </param>
170
168
public void StartHost ( string ipaddress , int port )
171
169
{
172
- OnlineMode = OnlineMode . IpHost ;
173
170
var chosenTransport = NetworkManager . Singleton . gameObject . GetComponent < TransportPicker > ( ) . IpHostTransport ;
174
171
NetworkManager . Singleton . NetworkConfig . NetworkTransport = chosenTransport ;
175
172
@@ -192,7 +189,6 @@ public void StartHost(string ipaddress, int port)
192
189
193
190
public async void StartUnityRelayHost ( )
194
191
{
195
- OnlineMode = OnlineMode . UnityRelay ;
196
192
var chosenTransport = NetworkManager . Singleton . gameObject . GetComponent < TransportPicker > ( ) . UnityRelayTransport ;
197
193
NetworkManager . Singleton . NetworkConfig . NetworkTransport = chosenTransport ;
198
194
@@ -253,24 +249,7 @@ public void RequestDisconnect()
253
249
254
250
public string GetPlayerId ( )
255
251
{
256
- var playerId = "" ;
257
- if ( AuthenticationService . Instance . IsSignedIn )
258
- {
259
- playerId = AuthenticationService . Instance . PlayerId ;
260
- }
261
- else if ( OnlineMode == OnlineMode . IpHost )
262
- {
263
- playerId = ClientPrefs . GetGuid ( ) + ProfileManager . Profile ;
264
- }
265
- else if ( OnlineMode == OnlineMode . UnityRelay )
266
- {
267
- Debug . LogError ( "OnlineMode set to UnityRelay, but not signed in through AuthenticationService." ) ;
268
- }
269
- else
270
- {
271
- Debug . LogError ( $ "OnlineMode not set to a valid value: { OnlineMode } ") ;
272
- }
273
- return playerId ;
252
+ return AuthenticationService . Instance . IsSignedIn ? AuthenticationService . Instance . PlayerId : ClientPrefs . GetGuid ( ) + ProfileManager . Profile ;
274
253
}
275
254
}
276
255
}
0 commit comments