|
@@ -157,11 +157,15 @@ public class GDRoom extends Room {
|
|
|
}
|
|
|
} finally {
|
|
|
lock.unlock();
|
|
|
- // 房间没人直接解散
|
|
|
- if (this.actors.isEmpty()) {
|
|
|
- this.destroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 广播
|
|
|
+ for (Player tmPlayer : this.actors.values()) {
|
|
|
+ if (tmPlayer != null) {
|
|
|
+ tmPlayer.receive(CommonProto.Cmd.DisbandRoom_VALUE, new HashMap<>());
|
|
|
}
|
|
|
}
|
|
|
+ this.destroy();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1471,9 +1475,10 @@ public class GDRoom extends Room {
|
|
|
if (!this.actors.isEmpty()) {
|
|
|
for (Player player : this.actors.values()) {
|
|
|
if (player != null) {
|
|
|
- this.leaveRoom(player);
|
|
|
+ player.resetRoom();
|
|
|
}
|
|
|
}
|
|
|
+ this.actors.clear();
|
|
|
}
|
|
|
|
|
|
Log.debug("清理房间数据...");
|