Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 04-16-2006, 10:36 AM   #1 (permalink)
Newbie
 
Join Date: Nov 2004
Location: York Haven, PA
Age: 32
Posts: 70
Send a message via ICQ to toddjumper Send a message via AIM to toddjumper Send a message via MSN to toddjumper
Default Need Help with Server Crash / Player On Death

This is a crash that has been occuring on my main production server. It just started happening recently. I finally was able to replicate the crash running in -debug mode. I will include the playermobile.cs, aos.cs and baseweapon.cs in a zip, since these 3 files are mentioned in the debug log. Note that these files have been customized. Any help is appreciated.

I have a feeling it may be my MonkFists script, since it's only crashing when players are using "Fists" to fight as a base weapon.

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.PlayerMobile.OnBeforeDeath() in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\PlayerMobile.cs:line 1745
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from)
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\PlayerMobile.cs:line 2243
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Boolean keepAlive) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\AOS.cs:line 175
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\AOS.cs:line 74
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\BaseWeapon.cs:line 2174
at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Customs\Edited Distro\BaseWeapon.cs:line 1068
at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender) in c:\AvatarsReturnRUNUO\RunUO 1.0\Scripts\Items\Weapons\Fists.cs:line 164
at Server.CombatTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
Attached Files
File Type: zip AOS.zip (51.8 KB, 5 views)
toddjumper is offline   Reply With Quote
Old 04-17-2006, 12:04 AM   #2 (permalink)
Forum Expert
 
DreamCatcher's Avatar
 
Join Date: Jan 2006
Location: Kenaz:The Rebirth...You'll find it on ConnectUO ;)
Posts: 1,637
Default

Well if its only crashing when they use that, then you may have to remove that script. I was on a shard that when a certain weapon was used it crashed everytime....They had to get rid of that weapon completely....
__________________
**Fun things to do**
Put decaf in the coffee maker for 3 weeks. Once everyone has gotten over their caffeine addictions, switch to espresso.:D :eek:
DreamCatcher is offline   Reply With Quote
Old 04-17-2006, 12:20 AM   #3 (permalink)
Forum Expert
 
Join Date: Oct 2002
Posts: 1,126
Default

It's a script error.

Specifically, take a look at the following in PlayerMobile.cs:
Code:
////////////////////////Added to remove resurection gumps before death if any///////////////
            GumpCollection gumps = NetState.Gumps;
            
            for (int i = 0; i < gumps.Count; ++i)
                {
                Gump gump = gumps[i];

                if (gumps[i].GetType() == typeof(ResurrectGump))
                    NetState.RemoveGump(i);
            
                }
////////////////////////Added to remove resurection gumps before death if any///////////////
Now, the crash log reports it was at line 1745 of PlayerMobile.cs, which is the GumpCollection gumps etc. line in the above.
It also specifies that it crashed due to a null reference exception. I'm guessing there is no NetState - ie. the player is disconnected.

Let's change the code to check for this:
Code:
////////////////////////Added to remove resurection gumps before death if any///////////////
            if ( NetState != null )
            {
                 GumpCollection gumps = NetState.Gumps;
            
                 for (int i = 0; i < gumps.Count; ++i)
                     {
                     Gump gump = gumps[i];

                     if (gumps[i].GetType() == typeof(ResurrectGump))
                         NetState.RemoveGump(i);  
                }
            }
////////////////////////Added to remove resurection gumps before death if any///////////////
Aenima is offline   Reply With Quote
Old 04-17-2006, 12:52 AM   #4 (permalink)
Forum Novice
 
RunUO2874's Avatar
 
Join Date: Jan 2006
Location: Canada
Age: 21
Posts: 230
Default

Code:
                 for (int i = 0; i < gumps.Count; ++i)
                     {
                     Gump gump = gumps[i];

                     if (gumps[i].GetType() == typeof(ResurrectGump))
                         NetState.RemoveGump(i);  
                }
That loop strikes me as odd...

If you remove the element at n, the elements at n + 1 ... gumps.Count will shift left one, right? So then n + 1 == n, so you effectively skip every gump entry after an entry that you remove. Probably not the cause of the crash, but worth looking into
__________________
Fear anonymity.

Last edited by RunUO2874; 04-17-2006 at 12:55 AM.
RunUO2874 is offline   Reply With Quote
Old 04-17-2006, 02:24 AM   #5 (permalink)
Forum Expert
 
Join Date: Oct 2002
Posts: 1,126
Default

Good find, I didn't look at it.

Thinking about it now, you may as well get rid of the whole thing and just call CloseGump( typeof( ResurrectGump ) ).
Aenima is offline   Reply With Quote
Old 04-19-2006, 07:56 PM   #6 (permalink)
Forum Novice
 
Join Date: Oct 2003
Location: Istanbul
Age: 23
Posts: 103
Send a message via MSN to Gordack
Default

Just change these in the Playermobile.cs
It wont give any crash.

Code:
public override bool Move( Direction d )
		{
			NetState ns = this.NetState;

			if ( ns != null )
			{
				GumpCollection gumps = ns.Gumps;

				for ( int i = 0; i < gumps.Count; ++i )
				{
					if ( gumps[i] is ResurrectGump )
					{
						//if ( Alive )
						{
							CloseGump( typeof( ResurrectGump ) );
						}
					          /*else
						{
							SendLocalizedMessage( 500111 ); // You are frozen and cannot move.
							return false;
						}*/
					}
				}
			}
__________________
If you really want something in this life, you have to work for it. Now, quiet! they're about to announce the lottery numbers.
Gordack is offline   Reply With Quote
Old 04-22-2006, 04:15 PM   #7 (permalink)
Newbie
 
Join Date: Nov 2004
Location: York Haven, PA
Age: 32
Posts: 70
Send a message via ICQ to toddjumper Send a message via AIM to toddjumper Send a message via MSN to toddjumper
Default

It was not my monk gloves, after removing them we got the same crashes again, and still saw "fists" in there. I will implement this playermobile fix and see if that's what it was, I believe I edited the playermobile in that area before to fix another problem with players "freezing" on death and having to log in and out to fix, was happening on almost every RunUO shard at the time actually.
toddjumper is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5