Veilheim/Map/SharedMapSystem.cs
/// <summary>
///     Send queued exploration data to server
/// </summary>
Send queued exploration data to server
Send queued exploration data to server
private static void SendQueuedExploreData(On.Minimap.orig_UpdateExplore orig, Minimap self, float dt, Player player)
        {
            bool doPayload = self.m_exploreTimer + Time.deltaTime > self.m_exploreInterval;
            orig(self, dt, player);
            if (explorationQueue.Count >= 10 && doPayload)
            {
                Logger.LogDebug($"UpdateExplore - sending newly explored locations to server ({explorationQueue.Count})");
                var toSend = new List<int>();
                lock (explorationQueue)
                {
                    toSend.AddRange(explorationQueue.Distinct());
                    explorationQueue.Clear();
                }
                var queueData = new ZPackage();
                queueData.Write(toSend.Count);
                foreach (var data in toSend)
                {
                    queueData.Write(data);
                }
                ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), nameof(RPC_Veilheim_ReceiveExploration_OnExplore), queueData);
            }
        }
private static void SendQueuedExploreData ( On . Minimap . orig_UpdateExplore orig , Minimap self , float dt , Player player ) { bool doPayload = self . m_exploreTimer + Time . deltaTime > self . m_exploreInterval ; orig ( self , dt , player ) ; if ( explorationQueue . Count >= 10 && doPayload ) { Logger . LogDebug ( $" UpdateExplore - sending newly explored locations to server ( { explorationQueue . Count } ) " ) ; var toSend = new List < int > ( ) ; lock ( explorationQueue ) { toSend . AddRange ( explorationQueue . Distinct ( ) ) ; explorationQueue . Clear ( ) ; } var queueData = new ZPackage ( ) ; queueData . Write ( toSend . Count ) ; foreach ( var data in toSend ) { queueData . Write ( data ) ; } ZRoutedRpc . instance . InvokeRoutedRPC ( ZRoutedRpc . instance . GetServerPeerID ( ) , nameof ( RPC_Veilheim_ReceiveExploration_OnExplore ) , queueData ) ; } }
Send queued exploration data to server
Send queued exploration data to server
// disregard mini changes for now, lets build up some first // Invoke RPC on server and send data
orig
On.Minimap.orig_UpdateExplore
self
Minimap
dt
float
player
Player