Skip to content

Commit

Permalink
https://api.playfab.com/releaseNotes/#161003
Browse files Browse the repository at this point in the history
  • Loading branch information
Playfab Jenkins Bot committed Oct 3, 2016
2 parents a882dd0 + 265ef79 commit cbe3ae6
Show file tree
Hide file tree
Showing 18 changed files with 202 additions and 44 deletions.
25 changes: 25 additions & 0 deletions PlayFabClientSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,31 @@ public static async Task<PlayFabResult<GetStoreItemsResult>> GetStoreItemsAsync(
return new PlayFabResult<GetStoreItemsResult> { Result = result };
}

/// <summary>
/// Retrieves the current server time
/// </summary>
public static async Task<PlayFabResult<GetTimeResult>> GetTimeAsync(GetTimeRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost("/Client/GetTime", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetTimeResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabUtil.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetTimeResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetTimeResult result = resultData.data;

return new PlayFabResult<GetTimeResult> { Result = result };
}

/// <summary>
/// Retrieves the key-value store of custom title settings
/// </summary>
Expand Down
21 changes: 19 additions & 2 deletions PlayFabClientSDK/source/PlayFabClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,19 @@ public class GetStoreItemsResult : PlayFabResultCommon

}

public class GetTimeRequest
{
}

public class GetTimeResult : PlayFabResultCommon
{
/// <summary>
/// Current server time when the request was received, in UTC
/// </summary>
public DateTime Time;

}

public class GetTitleDataRequest
{
/// <summary>
Expand Down Expand Up @@ -3401,6 +3414,11 @@ public class PayForPurchaseResult : PlayFabResultCommon
/// </summary>
public Dictionary<string,int> VirtualCurrency;

/// <summary>
/// A token generated by the provider to authenticate the request (provider-specific).
/// </summary>
public string ProviderToken;

}

public class PaymentOption
Expand Down Expand Up @@ -3913,8 +3931,7 @@ public enum SourceType
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}

public class StartGameRequest
Expand Down
7 changes: 6 additions & 1 deletion PlayFabClientSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ public enum PlayFabErrorCode
RequestAlreadyRunning = 1249,
ActionGroupNotFound = 1250,
MaximumSegmentBulkActionJobsRunning = 1251,
NoActionsOnPlayersInSegmentJob = 1252
NoActionsOnPlayersInSegmentJob = 1252,
DuplicateStatisticName = 1253,
ScheduledTaskNameConflict = 1254,
ScheduledTaskCreateConflict = 1255,
InvalidScheduledTaskName = 1256,
InvalidTaskSchedule = 1257
}

public class PlayFabError
Expand Down
6 changes: 3 additions & 3 deletions PlayFabClientSDK/source/PlayFabSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace PlayFab
{
public class PlayFabSettings
{
public const string SdkVersion = "0.38.160919";
public const string BuildIdentifier = "jbuild_csharpsdk_1";
public const string SdkVersionString = "CSharpSDK-0.38.160919";
public const string SdkVersion = "0.39.161003";
public const string BuildIdentifier = "jbuild_csharpsdk_0";
public const string SdkVersionString = "CSharpSDK-0.39.161003";

/// <summary> This is for PlayFab internal debugging. Generally you shouldn't touch this </summary>
public static bool UseDevelopmentEnvironment = false;
Expand Down
17 changes: 6 additions & 11 deletions PlayFabSDK/UnittestRunner/PlayFabApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public class PlayFabApiTest : UUnitTestCase
private static bool TITLE_CAN_UPDATE_SETTINGS = false;

// Fixed values provided from testInputs
private static string USER_NAME;
private static string USER_EMAIL;
private static string USER_PASSWORD;
private static string CHAR_NAME;

// Information fetched by appropriate API calls
Expand All @@ -51,18 +49,14 @@ public static void SetTitleInfo(Dictionary<string, string> testInputs)
TITLE_INFO_SET &= testInputs.TryGetValue("titleCanUpdateSettings", out eachValue);
TITLE_INFO_SET &= bool.TryParse(eachValue, out TITLE_CAN_UPDATE_SETTINGS);

TITLE_INFO_SET &= testInputs.TryGetValue("userName", out USER_NAME);
TITLE_INFO_SET &= testInputs.TryGetValue("userEmail", out USER_EMAIL);
TITLE_INFO_SET &= testInputs.TryGetValue("userPassword", out USER_PASSWORD);

TITLE_INFO_SET &= testInputs.TryGetValue("characterName", out CHAR_NAME);

// Verify all the inputs won't cause crashes in the tests
TITLE_INFO_SET &= !string.IsNullOrEmpty(PlayFabSettings.TitleId)
&& !string.IsNullOrEmpty(PlayFabSettings.DeveloperSecretKey)
&& !string.IsNullOrEmpty(USER_NAME)
&& !string.IsNullOrEmpty(USER_EMAIL)
&& !string.IsNullOrEmpty(USER_PASSWORD)
&& !string.IsNullOrEmpty(CHAR_NAME);
}

Expand Down Expand Up @@ -106,7 +100,7 @@ public void InvalidLogin()
{
TitleId = PlayFabSettings.TitleId,
Email = USER_EMAIL,
Password = USER_PASSWORD + "INVALID",
Password = "INVALID",
};
var task = PlayFabClientAPI.LoginWithEmailAddressAsync(request);
task.Wait();
Expand All @@ -132,6 +126,7 @@ public void InvalidRegistration()
Password = "x",
};
var registerTask = PlayFabClientAPI.RegisterPlayFabUserAsync(registerRequest);
registerTask.Wait();
UUnitAssert.NotNull(registerTask.Result);
UUnitAssert.IsNull(registerTask.Result.Result);
UUnitAssert.NotNull(registerTask.Result.Error);
Expand All @@ -158,11 +153,9 @@ public void LoginOrRegister()
CreateAccount = true
};
var loginTask = PlayFabClientAPI.LoginWithCustomIDAsync(loginRequest);
WaitForResultSuccess(loginTask, "Login with advertId failed");
loginTask.Wait(); // We don't care about success or fail here
WaitForResultSuccess(loginTask, "Login failed");

_playFabId = loginTask.Result.Result.PlayFabId; // Needed for subsequent tests

UUnitAssert.True(PlayFabClientAPI.IsClientLoggedIn(), "User login failed");
}

Expand All @@ -184,7 +177,9 @@ public void LoginWithAdvertisingId()
};
var loginTask = PlayFabClientAPI.LoginWithCustomIDAsync(loginRequest);
WaitForResultSuccess(loginTask, "Login with advertId failed");
loginTask.Wait(); // We don't care about success or fail here

_playFabId = loginTask.Result.Result.PlayFabId; // Needed for subsequent tests
UUnitAssert.True(PlayFabClientAPI.IsClientLoggedIn(), "User login failed");

UUnitAssert.StringEquals(PlayFabSettings.AD_TYPE_ANDROID_ID + "_Successful", PlayFabSettings.AdvertisingIdType);
}
Expand Down
3 changes: 1 addition & 2 deletions PlayFabSDK/source/PlayFabAdminModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2613,8 +2613,7 @@ public enum SourceType
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}


Expand Down
25 changes: 25 additions & 0 deletions PlayFabSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,31 @@ public static async Task<PlayFabResult<GetStoreItemsResult>> GetStoreItemsAsync(
return new PlayFabResult<GetStoreItemsResult> { Result = result };
}

/// <summary>
/// Retrieves the current server time
/// </summary>
public static async Task<PlayFabResult<GetTimeResult>> GetTimeAsync(GetTimeRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

object httpResult = await PlayFabHTTP.DoPost("/Client/GetTime", request, "X-Authorization", _authKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetTimeResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabUtil.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetTimeResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetTimeResult result = resultData.data;

return new PlayFabResult<GetTimeResult> { Result = result };
}

/// <summary>
/// Retrieves the key-value store of custom title settings
/// </summary>
Expand Down
21 changes: 19 additions & 2 deletions PlayFabSDK/source/PlayFabClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,19 @@ public class GetStoreItemsResult : PlayFabResultCommon

}

public class GetTimeRequest
{
}

public class GetTimeResult : PlayFabResultCommon
{
/// <summary>
/// Current server time when the request was received, in UTC
/// </summary>
public DateTime Time;

}

public class GetTitleDataRequest
{
/// <summary>
Expand Down Expand Up @@ -3401,6 +3414,11 @@ public class PayForPurchaseResult : PlayFabResultCommon
/// </summary>
public Dictionary<string,int> VirtualCurrency;

/// <summary>
/// A token generated by the provider to authenticate the request (provider-specific).
/// </summary>
public string ProviderToken;

}

public class PaymentOption
Expand Down Expand Up @@ -3913,8 +3931,7 @@ public enum SourceType
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}

public class StartGameRequest
Expand Down
7 changes: 6 additions & 1 deletion PlayFabSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ public enum PlayFabErrorCode
RequestAlreadyRunning = 1249,
ActionGroupNotFound = 1250,
MaximumSegmentBulkActionJobsRunning = 1251,
NoActionsOnPlayersInSegmentJob = 1252
NoActionsOnPlayersInSegmentJob = 1252,
DuplicateStatisticName = 1253,
ScheduledTaskNameConflict = 1254,
ScheduledTaskCreateConflict = 1255,
InvalidScheduledTaskName = 1256,
InvalidTaskSchedule = 1257
}

public class PlayFabError
Expand Down
25 changes: 25 additions & 0 deletions PlayFabSDK/source/PlayFabServerAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,31 @@ public static async Task<PlayFabResult<GetPublisherDataResult>> GetPublisherData
return new PlayFabResult<GetPublisherDataResult> { Result = result };
}

/// <summary>
/// Retrieves the current server time
/// </summary>
public static async Task<PlayFabResult<GetTimeResult>> GetTimeAsync(GetTimeRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

object httpResult = await PlayFabHTTP.DoPost("/Server/GetTime", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetTimeResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabUtil.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetTimeResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetTimeResult result = resultData.data;

return new PlayFabResult<GetTimeResult> { Result = result };
}

/// <summary>
/// Retrieves the key-value store of custom title settings
/// </summary>
Expand Down
13 changes: 13 additions & 0 deletions PlayFabSDK/source/PlayFabServerModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,19 @@ public class GetSharedGroupDataResult : PlayFabResultCommon

}

public class GetTimeRequest
{
}

public class GetTimeResult : PlayFabResultCommon
{
/// <summary>
/// Current server time when the request was received, in UTC
/// </summary>
public DateTime Time;

}

public class GetTitleDataRequest
{
/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions PlayFabSDK/source/PlayFabSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace PlayFab
{
public class PlayFabSettings
{
public const string SdkVersion = "0.38.160919";
public const string BuildIdentifier = "jbuild_csharpsdk_1";
public const string SdkVersionString = "CSharpSDK-0.38.160919";
public const string SdkVersion = "0.39.161003";
public const string BuildIdentifier = "jbuild_csharpsdk_0";
public const string SdkVersionString = "CSharpSDK-0.39.161003";

/// <summary> This is for PlayFab internal debugging. Generally you shouldn't touch this </summary>
public static bool UseDevelopmentEnvironment = false;
Expand Down
3 changes: 1 addition & 2 deletions PlayFabServerSDK/source/PlayFabAdminModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2613,8 +2613,7 @@ public enum SourceType
BackEnd,
GameClient,
GameServer,
Partner,
Stream
Partner
}


Expand Down
7 changes: 6 additions & 1 deletion PlayFabServerSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ public enum PlayFabErrorCode
RequestAlreadyRunning = 1249,
ActionGroupNotFound = 1250,
MaximumSegmentBulkActionJobsRunning = 1251,
NoActionsOnPlayersInSegmentJob = 1252
NoActionsOnPlayersInSegmentJob = 1252,
DuplicateStatisticName = 1253,
ScheduledTaskNameConflict = 1254,
ScheduledTaskCreateConflict = 1255,
InvalidScheduledTaskName = 1256,
InvalidTaskSchedule = 1257
}

public class PlayFabError
Expand Down
25 changes: 25 additions & 0 deletions PlayFabServerSDK/source/PlayFabServerAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,31 @@ public static async Task<PlayFabResult<GetPublisherDataResult>> GetPublisherData
return new PlayFabResult<GetPublisherDataResult> { Result = result };
}

/// <summary>
/// Retrieves the current server time
/// </summary>
public static async Task<PlayFabResult<GetTimeResult>> GetTimeAsync(GetTimeRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

object httpResult = await PlayFabHTTP.DoPost("/Server/GetTime", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
if(httpResult is PlayFabError)
{
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler(error);
return new PlayFabResult<GetTimeResult> { Error = error, };
}
string resultRawJson = (string)httpResult;

var serializer = JsonSerializer.Create(PlayFabUtil.JsonSettings);
var resultData = serializer.Deserialize<PlayFabJsonSuccess<GetTimeResult>>(new JsonTextReader(new StringReader(resultRawJson)));

GetTimeResult result = resultData.data;

return new PlayFabResult<GetTimeResult> { Result = result };
}

/// <summary>
/// Retrieves the key-value store of custom title settings
/// </summary>
Expand Down
Loading

0 comments on commit cbe3ae6

Please sign in to comment.