steam relay networking
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user