/// <summary>
 /// Asynchronously retrieves the server auth code for this client.
 /// </summary>
 /// <remarks>Note: This function is currently only implemented for Android.</remarks>
 /// <param name="serverClientId">The Client ID.</param>
 /// <param name="callback">Callback for response.</param>
 public void GetServerAuthCode(string serverClientId, Action <CommonStatusCodes, string> callback)
 {
     mServices.FetchServerAuthCode(serverClientId, (serverAuthCodeResponse) => {
         // Translate native errors into CommonStatusCodes.
         CommonStatusCodes responseCode =
             ConversionUtils.ConvertResponseStatusToCommonStatus(serverAuthCodeResponse.Status());
         // Log errors.
         if (responseCode != CommonStatusCodes.Success &&
             responseCode != CommonStatusCodes.SuccessCached)
         {
             OurUtils.Logger.e("Error loading server auth code: " + serverAuthCodeResponse.Status().ToString());
         }
         // Fill in the code & call the callback.
         if (callback != null)
         {
             // copy the auth code into managed memory before posting
             // the callback.
             string authCode = serverAuthCodeResponse.Code();
             PlayGamesHelperObject.RunOnGameThread(() =>
                                                   callback(responseCode, authCode));
         }
     });
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="vCommands.EvaluationResult"/> class with the specified known status code, originating expression, text output and data.
 /// </summary>
 /// <param name="status">Known status code indicating the success of the evaluation.</param>
 /// <param name="exp">The expression which evaluated to the current result.</param>
 /// <param name="output">The text output of the evaluation.</param>
 /// <param name="data"></param>
 /// <exception cref="System.ArgumentNullException"><paramref name="output"/> or <paramref name="data"/> are null.</exception>
 public EvaluationResult(CommonStatusCodes status, Expression exp, string output, params object[] data)
     : this((int)status, exp, output, data)
 {
 }