Save map generation args in replays/saves instead of full map.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0d479e7c18
commit
fdb4ce4e0f
@@ -84,6 +84,7 @@ namespace OpenRA
|
||||
public MapClassification Class;
|
||||
public MapVisibility Visibility;
|
||||
public DateTime ModifiedDate;
|
||||
public MapGenerationArgs GenerationArgs;
|
||||
|
||||
public MiniYaml RuleDefinitions;
|
||||
public MiniYaml WeaponDefinitions;
|
||||
@@ -219,19 +220,6 @@ namespace OpenRA
|
||||
return new Map(modData, package);
|
||||
}
|
||||
|
||||
public string ToBase64String()
|
||||
{
|
||||
LoadPackage();
|
||||
if (package is not ZipFileLoader.ReadWriteZipFile p)
|
||||
{
|
||||
var map = new Map(modData, package);
|
||||
p = new ZipFileLoader.ReadWriteZipFile();
|
||||
map.Save(p);
|
||||
}
|
||||
|
||||
return p.ToBase64String();
|
||||
}
|
||||
|
||||
IReadOnlyPackage parentPackage;
|
||||
|
||||
volatile InnerData innerData;
|
||||
@@ -259,6 +247,8 @@ namespace OpenRA
|
||||
public ActorInfo PlayerActorInfo => innerData.PlayerActorInfo;
|
||||
public DateTime ModifiedDate => innerData.ModifiedDate;
|
||||
|
||||
public MapGenerationArgs GenerationArgs => innerData.GenerationArgs;
|
||||
|
||||
public long DownloadBytes { get; private set; }
|
||||
public int DownloadPercentage { get; private set; }
|
||||
|
||||
@@ -482,6 +472,7 @@ namespace OpenRA
|
||||
newData.Status = MapStatus.Generating;
|
||||
newData.Title = args.Title;
|
||||
newData.Author = args.Author;
|
||||
newData.GenerationArgs = args;
|
||||
}
|
||||
else
|
||||
newData.Status = MapStatus.Unavailable;
|
||||
|
||||
Reference in New Issue
Block a user