LordFenris

Member
I have a question.
On our server based - to a large extent (but not only) on the last ServUO - in place of VvV we have implemented Factions together with Ethics (the server works in the Siege variant).
The Factions themselves and the rest of the fixes seem okay. Everything we've tested so far works in Factions, but we got a bug that resulted in a server crash when trying to cast a Recall / Gate / Sacred spell (via spellbook and when we click on spell scroll).
Below is a report, maybe some of you will want to take a look at the attached files and show us the direction in which we should look for the cause? Thank you in advance for your help.

Casting via Spellbook
Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Server.Spells.SpellHelper.CheckTravel(Mobile caster, Map map, Point3D loc, TravelCheckType type) in C:\ServerUO\UOMGGame\Scripts\Spells\Base\SpellHelper.cs:line 885
at Server.Spells.SpellHelper.CheckTravel(Mobile caster, TravelCheckType type) in C:\ServerUO\UOMGGame\Scripts\Spells\Base\SpellHelper.cs:line 798
at Server.Spells.Fourth.RecallSpell.CheckCast() in C:\ServerUO\UOMGGame\Scripts\Spells\Fourth\Recall.cs:line 135
at Server.Spells.Spell.Cast() in C:\ServerUO\UOMGGame\Scripts\Spells\Base\Spell.cs:line 737
at Server.Items.Spellbook.EventSink_CastSpellRequest(CastSpellRequestEventArgs e) in C:\ServerUO\UOMGGame\Scripts\Items\Equipment\Spellbooks\Spellbook.cs:line 1340
at Server.EventSink.InvokeCastSpellRequest(CastSpellRequestEventArgs e) in C:\ServerUO\UOMGGame\Server\EventSink.cs:line 2039
at Server.Network.PacketHandlers.CastSpell(NetState state, PacketReader pvSrc) in C:\ServerUO\UOMGGame\Server\Network\PacketHandlers.cs:line 1776
at Server.Network.PacketHandlers.ExtendedCommand(NetState state, PacketReader pvSrc) in C:\ServerUO\UOMGGame\Server\Network\PacketHandlers.cs:line 1749
at Server.Network.MessagePump.HandleReceive(NetState ns) in C:\ServerUO\UOMGGame\Server\Network\MessagePump.cs:line 340
at Server.Network.MessagePump.Slice() in C:\ServerUO\UOMGGame\Server\Network\MessagePump.cs:line 135
at Server.Core.Run() in C:\ServerUO\UOMGGame\Server\Main.cs:line 679

Casting via spellscroll
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Server.Spells.SpellHelper.CheckTravel(Mobile caster, Map map, Point3D loc, TravelCheckType type) in C:\ServerUO\UOMGGameTEST\Scripts\Spells\Base\SpellHelper.cs:line 885
at Server.Spells.SpellHelper.CheckTravel(Mobile caster, TravelCheckType type) in C:\ServerUO\UOMGGameTEST\Scripts\Spells\Base\SpellHelper.cs:line 798
at Server.Spells.Seventh.GateTravelSpell.CheckCast() in C:\ServerUO\UOMGGameTEST\Scripts\Spells\Seventh\GateTravel.cs:line 80
at Server.Spells.Spell.Cast() in C:\ServerUO\UOMGGameTEST\Scripts\Spells\Base\Spell.cs:line 737
at Server.Items.SpellScroll.OnDoubleClick(Mobile from) in C:\ServerUO\UOMGGameTEST\Scripts\Items\Consumables\SpellScrolls\SpellScroll.cs:line 92
at Server.Mobile.Use(Item item) in C:\ServerUO\UOMGGame\Server\Mobile.cs:line 4134
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc) in C:\ServerUO\UOMGGame\Server\Network\PacketHandlers.cs:line 1574
at Server.Network.MessagePump.HandleReceive(NetState ns) in C:\ServerUO\UOMGGame\Server\Network\MessagePump.cs:line 340
at Server.Network.MessagePump.Slice() in C:\ServerUO\UOMGGame\Server\Network\MessagePump.cs:line 135
at Server.Core.Run() in C:\ServerUO\UOMGGame\Server\Main.cs:line 679
Post automatically merged:

I would like to add that the crash occurs even before the spell invocation is pronounced over the character.
Post automatically merged:

Subject to be removed :) Coincidentally, I omitted Stronghold's travel conditions at spellhelper.cs in the mass of changed files After correction, the spells work :)
 

Attachments

  • Files.zip
    58.9 KB · Views: 3
Last edited:
It's because m_Rules has a length of 22 and m_Validators has a length of 23. In line 885, the same loop is used to check each element of both arrays at the same time, but that will only work if both arrays are the same length. By removing IsFactionStronghold, you made both the same length. You could have also added a column in m_Rules for IsFactionStronghold, thereby making both a length of 23. Either way would prevent the crash. If you want to restrict travel in the Stronghold, then you will want to add that instead of removing it from m_Validators.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back