Skip to content

Commit 88585c0

Browse files
committed
Added new namespaces for parts of project
1 parent 14bddd1 commit 88585c0

File tree

104 files changed

+7170
-6941
lines changed

Some content is hidden

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

104 files changed

+7170
-6941
lines changed

Assets/LootLocker/SampleApp/Stages.meta renamed to Assets/LootLocker.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/LootLocker/Admin/Editor/AdminServerAPI.cs

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,62 @@
77
using LootLockerAdmin;
88
using Unity.EditorCoroutines.Editor;
99

10-
/// <summary>
11-
/// made for admin, relay on editing coroutines
12-
/// </summary>
13-
public class AdminServerAPI : BaseServerAPI
10+
namespace LootLockerAdmin
1411
{
15-
public new static AdminServerAPI I;
16-
17-
public static void Init()
12+
/// <summary>
13+
/// made for admin, relay on editing coroutines
14+
/// </summary>
15+
public class AdminServerAPI : BaseServerAPI
1816
{
19-
I = new AdminServerAPI();
17+
public new static AdminServerAPI I;
2018

21-
BaseServerAPI.Init(I);
19+
public static void Init()
20+
{
21+
I = new AdminServerAPI();
2222

23-
I.StartCoroutine = EditorCoroutineUtility.StartCoroutineOwnerless;
24-
}
23+
BaseServerAPI.Init(I);
2524

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;
25+
I.StartCoroutine = EditorCoroutineUtility.StartCoroutineOwnerless;
26+
}
3127

32-
LootLockerAPIManagerAdmin.InitialAuthenticationRequest(authRequest, (response) =>
28+
protected override void RefreshTokenAndCompleteCall(ServerRequest cacheServerRequest, Action<LootLockerResponse> OnServerResponse)
3329
{
34-
if (response.success)
30+
var authRequest = new InitialAuthRequest();
31+
authRequest.email = activeConfig.email;
32+
authRequest.password = activeConfig.password;
33+
34+
LootLockerAPIManagerAdmin.InitialAuthenticationRequest(authRequest, (response) =>
3535
{
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)
36+
if (response.success)
4037
{
41-
SendRequest(cacheServerRequest, OnServerResponse);
42-
cacheServerRequest.retryCount++;
38+
Dictionary<string, string> headers = new Dictionary<string, string>();
39+
headers.Add("x-auth-token", activeConfig.token);
40+
cacheServerRequest.extraHeaders = headers;
41+
if (cacheServerRequest.retryCount < 4)
42+
{
43+
SendRequest(cacheServerRequest, OnServerResponse);
44+
cacheServerRequest.retryCount++;
45+
}
46+
else
47+
{
48+
LootLockerSDKAdminManager.DebugMessage("Admin token refresh failed");
49+
LootLockerResponse res = new LootLockerResponse();
50+
res.statusCode = 401;
51+
res.Error = "Admin token Expired";
52+
res.hasError = true;
53+
OnServerResponse?.Invoke(res);
54+
}
4355
}
4456
else
4557
{
46-
LootLockerSDKAdminManager.DebugMessage("Admin token refresh failed");
58+
LootLockerSDKAdminManager.DebugMessage("Admin token refresh failed", true);
4759
LootLockerResponse res = new LootLockerResponse();
4860
res.statusCode = 401;
4961
res.Error = "Admin token Expired";
5062
res.hasError = true;
5163
OnServerResponse?.Invoke(res);
5264
}
53-
}
54-
else
55-
{
56-
LootLockerSDKAdminManager.DebugMessage("Admin token refresh failed",true);
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-
});
65+
});
66+
}
6467
}
65-
}
68+
}

Assets/LootLocker/Admin/Editor/AdminUserTest.cs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
using System.Collections.Generic;
44
using UnityEngine;
55

6-
public class AdminUserTest : MonoBehaviour
6+
namespace LootLockerAdmin
77
{
8-
9-
[ContextMenu("Setup Two-Factor Authentication")]
10-
public void SetupTwoFactorAuthentication()
8+
public class AdminUserTest : MonoBehaviour
119
{
12-
LootLockerSDKAdminManager.SetupTwoFactorAuthentication((response) =>
10+
11+
[ContextMenu("Setup Two-Factor Authentication")]
12+
public void SetupTwoFactorAuthentication()
1313
{
14-
if (response.success)
15-
{
16-
LootLockerSDKAdminManager.DebugMessage("Successful setup two factor authentication: " + response.text);
17-
}
18-
else
14+
LootLockerSDKAdminManager.SetupTwoFactorAuthentication((response) =>
1915
{
20-
LootLockerSDKAdminManager.DebugMessage("failed to set two factor authentication: " + response.Error, true);
21-
}
22-
});
23-
}
16+
if (response.success)
17+
{
18+
LootLockerSDKAdminManager.DebugMessage("Successful setup two factor authentication: " + response.text);
19+
}
20+
else
21+
{
22+
LootLockerSDKAdminManager.DebugMessage("failed to set two factor authentication: " + response.Error, true);
23+
}
24+
});
25+
}
2426

27+
}
2528
}
2629

0 commit comments

Comments
 (0)