save/load environments to/from oars

This commit is contained in:
UbitUmarov
2020-06-22 15:46:39 +01:00
parent 7b77609537
commit 8fe2cd6c46
13 changed files with 146 additions and 36 deletions

View File

@@ -484,6 +484,16 @@ namespace OpenSim.Framework
sunlight_color = otmp;
Name = name;
}
public void GatherAssets(Dictionary<UUID, sbyte> uuids)
{
Util.AddToGatheredIds(uuids, bloom_id, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, cloud_id, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, halo_id, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, moon_id, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, rainbow_id, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, sun_id, (sbyte)AssetType.Texture);
}
}
public class WaterData
@@ -599,6 +609,12 @@ namespace OpenSim.Framework
return map;
}
public void GatherAssets(Dictionary<UUID, sbyte> uuids)
{
Util.AddToGatheredIds(uuids, normalMap, (sbyte)AssetType.Texture);
Util.AddToGatheredIds(uuids, transpTexture, (sbyte)AssetType.Texture);
}
}
public class DayCycle
@@ -889,6 +905,18 @@ namespace OpenSim.Framework
return cycle;
}
public void GatherAssets(Dictionary<UUID, sbyte> uuids)
{
foreach (WaterData wd in waterframes.Values)
{
wd.GatherAssets(uuids);
}
foreach (SkyData sd in skyframes.Values)
{
sd.GatherAssets(uuids);
}
}
}
public class ViewerEnvironment
@@ -1216,6 +1244,35 @@ namespace OpenSim.Framework
return env;
}
public static ViewerEnvironment FromOSDString(string s)
{
try
{
OSD eosd = OSDParser.Deserialize(s);
ViewerEnvironment VEnv = new ViewerEnvironment();
VEnv.FromOSD(eosd);
return VEnv;
}
catch
{
}
return null;
}
public static string ToOSDString(ViewerEnvironment VEnv, bool xml = false)
{
try
{
OSD eosd= VEnv.ToOSD();
if(xml)
return OSDParser.SerializeLLSDXmlString(eosd);
else
return OSDParser.SerializeLLSDNotationFull(eosd);
}
catch {}
return String.Empty;
}
public ViewerEnvironment Clone()
{
// im lazy need to proper clone later
@@ -1398,5 +1455,11 @@ namespace OpenSim.Framework
return true;
}
*/
public void GatherAssets(Dictionary<UUID, sbyte> uuids)
{
if (Cycle != null)
Cycle.GatherAssets(uuids);
}
}
}