help about some fix code..

11/12/2017 18:24 RhisisChaos#1
i would like to ask does anyone knows what kind of fix is this?

PHP Code:
int CMover::GetHitPoint()
{
#ifdef    __FIX_GET_HP_MP_FP
    
int hitPoint GetParam(DST_HPm_nHitPoint);
    
int maxHitPoint GetMaxHitPoint();

    if (
hitPoint maxHitPoint)
        return 
maxHitPoint;
    else
        return 
hitPoint;
#endif  //__FIX_GET_HP_MP_FP
    
return GetParamDST_HPm_nHitPoint );

my world.exe crashed every 5hrs to 10hrs... when i debug it! this code is the reason why it crashes.. does anyone know about this code? tnx...
11/12/2017 20:21 - DK#2
Quote:
Originally Posted by RhisisChaos View Post
i would like to ask does anyone knows what kind of fix is this?

PHP Code:
int CMover::GetHitPoint()
{
#ifdef    __FIX_GET_HP_MP_FP
    
int hitPoint GetParam(DST_HPm_nHitPoint);
    
int maxHitPoint GetMaxHitPoint();

    if (
hitPoint maxHitPoint)
        return 
maxHitPoint;
    else
        return 
hitPoint;
#endif  //__FIX_GET_HP_MP_FP
    
return GetParamDST_HPm_nHitPoint );

my world.exe crashed every 5hrs to 10hrs... when i debug it! this code is the reason why it crashes.. does anyone know about this code? tnx...

-> This Code set the HP , MP and FP to the maximal of your character, when you have more then your maximal hp. Example you had STA Buff and the Buff times out.. Then you had more hp then your maximal hp.. This Fix remove this bug and set it to the new max HP.
11/13/2017 09:58 RhisisChaos#3
Quote:
Originally Posted by DK ACE View Post
-> This Code set the HP , MP and FP to the maximal of your character, when you have more then your maximal hp. Example you had STA Buff and the Buff times out.. Then you had more hp then your maximal hp.. This Fix remove this bug and set it to the new max HP.
ahh i see.. but why is it that my world.exe crashes because of this code?
11/13/2017 10:02 FlyffServices#4
Quote:
Originally Posted by RhisisChaos View Post
ahh i see.. but why is it that my world.exe crashes because of this code?
More details of the crash please.
11/13/2017 10:22 RhisisChaos#5
Quote:
Originally Posted by FlyffServices View Post
More details of the crash please.
i'm going to view the full error later after it crashes again... but i have a picture here...

[Only registered and activated users can see links. Click Here To Register...]

i've checked my versioncommon.h and it was not define there so what i did is that i defined it... then my server became stable.. it did not crash anymore but when i added edit some files on my resources just like changing the stats/Damge/HP of the monster from the Tower siege (Propmover) new error came out and when i returned the stats/damage/HP of the monster to the original... that error came back... and until now it wont stop... so my server has only 5hrs to 10hrs or if im lucky it will last for 15hrs before it crashes again...
11/13/2017 10:28 FlyffServices#6
Quote:
Originally Posted by RhisisChaos View Post
i'm going to view the full error later after it crashes again... but i have a picture here...

[Only registered and activated users can see links. Click Here To Register...]

i've checked my versioncommon.h and it was not define there so what i did is that i defined it... then my server became stable.. it did not crash anymore but when i added edit some files on my resources just like changing the stats/Damge/HP of the monster from the Tower siege (Propmover) new error came out and when i returned the stats/damage/HP of the monster to the original... that error came back... and until now it wont stop... so my server has only 5hrs to 10hrs or if im lucky it will last for 15hrs before it crashes again...

Code:
int CMover::GetChgParam( int nDestParameter )
{
	if( nDestParameter < MAX_ADJPARAMARY )
		return m_chgParamAry[ nDestParameter ];
	return 0x7FFFFFFF;
}
Code:
#define MAX_ADJPARAMARY             117
Code:
LONG			m_chgParamAry[ MAX_ADJPARAMARY ];
Did u changed something here?

Can you post your defineAttribute.h (its in the resource folder)?
11/13/2017 10:44 RhisisChaos#7
Quote:
Originally Posted by FlyffServices View Post
Code:
int CMover::GetChgParam( int nDestParameter )
{
	if( nDestParameter < MAX_ADJPARAMARY )
		return m_chgParamAry[ nDestParameter ];
	return 0x7FFFFFFF;
}
Code:
#define MAX_ADJPARAMARY             117
Code:
LONG			m_chgParamAry[ MAX_ADJPARAMARY ];
Did u changed something here?

Can you post your defineAttribute.h (its in the resource folder)?
no i did not change any codes from there.. i've checked the defineattribute.h and MAX_ADJPARAMARY was defined...

11/13/2017 11:17 Hekmatyar#8
This is nullptr.

Well, to fix the crash immediately, you can move the access to the CUser class till after checking if it is valid. Guessing you are using the released Swap bug fix which likes to check before the pUser is checked to be a nullptr.
11/13/2017 15:24 RhisisChaos#9
Quote:
Originally Posted by Hekmatyar View Post
This is nullptr.

Well, to fix the crash immediately, you can move the access to the CUser class till after checking if it is valid. Guessing you are using the released Swap bug fix which likes to check before the pUser is checked to be a nullptr.
what is nullptr? sorry about that i don't get it.. pls educate me i'm just a newbie when in terms of codes....

my former developer put that fix on my source... and he abandoned me for a personal reason...
11/13/2017 16:45 ディオニュソス#10
Show us your CDPSrvr::OnDoEquip (pMover or pUser or however that variable is called obviously is null)
11/13/2017 17:43 RhisisChaos#11
Quote:
Originally Posted by ディオニュソス View Post
Show us your CDPSrvr::OnDoEquip (pMover or pUser or however that variable is called obviously is null)
you mean this sir?

PHP Code:
void CDPSrvr::OnDoEquipCAr arDPID dpidCacheDPID dpidUserLPBYTE lpBufu_long uBufSize )
{
    
DWORD nId;
    
int nPart;

    
ar >> nId;
    
ar >> nPart;        
    
    if( 
nPart >= MAX_HUMAN_PARTS )    
        return;

    
CUserpUser g_UserMng.GetUserdpidCachedpidUser );

#ifdef __SWITCH_FIX
    
if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
        
pUser->SetHitPointpUser->GetMaxHitPoint());

    if( 
pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
        
pUser->SetManaPointpUser->GetMaxManaPoint() );

    if( 
pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
        
pUser->SetFatiguePointpUser->GetMaxFatiguePoint() );
#endif //__SWITCH_FIX

    
if( IsValidObjpUser ) == FALSE )
        return;

    
CItemElempItemElem pUser->m_Inventory.GetAtIdnId );
    if( 
IsUsableItempItemElem ) == FALSE )
            return;
    if( 
nPart )
    {
        if( 
pUser->m_Inventory.IsEquipnId ) )
        {
            if( 
pItemElem != pUser->m_Inventory.GetEquipnPart ) )
                return;
        }
    }
    else
    {
        if( 
pUser->m_Inventory.IsEquipnId ) )
            return;
    }
#ifdef __HACK_1023
    
ItemProppItemProp        pItemElem->GetProp();
    if( 
pItemProp && pItemProp->dwParts == PARTS_RIDE )
    {
        if( !
pUser->m_Inventory.IsEquipnId ) )
        {
            
FLOAT fVal;
            
ar >> fVal;
            if( 
fVal != pItemProp->fFlightSpeed )
            {
                
pUser->AddDefinedTextTID_GAME_MODIFY_FLIGHT_SPEED );
                return;
            }
        }
    }
#endif    // __HACK_1023

    
if( pUser->IsDie() == FALSE )
        
pUser->DoUseEquipmentItempItemElemnIdnPart );

11/13/2017 17:52 ディオニュソス#12
Replace that with:
Code:
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) 
{ 
    DWORD nId; 
    int nPart; 

    ar >> nId; 
    ar >> nPart;         
     
    if( nPart >= MAX_HUMAN_PARTS )     
        return; 

    CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser ); 

    if( IsValidObj( pUser ) == FALSE ) 
        return; 

#ifdef __SWITCH_FIX 
    if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() ) 
        pUser->SetHitPoint( pUser->GetMaxHitPoint()); 

    if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() ) 
        pUser->SetManaPoint( pUser->GetMaxManaPoint() ); 

    if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() ) 
        pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); 
#endif //__SWITCH_FIX 

    CItemElem* pItemElem = pUser->m_Inventory.GetAtId( nId ); 
    if( IsUsableItem( pItemElem ) == FALSE ) 
            return; 
    if( nPart > 0 ) 
    { 
        if( pUser->m_Inventory.IsEquip( nId ) ) 
        { 
            if( pItemElem != pUser->m_Inventory.GetEquip( nPart ) ) 
                return; 
        } 
    } 
    else 
    { 
        if( pUser->m_Inventory.IsEquip( nId ) ) 
            return; 
    } 
#ifdef __HACK_1023 
    ItemProp* pItemProp        = pItemElem->GetProp(); 
    if( pItemProp && pItemProp->dwParts == PARTS_RIDE ) 
    { 
        if( !pUser->m_Inventory.IsEquip( nId ) ) 
        { 
            FLOAT fVal; 
            ar >> fVal; 
            if( fVal != pItemProp->fFlightSpeed ) 
            { 
                pUser->AddDefinedText( TID_GAME_MODIFY_FLIGHT_SPEED ); 
                return; 
            } 
        } 
    } 
#endif    // __HACK_1023 

    if( pUser->IsDie() == FALSE ) 
        pUser->DoUseEquipmentItem( pItemElem, nId, nPart ); 
}
11/13/2017 18:05 RhisisChaos#13
Quote:
Originally Posted by ディオニュソス View Post
Replace that with:
Code:
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) 
{ 
    DWORD nId; 
    int nPart; 

    ar >> nId; 
    ar >> nPart;         
     
    if( nPart >= MAX_HUMAN_PARTS )     
        return; 

    CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser ); 

    if( IsValidObj( pUser ) == FALSE ) 
        return; 

#ifdef __SWITCH_FIX 
    if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() ) 
        pUser->SetHitPoint( pUser->GetMaxHitPoint()); 

    if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() ) 
        pUser->SetManaPoint( pUser->GetMaxManaPoint() ); 

    if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() ) 
        pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); 
#endif //__SWITCH_FIX 

    CItemElem* pItemElem = pUser->m_Inventory.GetAtId( nId ); 
    if( IsUsableItem( pItemElem ) == FALSE ) 
            return; 
    if( nPart > 0 ) 
    { 
        if( pUser->m_Inventory.IsEquip( nId ) ) 
        { 
            if( pItemElem != pUser->m_Inventory.GetEquip( nPart ) ) 
                return; 
        } 
    } 
    else 
    { 
        if( pUser->m_Inventory.IsEquip( nId ) ) 
            return; 
    } 
#ifdef __HACK_1023 
    ItemProp* pItemProp        = pItemElem->GetProp(); 
    if( pItemProp && pItemProp->dwParts == PARTS_RIDE ) 
    { 
        if( !pUser->m_Inventory.IsEquip( nId ) ) 
        { 
            FLOAT fVal; 
            ar >> fVal; 
            if( fVal != pItemProp->fFlightSpeed ) 
            { 
                pUser->AddDefinedText( TID_GAME_MODIFY_FLIGHT_SPEED ); 
                return; 
            } 
        } 
    } 
#endif    // __HACK_1023 

    if( pUser->IsDie() == FALSE ) 
        pUser->DoUseEquipmentItem( pItemElem, nId, nPart ); 
}
ok sir.. i will try this and i will update you after... tnx...
11/20/2017 17:31 RhisisChaos#14
here are the errors....
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
[IMG=expandable: 1][Only registered and activated users can see links. Click Here To Register...][/IMG]
11/26/2017 17:03 RhisisChaos#15
Quote:
Originally Posted by ディオニュソス View Post
:wat:
I literally told you how to fix this, you ain't the sharpest tool in the shed, huh? :confused:
im putting the fix you gave me sir.. im just showing the full error...