mirror of
https://github.com/project-redbud/FunGame-Desktop.git
synced 2025-12-05 00:06:06 +00:00
修改部分代码语法
This commit is contained in:
parent
1d70b5019f
commit
699bd1888a
@ -97,11 +97,11 @@ namespace Milimoe.FunGame.Desktop.Controller
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<Room> list = new();
|
List<Room> list = [];
|
||||||
await UpdateRoomRequest.SendRequestAsync();
|
await UpdateRoomRequest.SendRequestAsync();
|
||||||
if (UpdateRoomRequest.Result == RequestResult.Success)
|
if (UpdateRoomRequest.Result == RequestResult.Success)
|
||||||
{
|
{
|
||||||
list = UpdateRoomRequest.GetResult<List<Room>>("rooms") ?? new();
|
list = UpdateRoomRequest.GetResult<List<Room>>("rooms") ?? [];
|
||||||
Main.UpdateUI(MainInvokeType.UpdateRoom, list);
|
Main.UpdateUI(MainInvokeType.UpdateRoom, list);
|
||||||
}
|
}
|
||||||
else throw new CanNotIntoRoomException();
|
else throw new CanNotIntoRoomException();
|
||||||
@ -145,9 +145,9 @@ namespace Milimoe.FunGame.Desktop.Controller
|
|||||||
Config.FunGame_isInRoom = true;
|
Config.FunGame_isInRoom = true;
|
||||||
Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 准备完毕。");
|
Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 准备完毕。");
|
||||||
}
|
}
|
||||||
List<User> ReadyPlayerList = SetReadyRequest.GetResult<List<User>>("ready") ?? new();
|
List<User> ReadyPlayerList = SetReadyRequest.GetResult<List<User>>("ready") ?? [];
|
||||||
if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username)));
|
if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username)));
|
||||||
List<User> NotReadyPlayerList = SetReadyRequest.GetResult<List<User>>("notready") ?? new();
|
List<User> NotReadyPlayerList = SetReadyRequest.GetResult<List<User>>("notready") ?? [];
|
||||||
if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username)));
|
if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -175,9 +175,9 @@ namespace Milimoe.FunGame.Desktop.Controller
|
|||||||
Config.FunGame_isInRoom = false;
|
Config.FunGame_isInRoom = false;
|
||||||
Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 已取消准备。");
|
Main.GetMessage("[ " + Usercfg.LoginUser.Username + " ] 已取消准备。");
|
||||||
}
|
}
|
||||||
List<User> ReadyPlayerList = CancelReadyRequest.GetResult<List<User>>("ready") ?? new();
|
List<User> ReadyPlayerList = CancelReadyRequest.GetResult<List<User>>("ready") ?? [];
|
||||||
if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username)));
|
if (ReadyPlayerList.Count > 0) Main.GetMessage("已准备的玩家:" + string.Join(", ", ReadyPlayerList.Select(u => u.Username)));
|
||||||
List<User> NotReadyPlayerList = CancelReadyRequest.GetResult<List<User>>("notready") ?? new();
|
List<User> NotReadyPlayerList = CancelReadyRequest.GetResult<List<User>>("notready") ?? [];
|
||||||
if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username)));
|
if (NotReadyPlayerList.Count > 0) Main.GetMessage("仍未准备的玩家:" + string.Join(", ", NotReadyPlayerList.Select(u => u.Username)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@ -256,7 +256,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
if (r.RoomMaster != null)
|
if (r.RoomMaster != null)
|
||||||
{
|
{
|
||||||
string msg = $"房间 [ {r.Roomid} ] 的房主已变更为" + (r.RoomMaster.Username != Usercfg.LoginUserName ? $" [ {r.RoomMaster.Username} ]" : "您") + "。";
|
string msg = $"房间 [ {r.Roomid} ] 的房主已变更为" + (r.RoomMaster.Username != Usercfg.LoginUserName ? $" [ {r.RoomMaster.Username} ]" : "您") + "。";
|
||||||
GetMessage(msg, TimeType.TimeOnly);
|
GetMessage(msg, TimeType.LongTimeOnly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -304,7 +304,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="msg"></param>
|
/// <param name="msg"></param>
|
||||||
/// <param name="timetype"></param>
|
/// <param name="timetype"></param>
|
||||||
public void GetMessage(string msg, TimeType timetype = TimeType.TimeOnly)
|
public void GetMessage(string msg, TimeType timetype = TimeType.LongTimeOnly)
|
||||||
{
|
{
|
||||||
void action()
|
void action()
|
||||||
{
|
{
|
||||||
@ -442,7 +442,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
/// <param name="msg"></param>
|
/// <param name="msg"></param>
|
||||||
private void WritelnSystemInfo(string msg)
|
private void WritelnSystemInfo(string msg)
|
||||||
{
|
{
|
||||||
msg = DateTimeUtility.GetDateTimeToString(TimeType.TimeOnly) + " >> " + msg;
|
msg = DateTimeUtility.GetDateTimeToString(TimeType.LongTimeOnly) + " >> " + msg;
|
||||||
WritelnGameInfo(msg);
|
WritelnGameInfo(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user