//----------------------------------------------------------------------------- // 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; }
void CSourcePython::OnCombinerPreCache(MDLCacheDataType_t type, MDLHandle_t handle ) { if (m_pOldMDLCacheNotifier) m_pOldMDLCacheNotifier->OnCombinerPreCache(type, handle); CALL_LISTENERS(OnCombinerPreCache, type, handle); }
void CSourcePython::OnDataUnloaded( MDLCacheDataType_t type, MDLHandle_t handle ) { if (m_pOldMDLCacheNotifier) m_pOldMDLCacheNotifier->OnDataUnloaded(type, handle); CALL_LISTENERS(OnDataUnloaded, type, handle); }
//----------------------------------------------------------------------------- // Purpose: called on level start //----------------------------------------------------------------------------- void CSourcePython::ClientSettingsChanged( edict_t *pEdict ) { unsigned int iEntityIndex; if (!IndexFromEdict(pEdict, iEntityIndex)) return; CALL_LISTENERS(OnClientSettingsChanged, iEntityIndex); }
//----------------------------------------------------------------------------- // 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); }
void CSourcePython::OnEdictAllocated( edict_t *edict ) { unsigned int iEntityIndex; if (!IndexFromEdict(edict, iEntityIndex)) return; CALL_LISTENERS(OnEdictAllocated, iEntityIndex); }
void CSourcePython::ClientFullyConnect( edict_t *pEntity ) { unsigned int iEntityIndex; if (!IndexFromEdict(pEntity, iEntityIndex)) return; CALL_LISTENERS(OnClientFullyConnect, iEntityIndex); }
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)); }
//----------------------------------------------------------------------------- // 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); }
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)); }
//----------------------------------------------------------------------------- // 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; }
//----------------------------------------------------------------------------- // Purpose: called on level start //----------------------------------------------------------------------------- void CSourcePython::ClientSettingsChanged( edict_t *pEdict ) { CALL_LISTENERS(ClientSettingsChanged, IndexFromEdict(pEdict)); }
void CSourcePython::OnEdictFreed( const edict_t *edict ) { CALL_LISTENERS(OnEdictFreed, ptr(edict)); }
//----------------------------------------------------------------------------- // Purpose: called on level start //----------------------------------------------------------------------------- void CSourcePython::LevelInit( char const *pMapName ) { CALL_LISTENERS(LevelInit, pMapName); }
void CSourcePython::ClientFullyConnect( edict_t *pEntity ) { CALL_LISTENERS(ClientFullyConnect, IndexFromEdict(pEntity)); }
void CSourcePython::OnEdictAllocated( edict_t *edict ) { CALL_LISTENERS(OnEdictAllocated, IndexFromEdict(edict)); }
//----------------------------------------------------------------------------- // Purpose: called once per server frame, do recurring work here (like checking for timeouts) //----------------------------------------------------------------------------- void CSourcePython::GameFrame( bool simulating ) { CALL_LISTENERS(Tick); }
void CSourcePython::OnEntityPreSpawned( CBaseEntity *pEntity ) { CALL_LISTENERS(OnEntityPreSpawned, ptr((CBaseEntityWrapper*) pEntity)); }
//----------------------------------------------------------------------------- // 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); }
void CSourcePython::OnEntityDeleted( CBaseEntity *pEntity ) { CALL_LISTENERS(OnEntityDeleted, IndexFromBaseEntity(pEntity), ptr((CBaseEntityWrapper*) pEntity)); }
//----------------------------------------------------------------------------- // 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)); }
//----------------------------------------------------------------------------- // Purpose: called on //----------------------------------------------------------------------------- void CSourcePython::ClientPutInServer( edict_t *pEntity, char const *playername ) { CALL_LISTENERS(ClientPutInServer, IndexFromEdict(pEntity), playername); }
//----------------------------------------------------------------------------- // Purpose: called on //----------------------------------------------------------------------------- void CSourcePython::ClientPutInServer( edict_t *pEntity, char const *playername ) { CALL_LISTENERS(OnClientPutInServer, ptr(pEntity), playername); }