From 1fa61bb5a02c745e15bd41896764b3a07185463a Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Fri, 8 Nov 2024 09:59:35 +0800 Subject: [PATCH] fix --- .../Assets/Script/Manager/AppRoom.cs | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs index 83145e7..b59b5ad 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs @@ -425,5 +425,25 @@ namespace AxibugEmuOnline.Client.Manager //解压 byte[] data = Helper.DecompressByteArray(msg.RawBitmap.ToArray()); } - } + } + + public static class RoomEX + { + /// + /// 获取房间空闲席位下标 (返回True表示由余位) + /// + /// + /// + /// + public static bool GetFreeSlot(this Protobuf_Room_MiniInfo roomMiniInfo,out int[] freeSlots) + { + List temp = new List(); + if (roomMiniInfo.Player1UID > 0) temp.Add(0); + if (roomMiniInfo.Player2UID > 1) temp.Add(1); + if (roomMiniInfo.Player3UID > 2) temp.Add(2); + if (roomMiniInfo.Player4UID > 3) temp.Add(3); + freeSlots = temp.ToArray(); + return freeSlots.Length > 0; + } + } } \ No newline at end of file