|
@@ -6,16 +6,27 @@ namespace ET.Server;
|
|
|
public static class RoomSystem
|
|
|
{
|
|
|
[ObjectSystem]
|
|
|
- public class RoomAwakeSystem : AwakeSystem<Room, long>
|
|
|
+ public class RoomAwakeSystem : AwakeSystem<Room>
|
|
|
{
|
|
|
- protected override void Awake(Room self, long id)
|
|
|
+ protected override void Awake(Room self)
|
|
|
{
|
|
|
- Log.Info($"创建房间...");
|
|
|
+ Log.Info($"创建房间实体...");
|
|
|
self.Type = 2;
|
|
|
self.Players = new List<Player>();
|
|
|
self.CreateTime = TimeHelper.ServerNow();
|
|
|
- // 添加房间玩家数据
|
|
|
+ // 添加本地房间数据
|
|
|
self.DomainScene().GetComponent<GameRoomComponent>().Add(self);
|
|
|
}
|
|
|
+
|
|
|
+ [ObjectSystem]
|
|
|
+ public class RoomDestroySystem : DestroySystem<Room>
|
|
|
+ {
|
|
|
+ protected override void Destroy(Room self)
|
|
|
+ {
|
|
|
+ Log.Info($"销毁房间实体...");
|
|
|
+ // 移除本地房间数据
|
|
|
+ self.DomainScene().GetComponent<GameRoomComponent>()?.Remove(self.Id);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|