[FIXED]No xp on official server

Old bugs stored here for reference.
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

[FIXED]No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 12:18 am

Kinglykrab noticed this and I can confirm it, you get no xp for any kills on the official server, checked the DB server and it works ok there so just an issue with the public server.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: No xp on official server

Post by thefoof » Sat Aug 17, 2013 1:47 am

XP modifier is set to 0 for frostfang on EQ2TC, it will need to be changed before xp can be gained, I tried changing it myself but don't have permission on that table so John will have to do it.

EDIT: Okay I just tested this on my local server with xp mod at 0 for the zone and still getting xp, so no clue what the issue is.

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 10:15 am

thefoof wrote:XP modifier is set to 0 for frostfang on EQ2TC, it will need to be changed before xp can be gained, I tried changing it myself but don't have permission on that table so John will have to do it.
You cannot go to the DB Editor, Zones, Frostfang and set the xp_modifier value?

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 5:31 pm

At the risk of starting another war of opinion... why is this code commented out?

ZoneServer::KillSpawn(...)

Code: Select all

					// Send xp...this is currently wrong fix it
					if (spawn != dead && ((Player*)spawn)->GetArrowColor(dead->GetLevel()) >= ARROW_COLOR_GREEN) {
						//SendCalculatedXP((Player*)spawn, dead);
Seems there was more detailed XP happening in SendCalculatedXP() than is in KillSpawn. As in, I am not seeing how Group XP is awarded without SendCalculatedXP().

I verified no XP given when I killed a yellow on EQ2TC, so I am about to step into this code, see where it leads me.


Edit: This code is well commented... has to be Jabantiz's work :D

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 5:44 pm

XP works on my local server as well as on the DB project server, just not EQ2TC, as for that code I don't remember give me a few to browse over it.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 5:57 pm

John Adams wrote:At the risk of starting another war of opinion... why is this code commented out?

ZoneServer::KillSpawn(...)

Code: Select all

					// Send xp...this is currently wrong fix it
					if (spawn != dead && ((Player*)spawn)->GetArrowColor(dead->GetLevel()) >= ARROW_COLOR_GREEN) {
						//SendCalculatedXP((Player*)spawn, dead);
Seems there was more detailed XP happening in SendCalculatedXP() than is in KillSpawn. As in, I am not seeing how Group XP is awarded without SendCalculatedXP().

I verified no XP given when I killed a yellow on EQ2TC, so I am about to step into this code, see where it leads me.


Edit: This code is well commented... has to be Jabantiz's work :D
This code is in the encounter loop, meaning xp will be sent to all player in the encounter, all group members will be added to the encounter list when any of them engage in combat. That function was commented out as calling it would result in group members getting xp multiple times for a kill (a group of 4 would get the xp 4 times for the kill) I then moved a portion of the code from SendCalclulatedXP into the KillSpawn function so xp will be given out.

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 6:08 pm

Makes sense. For reference, the above changes occurred in rev 1989.

The value coming back from CalculateXP is totally wrong.

Code: Select all

xp = -1.4674471e+010
All the calculations in CalculateXP() seem fine, except the value we're getting back from GetZone()->GetXPModifier()

Code: Select all

	if( GetZone()->GetXPModifier() != 0 ) {
		zone_xp_modifier = GetZone()->GetXPModifier();
		LogWrite(PLAYER__DEBUG, 5, "XP", "Zone XP Modifier = %.2f", zone_xp_modifier);
	}
which ends up being

Code: Select all

18:04:31 D XP        : Zone XP Modifier = -431602080.00
Frostfang has 0 as a XP modifier, so 0 should certainly not be creating the above negative, unless my math is a bit off ;)

Continuing to investigate.

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 6:15 pm

My additional logging.
18:14:09 D Command : Player 'Tess' (150), Command: clearallqueuedabilities
18:14:11 D Command : Player 'Tess' (150), Command: autoattack
18:14:11 D Combat : Weapon 'Ranger's Bow', Ammo 'tin arrow'
18:14:11 D Combat : Weapon: Primary, Fighter: 'Tess', Target: 'a Ry'Gorr centurion', Distance: 12.32
18:14:17 D Combat : Weapon 'Ranger's Bow', Ammo 'tin arrow'
18:14:17 D Combat : Weapon: Primary, Fighter: 'Tess', Target: 'a Ry'Gorr centurion', Distance: 8.90
18:14:17 D XP : Zone XP Modifier = -431602080.00
18:14:17 D XP : Yellow Arrow Multiplier = 4.25
18:14:17 D XP : Multiplier * 8 = 34.00
18:14:17 D XP : Encounter <= 5, total = 17.00
18:14:17 D XP : Calculating Double XP!
18:14:17 D XP : Percent of total / XP Needed * 100, percent = 17.00
18:14:17 D XP : Vitality >= Percent, total = 34.00
18:14:17 D World : Setting Global XP Rate to: 1.00
18:14:17 D XP : Final total = -14674470720.00
18:14:17 D Player : CalculateXP returned: -14674470912.00 experience.
18:14:17 D Combat : Zone Killing 'a Ry'Gorr centurion'
18:14:27 D Player : Remove Spawn 'a Ry'Gorr centurion' (1205)
18:14:27 D Command : Player 'Tess' (150), Command: clearallqueuedabilities
18:14:27 D Command : Player 'Tess' (150), Command: autoattack
xp_mod.jpg

Edit: Okay, I have chased the code all the way back to where it loads from the database. All values seem fine, except what is coming back from GetZone()->GetXPModifier()

No idea where the negative value is coming from. And again, no idea why this can be happening in my server >only< and nowhere else :p
You do not have the required permissions to view the files attached to this post.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 6:32 pm

Code: Select all

float	GetXPModifier() { return xp_mod; }
void	SetXPModifier(float val) { xp_mod = val; }
SetXPModifier() is only called from

Code: Select all

void WorldDatabase::LoadZoneInfo(ZoneServer* zone)
so no clue what is going on.

DB should set it, only thing I can think of trying is

Code: Select all

xp_mod = 0;
in the ZoneServer constructer.

Still no clue why this only seems to be happening on EQ2TC

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 6:35 pm

Just FYI, it is a Win32 compile, and I noticed when going to debug this, I kept getting warnings on my breakpoints that the code will never be hit due to preprocessors or some bizarre shit, so I moved back to Debug|Win32 to get passed it. Server is horribly slow now, but I can at least debug.


Edit: Confirmed, on my JA Test Server using EQ2TC's database, XP is fine ~boggle~ Scratch that. DB Project server data was fine, EQ2TC's data, I am not getting XP. WTF?

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 7:13 pm

Weirdest thing ever. I added the xp_mod = 0 to the zoneserver constructor as Jab suggested, and the problem went away.

Since both EQ2TC and JA Test server databases are based on DB Project's, I have no idea why the data from EQ2TC causes this zone_xp_modifier problem, while DB Project's does not. Mystery.

Committing changes. Rejoice in leveling up again.

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: No xp on official server

Post by John Adams » Sat Aug 17, 2013 7:27 pm

I just thought of something different on EQ2TC that is likely not on our other boxes... FrostfangSea is set to "always_loaded". Could that be somehow skipping xp_mod?

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 7:45 pm

I wouldn't think that would be an issue but as that is the only difference we can think of I will look into it.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 7:57 pm

Well that seems to be the cause, set antonica to always loaded on my server, same zone I was testing in last night, and now no xp. Will look into a fix for this issue.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: No xp on official server

Post by Jabantiz » Sat Aug 17, 2013 8:22 pm

On zones that are marked as always loaded or city zones we called WorldDatabase::LoadSpecialZones(), that did not load all info for a zone and xp_mod was among the stuff not loaded. I fixed this up to call the normal load function so all info should be set up properly now.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests