diff --git a/PlayFabApiTest.js b/PlayFabApiTest.js index 76c82dd9..adb76a22 100644 --- a/PlayFabApiTest.js +++ b/PlayFabApiTest.js @@ -563,23 +563,16 @@ var PlayFabApiTests = { /// /// CLIENT API - /// Try to deliberately register a character with an invalid email and password. - /// Verify that errorDetails are populated correctly. + /// Test that the client can publish custom PlayStream events /// WriteEvent: function (assert) { var writeEventDone = assert.async(); var writeEventRequest = { // Currently, you need to look up the correct format for this object in the API-docs: - // https://api.playfab.com/Documentation/Client/method/WriteEvent - "Event": { - "EventName": "forum_post_event", - "EventNamespace": "com.mygame.forums", - "EntityType": "player", - "Timestamp": "2014-03-07T00:00:00Z", // TODO: Write a current timestamp-string in the correct format - "CustomTags": { - "Region": "US-East" - }, + // https://api.playfab.com/Documentation/Client/method/WritePlayerEvent + "EventName": "ForumPostEvent", + "Body": { "Subject": "My First Post", "Body": "This is my awesome post." } diff --git a/PlayFabSDK/PlayFabAdminApi.js b/PlayFabSDK/PlayFabAdminApi.js index 8697e63b..e27ce164 100644 --- a/PlayFabSDK/PlayFabAdminApi.js +++ b/PlayFabSDK/PlayFabAdminApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.14.160411", + sdkVersion: "0.15.160414", productionServerUrl: ".playfabapi.com", logicServerUrl: null, diff --git a/PlayFabSDK/PlayFabClientApi.js b/PlayFabSDK/PlayFabClientApi.js index 76829852..76b78d1d 100644 --- a/PlayFabSDK/PlayFabClientApi.js +++ b/PlayFabSDK/PlayFabClientApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.14.160411", + sdkVersion: "0.15.160414", productionServerUrl: ".playfabapi.com", logicServerUrl: null, @@ -719,6 +719,24 @@ PlayFab.ClientApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/LogEvent", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback); }, + WriteCharacterEvent: function (request, callback) { + if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/WriteCharacterEvent", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback); + }, + + WritePlayerEvent: function (request, callback) { + if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/WritePlayerEvent", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback); + }, + + WriteTitleEvent: function (request, callback) { + if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/WriteTitleEvent", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback); + }, + AddSharedGroupMembers: function (request, callback) { if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method"; diff --git a/PlayFabSDK/PlayFabMatchmakerApi.js b/PlayFabSDK/PlayFabMatchmakerApi.js index 1b88b870..e75e05f6 100644 --- a/PlayFabSDK/PlayFabMatchmakerApi.js +++ b/PlayFabSDK/PlayFabMatchmakerApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.14.160411", + sdkVersion: "0.15.160414", productionServerUrl: ".playfabapi.com", logicServerUrl: null, diff --git a/PlayFabSDK/PlayFabServerApi.js b/PlayFabSDK/PlayFabServerApi.js index 6c4d7988..71908146 100644 --- a/PlayFabSDK/PlayFabServerApi.js +++ b/PlayFabSDK/PlayFabServerApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.14.160411", + sdkVersion: "0.15.160414", productionServerUrl: ".playfabapi.com", logicServerUrl: null, @@ -446,6 +446,24 @@ PlayFab.ServerApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/LogEvent", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + WriteCharacterEvent: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/WriteCharacterEvent", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + + WritePlayerEvent: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/WritePlayerEvent", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + + WriteTitleEvent: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/WriteTitleEvent", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + AddSharedGroupMembers: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";