Skip to content

Commit

Permalink
Revert "/search players now searches all players instead of currently…
Browse files Browse the repository at this point in the history
… online"

This reverts commit e3d58e3.
  • Loading branch information
Goodlyay committed May 4, 2023
1 parent e3d58e3 commit 3d8db92
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MCGalaxy/Commands/Information/CmdSearch.cs
Expand Up @@ -14,8 +14,7 @@
*/
using System;
using System.Collections.Generic;
using MCGalaxy.DB;
using MCGalaxy.SQL;
using MCGalaxy.Blocks;
using BlockID = System.UInt16;

namespace MCGalaxy.Commands.Info
Expand Down Expand Up @@ -87,10 +86,9 @@ public class CmdSearch : Command2
}

static void SearchPlayers(Player p, string keyword, string modifier) {
List<PlayerData> stats = new List<PlayerData>();
Database.ReadRows("Players", "*", record => stats.Add(PlayerData.Parse(record)));

List<string> players = Matcher.Filter(stats, keyword, pl => pl.Name);
Player[] online = PlayerInfo.Online.Items;
List<string> players = Matcher.Filter(online, keyword, pl => pl.name,
pl => p.CanSee(pl), pl => pl.ColoredName);
OutputList(p, keyword, "search players", "players", modifier, players);
}

Expand Down

0 comments on commit 3d8db92

Please sign in to comment.