Skip to content

Commit

Permalink
Merge pull request #280 from getbraincloud/release/5.3
Browse files Browse the repository at this point in the history
Release/5.3
  • Loading branch information
jo-codegirl authored May 15, 2024
2 parents 04f4f59 + ded6933 commit f085838
Show file tree
Hide file tree
Showing 22 changed files with 350 additions and 174 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.2.0"
s.version = "5.3.0"

s.summary = "The C++ client library for brainCloud"
s.homepage = "http://getbraincloud.com/"
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,6 @@ if (USE_LIBWEBSOCKETS)

endif()

if (XCODE)
# removing warning in clang 15, safe to ignore
target_link_options(brainCloud PUBLIC "LINKER:-no_warn_duplicate_libraries")
endif()

# Setup includes and linked libraries
target_include_directories(brainCloud PUBLIC "include" ${includes})
target_link_libraries(brainCloud PUBLIC ${libs})
Expand Down
18 changes: 17 additions & 1 deletion include/braincloud/BrainCloudAsyncMatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,23 @@ namespace BrainCloud {
const char * in_jsonSummary = NULL,
const char * in_jsonStatistics = NULL,
IServerCallback * in_callback = NULL );


/**
* Allows the current player in the game to overwrite the matchState and
* statistics without completing their turn or adding to matchHistory.
*
* Service Name - AsyncMatch
* Service Operation - UpdateMatchStateCurrentTurn
* *
* @param in_ownerId Match owner identifier
* @param in_matchId Match identifier
* @param in_version Game state version being updated, to ensure data integrity
* @param in_jsonMatchState JSON string provided by the caller Required.
* @param in_jsonStatistics Optional JSON string provided by the caller.
* @param in_callback
*/
void updateMatchStateCurrentTurn( const char * in_ownerId, const char * in_matchId, uint64_t in_version, const char * in_jsonMatchState, const char * in_jsonStatistics, IServerCallback * in_callback = NULL );

/**
* Allows the current player (only) to update Summary data without having to submit a whole turn.
*
Expand Down
33 changes: 22 additions & 11 deletions include/braincloud/BrainCloudGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ namespace BrainCloud
*/
void deleteGroupEntity(const char* in_groupId, const char* in_entityId, int32_t in_version, IServerCallback* in_callback = NULL);

/**
* Delete an outstanding request to join the group.
*
* Service Name - group
* Service Operation - DELETE_GROUP_JOIN_REQUEST
*
* @param in_groupId ID of the group.
* @param in_callback The method to be invoked when the server response is received
*/
void deleteGroupJoinRequest(const char* in_groupId, IServerCallback* in_callback = NULL);

/**
* Read information on groups to which the current user belongs.
*
Expand Down Expand Up @@ -395,17 +406,17 @@ namespace BrainCloud
*/
void rejectGroupInvitation(const char* in_groupId, IServerCallback* in_callback = NULL);

/**
* Reject an outstanding request to join the group.
*
* Service Name - group
* Service Operation - REJECT_GROUP_JOIN_REQUEST
*
* @param in_groupId ID of the group.
* @param in_profileId Profile ID of the invitation being deleted.
* @param in_callback The method to be invoked when the server response is received
*/
void rejectGroupJoinRequest(const char* in_groupId, const char* in_profileId, IServerCallback* in_callback = NULL);
/**
* Reject an outstanding request to join the group.
*
* Service Name - group
* Service Operation - REJECT_GROUP_JOIN_REQUEST
*
* @param in_groupId ID of the group.
* @param in_profileId Profile ID of the invitation being deleted.
* @param in_callback The method to be invoked when the server response is received
*/
void rejectGroupJoinRequest(const char* in_groupId, const char* in_profileId, IServerCallback* in_callback = NULL);

/**
* Remove a member from the group.
Expand Down
23 changes: 22 additions & 1 deletion include/braincloud/BrainCloudWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,13 @@ namespace BrainCloud {
*/
void resetUniversalIdPasswordAdvancedWithExpiry(const char * in_emailAddress, std::string in_serviceParams, int in_tokenTtlInMinutes , IServerCallback * in_callback = NULL);

/**
/**
* Returns true IF both Profile ID and Anonymous ID are stored - meaning reconnect possible
* @return true if reconnect possible
*/
bool canReconnect();

/**
* Re-authenticates the user with brainCloud
*
* @param in_callback The method to be invoked when the server response is received
Expand Down Expand Up @@ -798,6 +804,14 @@ namespace BrainCloud {
return client;
}


/**
* Clears Profile Id and Anonymous Id and deletes data entry on device
* Use Logout
* NOTE: If this is called when AnonymousAuthentication is used, the portal user cannot be reconnected or recovered!
*/
void clearIds();

/**
* Returns the stored profile id
* @return The stored profile id
Expand Down Expand Up @@ -832,6 +846,7 @@ namespace BrainCloud {
*/
void resetStoredAnonymousId();


/**
* For non-anonymous authentication methods, a profile id will be passed in
* when this value is set to false. This will generate an error on the server
Expand All @@ -849,6 +864,12 @@ namespace BrainCloud {
*/
bool getAlwaysAllowProfileSwitch();

/**
* Logs user out of playerState and optionally clears the profile id (eg. shared computer)
* NOTE: if forgetUser is true for an AuthenticateAnonymous THEN the user data will be in-accessible and non-recoverable
* @param forgetUser true if user profile should be deleted from device on logout, false to allow reconnect
* @param in_callback
*/
void logout(bool forgetUser, IServerCallback * in_callback);

virtual void serverCallback(BrainCloud::ServiceName serviceName, BrainCloud::ServiceOperation serviceOperation, std::string const & jsonData);
Expand Down
8 changes: 5 additions & 3 deletions include/braincloud/ServiceOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ namespace BrainCloud {
static const ServiceOperation DeleteMatch;
static const ServiceOperation CompleteMatchWithSummaryData;
static const ServiceOperation AbandonMatchWithSummaryData;
static const ServiceOperation UpdateMatchStateCurrentTurn;

static const ServiceOperation LastUploadStatus;

Expand Down Expand Up @@ -341,7 +342,8 @@ namespace BrainCloud {
static const ServiceOperation CreateGroupEntity;
static const ServiceOperation DeleteGroup;
static const ServiceOperation DeleteGroupEntity;
static const ServiceOperation DeleteGroupMemeber;
static const ServiceOperation DeleteGroupMember;
static const ServiceOperation DeleteGroupJoinRequest;
static const ServiceOperation GetMyGroups;
static const ServiceOperation IncrementGroupData;
static const ServiceOperation IncrementGroupEntityData;
Expand All @@ -358,7 +360,7 @@ namespace BrainCloud {
static const ServiceOperation ReadGroupEntity;
static const ServiceOperation ReadGroupMembers;
static const ServiceOperation RejectGroupInvitation;
static const ServiceOperation RejectGroupJoinRequest;
static const ServiceOperation RejectGroupJoinRequest;
static const ServiceOperation RemoveGroupMember;
static const ServiceOperation UpdateGroupData;
static const ServiceOperation UpdateGroupEntity;
Expand Down Expand Up @@ -517,4 +519,4 @@ namespace BrainCloud {
ServiceOperation(const char * value);
};

}
}
24 changes: 24 additions & 0 deletions src/BrainCloudAsyncMatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,30 @@ namespace BrainCloud
m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudAsyncMatch::updateMatchStateCurrentTurn(
const char * in_ownerId,
const char * in_matchId,
uint64_t in_version,
const char * in_jsonMatchState,
const char * in_jsonStatistics,
IServerCallback * in_callback)
{
Json::Value message;
message[OperationParam::AsyncMatchServiceOwnerId.getValue()] = in_ownerId;
message[OperationParam::AsyncMatchServiceMatchId.getValue()] = in_matchId;
message[OperationParam::AsyncMatchServiceVersion.getValue()] = (Json::UInt64) in_version;

if (StringUtil::IsOptionalParameterValid(in_jsonMatchState)) {
message[OperationParam::AsyncMatchServiceMatchState.getValue()] = JsonUtil::jsonStringToValue(in_jsonMatchState);
}
if (StringUtil::IsOptionalParameterValid(in_jsonStatistics)) {
message[OperationParam::AsyncMatchServiceStatistics.getValue()] = JsonUtil::jsonStringToValue(in_jsonStatistics);
}

ServerCall * sc = new ServerCall(ServiceName::AsyncMatch, ServiceOperation::UpdateMatchStateCurrentTurn, message, in_callback);
m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudAsyncMatch::updateMatchSummaryData(const char * in_ownerId, const char * in_matchId, uint64_t in_version, const char * in_jsonSummary, IServerCallback * in_callback)
{
Json::Value message;
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.2.0";
std::string BrainCloudClient::s_brainCloudClientVersion = "5.3.0";
const char* BC_SERVER_URL = "https://api.braincloudservers.com/dispatcherv2";

/**
Expand Down
17 changes: 13 additions & 4 deletions src/BrainCloudGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,22 @@ namespace BrainCloud
m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudGroup::rejectGroupJoinRequest(const char * in_groupId, const char * in_profileId, IServerCallback * in_callback)
void BrainCloudGroup::rejectGroupJoinRequest(const char * in_groupId, const char * in_profileId, IServerCallback * in_callback)
{
Json::Value message;
message[OperationParam::GroupId.getValue()] = in_groupId;
message[OperationParam::GroupProfileId.getValue()] = in_profileId;

ServerCall * sc = new ServerCall(ServiceName::Group, ServiceOperation::RejectGroupJoinRequest, message, in_callback);
m_client->getBrainCloudComms()->addToQueue(sc);
}

void BrainCloudGroup::deleteGroupJoinRequest(const char * in_groupId, IServerCallback * in_callback)
{
Json::Value message;
message[OperationParam::GroupId.getValue()] = in_groupId;
message[OperationParam::GroupProfileId.getValue()] = in_profileId;

ServerCall * sc = new ServerCall(ServiceName::Group, ServiceOperation::RejectGroupJoinRequest, message, in_callback);

ServerCall * sc = new ServerCall(ServiceName::Group, ServiceOperation::DeleteGroupJoinRequest, message, in_callback);
m_client->getBrainCloudComms()->addToQueue(sc);
}

Expand Down
Loading

0 comments on commit f085838

Please sign in to comment.