question

chrissimon-1 avatar image
chrissimon-1 asked

Cloud functions not receiving args when sent from build but works better in editor /development build

Hi, Im facing the same issue. The arguments to my cloud function seem to be missing very randomly. Sometimes the cloud reads the args but sometimes its missing.

CLIENT CODE :

 var challengeData_ = new ChallengeData
 {
     challengerId = myID,
     playerName = myName,
     dateTime = System.DateTime.Now,
     testString = "TEST THIS"
 };
    
 PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest()
 {
     FunctionName = "appendChallenge",
     FunctionParameter = new
     {
         PlayfabId = playfabIDToChallenge,
         challengeData = challengeData_
     },
     GeneratePlayStreamEvent = true
 }, OnAppendChallengeSuccess, OnAppendChallengeError);
    
    
 var obj_ = new TestData
 {
     ggg = "AAAATRGH",
     testString = "TESTTHIS"
 };
    
 PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest()
 {
     FunctionName = "TestFunction",
     FunctionParameter = new
     {
         PlayfabId = playfabIDToChallenge,
         PlayerName = myName,
         ChallengeData = obj_
     },
     GeneratePlayStreamEvent = true
 }, OnAppendChallengeSuccess, OnAppendChallengeError);

OUTPUT :

    "EventName": "player_executed_cloudscript",
     "Source": "CloudScript",
     "FunctionName": "TestFunction",
     "CloudScriptExecutionResult": {
         "FunctionName": "TestFunction",
         "Revision": 99,
         "FunctionResult": null,
         "FunctionResultTooLarge": null,
         "Logs": [
             {
                 "Level": "Info",
                 "Message": "targetId : 30DC529385E68D4E",
                 "Data": null
             },
             {
                 "Level": "Info",
                 "Message": " raw targetId : 30DC529385E68D4E",
                 "Data": null
             },
             {
                 "Level": "Info",
                 "Message": "newChallengeData : {}",
                 "Data": null
             },
             {
                 "Level": "Info",
                 "Message": "Pname : Pho",
                 "Data": null
             }
         ],
         "LogsTooLarge": null,
         "ExecutionTimeSeconds": 0.0316248,
         "ProcessorTimeSeconds": 0.001658,
         "MemoryConsumedBytes": 9800,
         "APIRequestsIssued": 1,
         "HttpRequestsIssued": 0,
         "Error": null
     },
     "EventNamespace": "com.playfab",
     "EntityType": "player",
     "TitleId": "CF32B",
     "EntityId": "C985AE79EF1A9A04",
     "EventId": "75460416bd31446bb06e17c61f1e7cb6",
     "SourceType": "BackEnd",
     "Timestamp": "2024-02-26T06:27:42.8711406Z",
     "History": null,
     "CustomTags": null,
     "Reserved": null,
     "PlayFabEnvironment": {
         "Vertical": "master",
         "Cloud": "main",
         "Application": "logicserver",
         "Commit": "00a1433"
     }
 },
 {
     "EventName": "player_executed_cloudscript",
     "Source": "CloudScript",
     "FunctionName": "appendChallenge",
     "CloudScriptExecutionResult": {
         "FunctionName": "appendChallenge",
         "Revision": 99,
         "FunctionResult": null,
         "FunctionResultTooLarge": null,
         "Logs": [
             {
                 "Level": "Info",
                 "Message": "targetId : undefined",
                 "Data": null
             },
             {
                 "Level": "Info",
                 "Message": " raw targetId : 30DC529385E68D4E",
                 "Data": null
             },
             {
                 "Level": "Info",
                 "Message": "newChallengeData : {\"challengerId\":\"C985AE79EF1A9A04\",\"playerName\":\"Pho\"}",
                 "Data": null
             }
         ],
         "LogsTooLarge": null,
         "ExecutionTimeSeconds": 0.0791159,
         "ProcessorTimeSeconds": 0.001986,
         "MemoryConsumedBytes": 11624,
         "APIRequestsIssued": 2,
         "HttpRequestsIssued": 0,
         "Error": null
     },
     "EventNamespace": "com.playfab",
     "EntityType": "player",
     "TitleId": "CF32B",
     "EntityId": "C985AE79EF1A9A04",
     "EventId": "770bff594cca414684117a54055fb435",
     "SourceType": "BackEnd",
     "Timestamp": "2024-02-26T06:27:42.8981305Z",
     "History": null,
     "CustomTags": null,
     "Reserved": null,
     "PlayFabEnvironment": {
         "Vertical": "master",
         "Cloud": "main",
         "Application": "logicserver",
         "Commit": "00a1433"
     }
 }

The functions receive more or less the same type of args but is half sent in one and completely omitted in the next.

The funcions work well when sent from the EDITOR. When sent from a normal build , it completely fails but works as above when sent from a development build. Please help! @Gosen Gao

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

May I know which version of Unity and PlayFab SDK you are using and which platform you are build? And could you please provide your cloud script for us to reproduce the issue? Also, if you build to android, you may try set network permissions manually by changing Edit -> Project Settings -> Player->Internet Access from Auto to Require.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.