Veilheim/Map/SharedMapSystem.cs
/// <summary>
///     On server, load saved data on minimap awake
/// </summary>
On server, load saved data on minimap awake
On server load saved data on minimap awake
private static void LoadExplorationData(On.Minimap.orig_Awake orig, Minimap self)
        {
            orig(self);
            if (ConfigUtil.Get<bool>("MapServer", "shareMapProgression"))
            {
                if (ZNet.instance.IsServerInstance())
                {
                    Minimap.instance.m_explored = new bool[Minimap.instance.m_textureSize * Minimap.instance.m_textureSize];
                    if (File.Exists(Path.Combine(ConfigUtil.GetConfigPath(), ZNet.instance.GetWorldUID().ToString(), "Explorationdata.bin")))
                    {
                        var mapData = ZPackageExtension.ReadFromFile(Path.Combine(ConfigUtil.GetConfigPath(), ZNet.instance.GetWorldUID().ToString(),
                            "Explorationdata.bin"));
                        ApplyMapData(mapData);
                    }
                    else
                    {
                        for (var i = 0; i < Minimap.instance.m_explored.Length; i++)
                        {
                            Minimap.instance.m_explored[i] = false;
                        }
                    }
                }
            }
        }
private static void LoadExplorationData ( On . Minimap . orig_Awake orig , Minimap self ) { orig ( self ) ; if ( ConfigUtil . Get < bool > ( " " , " " ) ) { if ( ZNet . instance . IsServerInstance ( ) ) { Minimap . instance . m_explored = new bool [ Minimap . instance . m_textureSize * Minimap . instance . m_textureSize ] ; if ( File . Exists ( Path . Combine ( ConfigUtil . GetConfigPath ( ) , ZNet . instance . GetWorldUID ( ) . ToString ( ) , " " ) ) ) { var mapData = ZPackageExtension . ReadFromFile ( Path . Combine ( ConfigUtil . GetConfigPath ( ) , ZNet . instance . GetWorldUID ( ) . ToString ( ) , " " ) ) ; ApplyMapData ( mapData ) ; } else { for ( var i = 0 ; i < Minimap . instance . m_explored . Length ; i ++ ) { Minimap . instance . m_explored [ i ] = false ; } } } } }
On server, load saved data on minimap awake
On server load saved data on minimap awake
orig
On.Minimap.orig_Awake
self
Minimap