[Client]Error with Spawn or DeSpawn mob
Hi, i don't know why this happen, sometimes it happen sometimes don't... I really don't know, the only thing i have is this.
This happen when I kill mobs and i send to them CHARSTATE_FAITING or CHARSTATE_SPAWNING
CNtlSobManager::AddObject (882) : [ASSERT] Failed PRE-condition: pFindSobObj == 0
Code:
CNtlPacket packet(sizeof(sGU_UPDATE_CHAR_STATE));
sGU_UPDATE_CHAR_STATE* res = (sGU_UPDATE_CHAR_STATE*)packet.GetPacketData();
CNtlPacket packet2(sizeof(sGU_UPDATE_CHAR_LP));
sGU_UPDATE_CHAR_LP * res2 = (sGU_UPDATE_CHAR_LP *)packet2.GetPacketData();
res->wOpCode = GU_UPDATE_CHAR_STATE;
res->handle = MobID;
res->sCharState.sCharStateBase.byStateID = CHARSTATE_SPAWNING;
res->sCharState.sCharStateBase.vCurLoc = pMonster->GetMobCurLoc();
res->sCharState.sCharStateBase.vCurDir = pMonster->GetMobCurDir();
res2->wOpCode = GU_UPDATE_CHAR_LP;
res2->handle = pMonster->GetMobHandle();
res2->wCurLP = pMonster->GetMobCurLP();
res2->wMaxLP = pMonster->GetMobMaxLP();
res2->dwLpEpEventId = 255;
packet.SetPacketLen(sizeof(sGU_UPDATE_CHAR_STATE));
app->UserBroadcast(&packet);
packet2.SetPacketLen( sizeof(sGU_UPDATE_CHAR_LP) );
app->UserBroadcast(&packet2);
Re: [Client]Error with Spawn or DeSpawn mob
@Nicolas321
First you need invert these packets
you need update the MOB LP and after his state
CHARSTATE_FAINTING = Dead
CHARSTATE_SPAWNING = is like your state when login or the mobs start appear at your map
Re: [Client]Error with Spawn or DeSpawn mob
I just make that about first LP 0 and then dead, i have to see how it works... but i don't know WHY, SOMETIMES doesn't crash, and sometimes does...
Maybe now with i put life in 0 and then kill him, maybe no more bugs.
No... still bug..
Maybe @Arnie36 know what happen?
Because the problem said CNtlSobManager::AddObject (882) : [ASSERT] Failed PRE-condition: pFindSobObj == 0
and only get bug when I call attack or skill in sometimes...
I use an older client from AKCore, maybe because it is compiled in debug mode get that error... i don't know :/
Re: [Client]Error with Spawn or DeSpawn mob
I can only guess
AddObject (882) : [ASSERT] Failed PRE-condition: pFindSobObj == 0
your client already has object 882
Re: [Client]Error with Spawn or DeSpawn mob
I think that too, but is rare... because also give me problems when I call attack or skill
But is impossible because I start the handle with this...
11000 <- there all handles starts it's not possible to have 882 I don't know if 882 is the object
:/
EDIT: Anrnie this ever happen to you in your online server? I don't know, I put print to see what HANDLE i'm sending and never is a wrong handle, because isn't repeated or some else error :/
Re: [Client]Error with Spawn or DeSpawn mob
I call attack or skill
Maybe is a animation bug
because we already get that in the past, because when mob fight's back his action need be 1
if 0 or > then you will get that error(always)
and our client is always debug because we was trying to make it clean haha :P
but you need see the attack id
for players if i remember you can only send in
res->byAttackSequence
1 2 (i don't know if we can send 3)
and for mobs(most of then)
you can only send 1(i don't know if 2 is because he have skill or no)
if you try to send example
res->byAttackSequence = 0
or
res->byAttackSequence = 80
you will get that message above @Nicolas321
Re: [Client]Error with Spawn or DeSpawn mob
But with Skills you don't have byAttackSequence
I do this for byAttackSequence
Code:
static BYTE byChainAttack = NtlGetBattleChainAttackSequence(myPC->GetPlayerLevel()); // this give me back 6
if (res->bChainAttack) // byChainAttack%6+NTL_BATTLE_CHAIN_ATTACK_START;
res->byAttackSequence = byChainAttack % 6 + NTL_BATTLE_CHAIN_ATTACK_START;//battlechainstart its 1
else
res->byAttackSequence = rand()%2;
Maybe the problem is because, I have one Manager who if you are in fight, every TWO seconds calls sendcharactionattack, and if I send SKILL and ACTIONATTACK so fast, almost at the same time, or I don't know...
PD: I don't have a mob fights system and AddSobManager that error is because one FindEntity return NULL, because can't find it.
Re: [Client]Error with Spawn or DeSpawn mob
Exactly
AddSobManager
Can be anything
FindEntity for Animation,Object,Item everything ^^
did you tried put 0 or 999 in battleSequence?
when you use a skill it's suposse the mob attacks you again right?
then if he will attack you, you need send battleSequence
rand()%2 can be any number between 0 1 2 ? or Some number(0....) % 2
Re: [Client]Error with Spawn or DeSpawn mob
Ohh, maybe is that... mmm i have to test thanks :D
And did u fix that error? Because is the only error I got.
when you use a skill it's suposse the mob attacks you again right?
Not at all... if u kill him with one shoot/skill, he doesn't have to attack you again.
@luiz45 I just made a test and client crash and in console i got AttackSequence = 1... :/
PD: I don't have mob attack, I just don't make it jet, but anyway, with your files, I mean AKCore, getclient crash?
I just make another test, kill mobs only with ActionAttack and, allways get attacsequence 1 and get error anyway...
Re: [Client]Error with Spawn or DeSpawn mob
@Nicolas321
i can't remember because the latest version of our source(for now not available to public) doesn't have that error maybe Kalisto fixed that
and yeah i just get that because byAttackSequence from Mob side and Player side
if some of then is invalid the client crashs
maybe is time to Debug in client side...orr
you could post the dbolog.txt here with that error =)
Re: [Client]Error with Spawn or DeSpawn mob
dobolog
Code:
[21:19:54 PM] CNtlBehaviorCharNormalAttack::HandleEvents => m_iHitIdx is range out
[21:20:28 PM] CNtlSobManager::AddObject (884) : [ASSERT] [ASSERT] it == m_mapObject.end() Failed
[21:25:32 PM] network lib : [2015-04-09 21:25:32:205] WSAEnumNetworkEvents Fail (10093) func[d:\development\pserver\dragonballonline\dboclient\ntllib\client\ntlclientnet\ntlclientnet.cpp] line[2594] function[CEventBaseNetworkImp::OnThreadProc]
Help? xD
PD:
Code:
if( SOCKET_ERROR == WSAEnumNetworkEvents( m_eventInfo.ahServer[i], m_eventInfo.ahEvent[i], &wsaNetworkEvents ) ) {
int rc = WSAGetLastError();
NET_LOGDL( "WSAEnumNetworkEvents Fail (%d)%s", rc, NtlGetErrorMessage(rc) );
continue;
}
Re: [Client]Error with Spawn or DeSpawn mob
Code:
if(m_iHitNum == 0 || m_iHitIdx >= m_iHitNum)
{
NtlLogFilePrint("CNtlBehaviorCharNormalAttack::HandleEvents => m_iHitIdx is range out");
return;
}
Here is your error
just like i said....
byAttackSequence is the key
but if you still have trouble, you can debug your client, set a breakpoint in your VS and repeat multiple times
and this
Code:
[21:25:32 PM] network lib : [2015-04-09 21:25:32:205] WSAEnumNetworkEvents Fail (10093) func[d:\development\pserver\dragonballonline\dboclient\ntllib\client\ntlclientnet\ntlclientnet.cpp] line[2594] function[CEventBaseNetworkImp::OnThreadProc]
doesnt mean nothing... this always says when you lost your connection with client
PS: at least i think that m_iHitNum is byAttackSequence
Re: [Client]Error with Spawn or DeSpawn mob
Nono, that wasn't the problem, I fix that, i was talking with Kalisto and he said to me, just like me, have the error, now i fix it, and I'm going to tell to him how to fix it.
PD:
Code:
if(m_iHitNum == 0 || m_iHitIdx >= m_iHitNum)
{
NtlLogFilePrint("CNtlBehaviorCharNormalAttack::HandleEvents => m_iHitIdx is range out");
return;
}
this eror was before now I don't have it
Anyway thanks for taking your time to response, thanks luiz :D