-
Notifications
You must be signed in to change notification settings - Fork 562
feat: replace guid with auth playerid for session management #488
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
Merged
LPLafontaineB
merged 32 commits into
develop
from
feature/replace-guid-with-auth-playerid
Mar 14, 2022
Merged
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
97c2ee1
Replaced custom guid with playerid for session management
LPLafontaineB 4ce6534
Removed code handling duplicate connections in debug builds
LPLafontaineB 5958c9b
Removed AddHostData method
LPLafontaineB 3d9ebfa
Removed guid from ClientPrefs
LPLafontaineB 62d5ea7
Made ClientPrefs class static
LPLafontaineB 47b02ba
cleaning up
LPLafontaineB e6bb5d5
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 020cce1
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 0d874b5
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 77b939f
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service b974e90
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 2d83fcf
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 5296213
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 1babc3f
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 8975d19
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 40d2f89
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service f13fd7a
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 6f27732
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 0d34e9c
Revert "Removed guid from ClientPrefs"
LPLafontaineB 4063c42
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 41790b7
Adding back GUID with IP connections
LPLafontaineB 9008d77
Merge branch 'feature/replace-guid-with-auth-playerid' of https://git…
LPLafontaineB f479872
Exctracted GetPlayerId to GameNetPortal
LPLafontaineB d164192
refactored GetPlayerId to use AuthService's playerId when signed in o…
LPLafontaineB d119ffb
cleanup using directives
LPLafontaineB 788eb23
Merge develop into feature/replace-guid-with-auth-playerid
netcode-ci-service 2973861
reverted unneeded change
LPLafontaineB 346bb7f
Simplified ProfileManager property
LPLafontaineB d66f779
Removed OnlineMode responsability from GameNetPortal
LPLafontaineB a44aeaa
Merge branch 'develop' into feature/replace-guid-with-auth-playerid
LPLafontaineB b525df7
Adding namespace
LPLafontaineB eabe77c
Merge branch 'develop' into feature/replace-guid-with-auth-playerid
LPLafontaineB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using UnityEngine; | ||
|
||
#if UNITY_EDITOR | ||
using ParrelSync; | ||
#endif | ||
|
||
public static class ProfileManager | ||
fernando-cortez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public const string AuthProfileCommandLineArg = "-AuthProfile"; | ||
|
||
static bool s_IsProfileSet = false; | ||
|
||
static string s_Profile = ""; | ||
|
||
public static string Profile | ||
{ | ||
get | ||
{ | ||
if (!s_IsProfileSet) | ||
SamuelBellomo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
s_Profile = GetProfile(); | ||
s_IsProfileSet = true; | ||
} | ||
|
||
return s_Profile; | ||
} | ||
private set => s_Profile = value; | ||
} | ||
|
||
static string GetProfile() | ||
{ | ||
#if UNITY_EDITOR | ||
//The code below makes it possible for the clone instance to log in as a different user profile in Authentication service. | ||
//This allows us to test services integration locally by utilising Parrelsync. | ||
if (ClonesManager.IsClone()) | ||
{ | ||
Debug.Log("This is a clone project."); | ||
var customArguments = ClonesManager.GetArgument().Split(','); | ||
|
||
//second argument is our custom ID, but if it's not set we would just use some default. | ||
|
||
var hardcodedProfileID = customArguments.Length > 1 ? customArguments[1] : "defaultCloneID"; | ||
|
||
return hardcodedProfileID; | ||
} | ||
#else | ||
var arguments = System.Environment.GetCommandLineArgs(); | ||
for (int i = 0; i < arguments.Length; i++) | ||
{ | ||
if (arguments[i] == AuthProfileCommandLineArg) | ||
{ | ||
var profileId = arguments[i + 1]; | ||
return profileId; | ||
} | ||
} | ||
#endif | ||
return ""; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.