Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Multiplayer campaigns: clients never get campaign-persistent variable values

Aperta
#7,891 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, lua

Direzione di ricerca

Start at send_variable_update_packet and the Campaign.persistent_variables mission-loading path, then trace multi_campaign_send_start during mission startup. Reproduce with two missions whose save-on-mission-progress variable changes from 0 to 7 and is read through mn.SEXPVariables["pv"].Value in mission 2. Done means every client receives the server’s carried persistent-variable values before client-side mission content is evaluated.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

In a multiplayer campaign, players other than the server never get the values of campaign-persistent ("save on mission progress") variables. The server starts each mission with the carried values, but every client starts with the defaults from the mission file. Anything the server evaluates is fine; anything a client evaluates on its own, like briefing text or messages that show a variable, or a client-side script, sees the wrong value.

Each client parses the mission itself and fills in persistent variables from its own Campaign.persistent_variables, which only the server ever updates. Nothing sends the carried values over afterwards: send_variable_update_packet only goes out when a variable is modified, and only for network variables.

Steps to reproduce

  1. Make a multiplayer coop campaign of two missions that both declare a number variable pv as save-on-mission-progress, default 0.
  2. In mission 1, set pv to 7 (an event is fine), then end the mission.
  3. Host it on a standalone server with two players and continue to mission 2.
  4. In mission 2's briefing, read pv on a player's machine (for example mn.SEXPVariables["pv"].Value in Lua), and compare it with the server's value (for example an event that sets a ship's hull from pv, which every player can see).

Master at 12a36dc1a, Linux Debug build, retail data: the server starts mission 2 with pv = 7, while the player's own copy reads 0.

Expected vs. actual behavior

Expected: every player's copy of a campaign-persistent variable matches the server's at the start of each mission.

Actual: only the server has the carried value; every other player has the mission file's default.

Proposed fixes

Ranked by simplicity, then maintainability, then thoroughness.

  1. After the server loads a campaign mission, send a variable update for each persistent variable whose value differs from the default. Reuses the existing update packet; it needs to go out for persistent variables, not only network ones.
  2. Send the campaign's persistent variables and containers to clients with the rest of the campaign data (alongside multi_campaign_send_start), so each client's own mission parse fills them in the same way the server's does.
  3. Treat the server as the source of truth for all variable and container state at mission start and sync it in full, which would also cover containers and any other place a client and server can drift.

Found while working on #4989, which makes player-hosted games carry these values on the server too, so this gap now shows up there as well.

Lingua principale
C++
Stelle
488
Fork
184
Merge medio
2g 9h
PR unite (30g)
40

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.