• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
K

kuabs

@kuabs
About
Posts
16
Topics
10
Groups
0
Followers
0
Following
0

Topics

  • K

    Could RTT be used to broadcast player-authoritative movement periodically?

    Scheduled Pinned Locked Moved Unsolved General rtt
    5
    0 Votes
    5 Posts
    494 Views
    Paul WinterhalderP

    All very good points @Panagiotis-Milios !

  • K

    How to let a user request Email Password Reset when they aren't authenticated?

    Scheduled Pinned Locked Moved Unsolved General authentication
    2
    0 Votes
    2 Posts
    372 Views
    J

    Hi Kuabs, you can use brainCloud webhooks to achieve this feature, the steps are as follows.

    Create a cloud code script, in this example use the name "webhook_forgotPassword", and paste the following code into the script. "use strict"; function main() { var response = {}; bridge.logDebugJson("Script inputs", data); var userEmail = data.parameters.email; response.stringResponse = "webhook is processing user email reseting..." + data.parameters.email; // validating the user email if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(userEmail)) { // checking if the email is existed in brainCloud users var context = { "pagination": { "rowsPerPage": 20, "pageNumber": 1 }, "searchCriteria": { "emailAddress": userEmail }, "sortCriteria": { "playerName": 1 } }; var userProxy = bridge.getUserServiceProxy(); var postResult = userProxy.sysGetPage(context); if (postResult.data.results.count > 0) { var userProfileID = postResult.data.results.items[0].profileId; // sending password reset email postResult = userProxy.sysSendPasswordResetEmail(userProfileID); if (postResult.status == 200) { response.stringResponse = "password reset email has been sent to user's email:" + userEmail; } else { response.stringResponse = "system error with sending email..."; } } else { response.stringResponse = "user doesn't exist with the email you provided"; } } else { response.stringResponse = "user's email is invalid."; } return response; } main();

    Open Design | Cloud Code | WebHooks page, and create a WebHook link to the script you created from the previous step. Copy down the WebHook URL for the next step.73ee4986-3d38-4694-bac5-d7c4896c99ba-image.png

    Now, you have completed the work from brainCloud. Next, open your client app editor (if you are using Unity), define the WebHook URL as a variable, and link it to your forgotEmail object (could be a link or button in your app) onClick event, making it trigger this URL when the user clicks with Application.OpenURL command. Grab user inputted email and append it as an email parameter to the URL as follows:

    const string passwordResetWebhookUrl = "https://portal.braincloudservers.com/webhook/12832/forgotPassword/6dc675bb-f8b4-495f-ac5e-1f0658bfe09c"; Application.OpenURL(passwordResetWebhookUrl + "?email=" + userEmail);

    Run your app to test, you should get a similar pop-up window as follows once a user clicks the forgotEmail object,
    94dd0dae-7d6e-44c8-ab26-0d57a8544bb4-image.png

    Check the reset email in your test email account...25a6f240-5246-4ba2-a216-e978eaccee8c-image.png

  • K

    Is there a place I can see all possible error code that can come back from various APIs?

    Scheduled Pinned Locked Moved Unsolved Cloud Code cloud code error
    5
    0 Votes
    5 Posts
    616 Views
    Paul WinterhalderP

    There is a global list of reason codes here - https://docs.braincloudservers.com/api/appendix/reasonCodes

  • K

    Cloud code retries, error handling question

    Scheduled Pinned Locked Moved Unsolved Cloud Code cloud code error
    2
    0 Votes
    2 Posts
    354 Views
    P

    A good way to handle failure besides retrying in code, is to schedule another script to run 1 minute later that will basically repeat the same action.

  • K

    Is profileId returned by auth considered sensitive?

    Scheduled Pinned Locked Moved Unsolved APIs profile authentication
    2
    0 Votes
    2 Posts
    353 Views
    P

    It's not. Just knowing a playerId is really not important as it's only a unique identifier for another player and nothing more than that.

  • K

    Only allow user to change username if it is unique and does not contain profanity?

    Scheduled Pinned Locked Moved Solved General users cloud code api
    4
    0 Votes
    4 Posts
    510 Views
    K

    @Paul-Winterhalder Amazing! This is perfect for my needs-- thanks so much Paul.

  • K

    How can we ensure that users data (Entities, Global Entities, Leaderboards, Statistics etc) are *only* writable from cloud-scripts?

    Scheduled Pinned Locked Moved Unsolved General cloudscript cloud code script api
    2
    0 Votes
    2 Posts
    330 Views
    P

    Use API blocking in the cloud code category to block all apis from client that write your user entities. Then clients can only write their entities using cloud-code and there you have the total control

  • K

    [Question] Difficulty setting up dev/prod environment with braincloud apps.

    Scheduled Pinned Locked Moved Solved General
    4
    0 Votes
    4 Posts
    516 Views
    K

    I believe this worked @Steve-Jones -- thanks so much for the tip!

  • K

    What is the proper way to implement an "Energy" system for a casual mobile game?

    Scheduled Pinned Locked Moved Unsolved General energy system mobile
    4
    0 Votes
    4 Posts
    573 Views
    P

    @kuabs Exactly. Always use braincloud server time for features that rely on time passed. Also, if you want to modify your recharge rate during gameplay, you might want to consider keeping it in a global entity instead so every user will be affected by it.

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users