question

fredsome avatar image
fredsome asked

Playfab Group

Hi, i am trying to make a turnbased game. I Make a group where all players are autojoined .I need to be able to upload file in the Group's File. I know how to upload and download files from players's entyties, but i don't know how to do that for group.

group.png (27.9 KiB)
10 |1200

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

Seth Du avatar image
Seth Du answered

Basically, if the upload is via Client side, the uploader’s client needs to call InitiateFileUploads API to generate a upload URL, then you may use PUT HTTP request to upload the file. After that, remember to call FinalizeFileUploads to finalize the process.

To download files, simply call GetFiles API (set Group Entity Key as the property in the request)to retrieve the details.

I am not sure the scenario of your project, by default, only the admin role of a group (or a title-level entity) is able to upload files, If you have any other questions on design your game, please feel free to send another thread.

10 |1200

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

fredsome avatar image
fredsome answered

How can i make it with cloud script?I have some handlers and i want to save the args in a group file,and after it return this file in another handler?witch call i should make?

1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

File IO in Cloud Script is not supported because typical operations you'd expect on a computer are conspicuously missing. Meanwhile, Azure Function may support it, however, you may consult Azure team about File IO or find anything helpful on corresponding website.

In terms of PlayFab, Azure Function will hold a title-level authentication context, which means it can modify any entity's file, you may call GetFiles API and specify the Group's Entity Key in the request. After modified, call InitiateFileUploads API, then FinalizeFileUploads.

Usually we won't recommend using Cloud Script/Azure function to download files/data from the external, because the time it takes is uncertain, which may exceed the runtime limit. I will recommend you to use Objects to handle those game data.

0 Likes 0 ·

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.