Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* PlayFab/SDKGenerator@b216b6e

* PlayFab/SDKGenerator@9603865

* Automated pf-main build from Jenkins

* PlayFab/SDKGenerator@88cfcc2

* PlayFab/SDKGenerator@15e56d3

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* PlayFab/SDKGenerator@6f6b966

* Automated build from Jenkins

* Automated build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated pf-main build from Jenkins

* Automated build from Jenkins
  • Loading branch information
Paul Gilmore authored Aug 30, 2016
1 parent ce99db8 commit 0f6a7af
Show file tree
Hide file tree
Showing 18 changed files with 991 additions and 27 deletions.
25 changes: 25 additions & 0 deletions PlayFabClientSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3209,6 +3209,31 @@ public static async Task<PlayFabResult<GetPlayerSegmentsResult>> GetPlayerSegmen
return new PlayFabResult<GetPlayerSegmentsResult> { Result = result };
}

/// <summary>
/// Get all tags with a given Namespace (optional) from a player profile.
/// </summary>
public static async Task<PlayFabResult<GetPlayerTagsResult>> GetPlayerTagsAsync(GetPlayerTagsRequest request)
{
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

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

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

GetPlayerTagsResult result = resultData.data;

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

private static string _authKey = null;

// Determine if the _authKey is set, without actually making it public
Expand Down
103 changes: 100 additions & 3 deletions PlayFabClientSDK/source/PlayFabClientModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ public class CatalogItem : IComparable<CatalogItem>
/// </summary>
public string ItemImageUrl;

/// <summary>
/// if true, then only a fixed number can ever be granted.
/// </summary>
public bool IsLimitedEdition;

public int CompareTo(CatalogItem other)
{
if (other == null || other.ItemId == null) return 1;
Expand Down Expand Up @@ -1818,6 +1823,34 @@ public class GetPlayerStatisticVersionsResult : PlayFabResultCommon

}

public class GetPlayerTagsRequest
{
/// <summary>
/// Unique PlayFab assigned ID of the user on whom the operation will be performed.
/// </summary>
public string PlayFabId;

/// <summary>
/// Optional namespace to filter results by
/// </summary>
public string Namespace;

}

public class GetPlayerTagsResult : PlayFabResultCommon
{
/// <summary>
/// Unique PlayFab assigned ID of the user on whom the operation will be performed.
/// </summary>
public string PlayFabId;

/// <summary>
/// Canonical tags (including namespace and tag's name) for the requested user
/// </summary>
public List<string> Tags;

}

public class GetPlayerTradesRequest
{
/// <summary>
Expand Down Expand Up @@ -2109,6 +2142,27 @@ public class GetStoreItemsResult : PlayFabResultCommon
[Unordered(SortProperty="ItemId")]
public List<StoreItem> Store;

/// <summary>
/// How the store was last updated (Admin or a third party).
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public SourceType? Source;

/// <summary>
/// The base catalog that this store is a part of.
/// </summary>
public string CatalogVersion;

/// <summary>
/// The ID of this store.
/// </summary>
public string StoreId;

/// <summary>
/// Additional data about the store.
/// </summary>
public StoreMarketingModel MarketingData;

}

public class GetTitleDataRequest
Expand Down Expand Up @@ -3797,6 +3851,17 @@ public class SharedGroupDataRecord

}


public enum SourceType
{
Admin,
BackEnd,
GameClient,
GameServer,
Partner,
Stream
}

public class StartGameRequest
{
/// <summary>
Expand Down Expand Up @@ -3987,20 +4052,30 @@ public class SteamPlayFabIdPair
public class StoreItem : IComparable<StoreItem>
{
/// <summary>
/// unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog
/// Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog
/// </summary>
public string ItemId;

/// <summary>
/// price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies)
/// Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies)
/// </summary>
public Dictionary<string,uint> VirtualCurrencyPrices;

/// <summary>
/// override prices for this item for specific currencies
/// Override prices for this item for specific currencies
/// </summary>
public Dictionary<string,uint> RealCurrencyPrices;

/// <summary>
/// Store specific custom data. The data only exists as part of this store; it is not transferred to item instances
/// </summary>
public object CustomData;

/// <summary>
/// Intended display position for this item. Note that 0 is the first position
/// </summary>
public uint? DisplayPosition;

public int CompareTo(StoreItem other)
{
if (other == null || other.ItemId == null) return 1;
Expand All @@ -4010,6 +4085,28 @@ public int CompareTo(StoreItem other)

}

/// <summary>
/// Marketing data about a specific store
/// </summary>
public class StoreMarketingModel
{
/// <summary>
/// Display name of a store as it will appear to users.
/// </summary>
public string DisplayName;

/// <summary>
/// Tagline for a store.
/// </summary>
public string Description;

/// <summary>
/// Custom data about a store.
/// </summary>
public object Metadata;

}

public class SubtractUserVirtualCurrencyRequest
{
/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion PlayFabClientSDK/source/PlayFabErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ public enum PlayFabErrorCode
SessionLogNotFound = 1244,
InvalidSearchTerm = 1245,
TwoFactorAuthenticationTokenRequired = 1246,
GameServerHostCountLimitExceeded = 1247
GameServerHostCountLimitExceeded = 1247,
PlayerTagCountLimitExceeded = 1248,
RequestAlreadyRunning = 1249
}

public class PlayFabError
Expand Down
4 changes: 2 additions & 2 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.35.160822";
public const string SdkVersion = "0.36.160829";
public const string BuildIdentifier = "jbuild_csharpsdk_0";
public const string SdkVersionString = "CSharpSDK-0.35.160822";
public const string SdkVersionString = "CSharpSDK-0.36.160829";

/// <summary> This is for PlayFab internal debugging. Generally you shouldn't touch this </summary>
public static bool UseDevelopmentEnvironment = false;
Expand Down
75 changes: 75 additions & 0 deletions PlayFabSDK/source/PlayFabAdminAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,31 @@ public static async Task<PlayFabResult<ResetCharacterStatisticsResult>> ResetCha
return new PlayFabResult<ResetCharacterStatisticsResult> { Result = result };
}

/// <summary>
/// Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag.
/// </summary>
public static async Task<PlayFabResult<AddPlayerTagResult>> AddPlayerTagAsync(AddPlayerTagRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

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

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

AddPlayerTagResult result = resultData.data;

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

/// <summary>
/// Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change.
/// </summary>
Expand Down Expand Up @@ -1863,5 +1888,55 @@ public static async Task<PlayFabResult<GetPlayersInSegmentResult>> GetPlayersInS
return new PlayFabResult<GetPlayersInSegmentResult> { Result = result };
}

/// <summary>
/// Get all tags with a given Namespace (optional) from a player profile.
/// </summary>
public static async Task<PlayFabResult<GetPlayerTagsResult>> GetPlayerTagsAsync(GetPlayerTagsRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

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

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

GetPlayerTagsResult result = resultData.data;

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

/// <summary>
/// Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag.
/// </summary>
public static async Task<PlayFabResult<RemovePlayerTagResult>> RemovePlayerTagAsync(RemovePlayerTagRequest request)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");

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

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

RemovePlayerTagResult result = resultData.data;

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

}
}
Loading

0 comments on commit 0f6a7af

Please sign in to comment.