• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiling Party Share EXP Crash

Extrodus

|| Blazera.net ||
Joined
Dec 22, 2008
Messages
2,691
Solutions
7
Reaction score
549
Location
Canada
All I've done was make talk actions that enable and disable the party share experience, and now I end up with a crash.

Method of Crash: Join Party, Enable Shared EXP, Kill a monster; after killing the monster instead of adding experience it just crashes.

Sources: https://github.com/TwistedScorpio/OTHire/

Crash Log Report:
Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff3ac4700 (LWP 31008)]
Player::onGainExperience (this=0x1329950, gainExp=2, fromMonster=true)
  at player.cpp:4059
4059  {


#0  Player::onGainExperience (this=0x1329950, gainExp=2, fromMonster=true)
  at player.cpp:4059
No locals.
#1  0x00000000004bb417 in Party::shareExperience (this=0x1305960,
  experience=<value optimized out>, fromMonster=<value optimized out>)
  at party.cpp:389
  xpgained = <value optimized out>
  shareExp = 2
#2  0x00000000004d9966 in Player::onGainExperience (this=0x1329950, gainExp=2,
  fromMonster=<value optimized out>) at player.cpp:4066
  party = 0x1329950
#3  0x00000000004bb417 in Party::shareExperience (this=0x1305960,
  experience=<value optimized out>, fromMonster=<value optimized out>)
  at party.cpp:389
  xpgained = <value optimized out>
  shareExp = 2
#4  0x00000000004d9966 in Player::onGainExperience (this=0x1329950, gainExp=2,
  fromMonster=<value optimized out>) at player.cpp:4066
  party = 0x1329950
#5  0x00000000004bb417 in Party::shareExperience (this=0x1305960,
  experience=<value optimized out>, fromMonster=<value optimized out>)
  at party.cpp:389
  xpgained = <value optimized out>

Any help is appreciated, source code can be found at the link above. Crash Report should help out to determine the cause, thanks to anyone who can be of help.
 
Just like editing the spr & dat on a normal client you need to make the same changes on the server, Same thing would apply to communication of its interface, these changes need to reflect what is written on the server.

Otherwise if the client were to override the actions of the server we would all be gods :)

That is just my opinion on this matter.
 
4059 in player.cpp is this line
Code:
}

But it is really referring to this method
Code:
void Player::getGainExperience(uint64_t& gainExp, bool fromMonster)
{
    if(fromMonster || g_config.getNumber(ConfigManager::RATES_FOR_PLAYER_KILLING)){
        gainExp = (uint64_t)std::floor(gainExp * getRateValue(LEVEL_EXPERIENCE));
    }
}

party.cpp line 389 is this line of code
Code:
(*it)->onGainExperience(shareExp, fromMonster);

But it is really talking about this whole method here
Code:
void Party::shareExperience(uint64_t experience, bool fromMonster)
{
    double member_factor = g_config.getNumber(ConfigManager::PARTY_MEMBER_EXP_BONUS);
    double xpgained = (experience + (experience * (member_factor / 100.))) / (memberList.size() + 1);

    if(xpgained < 0)
        return;
    uint64_t shareExp = (uint64_t)std::ceil(xpgained);

    for(PlayerVector::iterator it = memberList.begin(); it != memberList.end(); ++it){
        (*it)->onGainExperience(shareExp, fromMonster);
    }

    getLeader()->onGainExperience(shareExp, fromMonster);
}
There is more like player.cpp line 4066

What were the changes you made? That is the only real way we can resolve this issue by seeing the changes you made in the sources.
 
@Breed, the problem is I didnt change sources. All I did was create a talkaction that enables party share experience when in a party. Other than that, it is using all default source for party.cpp/party.h from the OTHire GitHub.

Although I assume it is an issue with the shareExperience/onGainExperience in sources.
 
Have the exact same issue as Extrodus.
I, well @ond created a talkaction for me to activate the shared experience but once it's active if a monster is killed by a player with it active server crashes. Or if a player dies same thing happens.

Only changes I did was I removed the check for if a player has been active in the last 2 minutes while attacking monsters. Cause if that check was there the shared experience never get activated. It gets enabled but it says "Someone in your party isn't active" and then it doesn't matter if they are active or not cause it never activates.

But if I comment out the check it says "Shared Experience is now active." but then it crashes like I said above
 
Well yeah, sorry. I did make that source change as well, but other than that; like you said, just made a talkaction to use it.
 
infnity loop, Player :: onGainExperience calls Party :: shareExperience then it calls Player :: onGainExperience and on, and on...
 
Back
Top