diff --git a/FunGame.Desktop/Controller/MainController.cs b/FunGame.Desktop/Controller/MainController.cs index b329f27..c390dbe 100644 --- a/FunGame.Desktop/Controller/MainController.cs +++ b/FunGame.Desktop/Controller/MainController.cs @@ -97,11 +97,11 @@ namespace Milimoe.FunGame.Desktop.Controller try { - List list = new(); + List list = []; await UpdateRoomRequest.SendRequestAsync(); if (UpdateRoomRequest.Result == RequestResult.Success) { - list = UpdateRoomRequest.GetResult>("rooms") ?? new(); + list = UpdateRoomRequest.GetResult>("rooms") ?? []; Main.UpdateUI(MainInvokeType.UpdateRoom, list); } else throw new CanNotIntoRoomException(); @@ -145,9 +145,9 @@ namespace Milimoe.FunGame.Desktop.Controller Config.FunGame_isInRoom = true; Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 准备完毕。"); } - List ReadyPlayerList = SetReadyRequest.GetResult>("ready") ?? new(); + List ReadyPlayerList = SetReadyRequest.GetResult>("ready") ?? []; if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username))); - List NotReadyPlayerList = SetReadyRequest.GetResult>("notready") ?? new(); + List NotReadyPlayerList = SetReadyRequest.GetResult>("notready") ?? []; if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username))); } return result; @@ -175,9 +175,9 @@ namespace Milimoe.FunGame.Desktop.Controller Config.FunGame_isInRoom = false; Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 已取消准备。"); } - List ReadyPlayerList = CancelReadyRequest.GetResult>("ready") ?? new(); + List ReadyPlayerList = CancelReadyRequest.GetResult>("ready") ?? []; if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username))); - List NotReadyPlayerList = CancelReadyRequest.GetResult>("notready") ?? new(); + List NotReadyPlayerList = CancelReadyRequest.GetResult>("notready") ?? []; if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username))); } return result; diff --git a/FunGame.Desktop/UI/Main/Main.cs b/FunGame.Desktop/UI/Main/Main.cs index c2eb77d..f7dc7e4 100644 --- a/FunGame.Desktop/UI/Main/Main.cs +++ b/FunGame.Desktop/UI/Main/Main.cs @@ -256,7 +256,7 @@ namespace Milimoe.FunGame.Desktop.UI if (r.RoomMaster != null) { string msg = $"房间 [ {r.Roomid} ] 的房主已变更为" + (r.RoomMaster.Username != Usercfg.LoginUserName ? $" [ {r.RoomMaster.Username} ]" : "您") + "。"; - GetMessage(msg, TimeType.TimeOnly); + GetMessage(msg, TimeType.LongTimeOnly); } } break; @@ -304,7 +304,7 @@ namespace Milimoe.FunGame.Desktop.UI /// /// /// - public void GetMessage(string msg, TimeType timetype = TimeType.TimeOnly) + public void GetMessage(string msg, TimeType timetype = TimeType.LongTimeOnly) { void action() { @@ -442,7 +442,7 @@ namespace Milimoe.FunGame.Desktop.UI /// private void WritelnSystemInfo(string msg) { - msg = DateTimeUtility.GetDateTimeToString(TimeType.TimeOnly) + " >> " + msg; + msg = DateTimeUtility.GetDateTimeToString(TimeType.LongTimeOnly) + " >> " + msg; WritelnGameInfo(msg); }