networking i guess

This commit is contained in:
2026-02-28 21:07:44 +02:00
parent e83f7cd448
commit 03c560c2b7
68 changed files with 1348 additions and 121 deletions

View File

View File

View File

View File

View File

@@ -4,21 +4,29 @@
void C_MOBAPlayer::Precache()
{
uint32_t uIndex = g_pAssetManager->LoadModel("game/core/models/cube.fmdl");
V_printf("%u\n", uIndex);
pModel = g_pAssetManager->GetModelByIndex(uIndex);
SetModel("game/core/models/cube.fmdl");
}
void C_MOBAPlayer::Spawn()
{
Precache();
BaseClass::Spawn();
SetThink(Think);
g_pWorldRenderer->SetCameraPosition({0, 0, -20});
};
void C_MOBAPlayer::Think( float fDelta )
{
BaseClass::Think(fDelta);
};
LINK_ENTITY_TO_CLASS(player, C_MOBAPlayer)
BEGIN_DATADESC(C_MOBAPlayer)
END_DATADESC()
IMPLEMENT_RECV_DT(C_MOBAPlayer)
NetPropFloat(m_fTimer),
END_RECV_DT()
IMPLEMENT_EMPTY_SEND_DT(C_MOBAPlayer)

View File

@@ -1,17 +1,21 @@
#include "baseentity.h"
#include "worldrender.h"
#include "game.h"
#include "assetmgr.h"
#ifndef MILMOBA_PLAYER_H
#define MILMOBA_PLAYER_H
#include "basemodelentity.h"
class C_MOBAPlayer: public C_BaseEntity
class C_MOBAPlayer: public C_BaseModelEntity
{
public:
DECLARE_CLASS(C_MOBAPlayer, C_BaseEntity)
DECLARE_CLASS(C_MOBAPlayer, C_BaseModelEntity);
DECLARE_DATADESC();
DECLARE_CLIENTCLASS()
virtual void Precache ( void ) override;
virtual void Spawn( void ) override;
virtual void Think( float fDelta );
void Think( float fDelta );
FunnyModel_t *pModel;
float m_fTimer;
};
#endif