Hey folks,
So I'm trying to call a cloudscript function from my custom game server for both players that were matched up. The problem I'm specifically having is that my cloudscript seems to be getting the same player PlayFabId for both calls. I'm fairly sure it has to do with the way I'm using the signal and response.
This is what my server call looks like (without all of my various gameplay-related code), this is called for each player.
ExecuteCloudscriptResponse.AddOnce( ( cloudResult ) => { // log.info( currentPlayerId ) shown here has same player Id, twice } ); ExecuteCloudscriptSignal.Dispatch( new ExecuteCloudScriptServerRequest() { PlayFabId = player.PlayFabId, // this is correct/unique in both calls FunctionName = "MatchComplete" } );
Inside my cloudscript I simply have a log.info( currentPlayerId ); and I display that in the return from cloud. My cloudscript function is getting hit twice, but it seems like it's getting incorrect data? Logically the AddOnce seems like it'd be the problem seeing as how it's not dealing well with my calling this a second time, but I'm just not sure.
Thanks for the help!
-Matt