diff --git a/Client/origin-client/autoloads/CustomLobby.gd b/Client/origin-client/autoloads/CustomLobby.gd
index f4912e3..406ebd7 100644
--- a/Client/origin-client/autoloads/CustomLobby.gd
+++ b/Client/origin-client/autoloads/CustomLobby.gd
@@ -171,11 +171,16 @@ func change_deck(deck_id: String) -> void:
print("[CustomLobby] ERR change_deck ", code, " ", msg))
-## Host-only: update lobby rule overrides (only when neither player is ready).
+## Host-only: update lobby rule overrides (open or full lobby, neither player ready).
func update_rules(rules_override: Dictionary) -> void:
Network.request("game.custom.update_rules",
{ "lobbyId": lobby_id, "rules": rules_override },
- func(_t: String, _p: Variant) -> void: pass,
+ func(_t: String, p: Variant) -> void:
+ # Apply new rules immediately from the ACK (don't wait for the push).
+ var d := p as Dictionary
+ var rules := d.get("rules", {}) as Dictionary
+ if not rules.is_empty():
+ lobby_rules_updated.emit(rules),
func(code: String, msg: String) -> void:
print("[CustomLobby] ERR update_rules ", code, " ", msg))
diff --git a/Server/src/SOR.Game/Handlers/GameUpdateLobbyRulesHandler.cs b/Server/src/SOR.Game/Handlers/GameUpdateLobbyRulesHandler.cs
index 2e5339e..0342aba 100644
--- a/Server/src/SOR.Game/Handlers/GameUpdateLobbyRulesHandler.cs
+++ b/Server/src/SOR.Game/Handlers/GameUpdateLobbyRulesHandler.cs
@@ -8,10 +8,10 @@ using SOR.Networking.Abstractions.Transport;
using SOR.Shared.Networking;
///
-/// game.custom.update_rules — host updates lobby rule overrides while in Full state.
+/// game.custom.update_rules — host updates lobby rule overrides while in Open or Full state.
///
-/// Only allowed when the lobby is Full and neither player is ready.
-/// A LobbyUpdatedPush with the new effective rules is sent to both participants.
+/// Allowed when the lobby is Open (waiting for guest) or Full (neither player ready).
+/// A LobbyUpdatedPush is sent to both participants when in Full state; host only when Open.
///
internal sealed class GameUpdateLobbyRulesHandler : GameHandlerBase, IMessageHandler
{
@@ -42,8 +42,8 @@ internal sealed class GameUpdateLobbyRulesHandler : GameHandlerBase, IMessageHan
var lobby = await _gameDb.CustomLobbies.FindAsync([req.LobbyId], ct)
?? throw new GameException("LOBBY_NOT_FOUND");
- if (lobby.Status != CustomLobbyStatus.Full)
- throw new GameException("LOBBY_NOT_FULL");
+ if (lobby.Status != CustomLobbyStatus.Open && lobby.Status != CustomLobbyStatus.Full)
+ throw new GameException("LOBBY_NOT_OPEN_OR_FULL");
if (lobby.HostAccountId != accountId)
throw new GameException("HOST_ONLY");
@@ -99,9 +99,13 @@ internal sealed class GameUpdateLobbyRulesHandler : GameHandlerBase, IMessageHan
var updatedPush = ServerMessage.Push("game.custom.lobby_updated",
new LobbyUpdatedPush(lobby.Id, effective));
- await Task.WhenAll(
+ var pushTasks = new List
+ {
_clientPush.PushAsync(lobby.HostAccountId.ToString(), updatedPush, ct),
- _clientPush.PushAsync(lobby.GuestAccountId!.Value.ToString(), updatedPush, ct));
+ };
+ if (lobby.GuestAccountId.HasValue)
+ pushTasks.Add(_clientPush.PushAsync(lobby.GuestAccountId.Value.ToString(), updatedPush, ct));
+ await Task.WhenAll(pushTasks);
return ServerMessage.Reply("game.custom.update_rules.ack", message.Seq,
new UpdateLobbyRulesResponse(LobbyId: lobby.Id, Rules: effective));