Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/message_box/OutOfSyncNetwork.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
class OutOfSyncNetwork extends SessionMessageBox | |||||
{ | |||||
constructor() | |||||
{ | |||||
super(); | |||||
registerOutOfSyncHandler(this.onNetworkOutOfSync.bind(this)); | |||||
} | |||||
/** | |||||
* The message object is constructed in CNetClientTurnManager::OnSyncError. | |||||
*/ | |||||
onNetworkOutOfSync(msg) | |||||
{ | |||||
let txt = [ | |||||
sprintf(translate("Out-Of-Sync error on turn %(turn)s."), { | |||||
"turn": msg.turn | |||||
}), | |||||
sprintf(translateWithContext("Out-Of-Sync", "Players: %(players)s"), { | |||||
"players": msg.players.join(translateWithContext("Separator for a list of players", ", ")) | |||||
}), | |||||
msg.hash == msg.expectedHash ? | |||||
translateWithContext("Out-Of-Sync", "Your game state is identical to the hosts game state.") : | |||||
translateWithContext("Out-Of-Sync", "Your game state differs from the hosts game state."), | |||||
"" | |||||
]; | |||||
if (msg.turn > 1 && g_GameAttributes.settings.PlayerData.some(pData => pData && pData.AI)) | |||||
txt.push(translateWithContext("Out-Of-Sync", "Rejoining Multiplayer games with AIs is not supported yet!")); | |||||
else | |||||
txt.push( | |||||
translateWithContext("Out-Of-Sync", "Ensure all players use the same mods."), | |||||
translateWithContext("Out-Of-Sync", 'Click on "Report a Bug" in the main menu to help fix this.'), | |||||
sprintf(translateWithContext("Out-Of-Sync", "Replay saved to %(filepath)s"), { | |||||
Freagarach: `.`? | |||||
elexisAuthorUnsubmitted Done Inline ActionsPerhaps the period is more correct. In this case the string ends with a filepath, so the user should not assume that period is part of the filepath. elexis: Perhaps the period is more correct. In this case the string ends with a filepath, so the user… | |||||
"filepath": escapeText(msg.path_replay) | |||||
}), | |||||
sprintf(translateWithContext("Out-Of-Sync", "Dumping current state to %(filepath)s"), { | |||||
FreagarachUnsubmitted Not Done Inline Actions.? Freagarach: `.`? | |||||
"filepath": escapeText(msg.path_oos_dump) | |||||
})); | |||||
this.Caption = txt.join("\n"); | |||||
this.display(); | |||||
} | |||||
} | |||||
OutOfSyncNetwork.prototype.Width = 600; | |||||
OutOfSyncNetwork.prototype.Height = 280; | |||||
OutOfSyncNetwork.prototype.Title = translate("Out of Sync"); |
Wildfire Games · Phabricator
.?