Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage can't download more than one file at a time #3

Open
Ryxali opened this issue May 28, 2019 · 1 comment
Open

Storage can't download more than one file at a time #3

Ryxali opened this issue May 28, 2019 · 1 comment

Comments

@Ryxali
Copy link

Ryxali commented May 28, 2019

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.

@JakBaranowski
Copy link
Contributor

Hi @Ryxali,

Thanks for reporting the issue. Indeed this could be done better. :-) I will look into resolving this in later updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants