|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
|
CRASH still occurs, haven't figured it out yet but seems to happen when players are fighting with fists?
I haven't seen this crash before in the whole year my shard has been up, have not installed anything new in weeks, seems to happen randomly for no reason while players are fighting. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Server.Mobiles.PlayerMobile.OnBeforeDeath() at Server.Mobile.Kill() at Server.Mobile.Damage(Int32 amount, Mobile from) at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from) at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Boolean keepAlive) at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy) at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender) at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender) at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender) at Server.CombatTimer.OnTick() at Server.Timer.Slice() at Server.Core.Main(String[] args) Last edited by toddjumper; 03-11-2006 at 11:02 PM. |
|
|
|
|
|
#2 (permalink) |
|
Join Date: Mar 2006
Posts: 45
|
In order for people to help you the most, it would be best if you could paste the code for your PlayerMobile.OnBeforeDeath method.
EDIT: If you can run your server with -debug, and try to emulate this crash again, it will tell you the exact line number in which is causing the problem. Anyhow please post your code. |
|
|
|
|
|
#3 (permalink) |
|
Newbie
|
I am posting the code from the OnDeath method of my playermobile now. The crash occured again today, but this code has been in the server for months now, perhaps just because players have been picking up. Note that there are additions in this ondeath method which are custom SE, but the rest is pretty much distro.
Code:
public override void OnDeath( Container c )
{
base.OnDeath( c );
HueMod = -1;
NameMod = null;
SavagePaintExpiration = TimeSpan.Zero;
SetHairMods( -1, -1 );
PolymorphSpell.StopTimer( this );
IncognitoSpell.StopTimer( this );
DisguiseGump.StopTimer( this );
EndAction( typeof( PolymorphSpell ) );
EndAction( typeof( IncognitoSpell ) );
MeerMage.StopEffect( this, true );
SkillHandlers.StolenItem.ReturnOnDeath( this, c );
if ( m_PermaFlags.Count > 0 )
{
m_PermaFlags.Clear();
if ( c is Corpse )
((Corpse)c).Criminal = true;
if ( SkillHandlers.Stealing.ClassicMode )
Criminal = true;
}
/********************SeSpellAdditionMod***********************/
PlayerMobile opponent = FindMostRecentDamager( false ) as PlayerMobile;
if ( opponent != null && opponent.Player )
{
if ( opponent.HonorOpponent != null && opponent.HonorOpponent == this && HonorOpponent != null && HonorOpponent == opponent )
{
double points = (double) ( Fame/ 4000 );
if ( opponent.IsHonorPenalty )
points /= 2.0;
int p = (int)Math.Round(points);
bool gainedPath = false;
if ( VirtueHelper.Award( opponent, VirtueName.Honor, p, ref gainedPath ) )
{
if ( gainedPath )
opponent.SendLocalizedMessage( 1063226 ); // You have gained a path in Honor!
else
opponent.SendLocalizedMessage( 1063225 ); // You have gained in Honor.
}
}
}
/********************EndSeSpellAdditionMod***********************/
if ( this.Kills >= 5 && DateTime.Now >= m_NextJustAward )
{
Mobile m = FindMostRecentDamager( false );
if( m is BaseCreature )
m = ((BaseCreature)m).GetMaster();
if ( m != null && m.Player && m != this )
{
bool gainedPath = false;
int theirTotal = ComputeSkillTotal( m );
int ourTotal = ComputeSkillTotal( this );
int pointsToGain = 1 + ((theirTotal - ourTotal) / 50);
if ( pointsToGain < 1 )
pointsToGain = 1;
else if ( pointsToGain > 4 )
pointsToGain = 4;
if ( VirtueHelper.Award( m, VirtueName.Justice, pointsToGain, ref gainedPath ) )
{
if ( gainedPath )
m.SendLocalizedMessage( 1049367 ); // You have gained a path in Justice!
else
m.SendLocalizedMessage( 1049363 ); // You have gained in Justice.
m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
m.PlaySound( 0x1F7 );
m_NextJustAward = DateTime.Now + TimeSpan.FromMinutes( pointsToGain * 2 );
}
}
}
if ( m_InsuranceCost > 0 )
SendLocalizedMessage( 1060398, m_InsuranceCost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
if ( m_InsuranceAward is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m_InsuranceAward;
if ( pm.m_InsuranceBonus > 0 )
pm.SendLocalizedMessage( 1060397, pm.m_InsuranceBonus.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.
}
Mobile killer = this.FindMostRecentDamager( true );
if ( killer is BaseCreature )
{
BaseCreature bc = (BaseCreature)killer;
Mobile master = bc.GetMaster();
if( master != null )
killer = master;
}
if ( this.Young )
{
Point3D dest = GetYoungDeathDestination();
if ( dest != Point3D.Zero )
{
this.Location = dest;
Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( SendYoungDeathNotice ) );
}
}
Faction.HandleDeath( this, killer );
}
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|