|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
|
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) |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Jan 2006
Location: Kenaz:The Rebirth...You'll find it on ConnectUO ;)
Posts: 1,637
|
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: |
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Posts: 1,126
|
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///////////////
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///////////////
|
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
Join Date: Jan 2006
Location: Canada
Age: 21
Posts: 230
|
Code:
for (int i = 0; i < gumps.Count; ++i)
{
Gump gump = gumps[i];
if (gumps[i].GetType() == typeof(ResurrectGump))
NetState.RemoveGump(i);
}
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. |
|
|
|
|
|
#6 (permalink) |
|
Forum Novice
|
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.
|
|
|
|
|
|
#7 (permalink) |
|
Newbie
|
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|