Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Error on healthbar packet  (Visto 2497 veces)

0 Miembros and 1 Guest are viewing this topic.

Online liron003 Posteado: July 28, 2022, 04:39:57 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 5
  • Gracias recibida: 3
  • gb
i work on files s6 and the packet on healthbar not send as well , the client recognize only 1 player each someone can help ? PLZ
ServerSide:
Code: [Select]
void GCNewHealthBarSend(LPOBJ lpObj) // OK
{

BYTE send[8192];

PMSG_NEW_HEALTH_BAR_SEND pMsg;
PMSG_NEW_HEALTH_BAR info;

pMsg.header.set(0xF3, 0xE2, 0);

int size = sizeof(pMsg);

pMsg.count = 0;


for (int n = 0;n < MAX_VIEWPORT;n++)
{
if (lpObj->VpPlayer[n].state != VIEWPORT_SEND && lpObj->VpPlayer[n].state != VIEWPORT_WAIT)
{
continue;
}

if (lpObj->VpPlayer[n].type != OBJ_USER)
{
continue;
}


if (OBJECT_RANGE(lpObj->VpPlayer[n].number) == 0)
{
continue;
}

if (gObj[lpObj->VpPlayer[n].number].Live == 0 )
{
continue;
}
info.index = lpObj->VpPlayer[n].number;

info.type = (BYTE)gObj[lpObj->VpPlayer[n].number].Type;

info.rate = (BYTE)((gObj[lpObj->VpPlayer[n].number].Life * 100) / (gObj[lpObj->VpPlayer[n].number].MaxLife + gObj[lpObj->VpPlayer[n].number].AddLife));

info.monsterid = gObj[lpObj->VpPlayer[n].number].Class;

info.Life = gObj[lpObj->VpPlayer[n].number].Life;

info.MaxLife = gObj[lpObj->VpPlayer[n].number].MaxLife + gObj[lpObj->VpPlayer[n].number].AddLife;

info.Level = gObj[lpObj->VpPlayer[n].number].Level;

info.Reset = 0;

if (gObj[lpObj->VpPlayer[n].number].Type == OBJ_USER)
{

if (gObj[lpObj->VpPlayer[n].number].iMaxShield + gObj[lpObj->VpPlayer[n].number].iAddShield > 0)
{
info.SDrate = (BYTE)((gObj[lpObj->VpPlayer[n].number].iShield * 100) / (gObj[lpObj->VpPlayer[n].number].iMaxShield + gObj[lpObj->VpPlayer[n].number].iAddShield));

info.Shield = gObj[lpObj->VpPlayer[n].number].iShield;

info.MaxShield = gObj[lpObj->VpPlayer[n].number].iMaxShield + gObj[lpObj->VpPlayer[n].number].iAddShield;
}

info.isSameGuild = (lpObj->m_PlayerData->GuildNumber>0 ? ((lpObj->m_PlayerData->GuildNumber == gObj[lpObj->VpPlayer[n].number].m_PlayerData->GuildNumber) ? true : false) : false);

info.HaveGuild = (gObj[lpObj->VpPlayer[n].number].m_PlayerData->GuildNumber>0 ? true : false);

if (info.HaveGuild == true)
{
memcpy(info.GuildName, gObj[lpObj->VpPlayer[n].number].m_PlayerData->GuildName, sizeof(info.GuildName));
}


}
else
{
info.Reset = 0;

info.SDrate = 0;

info.Shield = 0;

info.MaxShield = 0;

info.isSameGuild = 0;
}


memcpy(&send[size], &info, sizeof(info));
size += sizeof(info);

pMsg.count++;
}

pMsg.header.size[0] = SET_NUMBERHB(size);

pMsg.header.size[1] = SET_NUMBERLB(size);

memcpy(send, &pMsg, sizeof(pMsg));
IOCP.DataSend(lpObj->m_Index, send, size);
}

Client Side:
Code: [Select]
void GCNewHealthBarRecv(PMSG_NEW_HEALTH_BAR_RECV* lpMsg) // OK
{

ClearNewHealthBar();
for (int n = 0;n < lpMsg->count;n++)
{
PMSG_NEW_HEALTH_RECV* lpInfo = (PMSG_NEW_HEALTH_RECV*)(((BYTE*)lpMsg) + sizeof(PMSG_NEW_HEALTH_BAR_RECV) + (sizeof(PMSG_NEW_HEALTH_RECV) * n));


InsertNewHealthBar(lpInfo);
}
}

Gracias:


Online liron003 #1 Posteado: July 30, 2022, 10:55:45 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 5
  • Gracias recibida: 3
  • gb

Online liron003 #2 Posteado: August 01, 2022, 03:57:17 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 5
  • Gracias recibida: 3
  • gb

Offline ZTMarkz #3 Posteado: August 01, 2022, 04:16:00 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 283
  • Gracias recibida: 145
  • tk
VERSION? EMULADOR?


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
3 Replies
4982 Views
Last post January 12, 2018, 12:00:10 AM
by Pumperman
2 Replies
1825 Views
Last post February 17, 2021, 09:10:06 AM
by xXSiniestroXx
1 Replies
2365 Views
Last post February 07, 2021, 08:41:31 AM
by Ketamine
4 Replies
1672 Views
Last post December 18, 2021, 10:08:55 PM
by kayito
2 Replies
2071 Views
Last post January 25, 2022, 01:14:51 PM
by Virus22