Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#230123
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Jan 26, 2023
2 parents 8e8f1f5 + 690e150 commit 0bf1698
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 37 deletions.
1 change: 1 addition & 0 deletions code/include/playfab/PlayFabEventPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ namespace PlayFab
private:
void WorkerThread();
bool DoWork();
bool PopBuffer();
void WriteEventsApiCallback(const EventsModels::WriteEventsResponse& result, void* customData);
void WriteEventsApiErrorCallback(const PlayFabError& error, void* customData);
void CallbackRequest(std::shared_ptr<const IPlayFabEmitEventRequest> request, std::shared_ptr<const IPlayFabEmitEventResponse> response);
Expand Down
71 changes: 46 additions & 25 deletions code/source/playfab/PlayFabEventPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ namespace PlayFab
std::this_thread::sleep_for(std::chrono::milliseconds(this->settings->readBufferWaitTime));
}
}
// batch up any buffered events
while( PopBuffer() )
{
if (this->batch.size() >= this->settings->maximalNumberOfItemsInBatch)
{
// if batch is full
this->SendBatch(this->batch);
}
}
if( this->batch.size() > 0)
{
// Flush remaining events on shutdown
Expand All @@ -236,7 +245,6 @@ namespace PlayFab
{
using clock = std::chrono::steady_clock;
using Result = PlayFabEventBuffer::EventConsumingResult;
std::shared_ptr<const IPlayFabEmitEventRequest> request;

try
{
Expand Down Expand Up @@ -266,32 +274,15 @@ namespace PlayFab
{
return false;
}

switch (this->buffer.TryTake(request))
{
case Result::Success:
{
// add an event to batch
this->batch.push_back(std::move(request));

if (this->batch.size() == 1)
{
// if it is the first event in an incomplete batch then set the batch creation moment
this->momentBatchStarted = clock::now();
}

if (this->batch.size() >= this->settings->maximalNumberOfItemsInBatch)
{
// if batch is full
this->SendBatch(this->batch);
}
return true;
}
if( !PopBuffer() )
return false; // Done - nothing available

case Result::Disabled:
case Result::Empty:
default:
break;
if (this->batch.size() >= this->settings->maximalNumberOfItemsInBatch)
{
// if batch is full
this->SendBatch(this->batch);
return true;
}

// if batch was started
Expand Down Expand Up @@ -329,6 +320,36 @@ namespace PlayFab
return false;
}

bool PlayFabEventPipeline::PopBuffer()
{
using clock = std::chrono::steady_clock;
using Result = PlayFabEventBuffer::EventConsumingResult;
std::shared_ptr<const IPlayFabEmitEventRequest> request;

switch (this->buffer.TryTake(request))
{
case Result::Success:
{
// add an event to batch
this->batch.push_back(std::move(request));

if (this->batch.size() == 1)
{
// if it is the first event in an incomplete batch then set the batch creation moment
this->momentBatchStarted = clock::now();
}

return true;
}

case Result::Disabled:
case Result::Empty:
default:
break;
}
return false;
}

void PlayFabEventPipeline::SendBatch(std::vector<std::shared_ptr<const IPlayFabEmitEventRequest>>& localbatch)
{
// create a WriteEvents API request to send the batch
Expand Down
4 changes: 2 additions & 2 deletions code/source/playfab/PlayFabSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace PlayFab
// Control whether all callbacks are threaded or whether the user manually controls callback timing from their main-thread
// Note ANY api call may synchronously throw an exception if the title id is not set
bool PlayFabSettings::threadedCallbacks = false;
const std::string PlayFabSettings::sdkVersion = "3.99.230109";
const std::string PlayFabSettings::sdkVersion = "3.100.230123";
const std::string PlayFabSettings::buildIdentifier = "adobuild_xplatcppsdk_117";
const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.99.230109";
const std::string PlayFabSettings::versionString = "XPlatCppSdk-3.100.230123";
std::string PlayFabSettings::productionEnvironmentURL = ".playfabapi.com";

ErrorCallback PlayFabSettings::globalErrorHandler = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions com.playfab.xplatcppsdk.v141.autopkg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ configurations {
nuget {
nuspec {
id = "com.playfab.xplatcppsdk.v141";
version : 3.99.230109;
version : 3.100.230123;
title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2017";
summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience.";
authors: "PlayFab";
Expand All @@ -18,7 +18,7 @@ nuget {
iconUrl: "https://playfab.com/assets/img/playfab-mark.png";
requireLicenseAcceptance: false;
description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services.";
releaseNotes: "https://api.playfab.com/releaseNotes/#230109";
releaseNotes: "https://api.playfab.com/releaseNotes/#230123";
copyright: "Copyright 2023";
language: "C++";
tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native };
Expand Down
4 changes: 2 additions & 2 deletions com.playfab.xplatcppsdk.v141.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>com.playfab.xplatcppsdk.v141</id>
<version>3.99.230109</version>
<version>3.100.230123</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<projectUrl>http://github.com/PlayFab/XPlatCppSdk</projectUrl>
<license type="expression">Apache-2.0</license>
<icon>./images/icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>https://api.playfab.com/releaseNotes/#3.99.230109</releaseNotes>
<releaseNotes>https://api.playfab.com/releaseNotes/#3.100.230123</releaseNotes>
<description>Microsoft Azure PlayFab XPlatCppSdk</description>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage</tags>
Expand Down
4 changes: 2 additions & 2 deletions com.playfab.xplatcppsdk.v142.autopkg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ configurations {
nuget {
nuspec {
id = "com.playfab.xplatcppsdk.v142";
version : 3.99.230109;
version : 3.100.230123;
title: "PlayFab Cross Platform C++ Sdk for Visual Studio 2019+";
summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience.";
authors: "PlayFab";
Expand All @@ -18,7 +18,7 @@ nuget {
iconUrl: "https://playfab.com/assets/img/playfab-mark.png";
requireLicenseAcceptance: false;
description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services.";
releaseNotes: "https://api.playfab.com/releaseNotes/#230109";
releaseNotes: "https://api.playfab.com/releaseNotes/#230123";
copyright: "Copyright 2023";
language: "C++";
tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native };
Expand Down
4 changes: 2 additions & 2 deletions com.playfab.xplatcppsdk.v142.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>com.playfab.xplatcppsdk.v142</id>
<version>3.99.230109</version>
<version>3.100.230123</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<projectUrl>http://github.com/PlayFab/XPlatCppSdk</projectUrl>
<license type="expression">Apache-2.0</license>
<icon>./images/icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>https://api.playfab.com/releaseNotes/#3.99.230109</releaseNotes>
<releaseNotes>https://api.playfab.com/releaseNotes/#3.100.230123</releaseNotes>
<description>Microsoft Azure PlayFab XPlatCppSdk</description>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>Microsoft Azure PlayFab Baas Paas JSON REST HTTP SSL API cloud liveops game gamedev native nativepackage</tags>
Expand Down
4 changes: 2 additions & 2 deletions com.playfab.xplatxboxsdk.v141.autopkg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ configurations {
nuget {
nuspec {
id = "com.playfab.xplatxboxsdk.v141";
version : 3.99.230109;
version : 3.100.230123;
title: "PlayFab Xbox Platform C++ Sdk for Visual Studio 2017";
summary: "PlayFab is the unified backend platform for games and everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience.";
authors: "PlayFab";
Expand All @@ -28,7 +28,7 @@ nuget {
iconUrl: "https://playfab.com/assets/img/playfab-mark.png";
requireLicenseAcceptance: false;
description: "Authentication, in-game commerce, player data, title data, inventory, characters, statistics, leaderboards, analytics and reporting, friends, multiplayer, matchmaking, tournaments, cloud script, trading, real-time event handling, player management, live ops, and server hosting for all major platforms/devices and games of any scale. This sdk gives your game the ability log into PlayFab and access cloud data and services.";
releaseNotes: "https://api.playfab.com/releaseNotes/#230109";
releaseNotes: "https://api.playfab.com/releaseNotes/#230123";
copyright: "Copyright 2023";
language: "C++";
tags: { PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native, xbox };
Expand Down

0 comments on commit 0bf1698

Please sign in to comment.