Player 'Seriak'

General support forum. If you require assistance and your problem doesnt fall in any of the other categories, this is the forum for you!

Moderator: Team Members

Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Player 'Seriak'

Post by John Adams » Mon Oct 31, 2011 8:23 am

I don't know who this is, so hopefully they read the forum.

Please keep doing whatever it is you are doing to cause deadlocks and exceptions on EQ2TC. I almost have this bug identified, but unfortunately, it seems to only happen to you. I think it is logwrite() related, so I keep trying different things to corner it.

Thanks for your patience.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Player 'Seriak'

Post by John Adams » Mon Oct 31, 2011 8:39 am

Scatman,

This is one of the log entries that was causing an exception and crashing the entire world:

Code: Select all

LogWrite(NPC__DEBUG, "NPC", "'%s' engaged in combat with '%s'", this->GetName(), GetTarget()->GetName());
When I mouse over GetTarget()->GetName(), there was no value on the GetName(), assuming there should be.

So I tried changing the parameter:

Code: Select all

LogWrite(NPC__DEBUG, "NPC", "'%s' engaged in combat with '%s'", this->GetName(), ( GetTarget()->GetName() ) ? GetTarget()->GetName() : "Unknown" );
Tried testing if it was valid, and if no value, print "Unknown" but that seemed to cause the zone to crash, and then a deadlock probably coming out of a spell cast.
21:03:57 D LUA: Found LUA Spell Script: 'Spells/Fighter/Crusader/Shadowknight/CondemningSmite.lua'
21:03:57 D Combat: DamageType: Disease (8), Amt: 1.00
21:03:57 D Combat: Setting LockedNoLoot to 3 for 'a wilderbear cub'
21:03:57 D Combat: Setting InCombat 'True' for 'a wilderbear cub'
21:03:57 E Zone: Exception while running 'OutpostOverlord'
21:03:57 D Guilds: Guild::GetGuildMember: 71
21:03:57 D Guilds: Sent guild member to a client.
21:03:57 D Guilds: Guild Member logged out.
21:03:57 I Zone: Scheduling client 'Seriak' for removal.
21:03:57 D Player: Toggling Character OFFLINE!
21:04:12 D World: Removing connection...
21:04:29 E Mutex: Possible deadlock attempt by 'SpellProcess::MSpellProcess'!
21:04:29 I Zone: Initiating zone shutdown of 'OutpostOverlord'
21:04:33 I Zone: Completed zone shutdown of 'OutpostOverlord'
So the question is, how can I "test" that a value is valid before attempting to shove it into a log entry? Test it first, set another var, and pass that? I can't do it in-line?


The InCombat() call is where the offending logger is in NPC.cpp.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Player 'Seriak'

Post by Scatman » Mon Oct 31, 2011 5:43 pm

Make sure that GetTarget() is not null instead of GetTarget()->GetName(). A spawn will always have a name, but a spawn may not necessarily always have a target. When a NPC does not have a target, GetTarget() will return null.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Player 'Seriak'

Post by John Adams » Tue Nov 01, 2011 6:44 am

That makes sense, but is kinda odd. How would the code be senting NPC '%s' into combat with '%s' if the NPC doesn't have the player (or other NPC) targeted? Is this a bug, or the fact this InCombat() check is done before targeting takes place (ie., multiple thread business)?

Thanks, Scatto! So just check the GetTarget() not the GetName(). I'll give that a try.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Player 'Seriak'

Post by Scatman » Tue Nov 01, 2011 2:54 pm

InCombat() just sets whether or not the player is in combat (plus some other stuff like scripts and visual icons on the client). So there is always a possibility the NPC is not in combat before or after the NPC acquires a target. I'm sure there's cases where a NPC can be put into combat without even having a target too.

talinorcoldwind
Posts: 9
Joined: Mon Oct 17, 2011 6:45 pm

Re: Player 'Seriak'

Post by talinorcoldwind » Tue Nov 01, 2011 5:57 pm

Np I will keep logging in and playing all I am doing is playing not doing anything special. I am still having problems with my quest jurnal though it wont open.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests