Skip to content

platform dependent compile on AWS JS plugin #120

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
merged 2 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Assets/UXF/Scripts/DataHandling/WebAWSDynamoDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class WebAWSDynamoDB : DataHandler
[SubjectNerd.Utilities.EditScriptable]
public AWSCredentials credentials;

#if UNITY_WEBGL

[DllImport("__Internal")]
private static extern void DDB_Setup(string region, string identityPool, string callbackGameObjectName);

Expand All @@ -45,6 +47,22 @@ public class WebAWSDynamoDB : DataHandler

[DllImport("__Internal")]
private static extern string GetUserInfo();
#else
private static void DDB_Setup(string region, string identityPool, string callbackGameObjectName) => Error();
private static void DDB_CreateTable(string tableName, string primaryKeyName, string sortKeyName, string callbackGameObjectName) => Error();
private static void DDB_PutItem(string tableName, string jsonItem, string callbackGameObjectName) => Error();
private static void DDB_BatchWriteItem(string tableName, string jsonRequests, string callbackGameObjectName) => Error();
private static void DDB_GetItem(string tableName, string jsonItem, string callbackGameObjectName, string guid) => Error();
private static void DDB_Cleanup() => Error();
private static string GetUserInfo() => Error();

private static string Error()
{
throw new InvalidProgramException("WebAWSDynamoDB is not supported on this platform.");
}

#endif


private const string primaryKey = "ppid_session_dataname";
private const string sortKey = "trial_num";
Expand Down
2 changes: 1 addition & 1 deletion Assets/UXF/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.2
2.4.3