public void SendCreatePlayerCommand(PlayerCreator.CreatePlayer.Request request, Action <Improbable.PlayerLifecycle.PlayerCreator.CreatePlayer.ReceivedResponse> callback = null) { int validCallbackEpoch = callbackEpoch; var requestId = commandSender.SendCommand(request, entity); if (callback != null) { Action <Improbable.PlayerLifecycle.PlayerCreator.CreatePlayer.ReceivedResponse> wrappedCallback = response => { if (!this.IsValid || validCallbackEpoch != this.callbackEpoch) { return; } callback(response); }; callbackSystem.RegisterCommandResponseCallback(requestId, wrappedCallback); } }
public void SendCreatePlayerCommand(EntityId targetEntityId, global::Improbable.PlayerLifecycle.CreatePlayerRequestType request, Action <Improbable.PlayerLifecycle.PlayerCreator.CreatePlayer.ReceivedResponse> callback = null) { var commandRequest = new PlayerCreator.CreatePlayer.Request(targetEntityId, request); SendCreatePlayerCommand(commandRequest, callback); }