The International Simutrans Forum

 

Author Topic: [patch] bugfix for saving in network mode  (Read 2761 times)

0 Members and 1 Guest are viewing this topic.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
[patch] bugfix for saving in network mode
« on: August 01, 2010, 01:54:59 PM »
The savegame-frame calls karte_t::reset_timer(), which resets last_step_ticks. This leads to loss of synchronisation.

The patch simply checks whether we are in step mode FIX_RATIO, and does not reset last_step_ticks then.

Any comments appreciated, as I do not know other implications of this patch. Imho, it should not break that much, since this variable is reset upon loading/creating new world anyway.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: [patch] bugfix for saving in network mode
« Reply #1 on: August 01, 2010, 06:13:18 PM »
Why is this a problem? This is only called after saving locally; but locally saving a network game will loose synchronisation anyhow, since saving will reset several variables. Thus network games must not do autosave. (But they autosave anyhow anytime somebody joins a game.)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4564
  • Languages: EN, DE, AT
Re: [patch] bugfix for saving in network mode
« Reply #2 on: August 01, 2010, 07:31:47 PM »
This was meant for saving locally. Are there many variables resetted upon saving, or just a few?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: [patch] bugfix for saving in network mode
« Reply #3 on: August 01, 2010, 08:32:02 PM »
I think lots of; too many to investagte them all. This is actually the only reason, why every client has to locaclly save and reload when a new player joins.