Weird bug changing MAX_JOB

10/06/2016 10:37 raventh1984#1
Hi players,

I have removed the Hero Master jobs.
So far everything is ok.

Now i changed the MAX_JOB from 32 to 16 rebuild the source.

When launching the servers. WorldServer crashed. Giving me the following error.

Code:
GetModelElem - out of range: type=0, size=1220, index=1

2016/10/ 6   10:28:26   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=1 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   10:28:26   GetModelElem - out of range: type=1, size=100, index=0
So well guess i am going to debug the worldserver.

BreakPoint @ CObj** CLinkMap::GetObjPtr( const D3DXVECTOR3 & vPos, DWORD dwLinkType, int nLinkLevel )

Line int nPos = int( vPos.z / m_iMPU / nUnit ) * nMaxWidth + int( vPos.x / m_iMPU / nUnit );

Error: Division by Zero.

When i change the MAX_JOB back to 32 again i can launch the server without problems.

Any tips will be appriciated.

With kind regards.
10/06/2016 11:25 alfredico#2
If I remember correctly it was this function CWorld::ReadRespawn
10/06/2016 13:21 raventh1984#3
Thanks Alfredico.

Its not solved. The strange part is is that i am running an clean v15.
And still its giving me error logs that its missing models. So i checked mdlobj.inc from official and its all about Kalgas etc so i find it strange. That if you changed the MAX_JOB from 32 to 16 that its saying its missing models.

So its somewhat releated to each other only i am not seeing the link.

Updated.

Added everything inside mdlObj.inc from Official Flyff.

Still missing some parts.

Code:
GetModelElem - out of range: type=0, size=1974, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=0, size=1974, index=1

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=1 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=1, size=100, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=1 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=0, size=1974, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=0, size=1974, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=0, size=1974, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=0 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.

2016/10/ 6   13:26:52   GetModelElem - out of range: type=1, size=100, index=0

2016/10/ 6   13:26:52   CModelMng::loadModel mdlObj/mdlDyna ¿¡ objtype=1 index=0 bpart=0 ÀÇ Á¤º¸°¡ ¾ø±º¿©.
Also new error

Çä InsObjInFld¿¡¼* ¹üÀ§¸¦ ¹þ¾î³*°Ô Ãß°¡µÇ·Á°í Çϳ×?

Strange.

UPDATE::

i have changed part of the code at BOOL CWorld::ReadRespawn( CScript& s )

Code:
for (i = 0; i < MAX_JOB; i++)
				pInfo->m_CtrlElem.m_bSetJob[ i ] = s.GetNumber();
To
Code:
int maxjob = 16

for (i = 0; i < maxjob; i++)
				pInfo->m_CtrlElem.m_bSetJob[ i ] = s.GetNumber();
Changed the bSetJob also to 16 cause it was defined as BOOL bSetJob[MAX_JOB];

Started world server. Giving me errors about the mdlobj.

So changed maxjob = 16 to 32 and BOOL bSetJob[16] to [32]
Started worldserver and no more errors.

bSetJob is only used inside WorldFile.cpp and in User.cpp for opening an Box.
10/06/2016 21:07 Avalion#4
Quote:
Originally Posted by raventh1984 View Post
Changed the bSetJob also to 16 cause it was defined as BOOL bSetJob[MAX_JOB];

Started world server. Giving me errors about the mdlobj.

So changed maxjob = 16 to 32 and BOOL bSetJob[16] to [32]
Started worldserver and no more errors.

bSetJob is only used inside WorldFile.cpp and in User.cpp for opening an Box.
You have to keep it 32 or open every file that goes through that and re-save the file without the extra 16 ints or else the scanner will throw errors and cause that crash you're getting.
10/07/2016 12:44 alfredico#5
You only need to change the m_bSetJob to 32. Leave the rest as it is, the version is defined on respawn stuff, is not same as client version and not the same for all the cases.
Expected you to figure out this...
10/08/2016 08:49 raventh1984#6
Yeah i already figured it out.

Thank you all.