Skip to content

Commit

Permalink
Merge pull request #224 from getbraincloud/release/5.4.0
Browse files Browse the repository at this point in the history
Release/5.4.0
  • Loading branch information
bitheadCody authored Aug 28, 2024
2 parents f641387 + b8d2467 commit c7f3de5
Show file tree
Hide file tree
Showing 12 changed files with 717 additions and 111 deletions.
2 changes: 1 addition & 1 deletion deploy/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "braincloud",
"version": "5.3.0",
"version": "5.4.0",
"description": " brainCloud client for NodeJS",
"main": "index.js",
"react-native": "react-native.js",
Expand Down
6 changes: 6 additions & 0 deletions src/brainCloudClient-authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,12 @@ function BCAuthentication() {
_navLangCode = _navLangCode.split("-");
var languageCode = bc.languageCode == null ? _navLangCode[0] : bc.languageCode;
var countryCode = bc.countryCode == null ? _navLangCode[1] : bc.countryCode;
if (countryCode === "419") {
countryCode = "_LA_"
}
if (countryCode === "Hans" || countryCode === "Hant") {
countryCode = "CN"
}

var now = new Date();
var timeZoneOffset = -now.getTimezoneOffset() / 60.0;
Expand Down
25 changes: 25 additions & 0 deletions src/brainCloudClient-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function BCEvents() {

bc.event.OPERATION_SEND = "SEND";
bc.event.OPERATION_UPDATE_EVENT_DATA = "UPDATE_EVENT_DATA";
bc.event.OPERATION_UPDATE_EVENT_DATA_IF_EXISTS = "UPDATE_EVENT_DATA_IF_EXISTS";
bc.event.OPERATION_DELETE_INCOMING = "DELETE_INCOMING";
bc.event.OPERATION_DELETE_SENT = "DELETE_SENT";
bc.event.OPERATION_GET_EVENTS = "GET_EVENTS";
Expand Down Expand Up @@ -73,6 +74,30 @@ function BCEvents() {
});
};

/**
* Updates an event in the player's incoming event mailbox.
* Identical to updateIncomingEventData method, but will not return an error if the event does not exist
*
* Service Name - Event
* Service Operation - UpdateEventData
*
* @param evId The event id
* @param eventData The user-defined data for this event encoded in JSON.
* @param callback The method to be invoked when the server response is received
*/
bc.event.updateIncomingEventDataIfExists = function(evId, eventData, callback) {
var message = {
evId: evId,
eventData: eventData
};
bc.brainCloudManager.sendRequest({
service: bc.SERVICE_EVENT,
operation: bc.event.OPERATION_UPDATE_EVENT_DATA_IF_EXISTS,
data: message,
callback: callback
});
};

/**
* Delete an event out of the user's incoming mailbox.
*
Expand Down
54 changes: 30 additions & 24 deletions src/brainCloudClient-identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -1226,32 +1226,38 @@ function BCIdentity() {
});
};

bc.identity.switchToChildProfileInternal = function(childProfileId, childAppId, forceCreate, forceSingleton, callback) {

var _navLangCode = window.navigator.userLanguage || window.navigator.language;
_navLangCode = _navLangCode.split("-");
var languageCode = _navLangCode[0];
var countryCode = _navLangCode[1];
bc.identity.switchToChildProfileInternal = function (childProfileId, childAppId, forceCreate, forceSingleton, callback) {

var _navLangCode = window.navigator.userLanguage || window.navigator.language;
_navLangCode = _navLangCode.split("-");
var languageCode = _navLangCode[0];
var countryCode = _navLangCode[1];
if (countryCode === "419") {
countryCode = "_LA_"
}
if (countryCode === "Hans" || countryCode === "Hant") {
countryCode = "CN"
}

var now = new Date();
var timeZoneOffset = -now.getTimezoneOffset() / 60.0;
var now = new Date();
var timeZoneOffset = -now.getTimezoneOffset() / 60.0;

bc.brainCloudManager.sendRequest({
service: bc.SERVICE_IDENTITY,
operation: bc.identity.OPERATION_SWITCH_TO_CHILD_PROFILE,
data: {
profileId : childProfileId,
gameId : childAppId,
forceCreate : forceCreate,
forceSingleton : forceSingleton,
releasePlatform: "WEB",
timeZoneOffset : timeZoneOffset,
languageCode : languageCode,
countryCode : countryCode
},
callback: callback
});
};
bc.brainCloudManager.sendRequest({
service: bc.SERVICE_IDENTITY,
operation: bc.identity.OPERATION_SWITCH_TO_CHILD_PROFILE,
data: {
profileId: childProfileId,
gameId: childAppId,
forceCreate: forceCreate,
forceSingleton: forceSingleton,
releasePlatform: "WEB",
timeZoneOffset: timeZoneOffset,
languageCode: languageCode,
countryCode: countryCode
},
callback: callback
});
};

}

Expand Down
3 changes: 1 addition & 2 deletions src/brainCloudClient-lobby.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ function BCLobby() {
/// </summary>
bc.lobby.cancelFindRequest = function(lobbyType, callback) {
var data = {
lobbyType: lobbyType,
cxId: bc.rttService.getRTTConnectionId()
lobbyType: lobbyType
};

bc.brainCloudManager.sendRequest({
Expand Down
Loading

0 comments on commit c7f3de5

Please sign in to comment.