beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
46 stars 46 forks source link

Teiserver should save its match id inside replay start script #348

Open jauggy opened 6 days ago

jauggy commented 6 days ago

Discussion: https://discord.com/channels/549281623154229250/1251109245072572507/1251202506579640421

Maybe relevant code inside lobby_server.ex (line 114)

    options = %{
      "server/match/uuid" => new_match.server_uuid,
      "server/match/id" => new_match.id
    }

    modoptions = state.modoptions |> Map.merge(options)

Maybe change to:

    options = %{
      "server/match/uuid" => new_match.server_uuid,
      "game/server_match_id" => new_match.id
    }

    modoptions = state.modoptions |> Map.merge(options)

Then find any instances of

 "server/match/id" 

and replace with

"game/server_match_id"

1

EDIT: Updated with Lexon's suggestions.

L-e-x-o-n commented 6 days ago

I would change "server/match/id" to "game/server_match_id" instead of adding a new one. It would need to be changed in 2 other places it's currently used in. Chobby might also need changes to not display this under modoptions.