question

Paul Boutros avatar image
Paul Boutros asked

copy json files from CDN to player entity from script

Hello,

Here is the scenario. I have a game that loads 2 terrains Json files(2 entities) when it starts. It needs these files to build the world. The user can edit the terrain(like minecraft) and save it so this is why I saved these files as player entities. I currently added these two files manually. Here is the problem:
When a new user registers, I want somehow to have those 2 Json files popup on the user data files.

Could it be possible to have these files stored on the CDN and trigger a copy of these initial files on the user data file whenever a registration event occurs? What would be the way to do it?

Thanks~

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

·
Citrus Yan avatar image
Citrus Yan answered

You can use Actions and rules to achieve this: act on the player_added_title event ( it’s triggered upon player creation) by running a script, for instance, from Azure Function, that retrieves the initial files on the CDN and copy them on the user data files. Please navigate to the link mentioned to learn more.

4 comments
10 |1200

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

Paul Boutros avatar image Paul Boutros commented ·

Hi Citrus! I can't test it now, but it looks like these info should be all I need to do what I intended to do. I will post here again if I encounter any problem, Thanks!

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Paul Boutros commented ·

Sure, any questions please let us know!

0 Likes 0 ·
Paul Boutros avatar image Paul Boutros Citrus Yan commented ·

Well, I am doing it now, but really can't find the function to copy files from CDN to user Data. I have a work around of course: On new user registration, files from CDN are downloaded, then uploaded to the user data and it works, but could there be something more simple than that.. I feel it is a bit of a hack no?

0 Likes 0 ·
Show more comments

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.