protected override async Task Execute(MatchMakerClient sharedClient, TOptions options, CancellationToken cancellationToken) { sharedClient.Logger.Enabled = options.Verbose; stopwatch.Restart(); await ExecuteStandardCommand(sharedClient, options, cancellationToken); stopwatch.Stop(); OutputStream.WriteLine($"<<{stopwatch.ElapsedMilliseconds} milli seconds>>"); }
protected override async Task ExecuteStandardCommand(MatchMakerClient sharedClient, StandardCommandOptions options, CancellationToken cancellationToken) { var results = await sharedClient.GetRoomGroupListAsync(); OutputStream.WriteLine($"{results.Length} room groups found."); foreach (var result in results) { OutputStream.WriteLine($" {result.Name}"); } }
protected override async Task ExecuteStandardCommand(MatchMakerClient sharedClient, CreateRoomWithCreatingPortMappingCommandOptions options, CancellationToken cancellationToken) { var result = await sharedClient.CreateRoomWithCreatingPortMappingAsync(options.MaxPlayerCount, options.Protocol, options.PortCandidates, options.DefaultPortNumber, options.DiscoverTimeoutMilliSeconds, options.Password, options.forceToDiscoverNatDevice); OutputStream.WriteLine(result.IsDefaultPortUsed ? "Default port is used." : $"Private port {result.UsedPrivatePortFromCandidates} and public port {result.UsedPublicPortFromCandidates} from candidates are used."); OutputStream.WriteLine($"Room created with id \"{sharedClient.HostingRoomId}\"."); }