steam networking
This commit is contained in:
@@ -114,6 +114,11 @@ void CFunnyGameBridge::TryToConnectToServer()
|
||||
if (g_pServerConnection)
|
||||
{
|
||||
m_bIsConnectedToServer = true;
|
||||
C_BaseEntity **ppEntities = EntitySystem()->GetEntities();
|
||||
for ( int i = 0; i < MAX_EDICTS; i++ )
|
||||
{
|
||||
EntitySystem()->DestroyEntityByIndex(i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -133,7 +138,9 @@ void CFunnyGameBridge::Frame( float fDelta )
|
||||
pCurrentServer = g_pServerBridge;
|
||||
if (m_bIsConnectedToServer)
|
||||
if (g_pServerConnection->BIsActive())
|
||||
{
|
||||
pCurrentServer = g_pServerConnection;
|
||||
}
|
||||
|
||||
|
||||
if (pCurrentServer)
|
||||
@@ -150,6 +157,7 @@ void CFunnyGameBridge::Frame( float fDelta )
|
||||
switch (pPacket->m_eType)
|
||||
{
|
||||
case MESSAGE_ENTITY_CLASS_SYNC:
|
||||
V_printf("MESSAGE_ENTITY_CLASS_SYNC: %u = %s\n", (uint32_t)pPacket->m_entityClass.m_uIndex, pPacket->m_entityClass.m_szEntityName);
|
||||
pEntity = EntitySystem()->CreateByClassnameWithIndex(
|
||||
(char*)pPacket->m_entityClass.m_szEntityName, pPacket->m_entityClass.m_uIndex
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user