Full Version : Crash on [addtopack
xmlspawner >>Scripting Support >>Crash on [addtopack
<< Prev | Next >>
Erica- 07-01-2006
Hmm weird today i did a command [addtopack on some stacked demon bones and my server crashed heres the crah report

CODE
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Server.Commands.Add.Invoke(Mobile from, Point3D start, Point3D end, String[] args, ArrayList packs) at Server.Commands.Generic.AddToPackCommand.ExecuteList(CommandEventArgs e, ArrayList list)
at Server.Commands.Generic.BaseCommandImplementor.RunCommand(Mobile from, Object obj, BaseCommand command, String[] args)
at Server.Commands.Generic.SingleCommandImplementor.OnTarget(Mobile from, Object targeted, Object state)
at Server.Mobile.SimpleStateTarget.OnTarget(Mobile from, Object targeted)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

any idea how that command or what script needs fixing thanks.
ArteGordon- 07-01-2006
was this with the latest svn? I had heard that the [add command was causing problems like that. Not sure if they fixed it yet.
Erica- 07-01-2006
Yes with latest and it also does it on rc1 2.0 but i use svn 63 so not sure if this can even be fixed i would like to fix it if possible.
ArteGordon- 07-01-2006
this would be in the scripts/commands/add.cs
It looks like they havent done anything about that file between RC1 and rev 64
Erica- 07-01-2006
Is there anyway i can get this fixed cause im sure gms use it as well and i dont wanna be at work and come home server has crashed ect ect lol.
ArteGordon- 07-01-2006
what was the exact command line that was executed?
Erica- 07-01-2006
all i said was [addtopack and i target it a demon pile bones and bang server crashed.unless you need more information if gotta do it on debug mode tell me how to do debug mode but thats what i said [addtopack target a pile of demon bones also tryed just now with bandages crashed again same crash.
ArteGordon- 07-01-2006
ok, I was able to reproduce that. I'll take a look.
Erica- 07-01-2006
Thamks hopefully you will come with a fix hehe .
ArteGordon- 07-01-2006
in add.cs around line 28, make this change

QUOTE
public static void Invoke( Mobile from, Point3D start, Point3D end, string[] args, ArrayList packs ) { if (args == null || args.Length < 1) return; StringBuilder sb = new StringBuilder();

Erica- 07-01-2006
whats the scripts name is it add.cs ? nvm saw you said add lol.
ArteGordon- 07-01-2006
scripts/commands/add.cs
Erica- 07-01-2006
Oh btw ArteGordon can you tell me what exactly i write in my shortcut exe. to leave it in debug mode not sure how if you can explain thanks.
ArteGordon- 07-01-2006

QUOTE (Erica @ July 01, 2006 10:14 pm)
Oh btw ArteGordon can you tell me what exactly i write in my shortcut exe. to leave it in debug mode not sure how if you can explain thanks.

open up the properties of the shortcut, and then in the Target: field, enter the path to the executable with the -debug option after it like
"C:\Program Files\Games\RunUO 2.0\RunUO.exe" -debug
Erica- 07-01-2006
Btw i did the fix on add.cs for no more crash and works but before i did that fix i wanted to create the crash again in debug mode and heres what i got

CODE
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Server.Commands.Add.Invoke(Mobile from, Point3D start, Point3D end, String[] args, ArrayList packs) in c:\Program Files\RunUO-2.0-RC1\Scripts\Commands\Add.cs:line 46
at Server.Commands.Generic.AddToPackCommand.ExecuteList(CommandEventArgs e, ArrayList list) in c:\Program Files\RunUO-2.0-RC1\Scripts\Commands\Generic\Commands\Commands.cs:line 386
at Server.Commands.Generic.BaseCommandImplementor.RunCommand(Mobile from, Object obj, BaseCommand command, String[] args) in c:\Program Files\RunUO-2.0-RC1\Scripts\Commands\Generic\Implementors\BaseCommandImplementor.cs:line 254
at Server.Commands.Generic.SingleCommandImplementor.OnTarget(Mobile from, Object targeted, Object state) in c:\Program Files\RunUO-2.0-RC1\Scripts\Commands\Generic\Implementors\SingleCommandImplementor.cs:line 91
at Server.Mobile.SimpleStateTarget.OnTarget(Mobile from, Object targeted)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

not sure if thats what you did as well to get add.cs script fixed but seems that caused crash in the commands some where.