Navigation

    brainCloud Forums
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Solved
    • Unsolved
    • Users
    • Groups
    1. Home
    2. Gavin Beard
    G
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Gavin Beard

    @Gavin Beard

    0
    Reputation
    8
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Gavin Beard Follow

    Best posts made by Gavin Beard

    This user hasn't posted anything yet.

    Latest posts made by Gavin Beard

    • RE: Async match without opponent

      @Paul-Winterhalder said in Async match without opponent:

      Hi,

      brainCloud currently offers two forms of matchmaking:

      Offline matchmaking - for async match (i.e. words with friends) or one-way multiplayer (i.e. class of clans) style games. Both of those multiplayer types require you to have an opponent to play against when the match starts.

      There is also online matchmaking - which uses our lobby system - which is suitable of any online / real-time sort of multiplayer.

      (That one doesn't require you to have an opponent in mind when the lobby starts... and the lobby can start a match via a relay or room server session right away...)

      That said - I get the feeling that you are talking about more of an async match scenario (i.e. not-necessarily-online multiplayer) - where the match can start before an opponent has been identified.

      Am I correct that that is the scenario you are wanting to target?

      It's an interesting approach - as there's a much lower chance of matching against another player who isn't going to respond in a timely manner.

      Let me know if I've got the scenario right and we'll give it some more thought...

      Paul.

      Hi Paul,

      Yes, you are correct. When a user starts a new game, it'd essentially see if someone has already started a game but has no opponent, If a match is found the second player will be added to the game and can then make their move. If no match is found that is awaiting a player, it'll create a new game, let player 1 make their move and then go "dormant" until a player two is ready.

      If you have ever used the turn based aspect of Apples Game Center turn based service, this is essentially how that works.

      posted in General
      G
      Gavin Beard
    • Async match without opponent

      Hi,

      I am looking to replicate the functionality of match making in services like Apples Game Center, where by a user can create a new game, a check is done to see if there is anyone that has already started a match and submitted a move, and if that match has no opponent, it puts the new user in. At present in the brainCloud documents, it seems a match can only be created if you know the details of the opponent you want to start a match against.

      What would be the best patter to mimic this behaviour within BC (using unity)

      posted in General
      G
      Gavin Beard
    • RE: Execute script when new user is registered

      @JasonL Thanks, I ended up with this cloudCode:

      isForceCreate = String(data.callingMessage.forceCreate) == "true";
      isNewUser = String(data.message.newUser) == "true";
      
      var response = {};
      response.status = 200;
      response.data = data.message;
      
      if (isForceCreate && isNewUser) {
      
          var min = 10000000,
          max = 999999999
          prefix = ["player", "user", "member"]
          
          const num = Math.floor(Math.random() * (max - min + 1)) + min;
          const pre = prefix[Math.floor(Math.random() * prefix.length)];
          
          var defaultPlayerName = pre + String(num);
      
          var playerStateProxy = bridge.getPlayerStateServiceProxy();
          // We are changing the player name on the server.
          playerStateProxy.updatePlayerName(defaultPlayerName);
          // And in this API Call's return data.
          response.data.playerName = pre + String(num);
      }
      
      response; //return the object
      

      This works just the way I need

      posted in Cloud Code
      G
      Gavin Beard
    • Execute script when new user is registered

      Hi,

      I'd like to create a script that is executed when a new user is registered, to assign a random player name if one is not present (something like player12243534) but am struggling with the docs to see where / how I can do this?

      Thanks

      posted in Cloud Code
      G
      Gavin Beard
    • RE: Authentication error - Unity iOS

      Also getting the same error with "Sign In With Apple" when using the brainCloudWrapper.AuthenticateApple() method

      posted in Client APIs
      G
      Gavin Beard
    • RE: Authentication error - Unity iOS

      I can see in the documentation that reason code 40206 is "MISSING_IDENTITY_ERROR" and that it suggests maybe trying forceCreate?

      The iPhone crash is a bigger problem, as this can turn users away from the app pretty easily

      posted in Client APIs
      G
      Gavin Beard
    • Authentication error - Unity iOS

      Hi all,

      I've been trying out brainCloud as a replacement for Game Center turn based matching but I've run into a problem.

      In my C# script I have a brainCloud Wrapper:

      public BrainCloudWrapper brainCloudWrapper;
      

      when the singleton it is attached to is initiated it runs the following:

          ```
      

      brainCloudWrapper = gameObject.AddComponent<BrainCloudWrapper>();
      brainCloudWrapper.Init();

      
      There is a simple button in a UI that calls the following:
      
              ```
              brainCloudWrapper.AuthenticateAnonymous(successCallback = (response, cbObject) =>
              {
                  Debug.Log(string.Format("Success | {0}", response));
              },
              failureCallback = (status, code, error, cbObject) =>
              {
                  Debug.Log(string.Format("Failed | {0}  {1}  {2}", status, code, error));
              });
      

      it runs in the editor but gives me:

      Failed | 202 40206 {"status_message":"Processing exception (message): Credentials missing for Profile Id.","reason_code":40206,"status":202}

      If I run it on my iPhone test device it causes a complete crash of the app with the following:

      JsonTypeCoercionException: Only objects with default constructors can be deserialized. (BrainCloud.Internal.JsonResponseBundleV2)
        at BrainCloud.JsonFx.Json.TypeCoercionUtility.InstantiateObject (System.Type objectType, System.Collections.Generic.Dictionary`2[System.String,System.Reflection.MemberInfo]& memberMap) [0x00000] in <00000000000000000000000000000000>:0 
        at BrainCloud.JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0 
        at BrainCloud.JsonFx.Json.JsonReader.Deserialize[T] (System.String value) [0x00000] in <00000000000000000000000000000000>:0 
        at BrainCloud.Internal.BrainCloudComms.HandleResponseBundle (System.String jsonData) [0x00000] in <00000000000000000000000000000000>:0 
        at BrainCloud.Internal.BrainCloudComms.Update () [0x00000] in <00000000000000000000000000000000>:0 
        at BrainCloud.BrainCloudClient.Update (BrainCloud.eBrainCloudUpdateType in_updateType) [0x00000] in <00000000000000000000000000000000>:0 
      

      Am I missing something from my setup, or in my code calls? it ran a few times without problem but seemed to generate a new user every time it ran which wasn't the expected behaviour (I assumed if it was same device it would use the already created anon. user)

      Any help is much appreciated

      posted in Client APIs
      G
      Gavin Beard