AcManager.Pages.Drive.Srs.ViewModel.Go C# (CSharp) Метод

Go() публичный Метод

public Go ( ) : Task
Результат Task
            public async Task<bool> Go() {
                if (Server?.Ip == null || Player == null || CarId == null) return false;

                try {
                    if (Car == null) {
                        throw new InformativeException(string.Format(ToolsStrings.AcError_CarIsMissing, CarId), AppStrings.Srs_CarIsMissing_Commentary);
                    }

                    var anyTrack = TracksManager.Instance.GetDefault();
                    Logging.Debug(CarSkinId);
                    await GameWrapper.StartAsync(new Game.StartProperties {
                        BasicProperties = new Game.BasicProperties {
                            CarId = CarId,
                            CarSkinId = CarSkinId,
                            TrackId = anyTrack?.Id,
                            TrackConfigurationId = anyTrack?.LayoutId
                        },
                        ModeProperties = new Game.OnlineProperties {
                            ServerName = Server.DisplayName,
                            ServerIp = Server.Ip,
                            ServerPort = Server.Port ?? 9615,
                            ServerHttpPort = Server.PortHttp,
                            Password = Server.Password,
                            Penalties = true,
                        },
                        AdditionalPropertieses = {
                            new SrsMark {
                                Name = Player.DisplayName ?? SrsMark.GetName(),
                                Team = Player.Team ?? "",
                                Nationality = Player.Nationality ?? ""
                            }
                        }
                    });

                    return true;
                } catch (Exception e) {
                    NonfatalError.Notify(AppStrings.Common_CannotStartRace, e);
                    return false;
                }
            }