diff --git a/server/hallserver/room/constant.go b/server/hallserver/room/constant.go index 609d1629..e7ff231f 100644 --- a/server/hallserver/room/constant.go +++ b/server/hallserver/room/constant.go @@ -19,6 +19,7 @@ const ( ROOM_DISBAND_DEFAULT_REASON = iota ROOM_DISBAND_1_REASON ROOM_DISBAND_NO_NEXT_OWNER_REASON + ROOM_DISBAND_OWNER_OFFLINE_REASON ) const ROOM_MIN_START_TEAM_NUM = 1 diff --git a/server/hallserver/room/room.go b/server/hallserver/room/room.go index 92a53df1..0b5b9141 100644 --- a/server/hallserver/room/room.go +++ b/server/hallserver/room/room.go @@ -318,6 +318,11 @@ func (this *room) fillMFCurrentRoom(hum common.Player, pb *cs.MFCurrentRoom) { } func (this *room) OnPlayerOffline(hum common.Player) { + if this.isOwner(hum) { + if this.roomState == ROOM_INIT_STATE { + this.doDisband(ROOM_DISBAND_OWNER_OFFLINE_REASON) + } + } } func (this *room) OnPlayerOnline(hum common.Player) {