/search players now searches all players instead of currently online

This commit is contained in:
Goodlyay 2023-05-03 16:38:38 -07:00
parent cb451653b3
commit e3d58e3e38

View File

@ -14,7 +14,8 @@ permissions and limitations under the Licenses.
*/
using System;
using System.Collections.Generic;
using MCGalaxy.Blocks;
using MCGalaxy.DB;
using MCGalaxy.SQL;
using BlockID = System.UInt16;
namespace MCGalaxy.Commands.Info
@ -86,9 +87,10 @@ namespace MCGalaxy.Commands.Info
}
static void SearchPlayers(Player p, string keyword, string modifier) {
Player[] online = PlayerInfo.Online.Items;
List<string> players = Matcher.Filter(online, keyword, pl => pl.name,
pl => p.CanSee(pl), pl => pl.ColoredName);
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);
OutputList(p, keyword, "search players", "players", modifier, players);
}