From bd79a1340ee0ee5b9df08df0c0ff3cec43512637 Mon Sep 17 00:00:00 2001 From: zpc Date: Sun, 1 Dec 2024 07:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/CloudGaming.Code/Game/GameBLL.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/CloudGaming/Code/CloudGaming.Code/Game/GameBLL.cs b/src/CloudGaming/Code/CloudGaming.Code/Game/GameBLL.cs index a5e72e7..9f4f62f 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Game/GameBLL.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Game/GameBLL.cs @@ -403,6 +403,20 @@ namespace CloudGaming.Code.Game gameListDtos.Add(new GameHistoryListDto(gameInfo, list[gameId], ImageResStyle.小LOGO)); } } + if (gameListDtos.Count < 20) + { + //gameListDtos.Add + var gamelist = gameCache.DataList.Where(it => !gameListDtos.Any(game => game.GameId == it.GameId)); + var l = gamelist.OrderBy(it => new Random().Next(0, 999)).ToList(); + foreach (var g in l) + { + gameListDtos.Add(new GameHistoryListDto(g, 0, ImageResStyle.小LOGO)); + if (gameListDtos.Count > 20) + { + break; + } + } + } return gameListDtos; } }