Veilheim/Map/SharedMapSystem.cs
/// <summary>
///     Before ZNet destroy, save data to file on server
/// </summary>
Before ZNet destroy, save data to file on server
Before ZNet destroy save data to file on server
private static void SaveExplorationData(On.ZNet.orig_Shutdown orig, ZNet self)
        {
            if (ZNet.instance.IsServerInstance() && ConfigUtil.Get<bool>("MapServer", "shareMapProgression"))
            {
                Logger.LogInfo($"Saving shared exploration data");
                var mapData = new ZPackage(CreateExplorationData().ToArray());
                mapData.WriteToFile(Path.Combine(ConfigUtil.GetConfigPath(), ZNet.instance.GetWorldUID().ToString(), "Explorationdata.bin"));
            }
            orig(self);
        }
private static void SaveExplorationData ( On . ZNet . orig_Shutdown orig , ZNet self ) { if ( ZNet . instance . IsServerInstance ( ) && ConfigUtil . Get < bool > ( " " , " " ) ) { Logger . LogInfo ( $" Saving shared exploration data " ) ; var mapData = new ZPackage ( CreateExplorationData ( ) . ToArray ( ) ) ; mapData . WriteToFile ( Path . Combine ( ConfigUtil . GetConfigPath ( ) , ZNet . instance . GetWorldUID ( ) . ToString ( ) , " " ) ) ; } orig ( self ) ; }
Before ZNet destroy, save data to file on server
Before ZNet destroy save data to file on server
// Save exploration data only on the server
orig
On.ZNet.orig_Shutdown
self
ZNet