-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
The event listener is defined as follows:
/* This listener is used in pair with GetSharedFileIDFromUser.
We ask backends for user data to retrieve sharedFileID */
public class SpecificUserDataListener : GlobalSpecificUserDataListener
{
public ulong sharedFileID = 0;
private Storage storage = GalaxyManager.Instance.Storage;
public override void OnSpecificUserDataUpdated(GalaxyID userID)
{
Debug.Log("User " + userID + " data received");
storage.DownloadSharedFile(sharedFileID);
}
}
And is used like this
/* Downloads a file share */
public void DownloadSharedFileFromUser(GalaxyID userID, string fileName)
{
specificUserDataListener.sharedFileID = GetSharedFileIDFromUser(userID, fileName);
try
{
GalaxyInstance.User().RequestUserData(userID);
}
catch (GalaxyInstance.Error e)
{
Debug.Log("Could not request user data for reason " + e);
}
}
Given that there is only a single instance of the listener and the sharedFileId it's searching for is set with each new request, this means the listener can only listen for and therefore download a single item at a time.
Metadata
Metadata
Assignees
Labels
No labels