Skip to content

Commit

Permalink
players cmd to list all players only
Browse files Browse the repository at this point in the history
  • Loading branch information
pygrum committed Dec 27, 2023
1 parent 712625d commit 5c7889f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/commands/co-op.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func coopCmd(stop bool) {
cLogger.Info("co-op mode activated (%s:%d)", config.MainConfig.Interface, config.MainConfig.MultiplayerPort)
}

func playersCmd(names []string) {
players, err := console.Rpc.Players(ctx, &clientpb.PlayerRequest{Names: names})
func playersCmd() {
players, err := console.Rpc.Players(ctx, &clientpb.PlayerRequest{})
if err != nil {
cLogger.Error("%v", err)
return
Expand Down
8 changes: 1 addition & 7 deletions pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,10 @@ func ConsoleCommands() []*grumble.Command {
cmdPlayers = &grumble.Command{
Name: "players",
Help: "list registered players",
Args: func(a *grumble.Args) {
a.StringList("usernames", "player usernames")
},
Run: func(c *grumble.Context) error {
playersCmd(c.Args.StringList("usernames"))
playersCmd()
return nil
},
Completer: func(prefix string, args []string) []string {
return completion.Players(prefix, ctx)
},
HelpGroup: consts.CoopHelpGroup,
}

Expand Down

0 comments on commit 5c7889f

Please sign in to comment.