steam relay networking

This commit is contained in:
2026-03-01 23:06:28 +02:00
parent 03c560c2b7
commit 468d765aa1
16 changed files with 628 additions and 101 deletions

View File

@@ -92,7 +92,8 @@ CBaseEntity *CEntitySystem::CreateByClassname( const char *szName )
iSelectedSlot,
};
V_strncpy((char*)stClassSync.m_szEntityName, szName, 256);
g_pClientBridge->SendPacket({&stClassSync, sizeof(stClassSync)});
if (g_pCurrentConnection)
g_pCurrentConnection->SendPacket({&stClassSync, sizeof(stClassSync)});
return pEntity;
}
IEntityFactory *CEntitySystem::GetFactoryByClassname( const char *szName )
@@ -113,6 +114,25 @@ void CEntitySystem::Think()
CBaseEntity *pEntity;
int i;
for ( i = 0; i < MAX_EDICTS; i++ )
{
pEntity = m_pEntities[i];
if ( pEntity == NULL )
continue;
if ( !pEntity->m_pfnThink )
continue;
(pEntity->*pEntity->m_pfnThink)(0);
}
}
void CEntitySystem::NetThink( INetworkBase *pBase )
{
CBaseEntity *pEntity;
int i;
uint32_t u;
uint32_t x;
uint32_t uSize;
@@ -125,19 +145,15 @@ void CEntitySystem::Think()
EntityDataSyncValue_t *pValue;
};
for ( i = 0; i < MAX_EDICTS; i++ )
{
pEntity = m_pEntities[i];
if ( pEntity == NULL )
continue;
if ( !pEntity->m_pfnThink )
continue;
(pEntity->*pEntity->m_pfnThink)(0);
pNetMap = pEntity->GetSendMap();
uSize = sizeof(EntityDataSyncValue_t);
x = 0;
@@ -177,9 +193,10 @@ void CEntitySystem::Think()
}
pNetMap = pNetMap->m_pBase;
}
g_pClientBridge->SendPacket({pData, uSize});
if (g_pCurrentConnection)
g_pCurrentConnection->SendPacket({pData, uSize});
V_free(pData);
}
}