HBPLD 0 Report post Posted January 18, 2011 is me again and still have problem with show real damage. Look this Client step case DEF_OBJECTMAGIC: case DEF_OBJECTDAMAGEMOVE: case DEF_OBJECTDAMAGE: cDir = *cp; cp++; //here i change to receive with short sp = (short *)cp; sV1 = *sp; cp += 2; sp = (short *)cp; sV2 = *sp; cp += 2; //end break; case DEF_OBJECTDYING: cDir = *cp; cp++; //here i change to receive with short sp = (short *)cp; sV1 = *sp; cp += 2; sp = (short *)cp; sV2 = *sp; cp += 2; //end sp = (short *)cp; sX = *sp; cp += 2; sp = (short *)cp; sY = *sp; cp += 2; break; case DEF_OBJECTATTACK: cDir = *cp; cp++; //here i change to receive with short sp = (short *)cp; sV1 = *sp; cp += 2; sp = (short *)cp; sV2 = *sp; cp += 2; //end sp = (short *)cp; sV3 = *sp; cp += 2; break; and i change this if (sV1 > 0) wsprintf(cTxt, "-%dPts!", sV1); //pts else strcpy(cTxt, "Critical!"); on this wsprintf(cTxt, "-%dPts!", sV1); //pts next HG step; in function ::SendEventToNearClient_TypeA i change it *cp_s = (unsigned char)sV1; cp_s++; *cp_s = (unsigned char)sV2; cp_s++; on this sp = (short *)cp_s; *sp = (short)sV1; cp_s += 2; sp = (short *)cp_s; *sp = (short)sV2; cp_s += 2; and change this *cp_sv = sV1 - sX; cp_sv++; *cp_sv = sV2 - sY; cp_sv++; on this sp = (short *)cp_s; *sp = (short)sV1-sX; cp_s += 2; sp = (short *)cp_s; *sp = (short)sV2-sY; cp_s += 2; and second time under change that same change this *cp_s = (unsigned char)sV1; cp_s++; *cp_s = (unsigned char)sV2; cp_s++; on this sp = (short *)cp_s; *sp = (short)sV1; cp_s += 2; sp = (short *)cp_s; *sp = (short)sV2; cp_s += 2; change this *cp_sv = sV1 - sX; cp_sv++; *cp_sv = sV2 - sY; cp_sv++; on this sp = (short *)cp_s; *sp = (short)sV1-sX; cp_s += 2; sp = (short *)cp_s; *sp = (short)sV2-sY; cp_s += 2; and end my code and i have problem with this code because if i attack NPC and anything , client CRASH and dont show caption (-%d pts) strange error npc disappears , mobies What wrong it this code? what i bad do? Please Help :/ Sory for my bad english. Share this post Link to post Share on other sites
Audioslave 0 Report post Posted February 23, 2011 Remember that everytime you make a change on packets like changing var types etc. you're increasing the amount of bytes that will be sent to client / hgserver. So you also have to change the amount of bytes on SendMsg function. I'll explain: *cp_sv = sV1 - sX; cp_sv++; *cp_sv = sV2 - sY; cp_sv++; on this sp = (short *)cp_s; *sp = (short)sV1-sX; cp_s += 2; sp = (short *)cp_s; *sp = (short)sV2-sY; cp_s += 2; When you did that you change that cp++ to cp += 2 which means that you change the amount of bytes of the packet. Then on hgserver there is a function called iSendMsg that's send that packet to client. iSendMsg function its something like this: iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, iSize + 20); Imagine that before your changes iSendMsg sent 20 bytes. After your changes you increase +1 bytes on each cp which give us +2 bytes, so you need to change that on iSendMsg. iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, iSize + 22); Share this post Link to post Share on other sites
HBPLD 0 Report post Posted February 24, 2011 thanks ! fixed. :) Share this post Link to post Share on other sites
Audioslave 0 Report post Posted February 24, 2011 You're welcome! Share this post Link to post Share on other sites
cilin 0 Report post Posted February 25, 2011 tas hecho una maquina para la progra, estamos orgullosos de tu trabajo, abrazo. Share this post Link to post Share on other sites