ServUO Version
Publish 58
Ultima Expansion
Time Of Legends
help to organize the loading of the map, some areas of the previous map are not removed and a small area from the player is updated with a large zoom, a huge part of the old map is visible


screenshot_2024-03-25_06-37-46.png

I didn’t load part of the map at all

screenshot_2024-03-25_07-07-12.png


sorry for the flood
I solved the problem by using a second client that is not the one the server is using
 
Last edited:
post update again
there is still a problem
for some reason, as the first administrator created on the server, I can be on a new map, but when I try to move any other player or administrator using the same client there, I get a crash


crash:
Exception:
System.IndexOutOfRangeException: The index was out of array bounds.
   at Server.Mobiles.XmlSpawner.GlobalSectorTimer.OnTick() at \Scripts\Services\XmlSpawner\XmlSpawner Core\XmlSpawner2.cs:line 11388
   in Server.Timer.Slice() at \Server\Timer.cs:line 410
   at Server.Core.Main(String[] args) at \Server\Main.cs:line 729

XmlSpawner2:
        private class GlobalSectorTimer : Timer
        {

            public GlobalSectorTimer(TimeSpan delay)
                : base(delay, delay)
            {
                Priority = TimerPriority.OneSecond;
            }

            protected override void OnTick()
            {
                // check the sectors

                // check all active players
                if (NetState.Instances != null)   //line 11388
                {
                    foreach (NetState state in NetState.Instances)
                    {
                        Mobile m = state.Mobile;

                        if (m != null && (m.AccessLevel <= SmartSpawnAccessLevel || !m.Hidden))
                        {
                            // activate any spawner in the sector they are in
                            if (m.Map != null && m.Map != Map.Internal)
                            {
                                Sector s = m.Map.GetSector(m.Location);

                                if (s != null && GlobalSectorTable[m.Map.MapID] != null)
                                {

                                    List<XmlSpawner> spawnerlist;// = GlobalSectorTable[m.Map.MapID][s];
                                    if (GlobalSectorTable[m.Map.MapID].TryGetValue(s, out spawnerlist) && spawnerlist != null)
                                    {
                                        foreach (XmlSpawner spawner in spawnerlist)
                                        {

                                            if (spawner != null && !spawner.Deleted && spawner.Running && spawner.SmartSpawning && spawner.IsInactivated)
                                            {
                                                spawner.SmartRespawn();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

Timer.cs:
        public static void Slice()
        {
            lock (m_Queue)
            {
                m_QueueCountAtSlice = m_Queue.Count;

                var index = 0;

                while (index < m_BreakCount && m_Queue.Count != 0)
                {
                    var t = m_Queue.Dequeue();
                    var prof = t.GetProfile();

                    if (prof != null)
                    {
                        prof.Start();
                    }

                    t.OnTick();
                    t.m_Queued = false;  //line 410
                    ++index;

                    if (prof != null)
                    {
                        prof.Finish();
                    }
                }
            }
        }

        public Timer(TimeSpan delay)
            : this(delay, TimeSpan.Zero, 1)
        { }

        public Timer(TimeSpan delay, TimeSpan interval)
            : this(delay, interval, 0)
        { }

        public virtual bool DefRegCreation { get { return true; } }

        public void RegCreation()
        {
            var prof = GetProfile();

            if (prof != null)
            {
                prof.Created++;
            }
        }

        public Timer(TimeSpan delay, TimeSpan interval, int count)
        {
            _ToString = GetType().FullName;

            m_Delay = (long)delay.TotalMilliseconds;
            m_Interval = (long)interval.TotalMilliseconds;
            m_Count = count;

            if (!m_PrioritySet)
            {
                m_Priority = ComputePriority(count == 1 ? delay : interval);
                m_PrioritySet = true;
            }

            if (DefRegCreation)
            {
                RegCreation();
            }
        }

Main.cs:
            ScriptCompiler.Invoke("Configure");

            Region.Load();
            World.Load();

            ScriptCompiler.Invoke("Initialize");

            MessagePump messagePump = MessagePump = new MessagePump();

            _TimerThread.Start();

            foreach (Map m in Map.AllMaps)
            {
                m.Tiles.Force();
            }

            NetState.Initialize();

            EventSink.InvokeServerStarted();

            try
            {
                long now, last = TickCount;

                const int sampleInterval = 100;
                const float ticksPerSecond = 1000.0f * sampleInterval;

                long sample = 0;

                while (!Closing)
                {
                    _Signal.WaitOne();

                    Mobile.ProcessDeltaQueue();
                    Item.ProcessDeltaQueue();

                    Timer.Slice();
                    messagePump.Slice(); //line 729

                    NetState.FlushAll();
                    NetState.ProcessDisposedQueue();

                    if (Slice != null)
                    {
                        Slice();
                    }

                    if (sample++ % sampleInterval != 0)
                    {
                        continue;
                    }

                    now = TickCount;
                    _CyclesPerSecond[_CycleIndex++ % _CyclesPerSecond.Length] = ticksPerSecond / (now - last);
                    last = now;
                }
            }
            catch (Exception e)
            {
                CurrentDomain_UnhandledException(null, new UnhandledExceptionEventArgs(e, true));
            }
        }
 
Last edited:
Back