fix: stop tick room on delete
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
|
||||
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -75,6 +75,8 @@ public class LobbyInMemory : IRagonLobby
|
||||
|
||||
public void Persist(RagonRoom room)
|
||||
{
|
||||
room.Attach();
|
||||
|
||||
_rooms.Add(room);
|
||||
_logger.Trace($"New room: {room.Id}");
|
||||
|
||||
@@ -87,6 +89,8 @@ public class LobbyInMemory : IRagonLobby
|
||||
var result = false;
|
||||
if (room.Players.Count == 0)
|
||||
{
|
||||
room.Detach();
|
||||
|
||||
_rooms.Remove(room);
|
||||
_logger.Trace($"Room {room.Id} removed");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user