It is currently Fri Apr 19, 2024 3:07 am
CNetworkArray(bool, m_aBlockValid, MAX_BLOCKS);
IMPLEMENT_SERVERCLASS_ST(CInfoBlockManager, DT_InfoBlockManager)
SendPropArray3(SENDINFO_ARRAY3(m_aBlockValid), SendPropBool(SENDINFO_ARRAY(m_aBlockValid))),
END_SEND_TABLE()
IMPLEMENT_CLIENTCLASS_DT( C_InfoBlockManager, DT_InfoBlockManager, CInfoBlockManager )
RecvPropArray3(RECVINFO_ARRAY(m_aBlockValid), RecvPropInt(RECVINFO(m_aBlockValid[0]))),
END_RECV_TABLE()
SendPropArray3(SENDINFO_ARRAY3(m_aBlockValid), SendPropBool(SENDINFO_ARRAY(m_aBlockValid), 1, SPROP_UNSIGNED))
stoopdapoop wrote:
- Code: Select all
SendPropArray3(SENDINFO_ARRAY3(m_aBlockValid), SendPropBool(SENDINFO_ARRAY(m_aBlockValid), 1, SPROP_UNSIGNED))
would probably help, booleans take up a fully byte in C++ (up to 4 bytes in a struct if not packed properly) and I bet they send the whole thing unless you tell it to only send the first bit.
stoopdapoop wrote:weird, try SendPropInt instead of SendPropBool maybe? That's how valve passes bools, and how I've done it in the past. Looks like you're already receive table is expecting an int anyway.
typedef struct
{
int x, y, z;
} IntVector3D;
typedef struct
{
unsigned char x, y, z;
} CharVector3D;
SendPropArray3(SENDINFO_ARRAY3(m_aBlockPositions), SendPropInt(SENDINFO_ARRAY(m_aBlockPositions), sizeof(int)*3, 0)),
SendPropArray3(SENDINFO_ARRAY3(m_aBlockScales), SendPropInt(SENDINFO_ARRAY(m_aBlockScales), 3, SPROP_UNSIGNED)),
SendPropArray(SendPropInt(SENDINFO_ARRAY(myint),0),myint),
zombie@computer wrote:This is how i sent int[]s:
- Code: Select all
SendPropArray(SendPropInt(SENDINFO_ARRAY(myint),0),myint),
zombie@computer wrote:an array of arrays? why the hell would you do that? Just flatten the array.
SendPropArray3(SENDINFO_ARRAY3(m_aBlockPositions), SendPropInt(SENDINFO_ARRAY(m_aBlockPositions), (sizeof(int)*3)*3, 0)),
SendPropArray3(SENDINFO_ARRAY3(m_aBlockScales), SendPropInt(SENDINFO_ARRAY(m_aBlockScales), 3*3, SPROP_UNSIGNED)),
SendPropArray3(SENDINFO_ARRAY3(m_aBlockTypes), SendPropInt(SENDINFO_ARRAY(m_aBlockTypes), 1, SPROP_UNSIGNED)),
SendPropArray3(SENDINFO_ARRAY3(m_aBlockTypes), SendPropInt(SENDINFO_ARRAY(m_aBlockTextures), 1, SPROP_UNSIGNED)),
SendPropArray3(SENDINFO_ARRAY3(m_aBlockValid), SendPropInt(SENDINFO_ARRAY(m_aBlockValid), 1, SPROP_UNSIGNED)),
Users browsing this forum: No registered users