Secure data handling

I am currently working on integrating my game with a noSQL database, and I lack the networking/database knowledge to figure this out.

we currently have a constructed REST server built on top of a noSQL database for holding the data (JSon), and a CAS system in place for generating tokens, but both of these exist external to the game (URLs not given here). this is also all of the concrete info I have.

As far as I understand it the game needs to present the user with a log-in screen then use that to get the CAS token, and send the token to the REST server to get the data, then parse data, and display (I am presuming that if I can get a pull to work then up should not be too much of an issue). the UI, and the data parsing are fine, but it is talking to the CAS system, and the REST server that are my direct issues.

any guidance would be helpful.

secondary Qs:

  • can this be done is C# (my key experience), or do I “need” UnityScript?
  • can this be done in Web player, or is a full PC/Mac build required?
  • can I do this on a mobile?

You’re looking for the WWW class. As far as information on using REST, that’s a topic for Google.

In addition to Dave’s answer to answer your additional questions:

  • Yes (, No)
  • Yes (, No)
  • Yes

Also if you need a JSON parser i’ve posted one on the wiki

edit

//Example how to use the WWW class to request a JSON document
// C#

// RequestData.cs
using UnityEngine;
using SimpleJSON;

public class RequestData : MonoBehaviour
{
    IEnumerator SendRequest()
    {
        WWW request = new WWW("http://your.example.url/some/path/samplefile.php");
        
        // wait for the requst to finish
        yield return request;
        
        if (request.error == null || request.error == "")
        {
            Debug.Log("The JSON string: " + request.text);
            // request was successful, parse the text into a JSON object
            var N = JSON.Parse(request.text);
            // do something with the data ...
            if(N["success"] == "1")
            {
                //[...]
            }
        }
        else
        {
            Debug.Log("WWW error: " + request.error);
        }
    }

    void Start()
    {
        StartCoroutine(SendRequest());
    }
}

This is just an arbitrary example. How you would access the returned data depends on how your JSON object looks like.