Skip to content

Commit

Permalink
Merge pull request #293 from getbraincloud/release/5.5
Browse files Browse the repository at this point in the history
Release/5.5
  • Loading branch information
bitheadCody authored Jan 27, 2025
2 parents 044079a + 45e5360 commit 72821ee
Show file tree
Hide file tree
Showing 34 changed files with 428 additions and 22 deletions.
2 changes: 1 addition & 1 deletion BrainCloudCpp.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|

s.name = "BrainCloudCpp"

s.version = "5.4.1"
s.version = "5.5.0"

s.summary = "The C++ client library for brainCloud"
s.homepage = "http://getbraincloud.com/"
Expand Down
5 changes: 5 additions & 0 deletions include/braincloud/BrainCloudAuthentication.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ namespace BrainCloud
*/
void authenticateUniversal(const char * in_userId, const char * in_password, bool in_forceCreate, IServerCallback * in_callback = NULL);

/*
* Get server version.
*/
void getServerVersion(IServerCallback *in_callback = NULL);

/*
* Authenticate the user using a steam userid and session ticket (without any validation on the userid).
*
Expand Down
13 changes: 13 additions & 0 deletions include/braincloud/BrainCloudEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ namespace BrainCloud
*/
void sendEvent(const char * in_toProfileId, const char * in_eventType, const std::string& in_jsonEventData, IServerCallback * in_callback = NULL);

/**
* Sends an event to multiple users with the attached json data.
*
* Service Name - Event
* Service Operation - SEND_EVENT_TO_PROFILES
*
* @param in_toIds The profile ids of the users to send the event
* @param in_eventType The user-defined type of the event
* @param in_eventData The user-defined data for this event encoded in JSON
* @param in_callback The method to be invoked when the server response is received
*/
void sendEventToProfiles(const std::vector<std::string> &in_toIds, const char *in_eventType, const std::string &in_eventData, IServerCallback *in_callback);

/**
* Updates an event in the user's incoming event mailbox.
*
Expand Down
25 changes: 25 additions & 0 deletions include/braincloud/BrainCloudFriend.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ namespace BrainCloud
*/
void getProfileInfoForCredential(const char * in_externalId, AuthenticationType in_authenticationType, IServerCallback * in_callback = NULL);

/**
* Retrieves profile information for the specified user.
Silently fails, if profile does not exist, just returns null and success, instead of an error.
*
* Service Name - friend
* Service Operation - GET_PROFILE_INFO_FOR_CREDENTIAL_IF_EXISTS
*
* @param in_externalId The users's external ID
* @param in_authenticationType The authentication type of the user ID
* @param in_callback Method to be invoked when the server response is received.
*/
void getProfileInfoForCredentialIfExists(const char *in_externalId, AuthenticationType in_authenticationType, IServerCallback *in_callback = NULL);

/**
* Retrieves profile information for the specified external auth user.
*
Expand All @@ -71,6 +84,18 @@ namespace BrainCloud
*/
void getProfileInfoForExternalAuthId(const char * in_externalId, const char * in_externalAuthType, IServerCallback * in_callback = NULL);

/**
* Retrieves profile information for the specified user. Silently fails, if profile does not exist, just returns null and success, instead of an error.
*
* Service Name - Friend
* Service Operation - GET_PROFILE_INFO_FOR_EXTERNAL_AUTH_ID_IF_EXISTS
*
* @param in_externalId External ID of the friend to find
* @param in_externalAuthType The external authentication type used for this friend's external ID
* @param in_callback Method to be invoked when the server response is received.
*/
void getProfileInfoForExternalAuthIdIfExists(const char *in_externalId, const char *in_externalAuthType, IServerCallback *in_callback = NULL);

/**
* Retrieves the external ID for the specified user profile ID on the specified social platform.
*
Expand Down
25 changes: 25 additions & 0 deletions include/braincloud/BrainCloudGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,19 @@ namespace BrainCloud
*/
void updateGroupData(const char* in_groupId, int32_t in_version, const std::string& in_jsonData, IServerCallback* in_callback = NULL);

/**
* Update the acl settings for a group entity, enforcing ownership.
*
* Service Name - Group
* Service Operation - UPDATE_GROUP_ENTITY_ACL
*
* @param in_groupId The id of the group
* @param in_entityId The id of the entity to update
* @param in_acl Access control list for the group entity
* @param in_callback The method to be invoked when the server response is received
*/
void updateGroupEntityAcl(const char *in_groupId, const char *in_entityId, const std::string &in_acl, IServerCallback *in_callback = NULL);

/**
* Update a group entity.
*
Expand Down Expand Up @@ -495,6 +508,18 @@ namespace BrainCloud
*/
void setGroupOpen(const char* in_groupId, bool in_isOpenGroup, IServerCallback *callback = nullptr);

/**
* Set a group's access conditions.
*
* Service Name - Group
* Service Operation - UPDATE_GROUP_ACL
*
* @param groupId ID of the group
* @param acl The group's access control list. A null ACL implies default
* @param callback The method to be invoked when the server response is received
*/
void updateGroupAcl(const char *in_groupId, const std::string &in_acl, IServerCallback *in_callback = NULL);

/**
* Update a group's summary data
*
Expand Down
5 changes: 5 additions & 0 deletions include/braincloud/BrainCloudIdentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,11 @@ namespace BrainCloud
*/
void getIdentities(IServerCallback * in_callback = NULL);

/*
* Retrieves identity status for given identity type for this profile.
*/
void getIdentityStatus(AuthenticationType in_authenticationType, const char *in_externalAuthName, IServerCallback *in_callback);

/**
* Retrieve list of expired identities
*
Expand Down
13 changes: 13 additions & 0 deletions include/braincloud/BrainCloudMail.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


#include <string>
#include <vector>

#include "braincloud/IServerCallback.h"

Expand Down Expand Up @@ -60,6 +61,18 @@ namespace BrainCloud
*/
void sendAdvancedEmailByAddress(const char * in_emailAddress, const std::string & in_jsonServiceParams, IServerCallback * in_callback = NULL);

/**
* Sends an advanced email to the specified email addresses.
*
* Service Name - Mail
* Service Operation - SEND_ADVANCED_EMAIL_BY_ADDRESSES
*
* @param in_emailAddress The list of addresses to send the email to
* @param in_serviceParams Set of parameters dependant on the mail service configured
* @param in_callback The method to be invoked when the server response is received
*/
void sendAdvancedEmailByAddresses(const std::vector<std::string> &in_emailAddresses, const std::string &in_serviceParams, IServerCallback *in_callback = NULL);

private:
BrainCloudClient * m_client;
};
Expand Down
14 changes: 14 additions & 0 deletions include/braincloud/BrainCloudPlaybackStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ namespace BrainCloud
*/
void getRecentStreamsForTargetPlayer(const char * in_targetPlayerId, int in_maxNumStreams, IServerCallback * in_callback = NULL);

/**
* Protects a playback stream from being purged (but not deleted) for the given number of days (from now).
* If the number of days given is less than the normal purge interval days (from createdAt), the longer protection date is applied.
* Can only be called by users involved in the playback stream.
*
* Service Name - PlaybackStream
* Service Operation - PROTECT_STREAM_UNTIL
*
* @param in_playbackStreamId Identifies the stream to protect
* @param in_numDays The number of days the stream is to be protected (from now)
* @param in_callback The method to be invoked when the server response is received
*/
void protectStreamUntil(const char *in_playbackStreamId, int in_numDays, IServerCallback *in_callback = NULL);

private:
BrainCloudClient * m_client;
};
Expand Down
14 changes: 14 additions & 0 deletions include/braincloud/BrainCloudSocialLeaderboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,20 @@ namespace BrainCloud
void postScoreToDynamicGroupLeaderboardDaysUTC(const char * in_leaderboardId, const char * in_groupId, int32_t in_score, const std::string& in_jsonData, const char * in_leaderboardType,
int64_t in_rotationResetUTC, int32_t in_retainedCount, int32_t in_numDaysToRotate, IServerCallback * in_callback = NULL);

/**
* Post the group's score to the given social leaderboard, dynamically creating the group leaderboard if it does not exist yet.
* To create new leaderboard, configJson must specify leaderboardType, rotationType, resetAt, and retainedCount, at a minimum, with support to optionally specify an expiry in minutes.
*
* Service Name - Leaderboard
* Service Operation - POST_GROUP_SCORE_DYNAMIC_USING_CONFIG
*
* @param in_leaderboard The leaderboard to post to
* @param in_groupId The ID of the group
* @param in_score A score to post
* @param in_configJson Configuration for the leaderboard if it does not exist yet, specified as JSON object. The supporting configuration fields are listed in the following table of configJson fields.
* @param in_callback The method to be invoked when the server response is received
*/
void postScoreToDynamicGroupLeaderboardUsingConfig(const char *in_leaderboardId, const char *in_groupId, int32_t in_score, const std::string &in_scoreData, const std::string &in_configJson, IServerCallback *in_callback);

/**
* Removes score from group leaderboard
Expand Down
3 changes: 3 additions & 0 deletions include/braincloud/OperationParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ namespace BrainCloud {

// Event Service - Send Params
static const OperationParam EventServiceSendToId;
static const OperationParam EventServiceToIds;
static const OperationParam EventServiceSendEventType;
static const OperationParam EventServiceSendEventId;
static const OperationParam EventServiceSendEventData;
Expand Down Expand Up @@ -299,6 +300,7 @@ namespace BrainCloud {
static const OperationParam PlaybackStreamServiceIncludeSharedData;
static const OperationParam PlaybackStreamServiceEventData;
static const OperationParam PlaybackStreamServiceSummary;
static const OperationParam PlaybackStreamServiceNumDays;

static const OperationParam ProductServiceTransId;
static const OperationParam ProductServiceLanguage;
Expand Down Expand Up @@ -403,6 +405,7 @@ namespace BrainCloud {
static const OperationParam FieldAuthenticationToken;

static const OperationParam EmailAddress;
static const OperationParam EmailAddresses;
static const OperationParam Subject;
static const OperationParam Body;
static const OperationParam ServiceParams;
Expand Down
12 changes: 11 additions & 1 deletion include/braincloud/ServiceOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace BrainCloud {
static const ServiceOperation None;

static const ServiceOperation Authenticate;
static const ServiceOperation GetServerVersion;
static const ServiceOperation Attach;
static const ServiceOperation Merge;
static const ServiceOperation Detach;
Expand All @@ -27,6 +28,7 @@ namespace BrainCloud {
static const ServiceOperation UpdateUniversalIdLogin;
static const ServiceOperation GetChildProfiles;
static const ServiceOperation GetIdentities;
static const ServiceOperation GetIdentityStatus;
static const ServiceOperation GetExpiredIdentities;
static const ServiceOperation RefreshIdentity;
static const ServiceOperation ChangeEmailIdentity;
Expand Down Expand Up @@ -89,7 +91,9 @@ namespace BrainCloud {

static const ServiceOperation GetFriendProfileInfoForExternalId;
static const ServiceOperation GetProfileInfoForCredential;
static const ServiceOperation GetProfileInfoForCredentialIfExists;
static const ServiceOperation GetProfileInfoForExternalAuthId;
static const ServiceOperation GetProfileInfoForExternalAuthIdIfExists;
static const ServiceOperation GetExternalIdForProfileId;
static const ServiceOperation ReadFriendEntity;
static const ServiceOperation ReadFriendsEntities;
Expand Down Expand Up @@ -128,6 +132,7 @@ namespace BrainCloud {
static const ServiceOperation GetGroupSocialLeaderboardByVersion;
static const ServiceOperation PostScoreToGroupLeaderboard;
static const ServiceOperation PostScoreToDynamicGroupLeaderboard;
static const ServiceOperation PostScoreToDynamicGroupLeaderboardUsingConfig;
static const ServiceOperation RemoveGroupScore;
static const ServiceOperation GetGroupLeaderboardView;
static const ServiceOperation GetSummaryDataForProfileId;
Expand Down Expand Up @@ -164,6 +169,7 @@ namespace BrainCloud {
static const ServiceOperation ResetParentVC;

static const ServiceOperation Send;
static const ServiceOperation SendEventToProfiles;
static const ServiceOperation UpdateEventData;
static const ServiceOperation UpdateEventDataIfExists;
static const ServiceOperation DeleteSent;
Expand Down Expand Up @@ -255,6 +261,7 @@ namespace BrainCloud {
static const ServiceOperation GetStreamSummariesForTargetPlayer;
static const ServiceOperation GetRecentStreamsForInitiatingPlayer;
static const ServiceOperation GetRecentStreamsForTargetPlayer;
static const ServiceOperation ProtectStreamUntil;

static const ServiceOperation GetUserInfo;

Expand Down Expand Up @@ -371,17 +378,20 @@ namespace BrainCloud {
static const ServiceOperation RejectGroupJoinRequest;
static const ServiceOperation RemoveGroupMember;
static const ServiceOperation UpdateGroupData;
static const ServiceOperation UpdateGroupEntity;
static const ServiceOperation UpdateGroupEntityAcl;
static const ServiceOperation UpdateGroupEntityData;
static const ServiceOperation UpdateGroupMember;
static const ServiceOperation UpdateGroupName;
static const ServiceOperation SetGroupOpen;
static const ServiceOperation UpdateGroupAcl;
static const ServiceOperation GetRandomGroupsMatching;
static const ServiceOperation UpdateGroupSummaryData;

//mail
static const ServiceOperation SendBasicEmail;
static const ServiceOperation SendAdvancedEmail;
static const ServiceOperation SendAdvancedEmailByAddress;
static const ServiceOperation SendAdvancedEmailByAddresses;

//tournament
static const ServiceOperation GetTournamentStatus;
Expand Down
10 changes: 5 additions & 5 deletions solutions/windowsDesktop_vc120/brainCloud/brainCloud.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<ProjectGuid>{CDCA39C7-E839-4EF5-BB25-5C586B7C975B}</ProjectGuid>
<RootNamespace>GameClientLib</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsAppContainer>false</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsAppContainer>false</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WindowsAppContainer>false</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WindowsAppContainer>false</WindowsAppContainer>
</PropertyGroup>
Expand Down
11 changes: 11 additions & 0 deletions src/BrainCloudAuthentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ namespace BrainCloud {
authenticate(in_userid, in_password, AuthenticationType::Universal, NULL, in_forceCreate, "", in_callback);
}

void BrainCloudAuthentication::getServerVersion(IServerCallback *in_callback)
{
Json::Value message;

message[OperationParam::AuthenticateServiceAuthenticateGameId.getValue()] = m_client->getAppId().c_str();

ServerCall *sc = new ServerCall(ServiceName::AuthenticateV2, ServiceOperation::GetServerVersion, message, in_callback);

m_client->sendRequest(sc);
}

void BrainCloudAuthentication::authenticateSteam(const char * in_userid, const char * in_sessionticket, bool in_forceCreate, IServerCallback * in_callback)
{
authenticate(in_userid, in_sessionticket, AuthenticationType::Steam, NULL, in_forceCreate, "", in_callback);
Expand Down
2 changes: 1 addition & 1 deletion src/BrainCloudClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace BrainCloud
"Singleton usage is disabled. If called by mistake, use your own variable that holds an instance of the bcWrapper/bcClient.";

BrainCloudClient * BrainCloudClient::_instance = NULL;
std::string BrainCloudClient::s_brainCloudClientVersion = "5.4.1";
std::string BrainCloudClient::s_brainCloudClientVersion = "5.5.0";
const char* BC_SERVER_URL = "https://api.braincloudservers.com/dispatcherv2";

/**
Expand Down
13 changes: 13 additions & 0 deletions src/BrainCloudEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ namespace BrainCloud
m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudEvent::sendEventToProfiles(const std::vector<std::string> &in_toIds, const char *in_eventType, const std::string &in_eventData, IServerCallback *in_callback)
{
Json::Value data;
Json::Value toIds = JsonUtil::stringVectorToJson(in_toIds);
data[OperationParam::EventServiceToIds.getValue()] = toIds;
data[OperationParam::EventServiceSendEventType.getValue()] = in_eventType;
data[OperationParam::EventServiceSendEventData.getValue()] = JsonUtil::jsonStringToValue(in_eventData);

ServerCall *sc = new ServerCall(ServiceName::Event, ServiceOperation::SendEventToProfiles, data, in_callback);

m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudEvent::updateIncomingEventData(const char * in_fromPlayerId, uint64_t in_eventId, const std::string& in_jsonEventData, IServerCallback * in_callback)
{
Json::Value message;
Expand Down
Loading

0 comments on commit 72821ee

Please sign in to comment.