Esempio n. 1
0
//-----------------------------------------------------------------------------
// Purpose: called when a client joins a server
//-----------------------------------------------------------------------------
PLUGIN_RESULT CSourcePython::ClientConnect( bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen )
{
	CPointer allowConnect = CPointer((unsigned long) bAllowConnect);
	CPointer rejectMessage = CPointer((unsigned long) reject);
	CALL_LISTENERS(ClientConnect, allowConnect, IndexFromEdict(pEntity), pszName, pszAddress, rejectMessage, maxrejectlen);
	return PLUGIN_OVERRIDE;
}
Esempio n. 2
0
void CSourcePython::OnCombinerPreCache(MDLCacheDataType_t type, MDLHandle_t handle )
{
	if (m_pOldMDLCacheNotifier)
		m_pOldMDLCacheNotifier->OnCombinerPreCache(type, handle);

	CALL_LISTENERS(OnCombinerPreCache, type, handle);
}
Esempio n. 3
0
void CSourcePython::OnDataUnloaded( MDLCacheDataType_t type, MDLHandle_t handle )
{
	if (m_pOldMDLCacheNotifier)
		m_pOldMDLCacheNotifier->OnDataUnloaded(type, handle);

	CALL_LISTENERS(OnDataUnloaded, type, handle);
}
Esempio n. 4
0
//-----------------------------------------------------------------------------
// Purpose: called on level start
//-----------------------------------------------------------------------------
void CSourcePython::ClientSettingsChanged( edict_t *pEdict )
{
	unsigned int iEntityIndex;
	if (!IndexFromEdict(pEdict, iEntityIndex))
		return;

	CALL_LISTENERS(OnClientSettingsChanged, iEntityIndex);
}
Esempio n. 5
0
//-----------------------------------------------------------------------------
// Purpose: called on level start, when the server is ready to accept client connections
//		edictCount is the number of entities in the level, clientMax is the max client count
//-----------------------------------------------------------------------------
void CSourcePython::ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
{
	list edicts;
	for(int i=0; i < edictCount; i++)
		edicts.append(pEdictList[i]);
	
	CALL_LISTENERS(ServerActivate, edicts, edictCount, clientMax);
}
Esempio n. 6
0
void CSourcePython::OnEdictAllocated( edict_t *edict )
{
	unsigned int iEntityIndex;
	if (!IndexFromEdict(edict, iEntityIndex))
		return;

	CALL_LISTENERS(OnEdictAllocated, iEntityIndex);
}
Esempio n. 7
0
void CSourcePython::ClientFullyConnect( edict_t *pEntity )
{
	unsigned int iEntityIndex;
	if (!IndexFromEdict(pEntity, iEntityIndex))
		return;

	CALL_LISTENERS(OnClientFullyConnect, iEntityIndex);
}
Esempio n. 8
0
void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
	edict_t *pEdict;
	if (EdictFromBaseEntity(pEntity, pEdict)) {
		IServerUnknown* pServerUnknown = pEdict->GetUnknown();
		if (pServerUnknown)
			pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
	}
	CALL_LISTENERS(OnEntityCreated, ptr((CBaseEntityWrapper*) pEntity));
}
Esempio n. 9
0
//-----------------------------------------------------------------------------
// Purpose: called when a cvar value query is finished
//-----------------------------------------------------------------------------
void CSourcePython::OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity,
	EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue )
{
	PythonLog(4, "Cvar query (cookie: %d, status: %d) - name: %s, value: %s", iCookie, eStatus, pCvarName, pCvarValue );
	unsigned int iEntityIndex;
	if (!IndexFromEdict(pPlayerEntity, iEntityIndex))
		return;

	CALL_LISTENERS(OnQueryCvarValueFinished, (int) iCookie, iEntityIndex, eStatus, pCvarName, pCvarValue);
}
Esempio n. 10
0
void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
	int iIndex = IndexFromBaseEntity(pEntity);
	edict_t *pEdict = EdictFromIndex(iIndex);
	if (pEdict)
	{
		IServerUnknown* pServerUnknown = pEdict->GetUnknown();
		if (pServerUnknown)
			pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
	}
	CALL_LISTENERS(OnEntityCreated, iIndex, ptr((CBaseEntityWrapper*) pEntity));
}
Esempio n. 11
0
//-----------------------------------------------------------------------------
// Purpose: called when a client is authenticated
//-----------------------------------------------------------------------------
PLUGIN_RESULT CSourcePython::NetworkIDValidated( const char *pszUserName, const char *pszNetworkID )
{
	CALL_LISTENERS(NetworkidValidated, pszUserName, pszNetworkID);
	return PLUGIN_CONTINUE;
}
Esempio n. 12
0
//-----------------------------------------------------------------------------
// Purpose: called on level start
//-----------------------------------------------------------------------------
void CSourcePython::ClientSettingsChanged( edict_t *pEdict )
{
	CALL_LISTENERS(ClientSettingsChanged, IndexFromEdict(pEdict));
}
Esempio n. 13
0
void CSourcePython::OnEdictFreed( const edict_t *edict )
{
	CALL_LISTENERS(OnEdictFreed, ptr(edict));
}
Esempio n. 14
0
//-----------------------------------------------------------------------------
// Purpose: called on level start
//-----------------------------------------------------------------------------
void CSourcePython::LevelInit( char const *pMapName )
{
	CALL_LISTENERS(LevelInit, pMapName);
}
Esempio n. 15
0
void CSourcePython::ClientFullyConnect( edict_t *pEntity )
{
	CALL_LISTENERS(ClientFullyConnect, IndexFromEdict(pEntity));
}
Esempio n. 16
0
void CSourcePython::OnEdictAllocated( edict_t *edict )
{
	CALL_LISTENERS(OnEdictAllocated, IndexFromEdict(edict));
}
Esempio n. 17
0
//-----------------------------------------------------------------------------
// Purpose: called once per server frame, do recurring work here (like checking for timeouts)
//-----------------------------------------------------------------------------
void CSourcePython::GameFrame( bool simulating )
{
	CALL_LISTENERS(Tick);
}
Esempio n. 18
0
void CSourcePython::OnEntityPreSpawned( CBaseEntity *pEntity )
{
	CALL_LISTENERS(OnEntityPreSpawned, ptr((CBaseEntityWrapper*) pEntity));
}
Esempio n. 19
0
//-----------------------------------------------------------------------------
// Purpose: called on level end (as the server is shutting down or going to a new map)
//-----------------------------------------------------------------------------
void CSourcePython::LevelShutdown( void ) // !!!!this can get called multiple times per map change
{
	CALL_LISTENERS(LevelShutdown);
}
Esempio n. 20
0
void CSourcePython::OnEntityDeleted( CBaseEntity *pEntity )
{
	CALL_LISTENERS(OnEntityDeleted, IndexFromBaseEntity(pEntity), ptr((CBaseEntityWrapper*) pEntity));
}
Esempio n. 21
0
//-----------------------------------------------------------------------------
// Purpose: called when a client spawns into a server (i.e as they begin to play)
//-----------------------------------------------------------------------------
void CSourcePython::ClientActive( edict_t *pEntity )
{
	CALL_LISTENERS(ClientActive, IndexFromEdict(pEntity));
}
Esempio n. 22
0
//-----------------------------------------------------------------------------
// Purpose: called on
//-----------------------------------------------------------------------------
void CSourcePython::ClientPutInServer( edict_t *pEntity, char const *playername )
{
	CALL_LISTENERS(ClientPutInServer, IndexFromEdict(pEntity), playername);
}
Esempio n. 23
0
//-----------------------------------------------------------------------------
// Purpose: called on
//-----------------------------------------------------------------------------
void CSourcePython::ClientPutInServer( edict_t *pEntity, char const *playername )
{
	CALL_LISTENERS(OnClientPutInServer, ptr(pEntity), playername);
}