Game with user upload/downlaod function

Hello,

I want to add a feature to my game which gives the player the abbility to create photos/videos within the game and upload them to a server.
If a user then logs into the game (maybe from another pc) the photos/videos should be automatically downloaded from the server.

My question now: How do I accomplish this process?

  • I need some kind of login system for my game, so that the game knows which player created the data
  • I need to store the data on a server, but only the player who created the data should be able to access it.

→ how to handle the upload?
→ how to save the data in a secure way, so that only the player can access it?
→ how to download the data (but only the data the palyer is allowed to read; not the data from the other players)?

I hope you have some ideas, because I don’t know at this moment how to implement such a feature that is safe and fits all my needs.

regards

I would recommend you to give KiiSDK a try:

Documentation regarding uploading objects:
http://docs.kii.com/en/guides/unity/managing-data/object-storages/

You have to set up an account before using their services.

But it really is simple as:

// Create an object in an application-scope bucket.
KiiObject obj = Kii.Bucket("mydata").NewKiiObject();

// Set key-value pairs
obj ["score"] = 987;
obj ["mode"] = "easy";
obj ["premiumUser"] = false;

// Save the object
obj.Save((KiiObject savedObj, Exception e) => {
  if (e != null)
  {
    // Handle error
    return;
  }

  // Prepare file to upload.
  FileStream file = new FileStream("myImage.jpg", FileMode.Open);

  // Start uploading
  obj.UploadBody("image/jpeg", file, (KiiObject uploadedObj, Exception e2) => {
    if (e2 != null)
    {
      // Handle error
      return;
    }
    // Upload body is succeeded
  },
  (KiiObject uploadingObj, float progress) => {
    // Handle progress
  });
});

Hope it helps!