Skip to content

Commit 06a24d4

Browse files
committed
Initial Project
0 parents  commit 06a24d4

File tree

803 files changed

+141879
-0
lines changed

Some content is hidden

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

803 files changed

+141879
-0
lines changed

.gitignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This .gitignore file should be placed at the root of your Unity project directory
2+
#
3+
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4+
#
5+
/[Ll]ibrary/
6+
/[Tt]emp/
7+
/[Oo]bj/
8+
/[Bb]uild/
9+
/[Bb]uilds/
10+
/[Ll]ogs/
11+
/[Mm]emoryCaptures/
12+
13+
# Asset meta data should only be ignored when the corresponding asset is also ignored
14+
!/[Aa]ssets/**/*.meta
15+
16+
# Uncomment this line if you wish to ignore the asset store tools plugin
17+
/[Aa]ssets/AssetStoreTools*
18+
19+
# Autogenerated Jetbrains Rider plugin
20+
[Aa]ssets/Plugins/Editor/JetBrains*
21+
22+
# Visual Studio cache directory
23+
.vs/
24+
25+
# Gradle cache directory
26+
.gradle/
27+
28+
# Autogenerated VS/MD/Consulo solution and project files
29+
ExportedObj/
30+
.consulo/
31+
*.csproj
32+
*.unityproj
33+
*.sln
34+
*.suo
35+
*.tmp
36+
*.user
37+
*.userprefs
38+
*.pidb
39+
*.booproj
40+
*.svd
41+
*.pdb
42+
*.mdb
43+
*.opendb
44+
*.VC.db
45+
46+
# Unity3D generated meta files
47+
*.pidb.meta
48+
*.pdb.meta
49+
*.mdb.meta
50+
51+
# Unity3D generated file on crash reports
52+
sysinfo.txt
53+
54+
# Builds
55+
*.apk
56+
*.unitypackage
57+
58+
# Crashlytics generated file
59+
crashlytics-build.properties
60+

Assets/LootLocker.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/LootLocker/Admin.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/LootLocker/Admin/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
using LootLocker;
5+
using System;
6+
using LootLockerAdminRequests;
7+
using LootLockerAdmin;
8+
using Unity.EditorCoroutines.Editor;
9+
10+
/// <summary>
11+
/// made for admin, relay on editing coroutines
12+
/// </summary>
13+
public class AdminServerAPI : BaseServerAPI
14+
{
15+
public new static AdminServerAPI I;
16+
17+
public static void Init()
18+
{
19+
I = new AdminServerAPI();
20+
21+
BaseServerAPI.Init(I);
22+
23+
I.StartCoroutine = EditorCoroutineUtility.StartCoroutineOwnerless;
24+
}
25+
26+
protected override void RefreshTokenAndCompleteCall(ServerRequest cacheServerRequest, Action<LootLockerResponse> OnServerResponse)
27+
{
28+
var authRequest = new InitialAuthRequest();
29+
authRequest.email = activeConfig.email;
30+
authRequest.password = activeConfig.password;
31+
32+
LootLockerAPIManagerAdmin.InitialAuthenticationRequest(authRequest, (response) =>
33+
{
34+
if (response.success)
35+
{
36+
Dictionary<string, string> headers = new Dictionary<string, string>();
37+
headers.Add("x-auth-token", activeConfig.token);
38+
cacheServerRequest.extraHeaders = headers;
39+
if (cacheServerRequest.retryCount < 4)
40+
{
41+
SendRequest(cacheServerRequest, OnServerResponse);
42+
cacheServerRequest.retryCount++;
43+
}
44+
else
45+
{
46+
Debug.LogError("Admin token refresh failed");
47+
LootLockerResponse res = new LootLockerResponse();
48+
res.statusCode = 401;
49+
res.Error = "Admin token Expired";
50+
res.hasError = true;
51+
OnServerResponse?.Invoke(res);
52+
}
53+
}
54+
else
55+
{
56+
Debug.LogError("Admin token refresh failed");
57+
LootLockerResponse res = new LootLockerResponse();
58+
res.statusCode = 401;
59+
res.Error = "Admin token Expired";
60+
res.hasError = true;
61+
OnServerResponse?.Invoke(res);
62+
}
63+
});
64+
}
65+
}

Assets/LootLocker/Admin/Editor/AdminServerAPI.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using LootLockerAdminRequests;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using UnityEngine;
5+
6+
public class AdminUserTest : MonoBehaviour
7+
{
8+
9+
[ContextMenu("Setup Two-Factor Authentication")]
10+
public void SetupTwoFactorAuthentication()
11+
{
12+
LootLockerSDKAdminManager.SetupTwoFactorAuthentication((response) =>
13+
{
14+
if (response.success)
15+
{
16+
Debug.LogError("Successful setup two factor authentication: " + response.text);
17+
}
18+
else
19+
{
20+
Debug.LogError("failed to set two factor authentication: " + response.Error);
21+
}
22+
});
23+
}
24+
25+
}
26+

Assets/LootLocker/Admin/Editor/AdminUserTest.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)