Description
A .sav
file is an OLE document that can be considered as a "dictionary". For example, the OLE key Scenario Description
refers to a UTF-16 LE string corresponds to the title of a saved game file.
I am currently working on a feature to let xna-cncnet-client
support loading custom missions. In order to support this feature, xna-cncnet-client
must have a way to identify which mission corresponds to a saved game file, along with other restrictions to prevent user loads a different mission (to prevent potential conflicts; as supplemental files are copied by the client)
Thus, I request an addtional data field, described as below.
CustomMissionID
This value will be specified via the spawn.ini
file, given when the spawner is launchered.
; Generated by DTA Client
[Settings]
Scenario=spawnmap.ini
CustomMissionID=12345678
IsSinglePlayer=Yes
CustomMissionID
is an int32
integer. If this value is omitted, consider it 0.
In a .sav
file, the OLE key CustomMissionID
should corresponds with 4 byte-values that contains such an int32
integer in little-endian order. The number is untouched, saved as-is.
Rename of missionmd.ini file
When CustomMissionID
is specified and not 0, the access of missionmd.ini
shall be redirct to spawn.ini
file. This enables the client automatically generates the corresponding mission info without interrupting the game.
Full example of a spawn.ini
file:
; Generated by CnCNet Client
[Settings]
Scenario=Maps\CustomMissions\vnsepa.map
GameSpeed=1
Ra2Mode=False
CustomLoadScreen=Resources/l600s02.pcx
IsSinglePlayer=Yes
SidebarHack=False
Side=0
BuildOffAlly=True
DifficultyModeHuman=0
DifficultyModeComputer=2
CustomMissionID=-715243874
[Maps\CustomMissions\vnsepa.map]
Briefing=Brief:AREDDAWN
ShowBriefing=true
UIName=MAP:TITREDDAWN
LSLoadMessage=LoadMsg:AREDDAWN
LSLoadBriefing=LoadBrief:AREDDAWN
LS640BriefLocX=20
LS640BriefLocY=20
LS800BriefLocX=20
LS800BriefLocY=20
LS640BkgdName=custommission.shp
LS800BkgdName=custommission.shp
LS800BkgdPal=custommission.pal
LoadScreenText.Color=LightGrey
Saved games list filter
When CustomMissionID
is specified and it is not 0, only saved game files with the same CustomMissionID
shall be displayed.
Otherwise, when CustomMissionID
is not specified or is 0, only saved game files without CustomMissionID
or with a zero-valued CustomMissionID
shall be displayed.
Reading CustomMissionID from saved game file
When loading a saved game, the spawner loads CustomMissionID
based on the OLE key CustomMissionID
in a .sav file. CustomMissionID
will not be specified in spawn.ini
in this case.