Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/5.3 #280

Merged
merged 24 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f27003c
Merge pull request #274 from getbraincloud/BCLOUD-6698_logout
jo-codegirl Feb 15, 2024
02da0e0
Merge pull request #275 from getbraincloud/BCLOUD-6698_logout
jo-codegirl Feb 16, 2024
8517fc1
Merge branch 'release/5.2' into develop
jo-codegirl Feb 20, 2024
7fa8001
implement canReconnect(); add to unit tests
jo-codegirl Apr 22, 2024
0f346d2
reset profile id is protected in wrapper, resetting clears authentica…
jo-codegirl Apr 23, 2024
41658fd
fix test for linux define
jo-codegirl Apr 23, 2024
4410999
Clearing data in test fixture base logout
jo-codegirl Apr 23, 2024
e49028b
put storing authentication type back in in case someone needed it
jo-codegirl Apr 23, 2024
1a3fb5e
placed code to set country codeetc inside of locale function
jo-codegirl Apr 24, 2024
3a23ea0
tests for linux expect fail on reconnect (no save data)
jo-codegirl Apr 24, 2024
1c1643a
removed error in xcode linker options (for some versions of clang)
jo-codegirl Apr 24, 2024
b294e83
change to initialize rand for generate guid (fixes security error)
jo-codegirl Apr 24, 2024
1693328
Fixes for PR and updates tests to use wrapper more consistently
jo-codegirl Apr 25, 2024
9f4f4de
reorganized header file to show less nasty of a merge
jo-codegirl Apr 25, 2024
e410d15
Fix tests for Identity and Lobby
jo-codegirl Apr 25, 2024
04fb6e1
add asyncmatch update current turn
jo-codegirl May 9, 2024
a549e8f
missed a file previous commit
jo-codegirl May 9, 2024
23ace7e
updated comment asyncmatch
jo-codegirl May 10, 2024
2b4f386
Merge pull request #278 from getbraincloud/BCLOUD-8023-asyncmatchapi
jo-codegirl May 10, 2024
a86613a
DeleteGroupJoinRequest
jo-codegirl May 13, 2024
8e5e53d
unit test for Delete Group Join Request
jo-codegirl May 14, 2024
d3c8789
Merge pull request #279 from getbraincloud/BCLOUD-8340
jo-codegirl May 14, 2024
1f4eb4c
update version string 5.3.0
jo-codegirl May 14, 2024
ded6933
update podspec 5.3.0
jo-codegirl May 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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