Possibility to impl...
 
Notifications
Clear all

Possibility to implement own "Steam Workshop"

5 Posts
2 Users
0 Reactions
721 Views
(@romenics)
Posts: 3
Active Member
Topic starter
 

Hello!
Thanks you for the great system! Combu is very nice and usefull tool.

I have a question.
Is this possible to use Combu in order to create some kind of own "Steam Workshop"?
I mean a possibility to upload a file and make it public, so other people will be able to browse and download these files.

Thanks!

 
Posted : 14/01/2019 7:19 am
Topic Tags
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Hi, thanks for your appreciation.

The account's UserFile has a sharing property that allows access to a file to other users (UserFile.Load has a parameter includeShared to retrieve both account own  and shared by others). For now this is the only feature, but the management of global files is also a good idea for an add-on, I'll see if will find some time to work on such extra add-on or you can also try yourself if have some PHP klnowledge (I started a tutorial series in the blog section some time ago, which I'll continue as soon as I've some spare time).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 14/01/2019 9:37 am
(@romenics)
Posts: 3
Active Member
Topic starter
 

Thanks for the quick reply!

If I understood right, Combu already almost suitable for implementation of workshop.

Only one tiny thing should be added in order to make it possible.

We already have
Combu.UserFile.Load< T > ()
which will display a list of files (mods) of specific user.
All what we need, is just similar method, but it should search among all users (not only specific one)

So, for exmaple, we will be able easily to display all files of type "Map" which was upload by any user.

So, is this possible to use Combu.UserFile.Load< T > () but for all users?
If not, could you please implement that? Sound like it is very simple task for you.

Thanks!

 
Posted : 14/01/2019 6:04 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

To share a file with all other users (or just user's friends) as said you have to set the property sharing to eShareType.Everybody (in the database table UserFile the field ShareType is set to 0 for "sharing=everybody", 1 for "sharing=nobody [owner-only]" and 2 for "sharing=friends"):

UserFile newFile = new UserFile();
newFile.sharing = UserFile.eShareType.Everybody;
newFile.Update(yourFileContentByteArray, (bool success, string error) => {
    if (success)
        Debug.Log("Success");
    else
        Debug.Log("Failed: " + error);
});

 

Then to retrieve all files including the ones shared by other users:

int pageNumber = 1;
int countPerPage = 10;
bool includeShared = true;
UserFile.Load(CombuManager.localUser.id, includeShared, pageNumber, countPerPage, (UserFile[] files, int resultsCount, int pagesCount, string error) => {
    if (string.IsNullOrEmpty(error))
        Debug.Log("Files loaded: " + files.Length);
    else
        Debug.Log(error);
});

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 14/01/2019 6:58 pm
(@romenics)
Posts: 3
Active Member
Topic starter
 

Amazing! Seems like exactly what I need.

Thanks!

 
Posted : 17/01/2019 11:34 pm
Share: