协议修改
This commit is contained in:
@@ -38,6 +38,12 @@ public static class MapRoomSystem
|
||||
return ErrorCode.Successful;
|
||||
}
|
||||
|
||||
public static async FTask Exit(this MapRoom self, long id)
|
||||
{
|
||||
self.Units.Remove(id);
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
|
||||
public static List<MapUnitInfo> ToMapUnitInfo(this MapRoom self)
|
||||
{
|
||||
List<MapUnitInfo> ret = new List<MapUnitInfo>();
|
||||
|
||||
@@ -66,11 +66,23 @@ public static class RoomManageComponentSystem
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void Check(this RoomManageComponent self, int roomId)
|
||||
{
|
||||
if (self.Rooms.TryGetValue(roomId, out var room))
|
||||
{
|
||||
if (room.Units.Count < 1)
|
||||
{
|
||||
Log.Info($"房间没人了,解散房间,id={roomId}");
|
||||
// self.Remove(roomId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static MapRoom? Get(this RoomManageComponent self, int roomId)
|
||||
{
|
||||
return self.Rooms.GetValueOrDefault(roomId);
|
||||
}
|
||||
|
||||
|
||||
// public static MapRoom? Get(this RoomManageComponent self, long roomId)
|
||||
// {
|
||||
// return self.Rooms.GetValueOrDefault(roomId);
|
||||
|
||||
Reference in New Issue
Block a user